The previous implementation used bufio.NewWriter which could split a
single entry into multiple write() syscalls. Under concurrent O_APPEND
from multiple goroutines, these partial writes interleave, producing
corrupted lines that the scanner silently drops.
Fix: encode into a bytes.Buffer first, then issue a single f.Write()
call. For payloads under PIPE_BUF (4096 bytes on Linux), this is
guaranteed atomic by POSIX.
Fixes flaky TestAppend_ConcurrentWritersUniqueIDs in CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add config.BeadsDirPerm (0700) and config.BeadsFilePerm (0600) constants
- Add config.CheckBeadsDirPermissions() for startup warning if permissions
are too permissive (non-fatal, checks group/world bits)
- Add config.EnsureBeadsDir() helper for consistent directory creation
- Tighten all MkdirAll calls for .beads/ paths from 0750/0755 to 0700:
init.go, doltserver.go, credentials.go, audit.go, recipes.go,
embeddeddolt store.go and flock.go
- Add startup check in loadEnvironment() (cmd/bd/main.go)
- Windows build tag with no-op implementation (ACL-based permissions)
- 6 tests: constants, dir creation perms, warning on permissive, no
warning on secure, no error on nonexistent
Fixes: bd-kl6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LogFieldChange now accepts a reason parameter — bd close passes the
--reason text so cleanup context survives Dolt GC flatten. Also adds
CHANGELOG.md entry and info.go versionChanges for v0.62.0.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dolt GC flatten destroys commit history, which was the only record of
status changes. Add LogFieldChange to the audit package and call it from
bd update and bd close so that status/assignee/priority changes are
appended to .beads/interactions.jsonl — an append-only file that
survives GC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix gofmt: remove trailing blank lines in 4 files
- Skip TestOpenFromConfig_Embedded/DefaultsToEmbedded when no Dolt server
(these tests connect to 127.0.0.1:3307 which is unavailable in CI)
- Add CheckGitConflicts to collectValidateChecks (was missing, causing
TestValidateCheck_DetectsGitConflicts to fail)
- Implement CheckGitConflicts for CGO builds (scans JSONL for conflict
markers; only no-cgo stub existed)
- Fix TestIssueContentSize expected value: "some long description text"
is 26 chars, not 25
- Fix TestAppend_CreatesFileAndWritesJSONL: create metadata.json instead
of issues.jsonl so hasBeadsProjectFiles recognizes the BEADS_DIR
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/refinery
Rig: beads
Role: refinery
Code health review found 30+ instances of error suppression using blank
identifier without explanation. Added comments to 82 files explaining WHY
each error is safely ignored (best-effort cleanup, advisory operations,
safe defaults, etc.) to improve code maintainability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats