Commit Graph

4179 Commits

Author SHA1 Message Date
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -08:00
Steve Yegge
87f535a65e bd sync: 2025-12-27 14:48:16 2025-12-27 14:48:49 -08:00
Steve Yegge
3d927c8895 test: add ephemeral flag tests for spawnMolecule (bd-phin)
- Add TestSpawnMoleculeEphemeralFlag: verifies DB-based spawn
- Add TestSpawnMoleculeFromFormulaEphemeral: verifies formula-based spawn
- Both tests confirm Ephemeral flag is set correctly
- Tests also verify ephemeral issues excluded from ready work

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:48:37 -08:00
Steve Yegge
26785f9b46 refactor: remove bd mol catalog in favor of bd formula list (bd-ctmg)
- Delete mol_catalog.go (duplicate functionality)
- Update mol.go help text to point to bd formula list
- Update CLI_REFERENCE.md and MOLECULES.md docs
- Update deprecated template.go references

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:34:23 -08:00
Steve Yegge
cd9f8102dd bd sync: 2025-12-27 14:33:59 2025-12-27 14:33:59 -08:00
Steve Yegge
2e7b993a88 feat: add --prefix flag for cross-rig issue creation
Adds --prefix as a forgiving alias to --rig flag. Accepts:
- Exact prefix: bd-, gt-
- Prefix without hyphen: bd, gt
- Rig name: beads, gastown

All resolve to the correct rig via routes.jsonl lookup.
This matches agents' mental model of prefix-based routing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:26:00 -08:00
Steve Yegge
a9d082e050 bd sync: 2025-12-27 01:09:55 2025-12-27 01:09:55 -08:00
Steve Yegge
2f3877a267 fix: add macOS codesigning to bump-version.sh --install
Without codesigning, the binary gets 'Killed: 9' on macOS due to
Gatekeeper security. This adds xattr -cr and codesign -f -s - after
building and after each copy to install locations.
2025-12-27 00:58:59 -08:00
Steve Yegge
1d4933e841 chore: bump version to v0.38.0 2025-12-27 00:45:40 -08:00
Steve Yegge
21f307de89 feat: add --rig flag for cross-rig issue creation (bd-4nzq)
Adds --rig flag to bd create that allows creating issues in a different
rig without having to cd to that directory.

Example: bd create --rig beads --title='Bug report'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:44:39 -08:00
Steve Yegge
7de19223b0 bd sync: 2025-12-27 00:34:21 2025-12-27 00:34:33 -08:00
Steve Yegge
3d6fde90ea bd sync: 2025-12-26 23:47:52 2025-12-27 00:34:33 -08:00
Steve Yegge
45cf47b5f4 Merge pull request #753 from rsnodgrass/bd-improvements
feat: add database corruption recovery and sync backoff
2025-12-27 00:17:47 -08:00
Steve Yegge
05304e3ab1 Merge origin/main, fix test git init for modern git 2025-12-27 00:17:36 -08:00
Steve Yegge
65287ef7ba Merge pull request #756 from maphew/fix/comments-in-show-command
Fix: Display comments in bd show command (#177)
2025-12-27 00:11:50 -08:00
Steve Yegge
4362758626 Fix comments display: move outside dependents block, merge main 2025-12-27 00:11:35 -08:00
Steve Yegge
a3a324bc15 Merge pull request #761 from sukhodolin/fix/comment-no-db-mode
fix(nodb): set storeActive when initializing no-db mode
2025-12-27 00:04:45 -08:00
Steve Yegge
15cfef0247 Update documentation for bd mol pour/wisp command structure
Updated all documentation and help text to reflect:
- bd pour → bd mol pour
- bd ephemeral → bd mol wisp
- bd ephemeral list → bd mol wisp list
- bd ephemeral gc → bd mol wisp gc

Files updated:
- docs/MOLECULES.md
- docs/CLI_REFERENCE.md
- docs/ARCHITECTURE.md
- docs/DELETIONS.md
- skills/beads/references/MOLECULES.md
- cmd/bd/mol_catalog.go
- cmd/bd/mol_current.go
- cmd/bd/mol_distill.go
- cmd/bd/cook.go
2025-12-26 23:52:59 -08:00
Steve Yegge
a958c83422 feat: auto-resolve cross-rig IDs in bd dep add (bd-lfiu)
When `bd dep add` fails to resolve the dependency ID locally, it now
checks routes.jsonl for a matching prefix and auto-converts to an
external reference format (external:<project>:<id>).

This allows simpler syntax like:
  bd dep add gt-xyz bd-abc

Instead of the verbose:
  bd dep add gt-xyz external:beads:bd-abc

New functions in routing package:
- ExtractProjectFromPath: Gets project name from route path
- ResolveToExternalRef: Converts foreign ID to external ref using routes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:47:42 -08:00
Steve Yegge
cc7d2ae991 Rename bd mol ephemeral back to bd mol wisp
The verb 'wisp' fits the chemistry metaphor (pour, bond, burn, squash)
while 'ephemeral' is an adjective. The internal API field remains
'Ephemeral' but the CLI command is now 'bd mol wisp'.

Commands:
  bd mol wisp <proto>     - create ephemeral wisp
  bd mol wisp list        - list wisps
  bd mol wisp gc          - garbage collect old wisps
2025-12-26 23:47:00 -08:00
Steve Yegge
bf2f200754 Move pour and ephemeral under bd mol subcommand (bd-2fs7)
For consistency, all molecule operations are now under bd mol:
- bd mol pour <proto>     - create persistent mol
- bd mol ephemeral <proto> - create ephemeral mol
- bd mol ephemeral list   - list ephemeral issues
- bd mol ephemeral gc     - garbage collect old ephemeral issues

This aligns with existing mol subcommands: bond, squash, burn, etc.
2025-12-26 23:41:20 -08:00
Steve Yegge
a84c7a4f88 bd sync: 2025-12-26 23:41:01 2025-12-26 23:41:01 -08:00
Steve Yegge
27a82bfa24 bd sync: 2025-12-26 23:38:55 2025-12-26 23:38:55 -08:00
Steve Yegge
561bd9aa46 bd sync: 2025-12-26 23:19:26 2025-12-26 23:19:38 -08:00
Steve Yegge
e6dc1d7fe2 bd sync: 2025-12-26 20:51:56 2025-12-26 23:19:38 -08:00
Steve Yegge
3bd60b64dd bd sync: 2025-12-26 20:20:46 2025-12-26 23:19:38 -08:00
Steve Yegge
aba2ee0d7c bd sync: 2025-12-26 19:28:54 2025-12-26 23:19:38 -08:00
Steve Yegge
88e76ec426 bd sync: 2025-12-26 17:38:21 2025-12-26 23:19:38 -08:00
Steve Yegge
7046e90ada bd sync: 2025-12-26 17:29:25 2025-12-26 23:19:38 -08:00
Steve Yegge
0a14abcef5 fix: migration 028 handles missing created_by column
The migration was using SELECT * which fails when migrating databases
that predate the created_by column (34 columns vs 35). Now explicitly
lists columns and provides empty default for created_by if missing.

Also fixes missed Wisp→Ephemeral rename in multirepo_test.go.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:18:04 -08:00
Eugene Sukhodolin
0575ca9bd9 fix(nodb): set storeActive when initializing no-db mode
The `bd comment --no-db` command was failing because
initializeNoDbMode() set the global `store` but never set
`storeActive = true`. When comments.go called ensureStoreActive(),
the guard check failed and it tried to find a SQLite database,
returning an ironic error telling the user to use --no-db.

Why only `comment` was affected:
- Commands like `create`, `update`, `close` use `store` directly
- The `comment` command calls `ensureStoreActive()` first as a safety check
- That function guards on `storeActive && store != nil`
- Since `storeActive` was never set, the guard failed and it looked for SQLite

The fix aligns no-db mode with what ensureStoreActive() expects.
2025-12-26 22:23:58 -08:00
Steve Yegge
ea8ae11002 feat: Rename 'wisp' to 'ephemeral' in beads API (bd-o18s)
BREAKING CHANGE: API field and CLI command renamed

- types.Issue.Wisp → types.Issue.Ephemeral
- JSON field: "wisp" → "ephemeral"
- CLI: bd wisp → bd ephemeral
- Flags: --wisp → --ephemeral
- ID prefix: wisp → eph

The SQLite column already uses 'ephemeral' so no schema migration needed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 21:07:37 -08:00
Steve Yegge
89be2a9d7f fix: add idempotency check to migration 028 (tombstone_closed_at)
Migration 028 lacked an idempotency check, causing it to fail on databases
where the migration had already been applied. The migration would attempt
to copy data from issues to issues_new, but both tables had the same CHECK
constraint, causing the insert to fail.

Added check for "status = 'tombstone'" in the table schema to detect if
the migration has already been applied and skip if so.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:57:57 -08:00
Steve Yegge
05b84c3925 fix: bd ready excludes ephemeral (wisp) issues (hq-t15s)
Wisps are ephemeral issues used for patrol/operational cycles and should
not appear in `bd ready` output as trackable work items. Added ephemeral
exclusion filter to both the GetReadyWork() function and ready_issues VIEW.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:51:51 -08:00
Steve Yegge
d623488d6b fix: add missing created_by column to migration 028 (GH#757)
Migration 028 (tombstone_closed_at) recreates the issues table but was
missing the created_by column that exists in schema.go. This caused
`SELECT * FROM issues` to fail with column count mismatch on fresh DBs.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:34:50 -08:00
matt wilkie
dae8a7aca9 feat: add comments display to bd show command (#177) 2025-12-26 21:30:37 -07:00
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
Ryan Snodgrass
350a78f1ba fix: resolve all golangci-lint errors
Fixes 15 pre-existing lint issues:

errcheck (6 issues):
- mol_distill.go: Add _ = for f.Close() and os.Remove()
- routed.go: Add _ = for routedStorage.Close() (4 locations)

gosec (8 issues):
- maintenance.go, routes.go: Add nolint for G304 (file paths from known dirs)
- mol_distill.go: Add nolint for G304 (file creation in known search paths)
- formula.go: Change WriteFile permissions from 0644 to 0600 (G306)
- gate.go: Add nolint for G204 (exec.Command with trusted AwaitID fields)

misspell (1 issue):
- gate.go: Fix "cancelled" -> "canceled" in comment

unparam (2 issues):
- cook.go, controlflow.go: Add nolint for functions returning always-nil error

Also:
- Update pre-commit-hooks to v6.0.0
- Add lint step to "Landing the Plane" session-end protocol
2025-12-26 19:20:03 -05:00
Ryan Snodgrass
b977c1f947 chore: add pre-commit config for local lint enforcement
Adds .pre-commit-config.yaml with:
- golangci-lint v2.1.6 with 5m timeout
- Basic file hygiene hooks (trailing whitespace, EOF fixer, YAML check)

Install with: pre-commit install
2025-12-26 19:15:37 -05:00
Ryan Snodgrass
9c9f2f2ad8 fix(tests): use --initial-branch=main for modern git compatibility
Modern git (2.28+) uses 'main' as default branch, not 'master'.
Tests were failing because they assumed 'master' branch exists.

Changes:
- Use 'git init --initial-branch=main' instead of bare 'git init'
- Change 'git checkout master' to 'git checkout main'
- Add git.ResetCaches() after os.Chdir() to clear cached git state
- Ensures test isolation when changing directories
2025-12-26 19:09:41 -05:00
Ryan Snodgrass
252de1cdba feat(daemon): add sync backoff and consolidate hints into tips
Daemon sync improvements:
- Adds exponential backoff on sync failures (30s → 1m → 2m → 5m → 10m → 30m cap)
- Tracks sync state in .beads/sync-state.json (NeedsManualSync, FailureCount, BackoffUntil)
- Resets backoff on daemon start and manual bd sync
- Adds sync-state.json to default .gitignore

Tips consolidation (following ox-cli pattern):
- Moves sync conflict hint from hints.go into tips.go
- Proactive health checks trump educational tips
- Uses InjectTip() with high priority (200) and 100% probability for urgent warnings
- Removes deprecated hints.go
2025-12-26 19:09:31 -05:00
Ryan Snodgrass
721ae70ccb feat(doctor): add database corruption recovery to --fix
Adds automatic database recovery when bd doctor --fix detects corruption:
- Detects SQLite corruption (malformed database, SQLITE_CORRUPT errors)
- Backs up corrupted database before recovery attempt
- Rebuilds from JSONL if available (issues.jsonl, deletions.jsonl)
- Falls back to fresh database if JSONL unavailable
- Reports recovery results (issues imported, success/failure)

Recovery is triggered automatically by --fix when corruption is detected.
No manual intervention required.
2025-12-26 18:55:07 -05:00