Commit Graph

3977 Commits

Author SHA1 Message Date
Steve Yegge
204e8e66c7 bd sync: 2025-12-24 21:16:04 2025-12-24 21:16:04 -08:00
Steve Yegge
3c14ec7bf7 bd sync: 2025-12-24 21:02:59 2025-12-24 21:03:56 -08:00
Steve Yegge
53d905aa7a bd sync: 2025-12-24 20:43:10 2025-12-24 21:03:56 -08:00
Steve Yegge
12bd2e4963 bd sync: 2025-12-24 20:07:54 2025-12-24 21:03:56 -08:00
Steve Yegge
c3b971e639 bd sync: 2025-12-24 20:00:04 2025-12-24 21:03:56 -08:00
Steve Yegge
9f8b3478fd fix: filter wisps from sync_export.go (bd-687g)
The sync command's exportToJSONL function was not filtering wisps,
causing them to be re-added to JSONL during bd sync re-export step.

autoflush.go had wisp filtering but sync_export.go did not. Added
the same filtering logic to prevent wisps from being exported to JSONL.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:55:31 -08:00
Steve Yegge
f2e6df95c0 refactor: simplify wisp architecture - single DB with Wisp flag (bd-bkul)
- Remove cross-store squash logic from mol_squash.go
  - Delete runWispSquash() and squashWispToPermanent() functions
  - Simplify runMolSquash() to work with main store only

- Update mol_burn.go to work with main database
  - Remove .beads-wisp/ directory references
  - Look for Wisp=true issues in main store instead

- Update mol_bond.go to use Wisp flag instead of separate store
  - --wisp now creates issues with Wisp=true in main store
  - --pour creates issues with Wisp=false (persistent)
  - Update bondProtoMol signature to accept both flags

- Deprecate wisp storage functions in beads.go
  - WispDirName, FindWispDir, FindWispDatabasePath
  - NewWispStorage, EnsureWispGitignore, IsWispDatabase
  - All marked deprecated with reference to bd-bkul

- Remove obsolete cross-store squash tests
  - TestSquashWispToPermanent
  - TestSquashWispToPermanentWithSummary
  - TestSquashWispToPermanentKeepChildren

All tests pass. Build succeeds.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:42:54 -08:00
Steve Yegge
c0271aedbf wip: simplify wisp architecture - single db with Wisp flag (bd-bkul)
Progress on eliminating separate .beads-wisp/ directory:

- Add --wisp flag to bd create (creates issue with Wisp=true)
- Update bd wisp create to use main db instead of separate wisp storage
- Update bd wisp list to query main db with Wisp filter
- Update bd wisp gc to work with main database
- Add Wisp field to RPC ListArgs for daemon mode support
- Fix terminology: use "old/abandoned" for time-based cleanup,
  reserve "stale" for graph-pressure staleness (per Gas Town taxonomy)

Still TODO:
- Finish mol squash simplification (remove cross-store logic)
- Remove runWispSquash and squashWispToPermanent functions
- Update mol burn similarly
- Deprecate .beads-wisp/ functions in internal/beads/beads.go
- Test all changes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:31:27 -08:00
Steve Yegge
5f16d10634 docs: rewrite MOLECULES.md with workflow-first structure (bd-ul59)
Completely rewrote the molecular chemistry doc to be more practical:
- Start with execution semantics (what users care about)
- TL;DR section at top with 5 key concepts
- Explain dependency types and blocking behavior
- Clarify molecules = epics (no special types needed)
- Move chemistry metaphor to secondary section
- Add common patterns (sequential, fanout, dynamic bonding)
- Keep agent pitfalls and quick reference

The doc now reads like a reference manual with examples rather than
a philosophical treatise on work composition.

Filed gt-qe9w for Gas Town docs to follow same pattern.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 19:52:01 -08:00
Steve Yegge
5e971bd90a docs: add molecular chemistry documentation (bd-ul59)
Create docs/MOLECULES.md with comprehensive coverage of:
- Layer cake architecture (formulas → protos → molecules → epics → issues)
- Phase metaphor (solid/proto, liquid/mol, vapor/wisp)
- Phase transitions (pour, wisp create, squash, burn)
- Bonding patterns (proto+proto, proto+mol, mol+mol)
- Agent pitfalls (temporal language, forgetting to squash)
- Orphan vs stale matrix
- Progress tracking (computed, not stored)
- Parallelism model (default parallel, opt-in sequential)

Update CLI_REFERENCE.md with Molecular Chemistry section covering:
- Proto/template commands
- Pour command
- Wisp commands
- Bonding commands
- Squash and burn commands

Update ARCHITECTURE.md with cross-reference to new MOLECULES.md.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 19:31:14 -08:00
Steve Yegge
fbae7711bc bd sync: 2025-12-24 19:31:04 2025-12-24 19:31:04 -08:00
Steve Yegge
4668240495 bd sync: 2025-12-24 18:30:11 2025-12-24 18:30:11 -08:00
Steve Yegge
5eacec482d bd sync: 2025-12-24 18:24:08 2025-12-24 18:24:08 -08:00
Steve Yegge
6325487c81 bd sync: 2025-12-24 17:40:20 2025-12-24 17:40:20 -08:00
Steve Yegge
d3245d2610 bd sync: 2025-12-24 16:53:22 2025-12-24 16:53:22 -08:00
Steve Yegge
d953cf6138 bd sync: 2025-12-24 16:45:30 2025-12-24 16:45:30 -08:00
Steve Yegge
e3a7bf8b0b bd sync: 2025-12-24 16:30:40 2025-12-24 16:30:40 -08:00
Steve Yegge
922e54588b bd sync: 2025-12-24 16:25:37 2025-12-24 16:25:37 -08:00
Steve Yegge
c065e9840b bd sync: 2025-12-24 16:23:00 2025-12-24 16:23:10 -08:00
Steve Yegge
fda4f78207 bd sync: 2025-12-24 15:53:49 2025-12-24 16:23:10 -08:00
Steve Yegge
fd72ce8b3f bd sync: 2025-12-24 14:39:47 2025-12-24 16:23:10 -08:00
Steve Yegge
2f1ec2d388 release: v0.36.0
## Highlights

- **Formula system** - `bd cook` for declarative workflow templates
- **Gate issue type** - Async coordination primitives
- **`bd list --pretty --watch`** - Built-in colorized viewer with live updates
- **Child→parent dep prevention** - Blocks LLM temporal reasoning trap

## Breaking Changes

- `bd mol spawn` removed - use `bd pour` or `bd wisp create`
- `bd ready` excludes workflow types by default

## Bug Fixes

- GH#664: Dots in prefix handling
- GH#728: Child counter updates for explicit IDs
- GH#422: Multi-hyphen prefix parsing
- GH#704: Stealth mode uses .git/info/exclude

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 15:57:22 -08:00
Steve Yegge
7f33ee8f4d docs(info): add 0.36.0 to versionChanges
Adds release notes for v0.36.0 including:
- Formula system and gate issue type
- bd list --pretty --watch enhancements
- Child→parent dep prevention (LLM temporal trap)
- Multiple bug fixes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 15:55:50 -08:00
Steve Yegge
a574dc2206 docs(changelog): expand child→parent dep detection explanation
Highlights that this prevents a common LLM temporal reasoning trap
where 'Phase 1 before Phase 2' gets modeled as Phase 1 blocking Phase 2
instead of Phase 2 depending on Phase 1.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 15:46:42 -08:00
Steve Yegge
42c23e24df fix(lint): add nosec directive for formula parser file read
Also: comprehensive CHANGELOG update for v0.36.0 prep
- Formula system (bd cook, extends, needs/waits_for)
- Gate issue type for async coordination
- bd list --pretty/--watch viewer enhancements
- bd search date/priority/content filters
- 15+ bug fixes since v0.35.0
- Test coverage improvements (daemon 72%, compact 82%)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 15:22:01 -08:00
Steve Yegge
c28defb710 fix(sqlite): handle dots in prefix for extractParentChain (GH#664)
extractParentChain was using strings.Split(id, ".") which incorrectly
parsed prefixes containing dots (like "alicealexandra.com"). This caused
--parent to fail with "parent does not exist" even when the parent was
present in the database.

The fix uses IsHierarchicalID to walk up the hierarchy correctly, only
splitting on dots followed by numeric suffixes (the actual hierarchy
delimiter).

Example:
- "test.example-abc.1" now correctly returns ["test.example-abc"]
- Previously it incorrectly returned ["test", "test.example-abc"]

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:39:30 -08:00
Steve Yegge
25402184a6 fix: respect allowed_prefixes config during import (gt-2z6s)
The buildAllowedPrefixSet function now parses the allowed_prefixes config
and includes those prefixes when validating imports. This allows mol-*
prefixes to be imported without errors when configured.

Config example: bd config set allowed_prefixes "gt-,mol-"
2025-12-24 14:28:23 -08:00
Steve Yegge
f28785d2dc feat(formula): support needs and waits_for fields, add --prefix flag
- bd-hr39: Add `needs` field to Step as alias for depends_on. Converts
  to blocking dependencies between sibling steps during cooking.

- bd-j4cr: Add `waits_for` field to Step. Values: all-children or
  any-children. Preserved as gate:<value> label during cooking.

- bd-47qx: Add --prefix flag to bd cook command to prepend a prefix
  to proto IDs, enabling use of project prefixes like gt-.

Includes validation, dry-run output, and comprehensive tests.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:59:38 -08:00
Steve Yegge
90421e4567 bd sync: 2025-12-24 13:59:28 2025-12-24 13:59:28 -08:00
Steve Yegge
ad77e60499 bd sync: 2025-12-24 13:51:55 2025-12-24 13:51:55 -08:00
Steve Yegge
3fd11ad390 bd sync: 2025-12-24 13:50:26 2025-12-24 13:50:38 -08:00
Steve Yegge
d1c4526e6e fix(formula): address code review findings
Fixes from self-review of formula parser and bd cook:

1. Atomicity: Add cleanup on failure in cookFormula - if labels/deps
   transaction fails, delete the already-created issues

2. Validation: Add recursive depends_on validation for child steps
   and validate priority ranges for children

3. Documentation: Mark unimplemented fields (Expand, ExpandVars,
   Condition, Gate) with TODO(future) comments

4. Thread safety: Add note that Parser is NOT thread-safe

5. Error messages: Track first definition location for duplicate ID
   errors (e.g., "duplicate id at steps[1], first defined at steps[0]")

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:50:19 -08:00
Steve Yegge
4fdcda4568 feat(formula): add formula parser and bd cook command (bd-weu8, bd-wa2l)
Implements a new formula system for defining workflow templates in YAML:

- internal/formula/types.go: YAML schema types for .formula.yaml files
  - Formula, Step, VarDef, ComposeRules, BondPoint, Gate types
  - Support for workflow, expansion, and aspect formula types
  - Variable definitions with required, default, enum, and pattern

- internal/formula/parser.go: Parser with extends/inheritance support
  - Parse formula files from multiple search paths
  - Resolve extends references for formula inheritance
  - Variable extraction and substitution
  - Variable validation (required, enum, pattern)

- cmd/bd/cook.go: bd cook command to compile formulas into protos
  - Parse and resolve formula YAML
  - Create proto bead with template label
  - Create child issues for each step
  - Set up parent-child and blocking dependencies
  - Support --dry-run, --force, --search-path flags

Example workflow:
  bd cook mol-feature.formula.yaml
  bd pour mol-feature --var component=Auth --var framework=react

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:42:01 -08:00
Steve Yegge
0514e40c68 bd sync: 2025-12-24 13:41:27 2025-12-24 13:41:27 -08:00
Steve Yegge
37257e8dbc bd sync: 2025-12-24 13:20:01 2025-12-24 13:24:28 -08:00
Steve Yegge
1e7c7f5e54 fix(sqlite): update child_counters when explicit child IDs are created (GH#728)
When creating issues with explicit hierarchical IDs (e.g., bd-test.1, bd-test.2
via --id flag or import), the child_counters table was not being updated.
This caused GetNextChildID to return colliding IDs when later called with
--parent.

Changes:
- Add ensureChildCounterUpdatedWithConn() to update counter on explicit child creation
- Add ParseHierarchicalID() to extract parent and child number from IDs
- Update CreateIssue to call counter update after hierarchical ID validation
- Update EnsureIDs to call counter update when parent exists
- Add post-insert phase in batch operations to update counters after FK
  constraint can be satisfied
- Update tests to reflect new behavior where counter is properly initialized

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:22:55 -08:00
Steve Yegge
ce2b05356a feat(deps): detect/prevent child→parent dependency anti-pattern (bd-nim5)
This prevents a common mistake where users add dependencies from child
issues to their parent epics. This creates a deadlock:
- Child can't start (blocked by open parent)
- Parent can't close (children not done)

Changes:
- dep.go: Reject child→parent deps at creation time with clear error
- server_labels_deps_comments.go: Same check for daemon RPC
- doctor/validation.go: New check detects existing bad deps
- doctor/fix/validation.go: Auto-fix removes bad deps
- doctor.go: Wire up check and fix handler

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:03:27 -08:00
Steve Yegge
566e4f5225 bd sync: 2025-12-24 13:02:54 2025-12-24 13:02:54 -08:00
Steve Yegge
b53dbed757 bd sync: 2025-12-24 12:53:07 2025-12-24 12:53:25 -08:00
Steve Yegge
82d447d5ab bd sync: 2025-12-24 12:51:21 2025-12-24 12:53:25 -08:00
Steve Yegge
2ffe4abb35 bd sync: 2025-12-24 12:41:03 2025-12-24 12:53:25 -08:00
Steve Yegge
9ad70cce64 refactor(mol): remove bd mol spawn - use pour/wisp only (bd-8y9t)
Remove the spawn command from bd mol. Proto instantiation now uses:
- bd pour <proto> - Instantiate as persistent mol (liquid phase)
- bd wisp create <proto> - Instantiate as ephemeral wisp (vapor phase)

Rationale:
- 'spawn' doesn't fit the chemistry metaphor
- Two phase transitions (pour/wisp) are clearer than one command with flags
- Avoids confusion about defaults

Changes:
- Delete mol_spawn.go
- Update mol.go, mol_catalog.go, mol_distill.go to reference pour/wisp
- Update pour.go and wisp.go to remove 'Equivalent to spawn' comments
- Update info.go changelog entries
- Update CHANGELOG.md, ARCHITECTURE.md, DELETIONS.md

Closes bd-8y9t
2025-12-24 12:52:47 -08:00
Steve Yegge
9743b45c6d fix(import): preserve comment created_at timestamps during import (#735)
Comment timestamps were being overwritten with CURRENT_TIMESTAMP during
import, causing infinite sync loops between hosts as each import would
update timestamps.

Added ImportIssueComment() method that accepts and preserves the original
timestamp from JSONL, and updated importComments() to use it.

Closes #735
2025-12-24 12:45:20 -08:00
Steve Yegge
7f8f8f69d1 fix(sync): respect sync.remote config in daemon sync operations (#736)
The daemon sync functions (gitPushFromWorktree, syncBranchPull) were
checking git's branch tracking config and falling back to 'origin',
but ignoring bd's sync.remote config setting.

Now these functions check sync.remote config first, matching the
behavior of sync_check.go and sync_import.go.

Closes #736
2025-12-24 12:43:18 -08:00
Steve Yegge
9d0fc55e0b refactor(daemon): simplify JSONL path comment (#734)
Removes unnecessary parenthetical explanation about possible JSONL file names since findJSONLPath() already encapsulates that logic.

Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-12-24 12:38:13 -08:00
Charles P. Cross
cd2e9ac5c8 refactor(daemon): simplify JSONL path comment
Remove verbose parenthetical explanation from comment on line 73.
The comment now reads '// Get the actual JSONL path' instead of
'// Get the actual JSONL path (could be issues.jsonl, beads.base.jsonl, etc.)'

This is a documentation cleanup with no functional changes.
2025-12-24 12:38:04 -08:00
Steve Yegge
72db7e27ab fix(bd-68e4): export must specify -o to write to file, not stdout (#733)
When 'bd doctor --fix' detects DB has more issues than JSONL, it runs 'bd export' to sync them. However, 'bd export' without -o flag outputs to stdout instead of writing to .beads/issues.jsonl, making the fix a no-op.

Add -o .beads/issues.jsonl --force to the export command to ensure the JSONL file is actually updated.

Co-authored-by: matt wilkie <maphew@gmail.com>
2025-12-24 12:37:53 -08:00
matt wilkie
0f93bef240 fix(bd-68e4): export must specify -o to write to file, not stdout
When 'bd doctor --fix' detects DB has more issues than JSONL, it runs
'bd export' to sync them. However, 'bd export' without -o flag outputs
to stdout instead of writing to .beads/issues.jsonl, making the fix a
no-op.

Add -o .beads/issues.jsonl --force to the export command to ensure the
JSONL file is actually updated.
2025-12-24 12:37:24 -08:00
Charles P. Cross
61daa59fd0 feat(list): add --pretty and --watch flags for built-in viewer (#729)
feat(list): add --pretty and --watch flags for built-in viewer

Closes #654
2025-12-24 12:35:57 -08:00
Charles P. Cross
cdbca65ed4 feat(config): add override notification for config parameters (#731)
feat(config): add override notification for config parameters

Adds verbose logging when config values are overridden by flags/env vars.
2025-12-24 12:35:54 -08:00