untracked files on main: dceb101 feat(#63): IMP-34 R1 donor capacity measured bound (u1+u2)

This commit is contained in:
kmlee1 committed 2026-05-21 22:07:41 +09:00
commit 8f085a28d3
3220 files changed
+985495

No files matched your search

@@ -0,0 +1 @@
[{"id": 22690, "html_url": "https://gitea.hmac.kr/Kyeongmin/C.E.L_Slide_test2/issues/62#issuecomment-22690", "pull_request_url": "", "issue_url": "https://gitea.hmac.kr/Kyeongmin/C.E.L_Slide_test2/issues/62", "user": {"id": 28, "login": "Kyeongmin", "login_name": "", "source_id": 0, "full_name": "이경민", "email": "kyeongmin@noreply.localhost", "avatar_url": "https://gitea.hmac.kr/avatars/d883a35f9197b080b2a0c535c3f9357dcd5c7d40b3c42bd8f40218cb94609a8e", "html_url": "https://gitea.hmac.kr/Kyeongmin", "language": "", "is_admin": false, "last_login": "0001-01-01T00:00:00Z", "created": "2025-12-30T10:51:04+09:00", "restricted": false, "active": false, "prohibit_login": false, "location": "", "website": "", "description": "", "visibility": "public", "followers_count": 0, "following_count": 0, "starred_repos_count": 1, "username": "Kyeongmin"}, "original_author": "", "original_author_id": 0, "body": "[Claude #1] Stage 1 problem-review — IMP-46\n\n## 1. Source re-read + pair context\n\n- source axis = #62 (frame transformation cache layer — content-addressed cache; lookup before AI call + save after `visual_check PASS + 사용자 OK` or `--auto-cache`).\n- pair = #61 IMP-33 (closed at `c864fe0`, AI fallback scaffolding u1~u11, flag default OFF). IMP-33 already shipped a **u6 cache stub** + a **u8 step12 cache_key build site** that is sample-specific. IMP-46 = replace the stub backend AND fix the key.\n- depend = IMP-33 AI hook (now landed); declared consumer = every `route_ai_fallback` call site (currently only `gather_step12_ai_repair_proposals`).\n- out-of-scope (explicit) = AI call itself (IMP-33), cache → catalog promotion (R4).\n- roadmap axis = R3 (AI 보정/재구성 보조), wave 1 (실질 구동 필수).\n\n## 2. Root cause — what IMP-33 stub left unfinished (3-axis)\n\n### Axis A — u6 cache backend = NotImplementedError marker\n\n`src/phase_z2_ai_fallback/cache.py:79-82` (verified):\n\n```python\nraise NotImplementedError(\n \"IMP-46 persistent cache storage is not implemented yet; \"\n \"this is the IMP-33 u6 stub marker.\"\n)\n```\n\n`read_proposal` returns `None` for any key (`cache.py:36-45`); `save_proposal` enforces both gates then raises NotImplementedError (`cache.py:48-82`). IMP-46 = replace the marker with a real backend (read + write JSON under `data/frame_cache/{frame_id}/{signature_hash}.json` per issue spec). Gate semantics (visual_check_passed AND user_approved → write path) are already in place and must be preserved.\n\n### Axis B — u8 cache_key is sample-specific (the critical defect)\n\n`src/phase_z2_ai_fallback/step12.py:109-111` (verified):\n\n```python\ncache_key = \"::\".join(\n [template_id, \",\".join(sorted(record[\"source_section_ids\"]))]\n)\n```\n\n`source_section_ids` is the MDX section identifier (e.g., `\"02.mdx::sec-0\"`). This means:\n- a fresh MDX with the same structural shape → guaranteed cache MISS;\n- two MDX with different identifiers but identical signature → never hit;\n- adding/renaming a sample → orphans the cache entry.\n\nThis defeats the cache's reason to exist. The whole point of `feedback_no_hardcoding` (\"signature hash 가 sample-specific case 만들지 않게\") is to make the key **structural**, not source-identifier-based.\n\nIssue spec's required signature axes (verified against catalog + V4 evidence schema):\n\n| signature axis | source at HEAD | structural? |\n|---|---|---|\n| `frame_id` | `frame_contracts.yaml` per-template `frame_id:` (e.g. `1171281190`) — `templates/phase_z2/catalog/frame_contracts.yaml:23` | yes |\n| `v4_label` | V4 result `label` (`light_edit` / `restructure`) — passed as `record[\"label\"]` | yes |\n| `cardinality` | frame contract `cardinality.strict` OR V4 result `cardinality_signature` — `frame_contracts.yaml:27-29` | yes |\n| `source_shape` | `frame_contract.source_shape` (`top_bullets` / `paragraph` / `table`) — `frame_contracts.yaml:26` | yes |\n| `h3_count` | source MDX subsection count (derivable from `unit.raw_content`) | yes |\n| `char_count_bucket` | discretized text length (e.g., `<100`, `100-300`, `300-700`, `700+`) | yes |\n| `layout_preset` | `sidebar-right` / `two-column` / `hero-detail` / `single-column` — Phase Z layout choice | yes |\n| `zone_position` | `top` / `bottom_l` / `bottom_r` — zone topology position | yes |\n\nNone of these axes carry sample-specific identifiers. All are derivable from V4 result + frame contract + the unit's shape (not its source path). Hash → short hex digest.\n\n### Axis C — invalidation surface (3 sources)\n\nIssue spec: `frame contract 변경 / partial template 변경 / catalog 업데이트 → 해당 frame cache 폐기`. Verified sources at HEAD:\n\n| source | path | scope |\n|---|---|---|\n| frame contract | `templates/phase_z2/catalog/frame_contracts.yaml` (loaded by `src/phase_z2_mapper.py:49 load_frame_contracts` with `_CATALOG_CACHE` global) | per-template subtree |\n| partial template (family) | `templates/phase_z2/familLine truncated