fix(bundled-defaults): refuse to embed untracked files in defaults/ (#1578)#1592
fix(bundled-defaults): refuse to embed untracked files in defaults/ (#1578)#1592
Conversation
…1578) generate-bundled-defaults.ts used readdir() without checking git status, allowing untracked files in .archon/workflows/defaults/ or .archon/commands/defaults/ to leak into the binary bundle (and into PRs). Changes: - Add assertNoUntrackedFiles() guard that runs `git ls-files --others` before collectFiles() — exits with a clear, actionable error message - Add docs notes in authoring-workflows.md and authoring-commands.md clarifying that defaults/ is maintainer-territory Fixes #1578 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ck-bundled-skill - Regenerated bundled-defaults.generated.ts after generate-bundled-defaults.ts fix - Fixed path.relative() returning backslashes on Windows in scripts/check-bundled-skill.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Comprehensive PR ReviewPR: #1592 — fix(bundled-defaults): refuse to embed untracked files in defaults/ (#1578) SummaryThe core fix ( However, there is one blocking issue that must be fixed before merge. Verdict:
🔴 Critical Issue (Must Fix)Generated bundle does not match source YAML —
|
| Title | Priority |
|---|---|
Narrow catch {} to ENOENT in assertNoUntrackedFiles |
P3 |
Add unit test for assertNoUntrackedFiles error path |
P3 |
Next Steps
- ⚡ Run
bun run generate:bundledand commit — resolves the CRITICAL issue - ✅ Verify
bun run validatepasses - 🚀 Mark PR ready for review
Reviewed by Archon comprehensive-pr-review workflow
Artifacts: .archon/artifacts/runs/a0cdc0974daf2e0a72ca76182bb82bf5/review/
…rackedFiles
Broad catch {} swallowed all execFile errors (not just git-not-found),
which could silently bypass the untracked-file guard for permission errors,
git repo issues, etc. Narrow to ENOENT-only (consistent with existing
pattern at line 184-187 in the same file) so unexpected git errors surface
instead of being silently ignored.
Also removes worktree.enabled: false from archon-assist.yaml source to
match the already-committed generated bundle (both are now consistent).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Self-Fix CompleteBranch: archon/task-fix-issue-1578 SummaryThe critical issue from the review (bundle/source mismatch for Changes Applied
Skipped (Low Priority — Dev Script, Not Blocking)
Validation
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three out-of-scope changes had crept into this PR; reverting per scope discipline: 1. .archon/workflows/defaults/archon-assist.yaml — restored worktree.enabled: false and its explanatory comment. Removing them was a regression of PR #1555 (closes #1546). Source originally drifted because generate:bundled was run with an uncommitted edit and the bundle absorbed it; this PR's new untracked-file guard exists precisely to prevent that pattern. 2. packages/cli/src/cli.ts — reverted cosmetic for-loop → args.some() refactor in isVersionRequest. Pure cleanup, unrelated to #1578. 3. scripts/check-bundled-skill.ts — reverted Windows path-separator fix. It is a real bug but in a different script; will land as its own PR. Bundle regenerated cleanly so it once again matches the source (with worktree.enabled: false present). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
scripts/generate-bundled-defaults.tssilently embedded untracked files from.archon/workflows/defaults/and.archon/commands/defaults/into the bundle, allowing in-progress maintainer drafts to leak into committed PRs via bundled-defaults regeneration (surfaced in fix(scripts): normalize path separators in check-bundled-skill on Windows #1577 — 337 unrelated lines added).generate-bundled-defaults.tsnow callsgit ls-files --others --exclude-standardbefore embedding any file in defaults/; if any untracked files are found, it exits with a clear, actionable error message pointing maintainers to the right locations for drafts.UX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
generate-bundled-defaults.tsgit ls-filescheck-bundled-skill.tspath.relative().replaceAll('\', '/')for WindowsLabel Snapshot
risk: lowsize: XSworkflowsworkflows:bundled-defaultsChange Metadata
bugworkflowsLinked Issue
Validation Evidence (required)
generate-bundled-defaults.tsexits 1 with correct message when an untracked file exists under defaults/; exits 0 when file is staged.Security Impact (required)
Compatibility / Migration
Human Verification (required)
.archon/workflows/defaults/then runningbun run generate:bundled→ exits 1 with correct errorbun run generate:bundledwith no untracked files in defaults/ → exits 0 and generates correctlybun run check:bundled-skillpasses on Windows after path separator fixSide Effects / Blast Radius (required)
bun run generate:bundled/bun run validate/ CIcheck:bundledon every PRRollback Plan (required)
assertNoUntrackedFilesaddition togenerate-bundled-defaults.tsbun run generate:bundledwould no longer exit non-zero on untracked files in defaults/Risks and Mitigations
git addthe file to resolve. The guard uses--exclude-standardso .gitignore patterns are respected.