Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "trusted direct-human-context lane が明示的・完全一致の required contract section を既存 structural repair model で fail-closed に consume できるようにする"
change_kind: workflow
dedupe_key: "issue-refinement-loop:trusted-human-context-owner-anchor-section-source-span:v1"Parent Issue
none
Parent Goal Ref
- Goal:
preflight.run.with_human_contextで明示指定された trusted human-context anchor の exact section source を、既存の structural repair と controlled transaction lane で安全に消費できるようにする。 - Desired Destination:
#2572は main に merge 済みの本改善を用いた fresh canonical preflight から contract refinement を再開できる。
Current Validated Scope
run_refinement_preflight.pyは current Issue body の同一本文 alias に限定されたsource_spansassembly を持ち、trusted human-context anchor comment の exact required section は組み立てない。repair_issue_contract.pyは既にowner_anchorauthority とsource_span_exactderivation を表現できるが、owner anchor snapshot と exact span の provenance 再検証はこの producer path に未接続である。- 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 / PR feat: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2469 は current-issue same-body alias と known scalar の配線を完了しており、本 Issue はそれを拡張せず維持する。
Remaining Parent Gaps
- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 の trusted human decision
#5584982649の contract mutation と Workstream 2 / 4 materialization は、本 Issue の PR が main へ merge された後に別セッションの fresh current-main lane で再開する。
Outcome
run_refinement_preflight.py、repair_issue_contract.py、および focused regression tests の変更を含む 1 PR により、explicit with_human_context lane の trusted OWNER anchor が持つ exact canonical required section を owner_anchor / source_span_exact として provenance 検証付きで structural repair が消費し、異常・曖昧な source は auto-apply されない状態にする。
Runtime Verification Applicability
- decision: not_applicable
- reason: control-plane の静的 Python ロジックと deterministic fixture を変更するのみで、browser/runtime behavior を変更しないため。
In Scope
preflight.run.with_human_contextが explicit human-context lane と trusted anchor binding を満たす場合だけ、anchor comment 内の exact canonical H2 required section を bounded source span として assemble する。- 既存
owner_anchorauthority とsource_span_exact/template_value_exact/derived_scalar_exactderivation model を再利用し、source repo、target Issue、comment identity、body digest/revision、heading、exact span/text を既存 provenance model で再検証する。 - duplicate heading、empty/malformed section、unlabeled anchor、agent-report lane、association 不適合、wrong repo/Issue/comment identity、digest/revision mismatch、stale source、competing candidate を fail-closed に保つ。
- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 相当 positive fixture と origin/provenance/ambiguity negative fixtures、および 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 current-issue same-body regression を既存 focused test suite に追加または更新する。
Out of Scope
owner_anchor以外の authority kind、derivation model、schema enum、command registry profile、generic approval framework、security harness、daemon、ledger、persistent state storeの追加。- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 専用の hard-code、導入: M5 Playable Slice Hardening 実装 parent tracker #2572 Issue body の直接編集、M5 runtime workstream、WS2/WS4の実行、M6/M7 runtime。
- human origin を URL 単独から推定すること、fuzzy/semantic section matching、raw
gh issue editによる mutation lane の迂回。
Acceptance Criteria
- AC1: direct
preflight.run.with_human_contextの 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 形 fixtureで、trusted OWNER anchorにQuality Decision Record、Child Issues、Remaining Parent Gapsのexact H2 sourceが各1件ずつあり、target bodyに該当canonical headingがない場合、structural repair candidateはowner_anchorとsource_span_exactによりauto_apply_safeとなり、不要なhuman_judgment_requiredに落ちない。 - AC2: controlled structural repair transaction後のfresh preflightは、trusted contract patch planを生成可能な状態になる。
- AC3: unlabeled anchor、agent-report lane、wrong repository、wrong target Issue、comment identity/revision/digest mismatch、duplicate candidate、missing exact heading、empty/malformed section、competing exact sourceはauto-applyへ昇格せずfail-closedとなる。
- AC4: 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431 / PR feat: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2469 で確立した
current_issuesame-body source span・known scalar behaviorの回帰がない。 - AC5: command registryとdedicated structural repair consumerの既存profile・execution boundaryを変更しない。
Verification Commands
AC1 / AC3 / AC4:
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_structural_repair_known_scalars_wiring.py -q
# AC1
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -qAC2 / AC5:
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_structural_repair_action_apply_consumer.py -q
# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py -q
# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -qRepository baseline:
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.pyAllowed Paths
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/scripts/repair_issue_contract.py.claude/skills/issue-refinement-loop/tests/test_structural_repair_known_scalars_wiring.py.claude/skills/issue-refinement-loop/tests/test_structural_repair_action_apply_consumer.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.pyscripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 tooling gap以外の後続 Phase / 別スコープへの波及が判明した場合。
- nested SubAgent delegation が必要になった場合。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
Required Skills
なし。
Required Design References
.claude/skills/issue-refinement-loop/SKILL.md#Step 0f: Planner Consumption.claude/skills/issue-refinement-loop/references/anchor-comment-handling.mddocs/dev/agent-skill-boundaries.md#オーケストレーター設計原則(impl-review-loop / issue-refinement-loop)- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572, 実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431, PR feat: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2469, 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 (comment)
Delivery Rule
1 Issue = 1 PR。fresh dedicated worktreeで実装し、Draft PRを作成してfocused regressions、current-main baseline comparison、independent test/review、CI、fresh reviewを通す。- 導入: M5 Playable Slice Hardening 実装 parent tracker #2572 のcanonical trusted contract updateは本PRがmainにmergeされるまで実行しない。
Notes for Reviewer
- Scope Collision (C1): 実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 includes
.claude/skills/issue-refinement-loop/**but owns Task Context workflow-signal integration, not trusted anchor section-span assembly. This Issue changes only the explicit human-context structural repair producer/validator and focused regressions; do not combine the work or alter 実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 contracts. - Other overlap-preflight candidates are historical/broad paths. Live title/body search found no open Issue or PR owning trusted
owner_anchorsection source-span assembly.
Scope Delta
N/A
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Sep 8, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 8, 2026
implement-issue: 実装完了 (2026-09-08)
/home/squne/projects/LOOP_PROTOCOL/.claude/worktrees/issue-2582-trusted-anchor-section-source-spanworktree-issue-2582-trusted-anchor-section-source-span0141f295fix: wrap structural repair fixture literal (#2582)
squne121 commentedon Sep 9, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: revalidate trusted owner anchor sources (#2582)
fix: require canonical owner anchor heading (#2582)
fix: trusted owner anchor section spans (#2583)