docs: preserve MITC4 prep failure and recovery plan

This commit is contained in:
KOKO\Mimi
2026-09-06 10:56:03 +09:00
parent d533b61541
commit 7dca487da1
8 changed files with 400 additions and 15 deletions
+10
View File
@@ -109,3 +109,13 @@
- 결정: [계획](implementation-plan.md)의 별도 prep 1개 step 뒤 새 invocation으로 main 8개 step을 실행한다. 결합된 API/data 단위를 통합해 불필요한 full VERIFY 반복을 줄이고 각 step의 TDD·focused/full VERIFY·등록 Stop은 유지한다.
- 운영 근거: 기존 전체 검증의 약27.9분 합산 추정과 여러 1800초 deadline, nonlinear helper의 매번 solve 및 이미 로드된 Executor/Stop의 activation 경계를 [환경 E2/E3](implementation-environment.md)에 대조했다. 준비에서는 단일 유한 class timeout만 지정 후 실제 Executor main을 호출하며 runtime default의 최소 변경과 대응 Harness tests를 수행한다.
- 경계: Bootstrap은 기존 CLI option이나 sandbox 확대가 아니다. 정확한 값/명령은 Planning 문서의 원본을 따르고 Hook state·reentry·실행 메서드·retry·ownership guard를 override하지 않는다. Root/Coordinator도 active invocation 동안 non-owned 편집·커밋을 멈춘다. 보고 시점의 manual evidence와 Executor 종료 뒤 registered Stop/actual exit 사후 확인을 구분하며 성공 전 main activation을 하지 않는다.
- 실제 결과: [prep attempt1](coordination.md#execution-prep-attempt-1-실제-결과)은 기본 workspace-write에서 지정 `.codex/hooks.json` 변경을 거부당해 `blocked-environment`로 종료했다. Partial runtime/test/doc 변경과 마지막 test 수정 미검증을 보존한다. 현재 결정은 sandbox 확대나 성공 판정 권한을 포함하지 않으며, guarded Executor checkpoint 복구 계획 후 해당 실행 직전 명시적 사용자 승인 경계를 적용한다.
## MFE-ADR-012 — Source echo 분류 오탐의 bounded 운영 correction
- 상태: 실제 결함 재현 및 Planning의 최소 TDD·보존/activation 계획 확인; Correction 미실행.
- 발견·재현 owner: Root; 계획 owner: implementation-planning-agent; correction dispatch owner: coordinator-agent.
- 근거: [실제 raw/순수함수 재현](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/classifier-observation.json), [복구 R4](implementation-recovery.md#r4-조건부-exact-dfa-invocation과-후속-검증), [prep TDD](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md).
- 결정: 성공한 source-read 출력의 helper marker를 실제 runtime failure로 오인하는 분류 결함만 기존 `scripts/execute.py`/`tests/test_execute.py` 안에서 먼저 수정한다. 진짜 helper 진단, 명시 terminal/history, 실제 wrapper timeout만 허용되는 retry 및 sandbox/ownership 보호를 유지한다.
- 순서·이유: 기존 timeout-only AST guard로 현재 blocked/WIP를 먼저 보존하고 별도 Correction 뒤 새 Executor process를 시작한다. 이미 import된 classifier는 child source 수정만으로 바뀌지 않으며 reload/guard override로 성공을 만들지 않는다. 실제 Hook 쓰기 거부는 별도 환경 blocker로 보존한다.
- 경계: Physics/schema/tolerance `r2`와 선행6개 기술 계약을 바꾸지 않는다. Correction은 별도 signature의 unused allowance 확인 후 명시 dispatch하며 성공·검증·커밋은 실제 결과 뒤에만 기록한다. Exact-run sandbox 사용자 승인과 full VERIFY는 유지한다.
@@ -54,11 +54,13 @@ Reference artifact와 공통 정책은 수정하지 않는다. 외부 solver 실
| [io-mapping.md](io-mapping.md) | io-definition-agent | r2 | 책임·candidate 보존·TXT Value-only·27개 요구/11개 I/O 검증 obligation |
| [implementation-plan.md](implementation-plan.md) | implementation-planning-agent | r2 | Prep 1/main 8개 step 및 실행 계획 gate pass |
| [implementation-environment.md](implementation-environment.md) | implementation-planning-agent | r2 | 실제 backend·유한 deadline·bootstrap/activation·Git/사후 evidence 경계 |
| [implementation-recovery.md](implementation-recovery.md) | implementation-planning-agent | r2 | actual blocked 보존·guarded WIP checkpoint·별도 Correction·조건부 승인/status/activation 계획 감사 완료 |
| [implementation-interfaces.md](implementation-interfaces.md) | implementation-planning-agent | r2 | 기존 확장점·API/source-test·vendor/state/transaction 책임 |
| [implementation-verification.md](implementation-verification.md) | implementation-planning-agent | r2 | 요구27/NR27/I/O11·신규 test40·독립 oracle·fresh evidence·실제 validator |
| [phases/index.json](../../phases/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | 기존5개 entry/history 보존 및 이번2개 pending entry 등록 |
| [prep index](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | Step0 pending; exact owned paths 검증 |
| [prep step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md) | implementation-planning-agent | r2 | Timeout-only 운영 준비/TDD/full VERIFY; 실행 미완료 |
| [implementation-prep-evidence.md](implementation-prep-evidence.md) | implementation-agent | r2 | actual attempt1 blocked 보고서; 두 실패·마지막 test 수정의 미검증 구분은 coordination raw audit 참조 |
| [phases/index.json](../../phases/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | 기존5개 보존; prep blocked/main pending |
| [prep index](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | Step0 blocked; actual attempt1/history 보존 |
| [prep step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md) | implementation-planning-agent | r2 | 유한 deadline 및 재현 classifier 오탐의 최소 TDD/full VERIFY; 별도 Correction 후 재개 |
| [main index](../../phases/mitc4-shell-feast-eigen/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | Step0~7 pending; exact owned paths 검증 |
| [main step0](../../phases/mitc4-shell-feast-eigen/step0.md) | implementation-planning-agent | r2 | Frequency model/parser |
| [main step1](../../phases/mitc4-shell-feast-eigen/step1.md) | implementation-planning-agent | r2 | 공변 stabilization/static 회귀 |
+1 -1
View File
@@ -3,7 +3,7 @@
- Feature ID: `mitc4-shell-feast-eigen`
- Owner: `coordinator-agent`
- Input contract revision: `r2`
- 검토 상태: r2 requirements부터 implementation-planning까지 6개 gate pass; implementation의 execution-prep 진입. 구현·실제 reference 비교는 아직 미실행.
- 검토 상태: r2 requirements부터 implementation-planning까지 6개 gate pass; execution-prep attempt1은 지정 Hook 설정 쓰기 거부로 blocked-environment. 부분 runtime/test 변경과 미검증 test 수정을 보존하며 solver 구현·실제 reference 비교는 미실행이다.
기준: [프로젝트 지침](../../AGENTS.md), [프로젝트 PRD](../PRD.md), [프로젝트 ADR](../ADR.md).
지역 지침과 문서 목록은 [FEATURED_AGENTS.md](FEATURED_AGENTS.md), 상태 원본은 [coordination.md](coordination.md)를 따른다.
+44 -8
View File
@@ -4,14 +4,14 @@
- Owner: `coordinator-agent`
- Contract revision: `r2` (사용자 승인 stabilization 개선·영향받는 정적/eigen 재검증 범위)
- Stage: `implementation`
- Outcome: `pass` (r2 implementation-planning 실행 계약·정적 evidence 확인)
- Next owner: `implementation-agent` (Executor-selected execution-prep Step0)
- Attempt: `0` (r2 구현·수치 실패 관찰 없음; r1 이력 별도 보존)
- Outcome: `blocked-environment` (execution-prep Step0의 지정 `.codex/hooks.json` 쓰기 거부)
- Next owner: `coordinator-agent` (R2의 실제 Executor WIP checkpoint 할당; 이후 bounded Correction)
- Attempt: `1` (prep native 실행 1회; transport 재시도 없음)
- Completion: 미완료
- Failure classification: `null`
- Retry key: `null`
- Failure classification: `environment` (별도 focused test 수정의 미검증 상태도 보존)
- Retry key: `mitc4-shell-feast-eigen|implementation|environment|r2`
- Escalation class: `null`
- Blocker: `null` (실제 execution-prep/main 및 후속 기술 gate는 아직 미완료)
- Blocker: Native workspace-write가 지정된 Hook 설정 변경을 거부했다. 실제 실패와 부분 구현을 보존하고 권한·재개 조건을 충족하기 전에는 pending reset이나 재실행을 하지 않는다.
기준: [프로젝트 지침](../../AGENTS.md), [프로젝트 PRD](../PRD.md), [프로젝트 ADR](../ADR.md),
[SOLVER_AGENT_DESIGN](../SOLVER_AGENT_DESIGN.md), [FEATURE_DOCUMENTATION](../FEATURE_DOCUMENTATION.md).
@@ -34,14 +34,49 @@
| numerical-review r2 | [verdict](numerical-review.md), [독립 evidence](numerical-review-evidence.md), [controls](numerical-review-controls.md), [cases](numerical-review-cases.md), [reference-model](reference-model.md) | pass; NR-MFE-001 수학적 해소, 내부 수치 기준/27개 case/27개 requirement 및 logical reference readiness 모두 확인 |
| io-definition r2 | [main](io.md), [input](io-input.md), [schema](io-schema.md), [mapping](io-mapping.md) | pass; 4개 owner/r2 문서·27개 requirement·66개 상대 링크 및 원본 grammar/identity·additive schema·failure 보존 확인 |
| implementation-planning r2 | [main](implementation-plan.md), [environment](implementation-environment.md), [interfaces](implementation-interfaces.md), [verification](implementation-verification.md), [prep](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json), [main phase](../../phases/mitc4-shell-feast-eigen/index.json) | pass; 실제 read-only StepExecutor validator·16산출물·1+8 steps·owned128회/고유110·요구27/NR27/I/O11·신규test40·links575/anchor0 확인 |
| implementation r2 prep attempt 1 | [작성 시점 보고서](implementation-prep-evidence.md), [실제 terminal 상태](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json), [원시 Codex 결과](../../phases/mitc4-shell-feast-eigen-execution-prep/step0-output.json) | blocked-environment; Hook 설정 미변경, 마지막 test 수정 미검증, 수동 full VERIFY 및 solver 구현/reference 미실행 |
공통 문서 및 reference 파일 목록의 read-only 조사 명령은 exit code `0`으로 완료했다.
확인된 reference 파일은 `shellNL-eigen-meshfine.inp`, `shellNL-eigen-meshfine eigenvalues.txt`이며 실제 의미와 readiness는 담당 owner가 검토한다.
Root의 시작 Git 조사에서 worktree clean을 확인했다. 구현·build/test·외부 reference comparison은 아직 실행하지 않았다.
Root의 intake 시작 Git 조사에서는 worktree clean을 확인했다. 당시 구현·build/test·외부 reference comparison은 미실행이었다. 이후 실제 실행 결과는 아래 prep attempt 기록으로 구분한다.
관리문서 상대 링크 검사 결과는 `4`문서, 끊긴 local link `0`, exit code `0`이며 `git diff --check`도 exit code `0`이다.
## 현재 bounded dispatch
Planning owner의 복구계획 반환4개를 감사했다. [R2](implementation-recovery.md#r2-root-checkpoint-이후의-정확한-wip-보존-명령)의 unchanged `_commit_paths` 호출은 timeout-only AST·origin 이후 정확8개 문서 경로·linked identity·role·default sandbox·source8/control2 dirty 범위·blocked/history/raw/모든 파일 bytes 불변을 확인한다. 구현 WIP와 blocked metadata를 별도 commit하고 성공 상태를 만들지 않는다. [R3/R4](implementation-recovery.md#r3-승인-후에만-가능한-status-only-checkpoint)는 실제 Correction/후속 checkpoint/해당 실행 직전 사용자 승인 뒤에만 조건부 실행한다.
Owner 정적 검증은 Python checkpoint AST2/local links107/EOF·whitespace와 PowerShell block3 syntax errors0, 각 exit `0`이다. Coordinator는 반환4개 owner/r2/hash·links107/AST2를 재확인했고 exit `0`, 실제 read-only Executor constructor/identity/profile/linked/default sandbox 확인도 exit `0`이었다. `implementation-verification.md`, source/tests/index/top/raw는 이 Planning 작업에서 변경하지 않았다. 이 audit는 복구계획만 수용하며 implementation outcome은 `blocked-environment`를 유지한다.
실행 순서는 Root의 정확8문서 checkpoint → Coordinator가 R2의 실제 Executor WIP 두 commit을 할당 → 공식 Correction Agent가 재현된 classifier 결함만 수정·검증 → 실제 결과에 대한 Planning의 후속 checkpoint 감사 → 사용자 exact-run 승인 및 status-only recovery → 새 prep process다. 이미 로드된 classifier를 reload/override하지 않는다. 현재는 Correction 미실행이고 별도 allowance를 아직 사용하지 않았다. R2 실행 중에는 모든 non-owned 문서/코드 편집과 Root Git 작업을 동결한다.
아래는 완료된 bounded Planning dispatch 이력이다. Native prep attempt가 종료되어 관리문서 동결을 해제하고 Planning owner에게 실제 실패를 보존하는 복구 계획과 아래 classifier 결함의 최소 TDD 계획만 할당했다. 할당 범위는 `implementation-plan.md`, `implementation-environment.md`, 필요한 같은 폴더 `implementation-recovery.md`, `implementation-verification.md` 및 prep `step0.md`였으며 source/test/Implementation 보고서/phase index·status/Git은 수정하지 않았다.
기존 unchanged Executor의 guarded `_commit_paths`로 부분 구현과 control metadata를 별도 blocked/WIP commit하는 최소 절차를 구체화한다. 새 관리/계획 문서는 Root가 정확 경로로 먼저 checkpoint하여 현재 Step의 경로 검사 밖 dirty 파일을 남기지 않아야 한다. 이 작업은 `_commit_step`이나 성공 판정·pending reset을 호출하지 않으며 Hook 설정 거부를 우회하는 편집을 하지 않는다.
실제 native 실패, clean linked worktree와 해당 실행 직전 사용자 명시 승인이 필요한 sandbox 경계는 [Harness skill](../../.agents/skills/harness/SKILL.md#elevated-and-remote-execution)을 따른다. 권한 결정 이전에는 기존 failure history를 보존한 채 중단한다. 별도 사용자 승인은 아직 없다.
### Execution-prep attempt 1 실제 결과
Root는 최종 Planning checkpoint를 `d533b61`로 커밋했고 exact20 paths/staged check/commit/status를 확인했다. 재개 직전 clean, Git root 일치, 기본 sandbox 및 활성 중복 process 없음을 확인한 뒤 아래 승인된 E3 명령을 실행했다.
```powershell
python -B -c "from scripts import execute; execute.StepExecutor.CODEX_TIMEOUT_SECONDS = 14400; execute.main()" mitc4-shell-feast-eigen-execution-prep
```
Managed session `27453`은 shell exit `1`로 종료했다. 별도로 측정하지 않은 Python Executor exit를 추정하지 않는다. Raw Codex `exitCode=0`, `transportFailure=null`, 명시적 `blocked`가 보존되었고 Executor는 transport retry 없이 prep/top phase를 `blocked`로 기록했다. 실제 시작은 `2026-09-06T10:04:44+0900`, terminal history는 `2026-09-06T10:28:44+0900`이다. Branch는 `feat-mitc4-shell-feast-eigen-execution-prep`, HEAD는 여전히 `d533b615410751fe023dc73ac2be994f05d37d30`이며 Executor가 생성한 새 commit은 없다.
Raw JSON SHA-256은 `0d5c0fe0aeba5604c5289764e7aad1834902548ca02158f8feac03484b195941`이다. Stderr에는 `patch rejected: writing outside of the project; rejected by user approval settings`가 3회 기록되었다. Native report의 대상은 `.codex/hooks.json`이며 실제 해당 파일은 변경되지 않았다. Executor의 일반 분류 문구 `Codex Windows sandbox helper를 실행할 수 없습니다.`를 모든 도구의 실행 불능으로 확대하지 않는다.
Focused command는 `uv run --with pytest python -B -m pytest -v -rs tests/test_harness_timeouts.py`였다. Raw JSONL event62에서 첫 test fixture 오류를 포함해 4 failures, event64 test-only 수정 뒤 event66에서 의도한 1800 기본값에 대한 4 failures를 확인했다(각 exit `1`, 약0.40초). 이후 runtime 값 변경 뒤 event78은 exit `1`, `2 passed, 2 failed`, 1.86초였다.
- `test_stop_passes_one_shared_deadline_to_root_toolchain_and_plan`: 7200 값과 deadline 전파는 도달했지만 서로 다른 import의 `ProjectKind.CMAKE` 객체 비교가 실패했다. Event80에서 `.value` 비교로 test-only 수정했으며 이후 pytest 실행은 없다. 적용된 수정은 미검증이다.
- `test_registered_hook_and_one_time_invocation_contract`: Hook timeout `1800 != 7500` 실패다. 지정 `.codex/hooks.json` 쓰기 거부와 연결되며 설정은 1800으로 남아 있다.
[Implementation 작성 시점 보고서](implementation-prep-evidence.md)는 두 실패와 후속 test-only 수정의 검증 상태를 충분히 구분하지 않는다. Coordinator는 본문을 수정하지 않고 raw 순서로 gate를 판정하며 재개 Implementation owner에게 정확한 보고서 갱신을 요구한다. Python·Hook의 runtime 일부와 tests/doc 변경은 owned 범위에 있으나 manual configure/build/CTest/full pytest는 실행하지 않았다. 뒤의 aggregate shell exit `0`에는 `python` CommandNotFound가 섞여 있어 개별 command 성공 증거가 아니다. 추가 `uv run python -B -c ...` 상태 확인은 사용자 uv cache 접근 거부로 exit `1`이었다.
Native Codex의 실제 등록 Stop process `21804`와 CTest child `21716`를 관찰했다. 명령은 `python -X utf8 .../scripts/hooks/stop_validation.py`, `ctest --test-dir .../.harness/build -C Debug --output-on-failure`였고 실제 Debug/x64 build process도 관찰했다. 이는 수동 full VERIFY가 아니다. [CTest LastTest.log](../../.harness/build/Testing/Temporary/LastTest.log)는 362 `Test Passed`, 0 `Test Failed`, 시작10:12/종료10:28을 기록했다. 크기606010 bytes, SHA-256 `f32e535ba6d6b8b8ed7910b0790600698cfa5f20035d12ec5c6821c76df2291f`다. 별도 Stop/CTest process exit는 측정하지 못했으므로 `exit 0`으로 기록하지 않는다. 이 로그는 이후 실행으로 교체될 수 있는 ignored generated evidence다.
Root가 workspace 내부의 ignored [attempt1 archive](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/observation.json)에 `LastTest.log`, `step0-output.json`, `phase-index.json`, `top-index.json`을 복사하고 원본/복사본 hash 일치를 확인했다(exit `0`). [보존 CTest 로그](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/LastTest.log)와 [보존 raw 결과](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/step0-output.json)를 이후 audit의 안정 경로로 사용한다. Source/control/reference와 Hook state는 변경하지 않았다.
Root의 추가 read-only/pure-function 재현은 [classifier observation](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/classifier-observation.json)에 있다(SHA-256 `74c80fbdfc1eb5d4e28c5e1c77caf33d23af30858bbb7fb9742358e0d8df7eb5`, exit `0`). Raw stdout의 `orchestrator_helper_launch_failed` 7회는 성공한 source/test read command 4개(JSONL lines20/28/44/58, 각 exit `0`)에만 있고 stderr에는 없다. 기존 `_codex_environment_failure`는 성공한 source excerpt 문자열만 있는 exit0 payload도 helper failure로 반환했다. 따라서 현재 helper-launch reason은 source echo에 의한 Harness 분류 오탐이며 실제 도구 launch 실패의 evidence가 아니다. `.codex/hooks.json`의 실제 승인 설정 거부와 명시적 `blocked`는 여전히 유효하고 history를 수정하지 않는다.
같은 source read가 재실행의 성공 결과도 막을 수 있으므로 Planning에 기존 prep 소유 `scripts/execute.py`/`tests/test_execute.py` 안의 최소 TDD 회귀 계획을 추가로 할당했다. 실제 helper failure, 명시 terminal, sandbox·transport retry·ownership 보호를 유지하는 분류 수정만 다음 Implementation에 포함하며 Coordinator/Root는 source를 수정하지 않는다. 이는 운영 결함의 계획 delta로 physics/schema/tolerance `r2`를 바꾸거나 Correction budget을 새로 만들지 않는다.
Main Step0~7, solver C++ 변경, FEAST/reference 비교, physics/release는 미실행이다. Prep의 현재 outcome으로 구현 gate나 timeout activation을 통과시키지 않는다. Failure history·부분 구현을 보존하는 checkpoint 계획은 routine local 준비이며, 환경/사용자 결정 해소 후에만 Planning의 명시적 status-only recovery와 정확한 재실행을 허용한다.
### 최초 Implementation dispatch 이력
Planning owner의 r2 `pass` envelope와 계획 main/detail 4개 및 phase 제어문서 12개를 감사하여 implementation으로 전이한다. Source 변경·C++/FEAST/reference 성공을 뜻하지 않는다.
초기 14개 main 단위를 결합된 API/data 경계 기준으로 8개로 통합했고 각 step의 behavior별 RED/GREEN·focused/full VERIFY·등록 Stop은 유지한다. 운영 prep 1개는 다섯 deadline default와 관련 Harness tests만 소유하며 physics·schema·sandbox·retry·ownership을 바꾸지 않는다.
Owner는 첫 감사에서 Step2 대응 test owned 누락과 anchor 두 곳을 찾아 index/Markdown·정확한 링크를 수정했다. Actual `StepExecutor` read-only schema/owned validator와 최종 정적 감사는 exit `0`이다. Coordinator도 [V7의 실제 command](implementation-verification.md#v7-계획-정적-감사)를 읽은 뒤 재실행해 같은 결과와 16개 bundle SHA-256 `a28b78ad52a7e9606d026100934fea3ff324218be4210aa772e89cbaae42b413`를 확인했다.
@@ -315,4 +350,5 @@ Root는 사용자 승인된 가역적 운영준비 범위 안에서, 실제 repo
## Retry 기록
Correction 및 implementation rerun 사용 이력 없음. Transport attempt와 별도로 관리한다.
`mitc4-shell-feast-eigen|implementation|environment|r2`: actual attempt `1`, native terminal `blocked`, transport retry `0`, Correction `0`, Implementation rerun `0`이다. Specialist가 반환한 `focused-verify` 문구를 implementation gate로 정규화했으며 새로운 실패 key를 만들지 않았다.
Focused test의 마지막 적용 수정은 미검증으로 남는다. 이를 환경 실패로 통과 처리하거나 새 correction allowance로 취급하지 않는다. 환경 해소 후 같은 Step owner가 해당 test와 전체 필수 검증을 완료해야 한다.
@@ -5,6 +5,13 @@
- Input contract revision: `r2`
- 기본 보고서: [implementation-plan](implementation-plan.md)
E1/E2의 현재 값과 실행 전 표현은 최초 계획 시점 기록이다. Prep attempt1 종료 뒤 네 runtime
상수만 부분 변경되었고 Hook1800은 남았다. [복구 계획](implementation-recovery.md)의 WIP
보존·명시 승인·status-only checkpoint가 실제 완료되기 전 재실행하거나 main을 활성화하지 않는다.
실제 source echo의 classifier 오판도 prep의 최소 TDD 범위다. 이미 import된 Executor에는
Codex의 classifier source 수정이 자동 반영되지 않는다. 새 process activation과 재차 terminal
차단의 처리 경계는 [복구 계획](implementation-recovery.md)을 따른다.
## E1. 실제 backend와 preflight
[현재 환경 evidence](coordination.md#후속-실행-준비-관찰)를 적용한다. 이 계획 단계에서는
@@ -6,6 +6,12 @@
- 요청 outcome: `pass`; 다음 owner: `implementation-agent`
- 의미: 실행 가능한 계획의 Coordinator gate 검토 요청이다. 구현/검증 완료 판정이 아니다.
최초 prep attempt1은 지정 Hook 설정 쓰기 거부로 종료되었다. 부분 구현·blocked 기록의
보존과 승인 후 조건부 재개는 [복구 계획](implementation-recovery.md)을 따른다.
원 6단계 gate와 아래 main 계획은 유지하며 WIP 보존을 구현 성공으로 판정하지 않는다.
Prep에는 성공한 source echo를 helper failure로 오판한 재현 결함의 최소 classifier TDD도
포함한다. 기존 scripts/execute.py/tests/test_execute.py 소유 안에서 수행한다.
[FEATURED_AGENTS](FEATURED_AGENTS.md), [PRD](PRD.md), [ADR](ADR.md)와
[coordination](coordination.md), 승인된 [requirements](requirements.md), [research](research.md),
[formulation](formulation.md), [NR](numerical-review.md), [I/O](io.md) 및 각 상세 r2를 적용한다.
@@ -49,7 +55,8 @@ TXT의 Value10개와10singleton common families이며 기존 static U/UR/reactio
모든 exact implementation/test/build/report paths는 [main index](../../phases/mitc4-shell-feast-eigen/index.json)와
[prep index](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json)에 있다.
미래 보고서를 미리 생성하지 않았다. Planning 소유는 이 main/detail4문서와 할당된 phase files뿐이다.
실제 구현·full build/test·FEAST·reference comparison은 미실행이며 후속 Implementation이 수행한다.
Solver C++·FEAST·reference comparison은 미실행이다. 운영 prep의 부분 변경과 실제 검증
관찰은 [현재 상태](coordination.md)와 [복구 계획](implementation-recovery.md)에 구분한다.
계획 정적 감사 명령/exit/coverage는 [V7](implementation-verification.md#v7-계획-정적-감사)에 기록한다.
현재 upstream physics/schema/tolerance 미결정은 없다. Native Codex sandbox/runtime와 실제
@@ -0,0 +1,277 @@
# 차단된 prep의 보존과 조건부 재개 계획
- Feature ID: `mitc4-shell-feast-eigen`
- Owner: `implementation-planning-agent`
- Input contract revision: `r2`
- 기본 보고서: [implementation-plan](implementation-plan.md)
- 범위: 문서와 정적 검토만 완료한다. 아래 Git mutation/status edit/재실행은 아직 실행하지 않는다.
## R1. 실제 상태와 변경 없는 경계
필수 입력은 Feature 폴더와 [FEATURED_AGENTS](FEATURED_AGENTS.md), [PRD](PRD.md),
[ADR](ADR.md), [현재 Coordinator 감사](coordination.md#execution-prep-attempt-1-실제-결과),
기존 [환경](implementation-environment.md), [interfaces](implementation-interfaces.md),
[verification](implementation-verification.md) 및 그 upstream r2 links다.
[AGENTS](../../AGENTS.md), [agent 계약](../SOLVER_AGENT_DESIGN.md),
[문서 관리](../FEATURE_DOCUMENTATION.md), [harness](../../.agents/skills/harness/SKILL.md),
[fem-implementation-tdd](../../.codex/skills/fem-implementation-tdd/SKILL.md)를 적용한다.
Prep attempt1은 종료되었고 Step0/top은 blocked, history1이다.
[원 보고서](implementation-prep-evidence.md)의 미검증 test 수정/실패 횟수 서술은 후속
Implementation owner가 실제 raw 순서에 맞춰 갱신한다. Planning은 본문을 수정하지 않는다.
[보존된 raw](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/step0-output.json)와
[observation](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/observation.json)을 사용한다.
Raw SHA-256은 `0d5c0fe0aeba5604c5289764e7aad1834902548ca02158f8feac03484b195941`이다.
마지막 focused run은2pass/2fail, 이후 test-only 수정은 미실행이다. Registered CTest의
362pass 기록은 manual full VERIFY/별도 process exit를 대신하지 않는다.
[현재 Executor](../../scripts/execute.py)의 constructor는 경로/schema를 읽고 field를 설정한다.
`_stop_step`은 blocked/history/top을 저장한 뒤 종료하며 커밋하지 않는다.
`_commit_paths`는 자체 `_assert_step_scope`, trusted path 검증, exact staged 경로 검사와
commit 직전 재검사를 수행한다. 내부 index reset은 검사된 dirty 경로의 staging만 정리하며
worktree bytes는 보존한다. 아래 명령은 이 method를 변경 없이 호출한다.
`run/_commit_step/_finalize/_stop_step`, status reset, Hook writes 또는 guard overrides는 없다.
일반 실행용 clean preflight는 dirty WIP 보존 전에 성립하지 않으므로 이 전용 checkpoint는
constructor/identity/scope/commit 경로를 사용하고 마지막 clean 상태에서 정상 preflight를 확인한다.
이는 새로운 recovery CLI가 아니다.
## R2. Root checkpoint 이후의 정확한 WIP 보존 명령
1. 모든 실행이 종료된 상태에서 Coordinator가 이 계획을 감사한다. Root는 management4문서와
이 변경3문서, classifier delta를 반영한 prep step0.md의 정확한8경로만 먼저 checkpoint한다.
Partial runtime/tests/report와 phase index/top의
controls는 stage하거나 커밋하지 않는다. Root checkpoint 후 staging은 비어 있어야 한다.
2. Branch `feat-mitc4-shell-feast-eigen-execution-prep`, linked root, origin
`d533b615410751fe023dc73ac2be994f05d37d30`의 descendant, origin 이후 commit path가
해당8계획/관리 파일 이내임을 아래 명령이 검증한다. 현재 partial implementation8경로와 control2경로가
정확히 남아야 한다. `.codex/hooks.json`은 이 WIP commit의 변경 대상이 아니다.
3. Coordinator가 실행을 할당하면 **실제 Executor method**가 두 개의 local commit을 만든다.
Root/Coordinator는 실행 동안 추가 편집·커밋을 멈춘다. 성공 명칭이나 completed를 쓰지 않는다.
첫 commit 후 두 번째가 실패할 수 있으며 두 commit은 하나의 transaction이 아니다.
실패 시 현재 HEAD/index/worktree/log를 그대로 감사하고 자동 재시도나 rollback을 하지 않는다.
Workspace root의 별도 managed PowerShell process에서 아래 전체 block을 실행하도록 계획한다.
Python native exit를 즉시 저장하여 동일 shell exit로 전파한다. CommandNotFound는 terminating
error이며 나중 명령의 exit0으로 덮이지 않는다. 이 block은 **현재 planning turn에서 미실행**이다.
```powershell
$ErrorActionPreference = 'Stop'
Get-Command python -ErrorAction Stop | Out-Null
@'
import ast, hashlib, json, os
from pathlib import Path
from scripts import execute
phase = "mitc4-shell-feast-eigen-execution-prep"
origin = "d533b615410751fe023dc73ac2be994f05d37d30"
ex = execute.StepExecutor(phase)
root = Path(ex._root)
assert Path.cwd().resolve() == root
assert Path(ex._run_git_checked("rev-parse", "--show-toplevel").stdout.strip()).resolve() == root
assert ex._is_isolated_worktree()
assert ex._codex_sandbox_mode() == "workspace-write"
assert ex._implementation_agent_settings() == ("gpt-5.6-terra", "xhigh")
branch, before_head = ex._git_execution_identity()
assert branch == "refs/heads/feat-" + phase
ex._run_git_checked("merge-base", "--is-ancestor", origin, "HEAD")
doc_names = ("FEATURED_AGENTS.md", "PRD.md", "ADR.md", "coordination.md",
"implementation-plan.md", "implementation-environment.md", "implementation-recovery.md")
doc_paths = {"docs/mitc4-shell-feast-eigen/" + n for n in doc_names}
doc_paths.add("phases/" + phase + "/step0.md")
committed = ex._run_git_checked("diff", "--name-only", "--no-renames", origin, "HEAD").stdout.splitlines()
assert set(committed) <= doc_paths
assert not ex._run_git_checked("diff", "--cached", "--name-only").stdout.strip()
current_source = (root / "scripts/execute.py").read_text(encoding="utf-8")
original_source = ex._run_git_checked("show", origin + ":scripts/execute.py").stdout
assert ast.dump(ast.parse(current_source.replace("CODEX_TIMEOUT_SECONDS = 14400",
"CODEX_TIMEOUT_SECONDS = 1800"))) == ast.dump(ast.parse(original_source))
idx = ex._read_phase_index()
top = ex._read_top_index()
assert len(idx["steps"]) == 1 and idx["steps"][0]["status"] == "blocked"
assert len(idx["steps"][0]["attempt_history"]) == 1
assert next(p for p in top["phases"] if p["dir"] == phase)["status"] == "blocked"
owned = ex._step_owned_paths(idx["steps"][0])
expected_owned = ("scripts/execute.py", ".codex/hooks.json",
"scripts/hooks/stop_validation.py", "scripts/msvc_harness/models.py",
"scripts/msvc_harness/process.py", "tests/test_execute.py",
"tests/test_harness_timeouts.py", "docs/HARNESS_WORKFLOW.md",
"docs/mitc4-shell-feast-eigen/implementation-prep-evidence.md")
assert owned == expected_owned
control = ["phases/index.json", "phases/" + phase + "/index.json"]
code = [p for p in owned if p != ".codex/hooks.json"]
assert set(ex._assert_step_scope(owned)) == set(code + control)
raw_path = "phases/" + phase + "/step0-output.json"
raw = (root / raw_path).read_bytes()
assert hashlib.sha256(raw).hexdigest() == "0d5c0fe0aeba5604c5289764e7aad1834902548ca02158f8feac03484b195941"
frozen_paths = list(owned) + control + ["phases/" + phase + "/step0.md", raw_path]
frozen = {p: (root / p).read_bytes() for p in frozen_paths}
def verify_frozen():
assert all((root / p).read_bytes() == data for p, data in frozen.items())
assert ex._read_phase_index() == idx and ex._read_top_index() == top
assert ex._git_execution_identity()[0] == branch
verify_frozen()
previous = before_head
for paths, message in (
(code, "chore(mitc4-shell-feast-eigen-execution-prep): WIP blocked partial deadline preparation"),
(control, "chore(mitc4-shell-feast-eigen-execution-prep): preserve blocked attempt 1 metadata"),
):
verify_frozen()
assert ex._commit_paths(paths, message, owned_paths=owned)
current = ex._git_execution_identity()[1]
assert current != previous
actual = ex._run_git_checked("diff-tree", "--no-commit-id", "--name-only",
"--no-renames", "-r", current).stdout.splitlines()
assert set(actual) == set(paths), (current, actual)
verify_frozen()
print(json.dumps({"commit": current, "paths": sorted(actual), "status": "blocked"}))
previous = current
assert not ex._worktree_paths()
ex._preflight_repository()
verify_frozen()
print(json.dumps({"clean": True, "branch": branch, "head": previous,
"raw_sha256": hashlib.sha256(raw).hexdigest(),
"phase_status": "blocked", "history_count": 1}))
'@ | python -B -
$mfeCheckpointExit = $LASTEXITCODE
if ($mfeCheckpointExit -ne 0) { exit $mfeCheckpointExit }
exit $mfeCheckpointExit
```
상태/history/timestamps/다른 step/top/step markdown/raw/owned file bytes는 전후 동일해야 한다.
출력 commit SHA와 actual path set, clean/branch/root 및 실제 process exit를 Coordinator가
관리문서에 감사한다. 이 두 commit은 blocked WIP 보존이며 구현/검증 통과가 아니다.
Raw archive는 ignored 상태로 유지하고 Git에 추가하지 않는다.
## R3. 승인 후에만 가능한 status-only checkpoint
현재 exact DFA run의 명시적 사용자 승인은 없다. WIP checkpoint에는 별도 사용자 질문이
필요하지 않지만 DFA는 [harness elevated rule](../../.agents/skills/harness/SKILL.md#elevated-and-remote-execution)에 따라
동일 native 명령 실패 evidence, clean linked worktree, **해당 실행 직전 명시적 사용자 승인**,
approval flag가 모두 필요하다. 과거 일반 구현 승인이나 이 문서 작성은 그 승인이 아니다.
그 승인이 실제로 도착한 경우에만 다음 순서를 같은 bounded 복구 준비로 진행한다.
1. Coordinator가 승인된 exact command와 recovery dispatch를 management에 기록하고 Root가
그 문서만 checkpoint하여 clean을 유지한다. 원시 attempt1 archive는 그대로 보존한다.
2. Coordinator의 별도 명시 할당을 받은 Planning만
`phases/mitc4-shell-feast-eigen-execution-prep/index.json`의 **현재 Step0 status 한 값**
`blocked -> pending`을 바꾼다. `blocked_reason/blocked_at/started_at/created_at/
attempt_history`, owned paths, 다른 Step/top은 그대로 둔다. 현재 dispatch는 이 편집을 허용하지 않는다.
3. Coordinator가 할당한 실제 Executor method는 아래 control-only checkpoint를 수행한다.
Staged HEAD의 blocked JSON과 working pending JSON의 차이가 status 한 값뿐인지 검증한다.
Top은 계속 blocked다. 기존 `_check_blockers`는 phase의 첫 미완료 Step을 판별하므로
pending을 실행할 수 있으며 top을 미리 성공/초기화할 필요가 없다.
4. Clean checkpoint 확인 뒤 별도 변경 없이 R4의 승인된 invocation을 시작한다.
필요한 준비 사이에 실행 범위나 환경이 달라지면 재개하지 않고 Coordinator에 반환한다.
```powershell
$ErrorActionPreference = 'Stop'
Get-Command python -ErrorAction Stop | Out-Null
@'
import json
from pathlib import Path
from scripts import execute
phase = "mitc4-shell-feast-eigen-execution-prep"
ex = execute.StepExecutor(phase)
root = Path(ex._root)
assert Path.cwd().resolve() == root
assert Path(ex._run_git_checked("rev-parse", "--show-toplevel").stdout.strip()).resolve() == root
assert ex._is_isolated_worktree() and ex._codex_sandbox_mode() == "workspace-write"
branch, before_head = ex._git_execution_identity()
assert branch == "refs/heads/feat-" + phase
path = "phases/" + phase + "/index.json"
before = json.loads(ex._run_git_checked("show", "HEAD:" + path).stdout)
after = ex._read_phase_index()
expected = json.loads(json.dumps(before))
assert len(expected["steps"]) == 1 and expected["steps"][0]["status"] == "blocked"
expected["steps"][0]["status"] = "pending"
assert after == expected
assert set(ex._assert_step_scope(())) == {path}
assert not ex._run_git_checked("diff", "--cached", "--name-only").stdout.strip()
top_before = ex._read_control_bytes(ex._top_index_file)
raw_path = root / "phases" / phase / "step0-output.json"
raw_before = raw_path.read_bytes()
phase_before = ex._read_control_bytes(ex._index_file)
assert ex._commit_paths([path],
"chore(mitc4-shell-feast-eigen-execution-prep): queue approved recovery preserving attempt history")
current = ex._git_execution_identity()
assert current[0] == branch and current[1] != before_head
assert ex._run_git_checked("diff-tree", "--no-commit-id", "--name-only", "-r",
current[1]).stdout.splitlines() == [path]
assert ex._read_control_bytes(ex._index_file) == phase_before
assert ex._read_control_bytes(ex._top_index_file) == top_before
assert raw_path.read_bytes() == raw_before
assert ex._read_phase_index() == after and not ex._worktree_paths()
ex._preflight_repository()
print(json.dumps({"commit": current[1], "clean": True,
"step_status": "pending", "history_preserved": True}))
'@ | python -B -
$mfeStatusExit = $LASTEXITCODE
if ($mfeStatusExit -ne 0) { exit $mfeStatusExit }
exit $mfeStatusExit
```
이 단계도 `_commit_step`이나 완료 처리를 부르지 않는다. 이후 실행에서 추가 attempt 기록과
terminal outcome/timestamp 정리는 Executor 소유다. Planning/Root가 과거 failure를 지우지 않는다.
## R4. 조건부 exact DFA invocation과 후속 검증
Prep에 실제 classifier 결함의 TDD delta가 추가되었다. 상세 RED/GREEN/신규 test3개 및 전체
VERIFY는 [prep Step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md)에 있다.
[순수함수 재현](../../.harness/build/mitc4-eigen-evidence/prep/attempt1/classifier-observation.json)은
성공한 source read stdout의 marker7회가 오판 원인이었음을 보여 준다. 실제 protected Hook
쓰기 거부/명시 blocked는 별개의 실제 failure로 보존한다. Root/Coordinator가 확정한 순서는
이번 계획 종료 → 정확 문서 checkpoint → R2의 unchanged Executor WIP 두 commit → 별도
Correction Agent dispatch다. Correction 소유는 scripts/execute.py, tests/test_execute.py와
`docs/mitc4-shell-feast-eigen/corrections.md`이며 Hook/index/status/Git은 변경하지 않는다.
Correction은 Step0에 정의한 최소 RED/GREEN·focused/full acceptance를 수행한다.
Checkpoint/recovery bootstrap이 classifier를 monkeypatch하거나 진단을 지우지 않는다.
이미 시작된 Executor는 source 수정 뒤에도 예전 classifier를 유지하므로 Correction은 다음
실제 prep invocation보다 먼저 완료되어야 한다. 실제 Correction 결과가 반환된 뒤 Coordinator는
Planning을 별도 재개하여 source/report의 정확 checkpoint 계획을 감사한다. 현재 문서는 미래
Correction 성공/hash/commit이나 그 checkpoint를 미리 승인하지 않는다. 해당 검증·checkpoint와
새 process가 수정 classifier를 읽는 activation 확인이 끝나기 전 R3/R4 재개를 실행하지 않는다.
현재 timeout-only AST guard는 최초 WIP 보존에 그대로 유지한다. 수정된 classifier를 현재
Executor에 reload/override하거나 old classifier의 terminal을 성공으로 바꾸지 않는다.
R3과 사용자 승인까지 실제 완료된 경우에만, workspace root의 새 managed PowerShell
process에서 아래 실행을 허용한다. E3의 실제 `main()`과 단일 유한14400 timeout assignment를
유지하며 flag와 process-local sandbox 값만 승인 범위에 맞춘다. 이전 환경 값은 `finally`에서
복원하고 native exit를 즉시 저장한다. transport/ownership/Hook/verification guard는 변경하지 않는다.
```powershell
$ErrorActionPreference = 'Stop'
Get-Command python -ErrorAction Stop | Out-Null
$mfePriorSandbox = [Environment]::GetEnvironmentVariable('FEM_HARNESS_CODEX_SANDBOX', 'Process')
if ($null -ne $mfePriorSandbox -and $mfePriorSandbox -ne 'workspace-write') {
throw 'Unexpected pre-existing sandbox environment'
}
$mfeNativeExit = $null
try {
$env:FEM_HARNESS_CODEX_SANDBOX = 'danger-full-access'
python -B -c "from scripts import execute; execute.StepExecutor.CODEX_TIMEOUT_SECONDS = 14400; execute.main()" mitc4-shell-feast-eigen-execution-prep --approve-danger-full-access
$mfeNativeExit = $LASTEXITCODE
if ($null -eq $mfeNativeExit) { throw 'Native Executor exit was not captured' }
}
finally {
[Environment]::SetEnvironmentVariable('FEM_HARNESS_CODEX_SANDBOX', $mfePriorSandbox, 'Process')
}
exit $mfeNativeExit
```
Implementation은 선행 Correction의 실제 RED/GREEN evidence를 읽고 같은 classifier regression,
남은 Hook 변경, 미검증 test 수정의 focused 재검증, 전체 pytest와
MSVC/x64/Debug CMake/CTest, actual registered Stop을 모두 수행한다. 기존 보고서의 실제
2개 실패와 미검증 수정도 owner가 바로잡는다. 실패 이력을 새 RED 성공이나 correction으로
바꾸지 않는다. Native Exit/Stop 사후 감사까지 prep gate가 완료되기 전 main activation은 금지다.
Push/tag/publish/release 또는 다른 sandbox/guard 변경 권한은 없다.
## R5. 계획 정적 검증
Command AST/PowerShell syntax와 현 상태의 read-only 검사를 수행했다. Python `ast.parse`로
WIP/status checkpoint code2개를 검증했고 PowerShell `Parser::ParseInput`으로 실행 block3개의
syntax errors0을 확인했다(각 exit0). 현재 execute.py는 origin 대비 timeout 상수 외 AST가 같아
checkpoint에 사용되는 guard가 변경되지 않았음을 확인했다. Phase/top/raw는 보존 archive와
동일하며 상태 blocked/history1이다. 문서 EOF/trailing whitespace·local links와
`git diff --check`도 확인했다. Commit/status edit/DFA/CMake/CTest/pytest는 미실행이다.
최종 scope/link count·hash는 handoff에 기록한다.