docs(stage2): finalize v4 strategy and assets

Preserve v3 contracts while integrating accepted audit findings. Document version-free runtime assets and independent verification evidence.
This commit is contained in:
2026-08-28 17:08:03 +09:00
parent e35d979bb3
commit fef75bd30d
8 changed files with 2930 additions and 1 deletions
@@ -0,0 +1,118 @@
# Stage 2 v4 전략서와 자산 명세 작성
## Objective
`take_away_from_eval_v.3.md`의 취사선택을 `stage_2_optimal_update_strategy_v.3.md`의 5-task clean-slate 구조에 완전히 흡수하여 v4 전략서·상세 UML SVG·version-free 자산/source 명세를 작성하고, 사용자 지정 횟수의 독립 검증과 증분 개정을 완료한다.
## Deliverables
- `YAML_Prompts/2. Stage_2/stage_2_optimal_update_strategy_v.4.md`
- `YAML_Prompts/2. Stage_2/stage_2_optimal_update_strategy_v.4_workflow.svg`
- `YAML_Prompts/2. Stage_2/assets_for_stage_2_v.4.md`
- `YAML_Prompts/2. Stage_2/MEMORY.md` 압축 갱신
## Scope and Non-Scope
- 범위: v4의 전체·상세 DAG, IO, YAML 분류, 단계별 구현·검증 전략, 신규 자산/source inventory와 배포경로.
- 비범위: 실제 workflow YAML·Python engine·registry·rule Markdown·Weaviate collection 구현·배포, live LLM/E2E, 137종 법률가 sign-off, 법원 제출.
## Known Inputs
- `stage_2_optimal_update_strategy_v.3.md`
- `eval_stage_2_optimal_update_strategy_v.3.md`
- `take_away_from_eval_v.3.md`
- Stage 2 `MEMORY.md`
- 현행 Stage 1 v.8 산출물 계약과 지정 ACTIO migration source 10종
## Material Assumptions
- 소가 산정 규칙·민사소송 등 인지규칙 Markdown과 137종 canonical `case_type_id` registry는 계획된 production input이며 현재 구현 완료로 간주하지 않는다.
- v4 runtime은 구 Stage 2 v.0~v.3 YAML이나 legacy 자산을 직접 load하지 않는다.
- `case_type_id`는 S2_10 이후 drafting/retrieval/coverage selector이고 substantive claim router가 아니다.
- 모든 배포경로는 version-free canonical path로 제시하며 version은 manifest field/hash/release seal로 관리한다.
## Questions That Could Change the Outcome
- v3의 유효한 계약이 v4로 누락 없이 승계되는가.
- takeaway의 2 CRITICAL·22 MAJOR·36 MINOR·15 LOST disposition이 실행 가능한 schema·task·invariant·phase exit에 결속되는가.
- 사용자 예정 자산이 설명 source와 executable contract로 올바르게 분리되는가.
- 자산 inventory가 v4의 모든 named file/source를 정확히 포괄하는가.
## Workstreams and Dependencies
1. v3·takeaway·eval·기존 SVG·asset inventory 대조.
2. v4 backbone 설계 및 Markdown/SVG 초안 작성.
3. 독립 sub-agent 2개 병렬 검증 → 증분 개정, 정확히 2회.
4. 최종 v4에서 named assets/sources 추출하여 inventory 초안 작성.
5. 독립 sub-agent 1개 검증 → 1회 증분 개정.
6. 정적 검증, MEMORY 갱신, 결과 기록.
## Source and Tool Plan
- 로컬 전략서·평가서·원장을 1차 source로 사용한다.
- 법률 명제는 국가법령정보센터·대한민국 법원의 공식 원문만 authority seal 후보로 사용한다.
- `rg`, `sed`, `wc`, `shasum`, XML parser와 이미지 렌더 검증으로 무결성을 확인한다.
- 모든 편집은 `apply_patch`로 수행한다.
## Validation Plan
- v4에 5 task와 정확히 2 LLM task·3 deterministic task가 명시되는지 확인.
- overview DAG, ASCII 상세 DAG, 별도 SVG UML, IO, YAML 표, 단계별 작업이 상호 일치하는지 확인.
- C 2·M 22·m 36·LOST 15의 채택 결과가 contract/validator/fixture/phase에 보존되는지 crosswalk 검증.
- old YAML runtime edge, case-type substantive routing, LLM 산술, strict global no-save, legacy fallback이 0인지 확인.
- asset inventory의 named asset/source coverage, 중복, producer/consumer, version-free path를 검증.
- UTF-8, Markdown fence, SVG XML/render, internal link, whitespace, hash를 검사.
## Approval Boundaries
- 요청된 문서·SVG·MEMORY·ExecPlan만 수정한다.
- 외부 DB·서비스·repository remote에는 쓰지 않는다.
- 구현·배포·commit은 수행하지 않는다.
## Progress
- [x] AGENTS·MEMORY·workflow·evidence 규칙 확인
- [x] v3·takeaway·eval·기존 자산 구조 대조
- [x] v4 Markdown·SVG 초안 작성
- [x] 검증 round 1: sub-agent 2개 병렬 + 증분 개정
- [x] 검증 round 2: 동일 2개 sub-agent 병렬 + 증분 개정
- [x] assets v4 초안 작성
- [x] asset 검증 1회 + 증분 개정
- [x] 정적 검증·MEMORY 갱신
## Decision Log
| Date/Stage | Decision | Basis | Consequence |
|---|---|---|---|
| 2026-08-28 / intake | v3를 새로 축약하지 않고 유효 계약을 유지하며 takeaway만 증분 통합 | 대폭 개정에 따른 LOST 15 회귀 경험 | v3→v4 retained/replaced/added ledger를 둔다 |
| 2026-08-28 / intake | SVG는 별도 file artifact로 생성하고 Markdown은 image link만 삽입 | 사용자 content structure | UML source code를 본문에 넣지 않는다 |
| 2026-08-28 / intake | version은 path가 아닌 manifest metadata로 관리 | 사용자 version-free 배포경로 조건 | 모든 신규 runtime path에서 `/v2`, `/v3`, `/v4` segment 제거 |
| 2026-08-28 / round 1 | 외부 review receipt는 S2_40 산출물이 아니라 digest-bound human input으로 분리 | 두 독립 검증자가 동일 도달불능·seal 선후 문제 확인 | S2_40 idempotent wait/resume, commit intent와 post-rename result 도입 |
| 2026-08-28 / round 1 | retrieval config·crosswalk는 새 YAML 2개가 아니라 기존 `requirement_fact_scope.yml`의 closed section으로 둠 | 단순화·token economy와 92 catalog 안정성 | config/snapshot/replay hash는 receipt에 완전 봉인 |
| 2026-08-28 / round 2 | group ID는 C20에서 stable mint하고 content 변경 receipt는 새 DAG attempt로 되돌림 | 두 검증자가 GROUP_LOCAL 시점·review resume의 불변 candidate 모순을 확인 | C35 freeze, SUPERSEDED candidate 보존, S2_20/S2_30 재진입 계약 추가 |
| 2026-08-28 / round 2 | 제1117조 기간 경과 추정과 generic case type을 자동 탈락·catch-all로 사용하지 않음 | 항변·중단/정지·포기·권리남용과 claim-capable predicate가 법률판단을 요구 | digest-bound lawyer disposition과 closed generic predicate를 READY 전제로 둠 |
| 2026-08-28 / asset audit | release 증적은 `stage2_release.json` 내부 signed object로 일원화하고 기존 source inventory를 보완 | 1회 독립 감사에서 Stage 1 logical input, legacy 16, regression source가 누락됨 | 고정 manifest/receipt 10, fixture 동적 family, source/runtime 경계가 명시됨 |
## Evidence Ledger
| Claim/Issue | Source or Test | Status | Notes |
|---|---|---|---|
| v3 현행 전략 | `stage_2_optimal_update_strategy_v.3.md` | VERIFIED | 5-task 경계·유효 계약을 v4 retained/replaced/added ledger와 대조 |
| v3 취사선택 | `take_away_from_eval_v.3.md` | VERIFIED | 560행, C2/M22/m36/LOST15 disposition |
| 평가 원장 | `eval_stage_2_optimal_update_strategy_v.3.md`, `evals/stage2_v3/eval_v3_verification_ledger.md` | VERIFIED | v4가 채택한 C·M·m·LOST 처분과 최소 계약 대조 |
| 공식 법률 authority | law.go.kr/scourt official source | VERIFIED_LIMITED | 유류분 전환·사해행위 recipient·사죄광고·인지/소가 source 후보를 공식 원문에서 확인; release 전 A00 재봉인 필요 |
| v4 SVG 렌더 | `stage_2_optimal_update_strategy_v.4_workflow.svg`, `xmllint`, headless Chrome 1600×1900 | VERIFIED | XML well-formed 및 전체 화면 무잘림 확인 |
| 전략 검증 2회 | `evals/stage2_v4/round_1.md`, `evals/stage2_v4/round_2.md` | VERIFIED | 각 회차 독립 법률·architecture sub-agent 2개 병렬 검증 후 incremental revision |
| asset 검증 1회 | 독립 `v4_assets_audit` 결과와 deterministic catalog diff | VERIFIED | 92 YAML·21 Python·12 schema 일치; ACTIO 10·legacy 16 source 수 대조 |
## Risks and Failure Modes
- v3의 working contract를 문서 재구성 과정에서 누락할 위험.
- 전략서에 구현 완료·137종 coverage·live E2E를 과장할 위험.
- 자산 logical unit, physical file, source document, run output을 혼동할 위험.
- SVG와 ASCII/IO/YAML 표가 서로 다른 DAG를 표현할 위험.
- version-free 경로 조건을 file versioning과 혼동할 위험.
## Results and Residual Uncertainty
완료. 최종 산출물은 전략서 1,507행/112,959 bytes(`6baac7bb…`), SVG 179행/12,859 bytes(`88f98feb…`), 자산 명세 471행/40,855 bytes(`48616d9d…`)다. YAML 92개는 전략서와 자산 명세에서 exact name/class가 일치하며 분류는 LLM-DIRECT 2, LLM-CONTEXT 45, DUAL-CONTRACT 6, NON-LLM-DETERMINISTIC 39다. Python 21개와 schema 12개도 set 차이 0, SVG XML·Markdown fence·UTF-8·trailing whitespace 검사를 통과했다. 이는 설계 완료이며 실제 자산 구현·배포·live E2E·법률가 sign-off 완료 증거는 아니다.