This commit is contained in:
commit
8f085a28d3
3220 files changed
+985495
No files matched your search
@@ -0,0 +1 @@
|
||||
[{"id": 22114, "html_url": "https://gitea.hmac.kr/Kyeongmin/C.E.L_Slide_test2/issues/41#issuecomment-22114", "pull_request_url": "", "issue_url": "https://gitea.hmac.kr/Kyeongmin/C.E.L_Slide_test2/issues/41", "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-32 Step 9 application_plan unit assembly helper extraction\n\n## Root cause\n\nStep 9 `application_plan` per-unit dict assembly is currently inline inside `run_phase_z2_mvp1`. IMP-05 Case 7 had to add a `inspect.getsource(phase_z2_pipeline)` source-string guard because there is no helper-level call surface to test directly. The guard catches *literal disappearance* of the `candidate_evidence` + `fallback_chain` lines but cannot verify shape under representative inputs. IMP-32 extracts a pure helper so the guard can be replaced with a direct call test.\n\n## Issue body line number correction\n\nIssue body says `src/phase_z2_pipeline.py:2687~`. Actual location is `src/phase_z2_pipeline.py:4451-4567` (the per-unit `for i, unit in enumerate(units):` loop body that ends with `application_plan_units.append({...})`). Line 2687 is the unrelated `_write_step_artifact` docstring. Scope-lock anchors to the **4451-4567 span**, not 2687.\n\n## Verified call surface\n\nRead of `src/phase_z2_pipeline.py:4451-4567` confirms inline body consumes only these per-unit inputs:\n\n| Symbol | Source | Type |\n|---|---|---|\n| `unit` | `units[i]` (Step 6 composition unit) | obj with `.source_section_ids`, `.v4_candidates`, `.frame_template_id`, `.v4_rank`, `.selection_path`, `.fallback_reason` |\n| `zone_plan` | `zone_region_plans[i] if i < len(zone_region_plans) else {}` | dict (Step 8 output) |\n| `selection_trace` | `v4_fallback_traces.get(unit.source_section_ids[0], {})` | dict |\n| `plan_record` | `plan_record_by_unit_id.get(id(unit))` | Optional[dict] |\n| `v4_all_for_unit` | `lookup_v4_all_judgments(v4, _first_sid, alias_keys=section_alias_by_id.get(_first_sid))` | list[V4Candidate] |\n| `layout_preset` | outer-scope scalar (same for all units) | str |\n| `layout_candidates_list` | outer-scope scalar (same for all units) | list |\n\nModule-level dependencies still available inside helper: `APPLICATION_MODE_BY_V4_LABEL` (module constant), `get_contract` (module import).\n\n## Proposed helper signature\n\n```python\ndef _build_application_plan_unit(\n unit,\n zone_plan: dict,\n selection_trace: dict,\n plan_record: Optional[dict],\n v4_all_for_unit: list,\n *,\n layout_preset: str,\n layout_candidates_list: list,\n) -> dict:\n \"\"\"Step 9 per-unit application_plan dict assembly.\n\n Pure factory — no I/O, no global mutation. Caller wraps return value\n in application_plan_units.append(...). Extracted from inline span\n (IMP-32, was src/phase_z2_pipeline.py:4451-4567).\n \"\"\"\n ...\n```\n\nCall site (replaces 4451-4567 inline body):\n\n```python\nfor i, unit in enumerate(units):\n zone_plan = zone_region_plans[i] if i < len(zone_region_plans) else {}\n selection_trace = v4_fallback_traces.get(unit.source_section_ids[0], {})\n plan_record = plan_record_by_unit_id.get(id(unit))\n _first_sid = unit.source_section_ids[0]\n v4_all_for_unit = lookup_v4_all_judgments(\n v4, _first_sid, alias_keys=section_alias_by_id.get(_first_sid)\n )\n application_plan_units.append(_build_application_plan_unit(\n unit, zone_plan, selection_trace, plan_record, v4_all_for_unit,\n layout_preset=layout_preset,\n layout_candidates_list=layout_candidates_list,\n ))\n```\n\nRationale for keeping the `v4_all_for_unit` *lookup* in the caller (not the helper):\n- Helper stays pure / dependency-injected → trivial to test with synthetic inputs (no real `v4` payload, no `section_alias_by_id` plumbing).\n- `lookup_v4_all_judgments` already has its own coverage upstream; duplicating it inside the helper would re-couple the helper to the global v4 payload shape.\n- Matches the existing pattern where `selection_trace` / `plan_record` are also lookups computed in the caller, not the helper.\n\n## Scope-lock (binding)\n\n1. **Refactor only — zero behavior change.** Output `application_plan_units` list must be byte-identical to pre-IMP-32 for any given input.\n2. **Helper location** = module-level function inside `src/phase_z2_piLine truncated
|
||||
Reference in new issue
Block a user