Commit Graph

4138 Commits

Author SHA1 Message Date
Steve Yegge
a642c5b16a fix: restore --resolution alias for bd close (GH#746)
The --resolution flag was accidentally removed by a bd sync commit.
This restores the hidden alias for --reason, following Jira CLI convention.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:16:32 -08:00
Steve Yegge
daf539397e feat: add town-level activity signal for Gas Town daemon (bd-v8ku)
Writes activity.json to ~/gt/daemon/ when bd runs inside a Gas Town
workspace. This enables the daemon to detect bd usage and adjust its
polling frequency with exponential backoff.

Best-effort: silently skips if not in Gas Town or on any error.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:28:39 -08:00
Steve Yegge
78b8134131 fix: bd graph works with daemon running (GH#751)
Add direct storage fallback when daemon is running but store is nil,
matching the pattern used by dep tree, blocked, and ready commands.
2025-12-26 19:15:23 -08:00
Steve Yegge
c87d3efe43 Merge pull request #754 from zjrosen/zack/fix-created-by-daemon
CI failures are pre-existing on main (Nix hash mismatch, lint errors in unrelated files). PR is clean and includes test coverage.
2025-12-26 18:08:29 -08:00
Zachary Rosen
f6eeb170ef fix: add missing CreatedBy in RPC path
created_by was recently added in c3ef1c3f38 but was missing support for passing in the CreatedBy through the RPC path so a create that was using the daemon was never having the created_by field set.
2025-12-26 20:44:53 -05:00
Steve Yegge
2c7d34a4c3 Merge pull request #752 from jordanhubbard/main
E2E / chaos testing - first PoC with just 48% code coverage
2025-12-26 17:38:01 -08:00
Steve Yegge
08cf4d4911 feat: add --run-chaos-tests flag to release script (bd-kx1j)
Adds chaos and E2E test running to the release process:
- New --run-chaos-tests flag runs chaos/corruption recovery tests
- Runs both chaos and e2e tagged tests before commit/tag
- Updated quick start to recommend chaos tests for releases
- Tests use 10m timeout for thorough coverage

Part of PR #752 integration.
2025-12-26 17:29:16 -08:00
Steve Yegge
dc890308bb Add chaos testing PR #752 review (bd-kx1j) 2025-12-26 17:25:37 -08:00
Steve Yegge
3b8e4db555 bd sync: 2025-12-26 17:25:21 2025-12-26 17:25:21 -08:00
Steve Yegge
9bc98cd778 bd sync: 2025-12-26 15:20:26 2025-12-26 15:20:35 -08:00
Steve Yegge
2a1c03a915 bd sync: 2025-12-26 14:54:51 2025-12-26 15:20:35 -08:00
Steve Yegge
9ec8fdd538 fix: close routed storage connections per iteration in show command
The defer-in-loop pattern was causing all routed storage connections
to accumulate until function exit. This could lead to resource leaks
when showing multiple routed issues. Now explicitly close each
connection after processing each issue.

(bd-uu8p)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:08:56 -08:00
Steve Yegge
a9237741d2 fix: Bypass daemon for routed IDs in show command (bd-uu8p)
When an ID needs routing to a different beads directory, the daemon
cannot resolve it. Now we check needsRouting() before daemon resolution
and handle routed IDs via direct mode with routing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:54:44 -08:00
Steve Yegge
f11ad08ad9 bd sync: 2025-12-26 14:36:48 2025-12-26 14:36:48 -08:00
Steve Yegge
b9b2c826fd bd sync: 2025-12-26 14:36:25 2025-12-26 14:36:43 -08:00
Steve Yegge
f86a5187c2 bd sync: 2025-12-26 13:34:29 2025-12-26 14:36:43 -08:00
Steve Yegge
b71c06e954 bd sync: 2025-12-26 12:45:39 2025-12-26 14:36:43 -08:00
Steve Yegge
1583c57374 feat: Add prefix-based routing with routes.jsonl (bd-9gvf)
Enables cross-repo issue lookups via routes.jsonl configuration.
Running `bd show gt-xyz` from ~/gt now routes to the correct beads
directory based on the issue ID prefix.

- Add internal/routing/routes.go with routing logic
- Add cmd/bd/routed.go with routed storage helpers
- Update show command to use routed resolution in direct mode
- Support redirect files for canonical database locations
- Debug output available via BD_DEBUG_ROUTING=1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:36:20 -08:00
Jordan Hubbard
0b6ec57928 test: add cmd/bd helper coverage and stabilize test runner
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 17:55:51 -04:00
Steve Yegge
5c8d45aa49 fix(deps): Mark BurntSushi/toml as direct dependency (GH#749)
The toml package is imported directly in formula.go and
internal/formula/parser.go but was incorrectly marked as
indirect. This caused Nix builds to fail with vendor
inconsistency errors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:46:40 -08:00
Steve Yegge
c3ef1c3f38 feat: Add created_by field to issues (GH#748)
Add a created_by field to track who created each issue, similar to how
comments have an author field.

- Add CreatedBy string field to Issue struct
- Add migration 029 to add created_by column to issues table
- Update all SELECT/INSERT/Scan statements across storage layer
- Populate created_by in bd create from actor chain
- Display created_by in bd show output

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:33:54 -08:00
Jordan Hubbard
28f2c76589 Merge branch 'steveyegge:main' into main 2025-12-26 17:22:14 -04:00
Steve Yegge
6862f6e35b chore(nix): Update version to 0.37.0 in default.nix (GH#749)
Version was stuck at 0.30.7. The vendorHash may need updating too -
if build fails with hash mismatch, use the "got:" value from the error.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:04:27 -08:00
Steve Yegge
d3e90225a0 fix(doctor): Preserve parent-child dependencies in child→parent check (GH#750)
The CheckChildParentDependencies detection and ChildParentDependencies fix
were flagging ALL child→parent dependencies, including legitimate
'parent-child' type structural hierarchy relationships.

Now only blocking types (blocks, conditional-blocks, waits-for) are
detected as anti-patterns. The 'parent-child' type is a legitimate
hierarchy marker used for:
- Tracking parent-child relationships
- Transitive block propagation (if parent blocked, children blocked)
- Hierarchy visualization in external tools

Changes:
- Add type filter to SELECT queries (only blocking types)
- Add type filter to DELETE statement (preserve parent-child)
- Add regression test TestChildParentDependencies_PreservesParentChildType

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 12:49:40 -08:00
Jordan Hubbard
f5ef444d15 cmd/bd: add unit coverage for show/update/close
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 12:33:59 -04:00
Jordan Hubbard
91285f87b9 test: cover show paths and stabilize debouncer
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 12:04:45 -04:00
Jordan Hubbard
59413baac2 sqlite: stop migrations clobbering pinned/template
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 12:04:06 -04:00
Jordan Hubbard
1f5ed550fe test: cover daemon autostart paths
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 10:45:42 -04:00
Jordan Hubbard
6790fb2f2d test: cover rpc client gate + shutdown
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 10:19:30 -04:00
Jordan Hubbard
eab0b3ac41 test: raise memory storage coverage 2025-12-26 10:14:28 -04:00
Jordan Hubbard
6c37a58148 test: report total coverage from make test
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 09:47:48 -04:00
Jordan Hubbard
7af3106610 doctor: add fs fault injection and lock contention coverage
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 09:22:45 -04:00
Jordan Hubbard
8166207eb4 doctor: add JSONL integrity check/fix and harden repairs
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 08:18:25 -04:00
Steve Yegge
6a9e68630b chore: bump version to v0.37.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 01:29:30 -08:00
Steve Yegge
efe8180078 docs: Add 0.37.0 release notes
- Gate commands: bd gate create/eval/approve for async coordination
- New features: --suggest-next, --parent flag, TOML formulas, fork detection
- Fixes: gate await fields, tombstone timestamps, git caching, Windows support
2025-12-26 01:29:30 -08:00
Steve Yegge
1fdd3538d2 bd sync: 2025-12-26 01:12:48 2025-12-26 01:12:48 -08:00
Steve Yegge
cc858b8273 bd sync: 2025-12-26 01:10:54 2025-12-26 01:11:03 -08:00
Steve Yegge
8fa3a21a8a bd sync: 2025-12-26 00:58:07 2025-12-26 01:11:03 -08:00
Steve Yegge
a975cdecd9 bd sync: 2025-12-26 00:57:19 2025-12-26 01:11:03 -08:00
Steve Yegge
64d2f372a3 fix: Allow tombstones to retain closed_at timestamp
Previously, tombstones could not have a closed_at timestamp due to:
1. Go validation: `if status != closed && closed_at != nil` failed
2. SQL CHECK constraint: `(status = 'closed') = (closed_at IS NOT NULL)`

This caused import failures for tombstones that were closed before being
deleted - a valid scenario where we want to preserve the historical
closed_at timestamp for audit purposes.

Changes:
- internal/types/types.go: Updated validation to allow tombstones with
  closed_at (line 253)
- internal/storage/sqlite/schema.go: Updated CHECK constraint to allow
  closed AND tombstone statuses to have closed_at
- internal/storage/sqlite/migrations/028_tombstone_closed_at.go: Migration
  to update existing databases with the new constraint
- .beads/issues.jsonl: Fixed bd-6s61 status from 'closed' to 'tombstone'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:57:59 -08:00
Steve Yegge
9dc0da9fdd docs: Document COALESCE/NULLIF clone-local field protection pattern
Expands the inline comment to serve as a reference for when to use the
COALESCE(NULLIF(?, zero), column) defensive idiom in JSONL imports.

Pattern protects clone-local state (pinned, gate fields) from being
overwritten when importing JSONL where omitempty causes zero values to
represent "field absent" rather than "field is zero".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:45:59 -08:00
Jordan Hubbard
1a4f06ef8c doctor: harden corruption repair and JSONL config
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 04:29:29 -04:00
Steve Yegge
53921d75c8 chore: Move beads-release formula to gastown
Formulas are Gas Town orchestration workflows, not beads primitives.
The release workflow now lives in gastown/mayor/rig/.beads/formulas/

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:47:32 -08:00
Steve Yegge
e0403c2d31 Add mail gate evaluation in bd gate eval (gt-twjr5.4)
Mail gates check for messages matching the pattern (await_id):
- Case-insensitive substring match on message subjects
- If waiters specified, only matches messages to those recipients
- Closes gate when matching message found

Note: Full testing blocked by bd-70c4 (await fields being cleared).
The code is correct but gate fields get corrupted by auto-import.

Also adds context and storage imports for mail gate function.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:42:05 -08:00
Steve Yegge
a0e4267aa0 Add bd gate approve command for human gates (gt-twjr5.4)
Human gates now have proper workflow:
- Create with: bd gate create --await human:approve-deploy
- Approve with: bd gate approve <gate-id> [--comment "reason"]
- bd gate eval now reports human gates as "awaiting approval"
- Rejects non-human gates with clear error message

Also added mail gate placeholder in eval (awaiting mail: ...).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:35:35 -08:00
Steve Yegge
c366d538a1 bd sync: Filed bd-70c4 (gate await fields bug) 2025-12-25 23:32:44 -08:00
Steve Yegge
3b0630ba0e chore(formula): Convert beads-release to TOML format
Align with Gas Town formula format change from JSON to TOML.
Same content, cleaner syntax.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:31:32 -08:00
Steve Yegge
7fbc2766e2 fix(multirepo): Preserve gate await fields during upsert (bd-gr4q)
Apply COALESCE(NULLIF(...)) pattern to await_type, await_id, timeout_ns,
and waiters fields in upsertIssueInTx. This prevents gate await fields
from being cleared when importing issues from JSONL that don't have
these fields (since gates are wisps and aren't exported to JSONL.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)
2025-12-25 23:21:03 -08:00
Steve Yegge
5788f90aa1 bd sync: 2025-12-25 23:20:35 2025-12-25 23:20:35 -08:00
Steve Yegge
9a508240d9 fix(gate): Use correct gh pr field name (mergedAt, not merged)
The merged field does not exist in gh pr view output. The actual
fields are:
- state: OPEN, CLOSED, or MERGED
- mergedAt: timestamp string (empty if not merged)

Also simplified the switch statement since state already distinguishes
merged vs closed-without-merge PRs.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:10:00 -08:00