feat: /idd-edit runtime enforcement (R4 + R5) via extracted helper script (#154)#159
Open
kiki830621 wants to merge 1 commit into
Open
feat: /idd-edit runtime enforcement (R4 + R5) via extracted helper script (#154)#159kiki830621 wants to merge 1 commit into
kiki830621 wants to merge 1 commit into
Conversation
…ript Closes #150 Requirements 4 + 5 runtime enforcement deferral, addressing R1/R2/R3 bash-incremental failure on PR #153 (3 verify iterations each introduced new parser bugs). # Approach (per #154 D1-D3 locked decisions before EnterPlanMode) D1: PR path (this branch) D2: Q4 errata flow → refuse-with-helpful-message (NOT auto-override), aligns with IC_R007 user-authored-intent spirit D3: #156 test framework → ad-hoc shell test runner this PR + #156 generalizes later Mid-impl pivot per .claude/scripts/tests/spectra-archive-post-ic/ precedent: extract parser to .claude/scripts/idd-edit-helper.sh (proper extracted helper) instead of inline SKILL.md bash (which is what kept breaking in R1/R2/R3). # Implementation .claude/scripts/idd-edit-helper.sh — 3 subcommands: - parse-args: positional shift over 7 flags + missing-value guards (R3 C1/C2) + eq-form support + body-file readability (R3 H1) + R4 gate (R4) + override-pair guard. Emits eval-friendly KEY=value via printf %q. - validate-target: single gh API call, *[bot] allowlist + OWNER passthrough + override pathway, R5 refuse exit 4 with actionable message. - section-replace: awk-getline pattern (BSD/gnu safe, closes R3 C3 BSD awk -v multi-line newline reject). .claude/scripts/tests/idd-edit/ — fixture-dir test runner with 13 fixtures covering R1/R2/R3 regression set + R4/R5 gate cases. All 13 GREEN. SKILL.md changes: - Frontmatter argument-hint reflects new flag syntax - Step 1 + Step 2 replaced with helper script invocations - Step 4 --replace mode uses section-replace helper - ## 使用範例: 3 examples updated + 2 new (section-replace + errata override) - ## Batch mode: per-target R4/R5 note + #158 cross-link idd-comment/SKILL.md errata Template SPECIAL BEHAVIOUR: IDD_CALLER env var pattern + R5 refuse exit 4 handling + helpful message suggesting manual --override-user-content. # Spec + version openspec/specs/append-vs-modify-discipline/spec.md: Purpose + R4 + R5 preambles updated from 'deferred to #154' to 'landed via #154' + specific helper subcommand + tested-by fixture refs. plugin.json: 2.74.0 → 2.75.0. # Filed during implementation #155 — bash vs alternative layer (parking-lot P3) #156 — IDD plugin test framework (P2 — partially pre-empted by reusing precedent) #157 — spec.md @trace blocks no auto-updater (parking-lot P3) #158 — /idd-edit batch + R5 semantics decision (P2) Refs #154 Refs #150 Refs #155 Refs #156 Refs #157 Refs #158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #154 Refs #150 Refs #155 Refs #156 Refs #157 Refs #158
Summary
Closes #150 Requirements 4 + 5 runtime enforcement deferral, addressing R1/R2/R3 bash-incremental failure on PR #153 (3 verify iterations each introduced new parser bugs).
Approach (per #154 D1-D3 plan-locked decisions):
idd/154-edit-runtime)Mid-impl pivot per
.claude/scripts/tests/spectra-archive-post-ic/precedent: extract parser to.claude/scripts/idd-edit-helper.sh(proper extracted helper) instead of inline SKILL.md bash. This solves R1/R2/R3 root cause more deeply — AI no longer generates parser bash inline.What lands
.claude/scripts/idd-edit-helper.sh.claude/scripts/tests/idd-edit/.../skills/idd-edit/SKILL.md.../skills/idd-comment/SKILL.mdopenspec/specs/append-vs-modify-discipline/spec.mdplugin.jsonCHANGELOG.mdTest gate proof
BREAKING (runtime)
/idd-edit --replacewithout--scope/--sectionnow refuses (exit 3 + R4 message)/idd-editmodifying non-OWNER non-bot comment now refuses (exit 4 + R5 message);/idd-commenterrata flow auto-call handles gracefullyChecklist
ce0adf4)/idd-verify --pr <this-PR>)/idd-close #154after mergeFiled mid-impl
<!-- @trace -->blocks lack auto-update mechanism (tangential from #154 plan) #157 — spec.md<!-- @trace -->blocks no auto-updater (parking-lot P3)/idd-editbatch mode + R5 interaction semantics (P2; single-target enforcement shipped, batch interaction follow-up)Generated by /idd-implement on PR path. Do NOT add a GitHub close trailer (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary.