feat(stage2): implement S2_00 asset package

Add the 141-file deterministic ingress package, implementation plan, and scoped project memory record. Keep runtime admission disabled until pending bindings, signatures, authority data, Stage 1 seals, and legal review are complete.
This commit is contained in:
2026-08-30 01:32:29 +09:00
parent decd3280bc
commit 0ac7223790
143 changed files with 33509 additions and 0 deletions
@@ -0,0 +1,119 @@
# S2_00 assets implementation
## Objective
`S_00_SOW.md`와 `S2_00_assets.md`가 정의한 S2_00 고정 자산을 구현하고, 독립 생성 자산을 병렬 작성한 뒤 hash-dependent manifest와 loader binding을 순차 결속한다.
## Deliverables
- `YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/` 아래 S2_00 전담·공유·bundle 고정 자산
- 모든 `.py`와 byte-identical `.txt` mirror
- schema·YAML·JSON·Python 정적검사와 stdlib unit/integration fixture 검증
- 두 차례 독립 workstream 검증과 오류 자산 증분 개정
- `YAML_Prompts/2. Stage_2/MEMORY.md` 작업 요약
## Scope and Non-Scope
- 범위: DEV fixture release에서 실행 가능한 fixed CLI runtime, loader, schemas, tests, fixtures, workflows, profiles, prompts, authority/law-value seed, manifests.
- 비범위: AgentBackend native external-`.py` primitive 확정, 실제 서명키 기반 canary/production admission, live Stage 1 production run, S2_10 법률품질·137종 production sign-off.
- Stage 1 배포 55개 파일과 사건별 runtime input은 복제하지 않고 read-only dependency/locator로 결속한다.
## Known Inputs
- `YAML_Prompts/2. Stage_2/S_00_SOW.md`
- `YAML_Prompts/2. Stage_2/S2_00_assets.md`
- `YAML_Prompts/2. Stage_2/SKILL.md`
- `YAML_Prompts/2. Stage_2/test_code_executor.ipynb`
- Stage 1 v.8 producer YAML과 v.7 extension deployment contracts
## Material Assumptions
- 요청의 `S2_00_SOW.md`는 실재 정본 `S_00_SOW.md`를 뜻한다.
- 사용자 지정 authoring/deployment package root는 `YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/`이다. 파일 내부 canonical locator는 version-free `Stage_2_Clean/` 상대경로를 사용한다.
- 외부 법률 명제는 새로 확정하지 않는다. profile·authority seed는 `DRAFT_UNVERIFIED` 또는 DEV fixture 상태로 생성하고 production 승인을 주장하지 않는다.
## Questions That Could Change the Outcome
- AgentBackend가 fixed external `.py`를 호출하는 native primitive는 repository에서 확인되지 않았다. 이 항목은 생성 가능한 loader CLI와 binding contract로 대체하되 O-06을 `OPEN_EXTERNAL`로 유지한다.
- 실제 production signer/authorization은 외부 owner가 필요하므로 O-07을 `OPEN_EXTERNAL`로 유지한다.
## Workstreams and Dependencies
독립 생성 단위를 다음 3개(`N=3`)로 고정한다.
1. W1 `profile_bundle`: 45 LLM-CONTEXT profiles, P00/P10, authority/law-value DEV seed, coverage/corpus availability manifests.
2. W2 `runtime_tests`: fixed ingress runtime, 6 test axes, case/mutation fixtures.
3. W3 `contracts_orchestration`: 4 schemas, 3 workflows, loader, loader binding, cache policy, draft manifests.
W1~W3 완료 후 main agent가 `.py` mirror, physical hashes, module/regression/authority/stage2 release cross-hash를 순차 결속한다.
## Source and Tool Plan
- file inspection: `rg`, `jq`, `sed`, `shasum`
- file edits: `apply_patch`
- YAML parse: installed PyYAML
- Python validation: Python 3.14 stdlib `compileall`·`unittest`; 외부 package 설치 없음
- external network: 사용하지 않음
## Validation Plan
- Round 1: W1~W3별 독립 sub-agent 대조; 오류 파일만 병렬 개정
- Round 2: 동일 3개 축을 새 검증 turn으로 재검증; 오류 파일만 병렬 개정
- final: inventory path coverage, `.py`/`.txt` byte equality, JSON/YAML parse, schema reference/path/hash closure, compileall, unittest, forbidden old-Stage2/inline-Python/network scan
## Approval Boundaries
- 외부 배포·서명·네트워크 호출·production dependency 설치는 하지 않는다.
- 기존 unrelated dirty-worktree 파일은 수정하지 않는다.
## Progress
- [x] 정본·규칙·배포 루트 조사
- [x] N=3 workstream과 dependency 결정
- [x] W1~W3 병렬 생성
- [x] sequential hash/release binding 및 `.txt` mirror
- [x] Round 1 검증·개정
- [x] Round 2 검증·개정
- [x] final validation·MEMORY
## Decision Log
| Date/Stage | Decision | Basis | Consequence |
|---|---|---|---|
| 2026-08-29/intake | `S_00_SOW.md`를 정본으로 사용 | 요청명 파일은 부재하고 inventory가 정본을 명시 | 파일명 추측 없이 동일 SOW hash 사용 |
| 2026-08-29/intake | package root를 main working directory의 `Default_Agent/Stage_2_Clean/`로 사용 | 사용자 global constraint가 직접 지정 | canonical production copy와 구별해 보고 |
| 2026-08-29/scope | DEV fixture 실행가능성을 목표로 하고 canary/production을 주장하지 않음 | SOW O-06/O-07이 외부 미확정 | 생성 자산의 상태를 과장하지 않음 |
| 2026-08-30/round-2 | `gpt-5.6-sol/ultra`는 loader candidate binding에만 두고 S2_10 workflow에 중복하지 않음 | v4 §6.2 및 SOW §4.1 | evaluator의 `high` 변경 권고를 기각하고 separator·cache-key 결함만 교정 |
| 2026-08-30/round-2 | cache key에서 cluster/slice/run/attempt를 제외하고 release-bound static material만 사용 | v4 §14.1, cache policy | 동일 static prefix cohort의 key가 cluster별로 갈라지는 결함 제거 |
| 2026-08-30/final | release는 `DRAFT_NOT_EXECUTABLE`·`DEV_VALIDATION_ONLY`로 유지 | 외부 signature·completion seal·authority·법률검수 미폐쇄 | 정적·fixture PASS를 production 또는 법률품질 PASS로 승격하지 않음 |
## Evidence Ledger
| Claim/Issue | Source or Test | Status | Notes |
|---|---|---|---|
| S2_00 core 4 + tests 6 + shared 10 | `S_00_SOW.md` §2, `S2_00_assets.md` | VERIFIED | exact paths locked |
| Stage 1 deployment closure 55 | current registry/runtime manifest vs inventory | VERIFIED | 3+26+9+17 |
| Python environment | `python3 --version`, module probe | VERIFIED | 3.14.7; PyYAML present, pytest/jsonschema absent |
| AgentBackend external `.py` invocation | SOW §2.3·§18 | OPEN_EXTERNAL | no production execution claim |
| 생성 대상 fixed asset | `S2_00_assets.md` §1~§3 vs current tree | VERIFIED | 고정 파일 141개; JSON 70, YAML 53, Python 8, Python mirror 8 포함 |
| 상류 Stage 1 배포 55 해시 | current deployment bytes | VERIFIED | 55/55 존재, declared hash mismatch 0; full runtime manifest는 NOT_RELEASE_READY |
| bundle provenance schema | context schema/runtime cross-check | FIXED | nested RFC 6901 pointer·typed prefix validation receipt 보완 |
| regression/module closure | final binder + closure audit | VERIFIED | fixture 10+50, test source 6, module 65, Stage 2 direct 49, mirror 8 전부 raw hash 일치 |
| Round 1 independent audit | W1/W2/W3 cross-audit | FIXED | source/schema/conservation/slice/bundle/loader 경계의 실결함을 3개 병렬 수정군으로 교정 |
| Round 2 independent audit | runtime·release·profile/cache 3축 | FIXED | failure cohort schema, static cache key, projection provenance, 16+1 exact set, separator·authority/module 경계를 마지막 3개 수정군으로 교정 |
| Python unit/integration | `unittest discover tests/s2_00` | VERIFIED | 38/38 PASS |
| loader trust boundary | `stage2_loader.py --validate-only` | VERIFIED_WITH_PENDING_BINDINGS | direct asset와 release oracle hash PASS; 의도된 cycle refs·외부 admission은 pending |
| 전체 정적 closure | JSON/YAML parse, in-memory Python compile, schema/hash/digest script | VERIFIED | release digest `8b46dc52…5017`, prefix digest `3634cb69…071`, old Stage 2 fallback 0 |
## Risks and Failure Modes
- schema와 runtime drift: schemas-first + test round로 통제한다.
- manifest self-hash cycle: manifest 자신의 hash를 내부 closure에서 제외하고 signed envelope를 외부 owner 책임으로 둔다.
- legal profile overclaim: authority-free draft context와 explicit review status로 제한한다.
- fixture success를 production 증거로 오해: release class와 final report에 DEV 범위를 명시한다.
## Results and Residual Uncertainty
`YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/`에 고정 파일 141개를 생성했다. 8개 Python 정본은 동일 내용의 `.txt` mirror와 byte-identical하고, module 65행·Stage 1 referenced lock 55행·Stage 2 direct lock 49행·downstream availability 2행·Stage 1 source contract 17행·fixture 60행이 모두 실물 hash와 일치한다. JSON 70개와 YAML 53개 파싱, Python 8개 in-memory compile, deployment schema, release/module digest, prefix NFC/hash 및 전체 38개 unit/integration test를 통과했다.
패키지는 여전히 `DRAFT_NOT_EXECUTABLE`·`DEV_VALIDATION_ONLY`다. O-06 external AgentBackend invocation, O-07 signed admission, Stage 1 completion seal, detached release signature가 열려 있고, full Stage 1 runtime manifest도 `STAGE1_NOT_RELEASE_READY`다. authority release·corpus·P00/P10/profile의 법률가 검수와 live Stage 1→S2_00→S2_10/S2_40 E2E는 수행하지 않았다. 10+50 fixture는 hash-bound descriptor이며 runtime result receipt는 `NOT_RUN`이다. 따라서 이번 결과는 고정 자산 구현과 정적/fixture contract 검증의 완료이지 production 배포·법률정확성 또는 제출가능성의 증명이 아니다.