Finding
dist/commands/*.md (compiled command artifacts, output of npm run build:mds) are never pruned when a command host is removed or renamed — stale compiled files can accumulate under dist/commands/.
Why this is tracked
Derived during resolution of PR #334 (not a triaged review finding — a follow-up identified while fixing security-4). security-4 fixed the equivalent stale-artifact exposure for dist/agents/*.md (commit ece15ce): scripts/build-mds.ts now prunes unclaimed dist/agents/*.md using AGENTS_OUTPUT_DIR from the allowlist. dist/commands/ has the same stale-artifact exposure.
Why it's a separate ticket (not folded into security-4's fix)
The claimed set for dist/commands/ is not as simple as "compiled destinations" — it must be compiled destinations ∪ the hand-authored release.md copy (a static, non-MDS command file that also lives in dist/commands/). This makes the prune logic asymmetric with the dist/agents/ case. Exposure is also lower here: there's no competing audited source file that a stale dist/commands/*.md could outrank (unlike the dist/agents/ case where a stale compiled agent could silently shadow a newer hand-authored source).
Suggested fix
Extend the build:mds pruning step (scripts/build-mds.ts) to also prune unclaimed dist/commands/*.md, with the claimed set computed as compiled command destinations unioned with the hand-authored release.md path.
References
Finding
dist/commands/*.md(compiled command artifacts, output ofnpm run build:mds) are never pruned when a command host is removed or renamed — stale compiled files can accumulate underdist/commands/.Why this is tracked
Derived during resolution of PR #334 (not a triaged review finding — a follow-up identified while fixing security-4).
security-4fixed the equivalent stale-artifact exposure fordist/agents/*.md(commit ece15ce):scripts/build-mds.tsnow prunes unclaimeddist/agents/*.mdusingAGENTS_OUTPUT_DIRfrom the allowlist.dist/commands/has the same stale-artifact exposure.Why it's a separate ticket (not folded into security-4's fix)
The claimed set for
dist/commands/is not as simple as "compiled destinations" — it must be compiled destinations ∪ the hand-authoredrelease.mdcopy (a static, non-MDS command file that also lives indist/commands/). This makes the prune logic asymmetric with thedist/agents/case. Exposure is also lower here: there's no competing audited source file that a staledist/commands/*.mdcould outrank (unlike thedist/agents/case where a stale compiled agent could silently shadow a newer hand-authored source).Suggested fix
Extend the
build:mdspruning step (scripts/build-mds.ts) to also prune unclaimeddist/commands/*.md, with the claimed set computed as compiled command destinations unioned with the hand-authoredrelease.mdpath.References
.devflow/docs/reviews/feat-323-tracker-phase-1-mds-plumbing-provably-by/2026-09-09_2237Follow-upssection of the resolution summary)