Commit graph

9 commits

Author SHA1 Message Date
Okano, Osamu
e585a61875
fix: avoid false shared-server bootstrap no-op for synthesized worktrees
Co-authored-by: Okano, Osamu <19066+osamu2001@users.noreply.github.com>
2026-04-24 08:16:38 -07:00
Harry Miller
7bd9e18500
fix(audit): use atomic write to prevent torn lines under concurrent O_APPEND (#3301)
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>
2026-04-17 15:10:26 -07:00
Jim Wordelman
2ed8cb8ab3
test(audit): prove concurrent-writer ID uniqueness invariant (#3164)
Co-authored-by: quad341 <quad341@users.noreply.github.com>
2026-04-10 21:52:11 -07:00
Harry
047e506859 Enforce .beads/ directory permissions at runtime
- 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>
2026-03-30 09:15:49 -07:00
emma
faa69f922b feat: audit log captures close reason; add v0.62.0 changelog and version notes
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>
2026-03-21 16:54:01 -07:00
beads/crew/emma
a44e01e971 feat: audit log status changes to interactions.jsonl (bd-42f)
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>
2026-03-20 19:13:16 -07:00
beads/refinery
041b74b54a fix: resolve CI failures on main (6 tests, formatting)
- 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
2026-02-23 09:50:33 -08:00
jasper
619f34a441 chore: add explanatory comments to silently ignored errors across codebase
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
2026-02-14 17:16:43 -08:00
Steve Yegge
7b758271ed feat(audit): add append-only agent audit trail (.beads/interactions.jsonl)
Implements audit logging for agent interactions to support auditing and
dataset generation (fixes #649).

New features:
- .beads/interactions.jsonl (append-only audit log)
- bd audit record: log LLM calls, tool calls, or pipe JSON via stdin
- bd audit label <id>: append labels (good/bad) for dataset curation
- bd compact --audit: optionally log LLM prompt/response during compaction
- bd init: creates empty interactions.jsonl
- bd sync: includes interactions.jsonl in staging

Audit entries are append-only - labeling creates new entries that
reference parent entries by ID.

Closes #649

Co-authored-by: Dmitry Chichkov <dchichkov@nvidia.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:24:51 -08:00