Skip to content

Latest commit

ย 

History

History
93 lines (65 loc) ยท 6.22 KB

File metadata and controls

93 lines (65 loc) ยท 6.22 KB

Codex Operating Contract for thesis-rca

์ด ํŒŒ์ผ์€ Claude Code ์ค‘์‹ฌ์œผ๋กœ ์šด์˜๋˜๋˜ thesis-rca๋ฅผ Codex์—์„œ๋„ ๊ฐ™์€ ์—ฐ๊ตฌยท์‹คํ—˜ ๊ณ„์•ฝ์œผ๋กœ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•œ repo-local ์ •๋ณธ์ด๋‹ค. Codex๋Š” ์ด ํŒŒ์ผ๊ณผ CLAUDE.md, ๊ด€๋ จ rules/*.md, .codex/config.toml, .codex/hooks.json์„ ํ•จ๊ป˜ ๋”ฐ๋ฅธ๋‹ค.

Role Split

  • Codex is the orchestrator of record. ์™„๋ฃŒ ํŒ๋‹จ์€ ๋Œ€ํ™”๊ฐ€ ์•„๋‹ˆ๋ผ ํŒŒ์ผ, git, ๋กœ๊ทธ, ๊ฒฐ๊ณผ๋ฌผ ๊ฒ€์ฆ์— ๊ทผ๊ฑฐํ•œ๋‹ค.
  • Claude Code is subordinate and optional. ์‚ฌ์šฉ์ž๊ฐ€ Claude ๋ณ‘ํ–‰์„ ์š”๊ตฌํ•˜๊ฑฐ๋‚˜ ๋…๋ฆฝ ๊ฒ€ํ† ๊ฐ€ ์œ ์šฉํ•  ๋•Œ๋งŒ bounded review/draft์— ์‚ฌ์šฉํ•œ๋‹ค. Claude ์ถœ๋ ฅ๋งŒ์œผ๋กœ ์™„๋ฃŒ๋ฅผ ์ฃผ์žฅํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • Research-first advisor stance. ์—ฐ๊ตฌ์งˆ๋ฌธ, ๋‹จ์ผ ๋…๋ฆฝ๋ณ€์ˆ˜, baseline, evaluation, reproducibility, falsifiability๋ฅผ ์šฐ์„ ํ•˜๊ณ  ์•ฝํ•œ ์ฃผ์žฅ๊ณผ ๋ฏธ๊ฒ€์ฆ ๊ฒฐ๊ณผ๋ฅผ ๋ช…์‹œํ•œ๋‹ค.

Startup Checklist

์ƒˆ ์ž‘์—…์„ ์‹œ์ž‘ํ•  ๋•Œ ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค.

  1. git status --short --branch๋กœ branch์™€ dirty tree๋ฅผ ํ™•์ธํ•˜๊ณ  ์‚ฌ์šฉ์ž ๋ณ€๊ฒฝ์„ ๋ณด์กดํ•œ๋‹ค.
  2. CLAUDE.md, docs/research-charter.md, ์ž‘์—…๊ณผ ๊ด€๋ จ๋œ rules/*.md๋ฅผ ์ฝ์–ด ํ˜„์žฌ checkpoint๋ฅผ ํ™•์ธํ•œ๋‹ค.
  3. .codex/config.toml๊ณผ .codex/hooks.json์ด ํ™œ์„ฑํ™”๋๋Š”์ง€ ํ™•์ธํ•œ๋‹ค. Codex๊ฐ€ project hooks trust ๊ฒ€ํ† ๋ฅผ ์š”๊ตฌํ•˜๋ฉด /hooks์—์„œ ์ •ํ™•ํ•œ ์ •์˜๋ฅผ ๊ฒ€ํ† ยท์‹ ๋ขฐํ•˜๊ธฐ ์ „๊นŒ์ง€ ์“ฐ๊ธฐ/๋ฏผ๊ฐ ๋ช…๋ น์„ ๋ฉˆ์ถ˜๋‹ค.
  4. ๊ธฐ๋ณธ ๋ณธ๋ฅ˜๋Š” Research Track์ด๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ๋ช…์‹œ์ ์œผ๋กœ ์‹คํ—˜ ์žฌ๊ฐœ๋ฅผ ์ง€์‹œํ•  ๋•Œ๋งŒ Experiment Track์— ์ง„์ž…ํ•œ๋‹ค.
  5. ์‹คํ—˜/๋ถ„์„ ์™„๋ฃŒ๋Š” ๊ฒฐ๊ณผ ํŒŒ์ผ, row count, raw count, ๋กœ๊ทธ, ๋ถ„์„ ์‚ฐ์ถœ๋ฌผ์„ ์‹ค์ œ ๋ช…๋ น์œผ๋กœ ํ™•์ธํ•œ ๋’ค์—๋งŒ ์ฃผ์žฅํ•œ๋‹ค.

Codex-native Surfaces

  • ์ง€์† ๊ทœ์น™: AGENTS.md + CLAUDE.md + rules/
  • repo skills: .agents/skills/*/SKILL.md; Claude slash command /name์€ Codex $name๊ณผ ๋Œ€์‘ํ•œ๋‹ค.
  • custom agents: .codex/agents/*.toml
    • research_planner, experiment_planner, paper_writer, experiment, results_critic
  • lifecycle guard: .codex/hooks.json โ†’ .codex/hooks/pretool_guard.py
  • superpowers: ๊ณต์‹ Codex superpowers@openai-curated plugin์˜ skills๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

Claude ์›๋ณธ skill๊ณผ agent ํŒŒ์ผ์€ domain workflow์˜ ๋‹จ์ผ ์ •๋ณธ์œผ๋กœ ์œ ์ง€ํ•œ๋‹ค. Codex wrapper/custom agent๋Š” ์›๋ณธ ํŒŒ์ผ์„ ๋๊นŒ์ง€ ์ฝ๊ณ  ๋„๊ตฌ๋ช…๋งŒ ํ˜„์žฌ Codex ํ‘œ๋ฉด์œผ๋กœ ๋ฒˆ์—ญํ•œ๋‹ค. ์‚ฌ์šฉ์ž ์ง€์‹œ, ์ด ํŒŒ์ผ, Codex ์•ˆ์ „ ์ •์ฑ…์ด ์ถฉ๋Œ ์‹œ ์šฐ์„ ํ•œ๋‹ค.

Hook Enforcement

Codex PreToolUse adapter๋Š” Claude guard์™€ ๋™์ผํ•œ ์ •์ฑ…์„ ์‹ค์ œ ์ง‘ํ–‰ํ•œ๋‹ค.

  • Bash: pr-only-guard.sh โ†’ experiment-guard.sh โ†’ bash-guard.sh
  • apply_patch/Edit/Write: patch target๊ณผ ์ถ”๊ฐ€ ๋‚ด์šฉ์„ ์ถ”์ถœํ•ด claude-config-guard.sh โ†’ data-guard.sh โ†’ secret-scanner.sh
  • Agent: agent-model-guard.sh ํ˜ธํ™˜ ๊ฒฝ๊ณ 

ํ›…์„ ์šฐํšŒํ•˜๋Š” option์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. specialized/hosted tool์ฒ˜๋Ÿผ hook coverage ๋ฐ–์ธ ์“ฐ๊ธฐ ์ž‘์—…๋„ ๊ฐ™์€ ์ •์ฑ…์„ ์ˆ˜๋™ ์ ์šฉํ•œ๋‹ค.

Git Workflow

  • main ์ง์ ‘ commitยทmergeยทpush ๊ธˆ์ง€. ๋ชจ๋“  ๋ณ€๊ฒฝ์€ feature branch์™€ PR์„ ๊ฑฐ์นœ๋‹ค.
  • ์ •๊ทœ ๋งˆ๋ฌด๋ฆฌ: feature branch โ†’ push โ†’ ํ•œ๊ตญ์–ด PR โ†’ ์‚ฌ์šฉ์ž ์Šน์ธ โ†’ gh pr merge --rebase --delete-branch.
  • --force, --force-with-lease, --no-verify, --no-gpg-sign, --admin ๊ธˆ์ง€.
  • commit/PR ์ œ๋ชฉ๊ณผ ๋ณธ๋ฌธ์€ ํ•œ๊ตญ์–ด๋กœ ์ž‘์„ฑํ•œ๋‹ค. AI attribution์€ ์‚ฌ์šฉ์ž๊ฐ€ ์š”๊ตฌํ•˜์ง€ ์•Š๋Š” ํ•œ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • ํŒŒ์ผ๋ณ„๋กœ ๋ช…์‹œํ•ด stageํ•˜๋ฉฐ .DS_Store, credentials, secret, ๋ถˆํ•„์š”ํ•œ binary๋ฅผ ์ถ”์ ํ•˜์ง€ ์•Š๋Š”๋‹ค.

Research Track โ€” Default

Trigger: ๋…ผ๋ฌธ ์กฐ์‚ฌ, ์„ ํ–‰์—ฐ๊ตฌ, ์ž๋ฃŒ์กฐ์‚ฌ, ํฌ์ง€์…”๋‹, ๊ด€๋ จ์—ฐ๊ตฌ.

  1. rules/research-pipeline.md R-1์— ๋”ฐ๋ผ scope๋ฅผ ์ •ํ•˜๊ณ  ์‚ฌ์šฉ์ž ์Šน์ธ ์ „ ๊ฒ€์ƒ‰ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  2. ๋…ผ๋ฌธ ์ „๋ฌธ์„ $paper-reader๋กœ ์ฝ์–ด docs/papers/{slug}.md์— ํ•œ ํŽธ์”ฉ ๊ธฐ๋กํ•œ๋‹ค.
  3. $paper-survey๋กœ docs/surveys/paper_survey_v{N}.md๋ฅผ ์ž‘์„ฑํ•œ๋‹ค.
  4. 5ํŽธ ์ด์ƒ, ๊ฐ ๋…ผ๋ฌธ์˜ 1์ฐจ ์ถœ์ฒ˜, ์ •๋Ÿ‰ ์ˆ˜์น˜, ๋ณธ ๋…ผ๋ฌธ ์ ์šฉ ๊ฐ€๋Šฅ์„ฑ์„ ๊ฒ€์ฆํ•œ๋‹ค.
  5. ๊ฒ€์ƒ‰์ด ํ•„์š”ํ•œ ๋ฌธํ—Œยท์ตœ์‹  ์‚ฌ์‹ค์€ web์œผ๋กœ ํ™•์ธํ•˜๋ฉฐ ๊ธฐ์–ต์œผ๋กœ ์ถœ์ฒ˜๋‚˜ ์ˆ˜์น˜๋ฅผ ๋งŒ๋“ค์–ด๋‚ด์ง€ ์•Š๋Š”๋‹ค.

Experiment Track โ€” Explicit Instruction Only

Trigger: ์‹คํ—˜ ์ง„ํ–‰/์žฌ๊ฐœ, V9 ์‹คํ–‰, fault injection ์‹คํ–‰ ๋“ฑ ์‚ฌ์šฉ์ž์˜ ๋ช…์‹œ์  ์ง€์‹œ.

  1. rules/experiment-pipeline.md, rules/data-safety.md, docs/lab-environment.md, ์Šน์ธ๋œ plan์„ ํ™•์ธํ•œ๋‹ค.
  2. LLM model์€ gpt-4o-mini๋กœ ๊ณ ์ •ํ•˜๊ณ  framework/context/RAG/harness๋งŒ ๊ฐœ์„ ํ•œ๋‹ค.
  3. $lab-tunnel์€ ๊ธฐ์กด tunnel health๋ฅผ ๋จผ์ € ํ™•์ธํ•ด ์ •์ƒ์ด๋ฉด ์žฌ์‚ฌ์šฉํ•œ๋‹ค. K8s API, Prometheus, Loki, cluster state, output path๋ฅผ preflightํ•œ๋‹ค.
  4. ์žฅ์‹œ๊ฐ„ ์‹คํ—˜์€ background process๋กœ ์‹œ์ž‘ํ•˜๊ณ  PID/log/result path๋ฅผ ์ฆ‰์‹œ ๋ณด๊ณ ํ•œ๋‹ค.
  5. ์‹คํ—˜ ์ค‘ git ์ƒํƒœ ๋ณ€๊ฒฝ ๊ธˆ์ง€. ์™„๋ฃŒ ํ›„ $lab-restore์™€ row/raw/log/analysis ๊ฒ€์ฆ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค.
  6. results/*.csv, results/raw_v*/*.json, results/ground_truth.csv๋Š” ์ˆ˜์ •ยท์‚ญ์ œํ•˜์ง€ ์•Š๋Š”๋‹ค.
  7. Step 5 ๋ถ„์„์€ fresh results_critic agent์— ๋งก๊ฒจ confirmation bias๋ฅผ ์ค„์ด๊ณ , Step 6์˜ next goalยท์ƒˆ session promptยทTickTick handoff๊ฐ€ ๋ชจ๋‘ ์žˆ์–ด์•ผ ํ•œ round๊ฐ€ ๋๋‚œ๋‹ค.

Superpowers Mapping

  • session/task entry: using-superpowers
  • research/experiment design: brainstorming; scope/design ์Šน์ธ ์ „ ๊ฒ€์ƒ‰ยท๊ตฌํ˜„ ๊ธˆ์ง€
  • multi-step implementation: writing-plans
  • execution: executing-plans ๋˜๋Š” subagent-driven-development
  • debugging: systematic-debugging
  • completion claim: verification-before-completion
  • branch finish: finishing-a-development-branch option 2 โ†’ $pr-merge

์‚ฐ์ถœ๋ฌผ ๊ฒฝ๋กœ๋Š” CLAUDE.md์˜ Output Path Mapping์„ ๋”ฐ๋ฅด๊ณ  docs/superpowers/ ๊ธฐ๋ณธ ๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค.

Reporting Standard

ํ•œ๊ตญ์–ด๋กœ ์งง์€ ๊ฒฐ๋ก ๋ถ€ํ„ฐ ๋งํ•˜๊ณ  ๋‹ค์Œ์„ ๊ตฌ๋ถ„ํ•œ๋‹ค.

  • ํŒ๋‹จ/๊ด€์ฐฐํ•œ ์‚ฌ์‹ค: git ์ƒํƒœ, ํŒŒ์ผ, ๋กœ๊ทธ, row count ๋“ฑ ํ™•์ธ๋œ ๋‚ด์šฉ
  • ๊ทผ๊ฑฐ/์ •์ฑ…: CLAUDE.md, rules/, hooks, ๋…ผ๋ฌธ/๊ฒฐ๊ณผ ์ถœ์ฒ˜
  • ๋ฆฌ์Šคํฌ/๊ฐ€์ •: ์•„์ง ๊ฒ€์ฆ๋˜์ง€ ์•Š์€ ์ถ”๋ก ๊ณผ ํ•œ๊ณ„
  • ๋‹ค์Œ ์•ก์…˜: ๋ฐ”๋กœ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ checkpoint ํ•œ ๋‹จ๊ณ„

์ฝ”๋“œยท๋ฌธ์„œยท์„ค์ •์„ ์ˆ˜์ •ํ–ˆ์œผ๋ฉด $changelog๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ์™„๋ฃŒ ์ง์ „ ์‹ค์ œ ๊ฒ€์ฆ ๋ช…๋ น ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•œ๋‹ค.