Skip to content

chore(build): prune unclaimed dist/commands/*.md artifacts #336

Description

@dean0x

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

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

    tech-debtTechnical debt items to address

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions