fix: bd doctor detects committed runtime/sensitive files that should be gitignored (GH#2535)#2538
Merged
steveyegge merged 1 commit intogastownhall:mainfrom Mar 12, 2026
Conversation
…be gitignored (GH#2535) Add CheckTrackedRuntimeFiles doctor check that uses 'git ls-files .beads/' to detect tracked files matching runtime patterns: - Lock files (*.lock, daemon.lock, dolt-server.lock, etc.) - Daemon runtime (daemon.pid, daemon.log, dolt-server.*) - Corrupt backup directories (*.corrupt.backup/) - Sensitive files (.beads-credential-key) - flagged as ERROR - Runtime state (interactions.jsonl, push-state.json, sync-state.json) - Dolt database contents (dolt/) - Ephemeral SQLite files FixTrackedRuntimeFiles runs 'git rm --cached' to untrack without deleting. Also expands GitignoreTemplate with missing patterns: - daemon.* (daemon.lock, daemon.log, daemon.pid) - interactions.jsonl - push-state.json - *.lock (catches all lock files) - *.corrupt.backup/ (recovery artifacts) - .exclusive-lock Amp-Thread-ID: https://ampcode.com/threads/T-019ce2aa-679e-711f-bb66-ab107d9394c6 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bd doctorhad no check for runtime or sensitive files that are tracked by git but should be in.gitignore. These files pollute the repo and can leak credentials.Changes
New doctor check:
Tracked Runtime Files(cmd/bd/doctor/tracked_runtime.go)git ls-files .beads/and flags tracked files matching runtime/sensitive patterns*.lock,daemon.*,*.corrupt.backup/, dolt directory contents, ephemeral SQLite,interactions.jsonl,push-state.json, etc..beads-credential-keygit rm --cachedto untrack without deleting local copiesExpanded
.beads/.gitignoretemplate (cmd/bd/doctor/gitignore.go)daemon.*,interactions.jsonl,push-state.json,*.lock,*.corrupt.backup/,.exclusive-lockIntegration
Check()andFix()paths implementedTests
42 tests: 35 pattern-match cases, 5 integration tests (no-git, clean, runtime, sensitive, corrupt-backup), 1 fix test, 1 gitignore template test.
Closes #2535