Skip to content

feat: discussion-type issue metadata helper (idd-issue Step 3.5)#248

Open
kiki830621 wants to merge 2 commits into
mainfrom
idd/141-142-discussion-metadata-helper
Open

feat: discussion-type issue metadata helper (idd-issue Step 3.5)#248
kiki830621 wants to merge 2 commits into
mainfrom
idd/141-142-discussion-metadata-helper

Conversation

@kiki830621

Copy link
Copy Markdown
Member

What

Adds Step 3.5: Discussion Metadata Helper to idd-issue — after an issue is created and before attachment upload, advisory-surface GitHub right-sidebar metadata (assignee / label / milestone) for discussion-type issues.

Cluster PR: closes out both feature Refs #141 and prevention Refs #142 in one change (both land in skills/idd-issue/SKILL.md).

Lean-v1 scope (per feedback_lead_minimal)

Implements the essence of Refs #141, not the full 7-component v1:

  • Detection: --discussion flag is the sole primary trigger. Body-heuristic detection is opt-in behind config discussion_metadata_heuristic (design Q1's own recommended default) — standard bug/feature issues are never subjected to the 4-prompt ceremony.
  • Four advisory sub-steps, all surface-only (never auto-set outward-facing metadata; unattended mode prints suggestions only, sets nothing):
    • (a) assignee from body's tagging-collaborators-verified @login set
    • (b) label = config-overridable discussion_label (default discussion)
    • (c) milestone only on a time-bound signal, reusing existing Step 4.5 machinery
    • (d) native GraphQL relationship DEFERRED (- [~], disclosed in prose)

Why (d) is deferred — not dropped

Highest complexity/risk of the four; it would reuse the v2.52.0+ --blocked-by GraphQL path, which is not yet generalized into a reusable primitive. Design Q4 already keeps the body-text #N reference regardless, so deferring loses no inline context. Light-up condition (extracting the mutation into a helper) is documented in the prose.

Folds in Refs #142 — three mandatory label safeguards

  • S1 verify-by-read after gh label create (silent-succeed is indistinguishable from noop-on-exists — read-back is the only reliable detection)
  • S2 pre-add existence check for the --add-label path
  • S3 UI cache-sync hint at the Step 5 report, on FRESH create only — names the confusing Invalid value ... for label string + hard-refresh remedy

Tests

  • New artifact-level drift-guard fixture scripts/tests/discussion-metadata/test.sh (13 assertions, TDD RED→GREEN)
  • Full suite 22/22 GREEN
  • Fixture locks the contract prose (trigger + 4 sub-steps + 3 safeguards + disclosed deferral) against silent deletion. It does not execute the AskUserQuestion helper — that is a Claude-runtime contract, unrunnable in a shell harness (same artifact-level pattern as session-start-commit-rule).

Merge-order note

Only references rules/tagging-collaborators.md (sub-step (a) reuses its verified-@login set) — does not modify it, so no file conflict with the #85/#86 tagging-family PRs. Independent of PR #247.

Refs #141
Refs #142

Add Step 3.5 (Discussion Metadata Helper) to idd-issue: after an issue is
created and before attachment upload, advisory-surface GitHub right-sidebar
metadata for discussion-type issues (advisor briefing / review-feedback /
awaiting-decision).

Lean-v1 scope (per feedback_lead_minimal — the essence, not the full
7-component v1):
- Detection: --discussion flag is the sole primary trigger; body-heuristic
  detection is opt-in behind config discussion_metadata_heuristic (design Q1's
  own recommended default) so standard bug/feature issues are never subjected
  to the 4-prompt ceremony.
- Four advisory sub-steps, all surface-only (never auto-set outward-facing
  metadata; unattended mode prints suggestions only, sets nothing):
  (a) assignee from body's tagging-collaborators-verified @login set;
  (b) label = config-overridable discussion_label (default `discussion`);
  (c) milestone only on a time-bound signal, reusing Step 4.5 machinery;
  (d) native GraphQL relationship DEFERRED (- [~], disclosed) — highest
      complexity/risk, reuses a not-yet-generalized --blocked-by code path.

Fold in #142's three mandatory label safeguards:
- S1 verify-by-read after `gh label create` (silent-succeed is
  indistinguishable from noop-on-exists — read-back is the only reliable
  detection).
- S2 pre-add existence check for the --add-label path.
- S3 UI cache-sync hint at the Step 5 report on FRESH create only — names the
  confusing "Invalid value ... for label" string + hard-refresh remedy.

TDD: new artifact-level drift-guard fixture
scripts/tests/discussion-metadata/test.sh (13 assertions, RED→GREEN); full
suite 22/22 GREEN. Fixture locks the contract prose (trigger + 4 sub-steps +
3 safeguards + disclosed deferral) against silent deletion; it does not
execute the AskUserQuestion helper (Claude-runtime contract, unrunnable in a
shell harness).

Refs #141
Refs #142
verify round-1(Codex 跨模型盲驗)抓到 #142 Safeguard 2 的控制流 bug:
`gh issue edit --add-label` 在 label_exists 的 if 之後無條件執行,
註解寫「只在 verified-exist 後」但控制流沒 gate —— 對不存在的 label 做
--add-label 會 silently auto-create 白色 label,正是 S2 要防的 edge case。

- SKILL.md:把 --add-label gate 進 `if label_exists` 的 then 分支;
  else 分支導回 auto-create(S1 verify-by-read)或 skip,不落到 blind add
- label_exists:改用 `.[].name | grep -qx` 精確比對,不把 name 裸插進 jq
  表達式 —— 含引號的 custom label 名也安全(Codex finding 2)
- drift-guard fixture:加一個 needle 鎖「不 blind add」gated 分支,把此次
  修復轉成 regression guard(bash 不可 shell-run,只能鎖 prose;Codex finding 3)

drift-guard: 22 suites / 0 fail(discussion-metadata 14 needles GREEN)

Refs #141
Refs #142
@kiki830621

Copy link
Copy Markdown
Member Author

🔍 idd-verify — PR #248 (discussion-metadata helper, #141 + #142)

Verdict: ✅ PASS(round-1 修復後)

Backend(lean tier,比例原則)

此 PR 是 prose + 一個 drift-guard fixture、零可執行 runtime code(SKILL.md 內的 bash 是給 Claude runtime 遵循的指令,非測試 harness 執行)。依 #205 token-cost 裁決,全套 opus 5-agent ensemble 對此改動不成比例,故採精簡雙鏡

  • Codex 跨模型盲驗(gpt-5.5,獨立模型家族,看不到 coordinator 判斷)
  • Coordinator adversarial premise-attack(攻 premise 而非 mechanics)

保留了 ensemble 最高價值的兩個 lens(cross-model blind verify + adversarial),略過同構冗餘的其餘 3 lens。

Round 1 — Codex 抓到 real defect(已修)

# Sev Finding 處置
1 MEDIUM #142 S2 控制流 bug:gh issue edit --add-labellabel_existsif 之後無條件執行,註解寫「只在 verified-exist 後」但控制流沒 gate → 對不存在 label 做 --add-label 會 silently auto-create 白色 label(正是 S2 要防的 edge case) ✅ 修:把 add gate 進 if label_exists then 分支;else 導回 auto-create/skip
2 LOW label_exists$LABEL_NAME 裸插進 jq select(.name == "…") → 含引號的 custom label 名會破 jq ✅ 修:改 .[].name | grep -qx 精確比對,不插值
3 LOW drift-guard 只 grep prose,抓不到上述控制流 bug(false-assurance 縫隙) ✅ 部分修:加 needle 鎖「不 blind add」gated 分支,把此次修復轉成 regression guard(bash 不可 shell-run,這是 artifact-level fixture 的固有上限,已誠實揭露)

修復 commit:2158b1d

Coordinator adversarial premise-attack

Re-verification

  • drift-guard: 22 suites / 0 faildiscussion-metadata 14 needles GREEN,含新 gated-branch guard)
  • CI: suites=SUCCESS、mergeState=CLEAN、mergeable=MERGEABLE

停在 verified — 依 IDD 契約不 auto-merge、不 auto-close。人工 review → merge → /idd-close #141 #142 由你接手。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant