Commit Graph

10 Commits

Author SHA1 Message Date
coffeegoddd☕️✨
a097fc546b /{cmd,internal}: fix lint issues 2026-01-20 13:46:57 -08:00
lydia
5d68e6b61a refactor(hook): simplify export state logic, add tests
Code review fixes:
- Renamed misleading exportIncrementalDolt to hasDoltChanges (now just checks for changes)
- Extracted stageJSONLFiles() helper to eliminate duplication
- Extracted runJSONLExport() helper
- Removed unused Actor field from ExportState (add back when implementing filtering)
- Consolidated hookPreCommitDoltFallback into doExportAndSaveState
- Added updateExportStateCommit for no-change fast path

Net reduction: 44 lines (-116/+72)

Added tests for:
- getWorktreeHash
- Export state paths
- Save/load export state
- JSON serialization with omitempty
- updateExportStateCommit
- computeJSONLHashForHook

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 11:44:08 -08:00
lydia
ba0e754dc8 feat(hook): implement per-worktree export state tracking (Design Part 21)
Updates ExportState to track Dolt commits (not git commits) for accurate
change detection. This prevents polecats sharing a Dolt DB from exporting
each others uncommitted work.

Changes:
- ExportState now tracks Dolt commit hash via VersionedStorage.GetCurrentCommit()
- Added WorktreeHash and Actor fields for debugging and future filtering
- hookPreCommitDolt uses Diff() to detect changes since last export
- Added hookPreCommitDoltFallback for graceful degradation
- Added exportIncrementalDolt and exportFullDolt helper functions
- Removed unused exportToJSONLFromStore function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:46:44 -08:00
beads/crew/fang
62dd5f8585 feat(hooks): add DeleteBranch for import branch cleanup
- Add DeleteBranch method to DoltStore for removing branches
- Update hookPostMergeDolt to clean up import branches after merge
- Completes hq-ew1mbr.9 git hook infrastructure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:00:06 -08:00
onyx
fc19a94ad9 fix(hooks): Route hook templates to Dolt-aware implementations
- Fix infinite recursion bug in computeJSONLHashForHook (was calling
  itself instead of computeJSONLHash)
- Update pre-commit, post-merge, post-checkout templates to use
  `bd hook <name>` instead of `bd hooks run <name>`, routing to the
  Dolt-aware implementations in hook.go
- Update all hook template versions to 0.48.0 for consistency

The hook infrastructure added in 15d74a9a had a critical bug where
the hash computation function recursed infinitely, and the templates
still pointed to the old hook implementations in hooks.go instead
of the new Dolt-aware ones in hook.go.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:44:10 -08:00
quartz
15d74a9a49 feat(hooks): Add git hook infrastructure for Dolt backend
This commit implements the git hook infrastructure for Dolt storage backend
as specified in the design document.

Changes:
- Add `bd hook` command (singular) for git hooks to call directly
- Implement per-worktree export state tracking in .beads/export-state/
- Add post-checkout guard to only import if JSONL changed
- Add hook chaining configuration (chain_strategy, chain_timeout_ms)
- Support hooks in .beads/hooks/ directory with git config core.hooksPath
- Implement branch-then-merge import pattern for Dolt storage
- Update bd init to install hooks to .beads/hooks/ for Dolt backend
- Add --beads flag to `bd hooks install` command

The new `bd hook` command supports:
- pre-commit: Export database to JSONL, stage changes
- post-merge: Import JSONL to database after pull/merge
- post-checkout: Import JSONL after branch checkout (with guard)

For Dolt backend, uses branch-then-merge pattern:
1. Create jsonl-import branch
2. Import JSONL data to branch
3. Merge branch to main (cell-level conflict resolution)
4. Delete branch on success

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:24:48 -08:00
Steve Yegge
1611f16751 refactor: remove unused bd pin/unpin/hook commands (bd-x0zl)
Analysis found these commands are dead code:
- gt never calls `bd pin` - uses `bd update --status=pinned` instead
- Beads.Pin() wrapper exists but is never called
- bd hook functionality duplicated by gt mol status
- Code comment says "pinned field is cosmetic for bd hook visibility"

Removed:
- cmd/bd/pin.go
- cmd/bd/unpin.go
- cmd/bd/hook.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:15 -08:00
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -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
cadf798b23 feat: implement molecular chemistry UX commands
Add chemistry-inspired commands for the molecular work metaphor:

New commands:
- bd pour <proto>: Instantiate proto as persistent mol (liquid phase)
- bd wisp create <proto>: Instantiate proto as ephemeral wisp (vapor)
- bd hook: Inspect what's pinned to an agent's hook

Enhanced commands:
- bd mol spawn: Add --pour flag, deprecate --persistent
- bd mol bond: Add --pour flag (force liquid on wisp target)
- bd pin: Add --for <agent> and --start flags

Phase transitions:
  Proto (solid) --pour--> Mol (liquid) --squash--> Digest
  Proto (solid) --wisp--> Wisp (vapor) --burn--> (nothing)

Design docs: gastown/mayor/rig/docs/molecular-chemistry.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 02:21:40 -08:00