Skip to content

fix: bd doctor detects committed runtime/sensitive files that should be gitignored (GH#2535)#2538

Merged
steveyegge merged 1 commit intogastownhall:mainfrom
maphew:fix/doctor-detect-committed-sensitive-2535
Mar 12, 2026
Merged

fix: bd doctor detects committed runtime/sensitive files that should be gitignored (GH#2535)#2538
steveyegge merged 1 commit intogastownhall:mainfrom
maphew:fix/doctor-detect-committed-sensitive-2535

Conversation

@maphew
Copy link
Copy Markdown
Collaborator

@maphew maphew commented Mar 12, 2026

Summary

bd doctor had 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)

  • Runs git ls-files .beads/ and flags tracked files matching runtime/sensitive patterns
  • WARNING for runtime files: *.lock, daemon.*, *.corrupt.backup/, dolt directory contents, ephemeral SQLite, interactions.jsonl, push-state.json, etc.
  • ERROR for sensitive files: .beads-credential-key
  • Fix path: git rm --cached to untrack without deleting local copies

Expanded .beads/.gitignore template (cmd/bd/doctor/gitignore.go)

  • Added missing patterns: daemon.*, interactions.jsonl, push-state.json, *.lock, *.corrupt.backup/, .exclusive-lock

Integration

  • Registered as check 14h (Git Integration category)
  • Both Check() and Fix() paths implemented

Tests

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

…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>
@maphew maphew requested a review from steveyegge March 12, 2026 16:48
@steveyegge steveyegge merged commit 91d98f3 into gastownhall:main Mar 12, 2026
9 checks passed
@maphew maphew deleted the fix/doctor-detect-committed-sensitive-2535 branch March 12, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bd doctor doesn't detect committed runtime/sensitive files that should be gitignored

2 participants