Skip to content

[infra] spec.md <!-- @trace --> blocks lack auto-update mechanism (tangential from #154 plan) #157

Description

@kiki830621

Problem

Source: surfaced during /idd-plan #154 tangential sweep (Step 2.5)

openspec/specs/append-vs-modify-discipline/spec.md 每個 Requirement 後面都有 <!-- @trace --> block:

<!-- @trace
source: add-action-scoped-modify-discipline
updated: 2026-05-25
code:
  - plugins/issue-driven-dev/skills/idd-diagnose/SKILL.md
  - plugins/issue-driven-dev/skills/idd-issue/SKILL.md
  - plugins/issue-driven-dev/CHANGELOG.md
  - plugins/issue-driven-dev/skills/idd-update/SKILL.md
  ... (10+ files listed)
-->

8+ blocks in 1 spec,都列同樣 code: array of files。

Background

#150 spectra-archive 階段 emit 這些 trace blocks 作為 spec → code traceability hint。 但 grep 確認沒有自動更新機制:

$ grep -r "trace.*update\|update.*trace" .agents/ .claude/ scripts/ 2>/dev/null
# (no matches)

當未來 PR(例 #154)改 3 個 SKILL.md 但 <!-- @trace --> blocks 沒對應更新 → blocks become stale → reverse-lookup「該 spec Requirement 對應哪些 code 檔」不可靠。

Impact

每次任何 PR 動到 spec-linked 檔案,都該 review 是否有對應 <!-- @trace --> block 需 sync。 目前是 silent drift — 沒人警告。

Open questions

  • spectra tooling(spectra validate / spectra analyze / 其他 subcommand)是否 native 支援 trace block auto-update?
  • 若 spectra 不支援:寫 manual script(scripts/sync-spec-traces.sh)?或 pre-commit hook?
  • block schema(source: updated: code:)是 [META] Codify append-vs-modify discipline as plugin-level principle #150 ship 還 spectra 內建?該設 contract 還是 informal?

Type

enhancement / infrastructure — spec-code traceability mechanism gap

Priority

P3 — parking-lot until ≥1 incident「spec ref'd file 已 rename/delete 但 trace block 沒跟」surfaces。 目前 silent drift 不阻擋 review。

Related

Refs #154 #150


Current Status

Phase: diagnosed
Last updated: 2026-07-11 by /idd-diagnose (via /idd-all focused batch drain)

Key Decisions

  • 維持 parked — 等 trace-stale 實害 trigger(issue 自訂 P3 parking 條件未發生)

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparking-lotDiagnosed but deferred until trigger condition fires. /idd-list filter candidate.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions