Commit Graph

4082 Commits

Author SHA1 Message Date
Steve Yegge
acc7168931 bd sync: 2025-12-25 22:04:46 2025-12-25 22:58:10 -08:00
Steve Yegge
3d83226d93 bd sync: 2025-12-25 20:20:55 2025-12-25 22:58:10 -08:00
Steve Yegge
07181560a7 feat(gate): Add GitHub gate evaluation (gh:run, gh:pr)
Implements evaluation for GitHub-related gate types:

- gh:run: Checks if a GitHub Actions run has completed using
  `gh run view <id> --json status,conclusion`
- gh:pr: Checks if a PR has been merged/closed using
  `gh pr view <id> --json state,merged`

Both gate types require the gh CLI to be installed and authenticated.
If gh fails (not installed, network issues, invalid IDs), the gate is
skipped rather than erroneously closed.

Refactors the eval loop to use a switch statement for cleaner
gate type dispatch.

(gt-twjr5.3)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:57:39 -08:00
Steve Yegge
f6c739f75e feat(merge): Export Merge3WayWithTTL for configurable tombstone TTL (bd-6rl) 2025-12-25 22:45:44 -08:00
Steve Yegge
19a182a26a docs(git): Add thread-safety warning to ResetCaches() (bd-43xj) 2025-12-25 22:45:44 -08:00
Steve Yegge
1d3a7f98df Add bd gate eval command for timer gate evaluation (gt-twjr5.2)
- New `bd gate eval` command evaluates all open gates and closes elapsed ones
- Timer gates: closes when elapsed time exceeds timeout duration
- For timer gates, parse duration from await_id if --timeout not explicitly set
- Supports --dry-run and --json output modes
- Idempotent and safe to run repeatedly (e.g., in Deacon patrol)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:29:05 -08:00
Steve Yegge
32c803dd16 fix(worktree): Cache git detection results to eliminate slowness (bd-7di)
In git worktrees, any bd command was slow with a 2-3s pause because:
- git.IsWorktree() was called 4+ times per command
- Each call spawned 2 git processes (git-dir and git-common-dir)
- git.GetRepoRoot() and git.GetMainRepoRoot() also called multiple times

Fix: Cache results using sync.Once since these values do not change during
a single command execution:
- IsWorktree() - caches worktree detection
- GetRepoRoot() - caches repo root path
- GetMainRepoRoot() - caches main repo root for worktrees

Added ResetCaches() for test cleanup between subtests that change directories.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:04:40 -08:00
Steve Yegge
df5d4b384c Add TOML support for formulas (gt-xmyha)
- Add TOML parsing using BurntSushi/toml
- Update formula loader to try .toml first, fall back to .json
- Add `bd formula convert` command for JSON→TOML migration
- Multi-line string support for readable descriptions
- Cache git worktree/reporoot checks for performance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 21:59:19 -08:00
Steve Yegge
5c3a40156c feat(init): Auto-detect fork repos and offer to configure .git/info/exclude (GH#742)
When bd init runs in a forked repo (detected via upstream remote), prompt
the user to configure .git/info/exclude to keep beads files local.

- Add --setup-exclude flag for manual trigger
- Add fork detection to init flow (reuses detectForkSetup)
- Add setupForkExclude() to configure .git/info/exclude with:
  .beads/, **/RECOVERY*.md, **/SESSION*.md
- Add promptForkExclude() with Y/n prompt (default yes)
- Add containsExactPattern() helper for precise pattern matching

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 21:38:20 -08:00
Aarya Reddy
bd5fc214c3 feat(ready,blocked): Add --parent flag for scoping by epic/bead desce… (#743)
* feat(ready,blocked): Add --parent flag for scoping by epic/bead descendants

Add --parent flag to `bd ready` and `bd blocked` CLI commands and MCP tools
to filter results to all descendants of a specific epic or bead.

## Backward Compatibility

- CLI: New optional --parent flag; existing usage unchanged
- RPC: New `blocked` operation added (was missing); existing operations unchanged
- MCP: New optional `parent` parameter; existing calls work as before
- Storage interface: GetBlockedIssues signature changed to accept WorkFilter
  - All callers updated to pass empty filter for existing behavior
  - Empty WorkFilter{} returns identical results to previous implementation

## Implementation Details

SQLite uses recursive CTE to traverse parent-child hierarchy:

    WITH RECURSIVE descendants AS (
        SELECT issue_id FROM dependencies
        WHERE type = 'parent-child' AND depends_on_id = ?
        UNION ALL
        SELECT d.issue_id FROM dependencies d
        JOIN descendants dt ON d.depends_on_id = dt.issue_id
        WHERE d.type = 'parent-child'
    )
    SELECT issue_id FROM descendants

MemoryStorage implements equivalent recursive traversal with visited-set
cycle protection via collectDescendants helper.

Parent filter composes with existing filters (priority, labels, assignee, etc.)
as an additional WHERE clause - all filters are AND'd together.

## RPC Blocked Support

MCP beads_blocked() existed but daemon client raised NotImplementedError.
Added OpBlocked and handleBlocked to enable daemon RPC path, which was
previously broken. Now both CLI and daemon clients work for blocked queries.

## Changes

- internal/types/types.go: Add ParentID *string to WorkFilter
- internal/storage/sqlite/ready.go: Add recursive CTE for parent filtering
- internal/storage/memory/memory.go: Add getAllDescendants/collectDescendants
- internal/storage/storage.go: Update GetBlockedIssues interface signature
- cmd/bd/ready.go: Add --parent flag to ready and blocked commands
- internal/rpc/protocol.go: Add OpBlocked constant and BlockedArgs type
- internal/rpc/server_issues_epics.go: Add handleBlocked RPC handler
- internal/rpc/client.go: Add Blocked client method
- integrations/beads-mcp/: Add BlockedParams model and parent parameter

## Usage

  bd ready --parent bd-abc              # All ready descendants
  bd ready --parent bd-abc --priority 1 # Combined with other filters
  bd blocked --parent bd-abc            # All blocked descendants

## Testing

Added 4 test cases for parent filtering:
- TestParentIDFilterDescendants: Verifies recursive traversal (grandchildren)
- TestParentIDWithOtherFilters: Verifies composition with priority filter
- TestParentIDWithBlockedDescendants: Verifies blocked issues excluded from ready
- TestParentIDEmptyParent: Verifies empty result for childless parent

* fix: Correct blockedCmd indentation and suppress gosec false positive

- Fix syntax error from incorrect indentation in blockedCmd Run function
- Add nolint:gosec comment for GetBlockedIssues SQL formatting (G201)
  The filterSQL variable contains only parameterized WHERE clauses with
  ? placeholders, not user input
2025-12-25 21:11:58 -08:00
Steve Yegge
4ffbab5311 docs(worktrees): Add 'Fully Separate Beads Repository' section (GH#195)
Document the BEADS_DIR workflow for storing beads in a completely
separate git repository from your code. This feature was added in
PR #533 by @dand-oss but wasn't documented.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:48:59 -08:00
Steve Yegge
e91f0de8d1 feat(formula): Add inline step expansion (gt-8tmz.35)
Steps can now declare their own expansion using the Expand field:

  steps:
    - id: design
      expand: rule-of-five
      expand_vars:
        iterations: 3

This is more convenient than compose.expand for single-step expansions.
The step is replaced by the expansion template with variables substituted.

Reuses existing expandStep() and mergeVars() from gt-8tmz.34.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:46:12 -08:00
Steve Yegge
f82c75c39e feat(formula): Validate expanded step IDs are unique (gt-8tmz.36) 2025-12-25 20:19:55 -08:00
Steve Yegge
e8458935f9 feat(formula): Implement expansion var overrides (gt-8tmz.34)
- Add vars parameter to expandStep for {varname} substitution
- Add mergeVars to combine formula defaults with rule overrides
- Update ApplyExpansions to merge and pass vars for expand/map rules
- Apply var substitution to step ID, title, description, assignee,
  labels, and dependencies
- Add comprehensive tests for var overrides functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:07:29 -08:00
Steve Yegge
f3a5e02a35 feat(close): Add --suggest-next flag to show newly unblocked issues (GH#679)
When closing an issue, the new --suggest-next flag returns a list of
issues that became unblocked (ready to work on) as a result of the close.

This helps agents and users quickly identify what work is now available
after completing a blocker.

Example:
  $ bd close bd-5 --suggest-next
  ✓ Closed bd-5: Completed

  Newly unblocked:
    • bd-7 "Implement feature X" (P1)
    • bd-8 "Write tests for X" (P2)

Implementation:
- Added GetNewlyUnblockedByClose to storage interface
- Implemented efficient single-query for SQLite using blocked_issues_cache
- Added SuggestNext field to CloseArgs in RPC protocol
- Added CloseResult type for structured response
- CLI handles both daemon and direct modes

Thanks to @kraitsura for the detailed feature request and design.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:05:04 -08:00
Steve Yegge
35ab0d7a7f bd sync: 2025-12-25 20:01:27 2025-12-25 20:01:27 -08:00
Steve Yegge
76c1e08a9b bd sync: 2025-12-25 20:01:13 2025-12-25 20:01:13 -08:00
Steve Yegge
46b7f162cf bd sync: 2025-12-25 19:55:25 2025-12-25 19:55:25 -08:00
Steve Yegge
488ec56938 fix(mcp): Graceful fallback on Windows for daemon mode (GH#387)
- Skip daemon mode on Windows (sys.platform == win32)
- Falls back to CLI mode which works on all platforms
- Avoids asyncio.open_unix_connection which does not exist on Windows

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 19:50:55 -08:00
Steve Yegge
c64ad028b7 fix(npm): Windows postinstall file locking issue (GH#670)
- Move write stream creation after redirect handling to avoid orphan
  streams that keep file handles open
- Add 100ms delay after file.close() on Windows to ensure handle release
- Fixes "The process cannot access the file" error during extraction

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 19:47:22 -08:00
Steve Yegge
bbe1980b6c bd sync: 2025-12-25 19:43:27 2025-12-25 19:43:27 -08:00
Steve Yegge
3e7628348a bd sync: 2025-12-25 19:40:08 2025-12-25 19:40:08 -08:00
Steve Yegge
8050e7b5fa bd sync: 2025-12-25 19:38:08 2025-12-25 19:38:08 -08:00
Steve Yegge
fbd2371200 bd sync: 2025-12-25 19:32:24 2025-12-25 19:32:24 -08:00
Steve Yegge
ae2a0b2503 bd sync: merge divergent histories (content-level recovery) 2025-12-25 19:30:40 -08:00
Steve Yegge
b21b318588 feat: Improve bd mol distill command
- Update help text to clarify mol/wisp/epic support (not just epics)
- Add daemon support (no longer requires --no-daemon)
- Add -o shorthand for --output flag
- Update use cases to match new architecture

Part of bd-1dez.1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:54:33 -08:00
Steve Yegge
cfecadc8a5 docs: Clarify formulas are JSON, add distillation and sharing docs
- Fix YAML → JSON references in formula.go and types.go
- Update MOLECULES.md with ephemeral proto architecture
- Add Distillation section: extract formulas from completed work
- Add Sharing section: Mol Mall formula marketplace
- Update Layer Cake diagram to show ephemeral proto flow

Related: bd-1dez (Mol Mall epic)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:43:08 -08:00
Steve Yegge
abf672243c feat: Compile-time vs runtime cooking (gt-8tmz.23)
Add --mode flag (compile/runtime) and --var flag to bd cook command.

Compile-time mode (default):
- Keeps {{variable}} placeholders intact
- Use for: modeling, estimation, contractor handoff

Runtime mode (triggered by --var or --mode=runtime):
- Substitutes variables with provided values
- Validates all required variables have values
- Use for: final validation before pour

Also updates --dry-run output to clearly show which mode is active
and display substituted values in runtime mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:40:15 -08:00
Steve Yegge
ea9f1d2760 Add edge case tests for expression evaluator (code review)
Test cases for:
- Unary minus in expression: 3*-2 -> -6
- Parenthesized negative: (-5) -> -5
- Unary minus after power: 2^-1 -> 0 (truncated)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:55:42 -08:00
Steve Yegge
030838cfde Implement computed range expansion for loops (gt-8tmz.27)
Add support for for-each expansion over computed ranges:

  loop:
    range: "1..2^{disks}-1"  # Evaluated at cook time
    var: move_num
    body: [...]

Features:
- Range field in LoopSpec for computed iterations
- Var field to expose iteration value to body steps
- Expression evaluator supporting + - * / ^ and parentheses
- Variable substitution in range expressions using {name} syntax
- Title/description variable substitution in expanded steps

Example use case: Towers of Hanoi formula where step count is 2^n-1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:48:35 -08:00
Steve Yegge
258d183e25 Add waits_for handling to collectDependenciesToSubgraph (gt-8tmz.38)
The ephemeral proto path (collectDependenciesToSubgraph) was missing
waits_for handling that was already implemented in collectDependencies
for persisted protos. This ensures fanout gate dependencies are created
correctly for both ephemeral and persisted formula cooking.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:40:51 -08:00
Steve Yegge
ba17898365 Implement fanout gate: waits-for children aggregation (gt-8tmz.38)
- Add children-of(step-id) syntax for explicit spawner reference
- Add WaitsForSpec type and ParseWaitsFor() helper
- Update cook.go to create DepWaitsFor dependencies with metadata
- Infer spawner from first needs entry when using all-children
- Add validation tests for children-of() syntax
- Add unit tests for ParseWaitsFor()

This completes the Christmas Ornament aggregation pattern:
- survey-workers does for-each → creates N children
- aggregate waits-for children-of(survey-workers)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:33:54 -08:00
Steve Yegge
54a051aba3 gt-4v1eo: Implement ephemeral protos - cook formulas inline
Major refactor of molecular chemistry to make protos ephemeral:
- Formulas are now cooked directly to in-memory TemplateSubgraph
- No more proto beads stored in the database

Changes:
- cook.go: Add cookFormulaToSubgraph() and resolveAndCookFormula()
  for in-memory formula cooking
- template.go: Add VarDefs field to TemplateSubgraph for default
  value handling, add extractRequiredVariables() and
  applyVariableDefaults() helpers
- pour.go: Try formula loading first for any name (not just mol-)
- wisp.go: Same pattern as pour
- mol_bond.go: Use resolveOrCookToSubgraph() for in-memory subgraphs
- mol_catalog.go: List formulas from disk instead of DB proto beads
- mol_distill.go: Output .formula.json files instead of proto beads

Flow: Formula (.formula.json) -> pour/wisp (cook inline) -> Mol/Wisp

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:22:00 -08:00
Steve Yegge
ec85577589 fix: Remove unused code from wisp.go (code review followup)
Remove resolvePartialIDDirect function and context import that became
dead code after switching to resolveOrCookFormula in bd-rciw.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:15:02 -08:00
Steve Yegge
56deb02d2a feat: Support ephemeral protos: cook inline for pour/wisp/bond (bd-rciw)
Changes:
- bd cook: outputs proto JSON to stdout by default, add --persist flag
  for legacy behavior (write to database)
- bd pour: accepts formula names, cooks inline as ephemeral proto,
  spawns mol, then cleans up temporary proto
- bd wisp create: accepts formula names, cooks inline as ephemeral proto,
  creates wisp, then cleans up temporary proto
- bd mol bond: already supported ephemeral protos (gt-8tmz.25)

The ephemeral proto pattern avoids persisting templates in the database.
Protos are only needed temporarily during spawn operations - the spawned
mol/wisp is what gets persisted.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 17:04:31 -08:00
Steve Yegge
e4feccfc2b bd sync: 2025-12-25 17:03:56 2025-12-25 17:03:56 -08:00
Steve Yegge
c1fefc1bc4 bd sync: 2025-12-25 16:55:34 2025-12-25 16:55:34 -08:00
Steve Yegge
788e07be00 bd sync: 2025-12-25 14:49:21 2025-12-25 16:55:27 -08:00
Steve Yegge
76f2179ea4 bd sync: 2025-12-25 14:06:00 2025-12-25 16:55:27 -08:00
Steve Yegge
e410b9b08d bd sync: 2025-12-25 13:56:03 2025-12-25 16:55:27 -08:00
Steve Yegge
f1493a2fff docs: add info.go versionChanges entry for 0.37.0
20 agent-actionable changes:
- 9 new features (control flow, aspects, formula commands, etc.)
- 3 breaking changes (YAML→JSON, mol run removed, wisp architecture)
- 8 bug fixes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:51:26 -08:00
Steve Yegge
35e8c06f3e feat: add beads-release formula for molecular releases
18-step workflow covering full release cycle:
- Preflight checks (git status, pull)
- Documentation (CHANGELOG, info.go)
- Version bump (wraps bump-version.sh)
- Git operations (commit, tag, push)
- CI verification
- Artifact verification (GitHub, npm, PyPI)
- Local installation and daemon restart

Replaces ad-hoc release process with structured molecular workflow.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:51:26 -08:00
Steve Yegge
73e56d0876 Fix in-place mutation in ApplyBranches/ApplyGates (gt-v1pcg)
- ApplyBranches and ApplyGates now clone steps before modifying,
  matching the immutability pattern of ApplyLoops and ApplyAdvice
- Added internal applyBranchesWithMap/applyGatesWithMap for efficiency
- ApplyControlFlow builds stepMap once for both (gt-gpgdv optimization)
- Added cloneStepsRecursive helper
- Added TestApplyBranches_Immutability and TestApplyGates_Immutability

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:48:37 -08:00
Steve Yegge
3b3f844484 fix: Address code review issues in bd mol bond formula support
Fixes from review of gt-8tmz.25 implementation:

1. Dry-run no longer cooks formulas - added resolveOrDescribe() for
   dry-run mode that checks if operand exists without cooking

2. Ephemeral protos now cleaned up after successful bond, not just
   on error

3. Unique proto IDs to avoid collision - ephemeral protos use format
   "_ephemeral-<formula>-<timestamp>" instead of formula name

4. Removed unused vars parameter from resolveOrCookFormula

5. Added informative output showing formulas will be cooked and
   cleaned up

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:47:03 -08:00
Steve Yegge
6bb11c4297 docs: update CHANGELOG [Unreleased] for 0.37.0
Comprehensive changelog entries for all changes since v0.36.0:
- 8 new features (control flow, aspects, stale detection, etc.)
- 3 breaking changes (YAML→JSON, wisp architecture, mol run removal)
- 13 bug fixes
- 2 documentation updates

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:43:37 -08:00
Steve Yegge
cb6f3cdb5e feat: Add formula name support to bd mol bond (gt-8tmz.25)
Bond command now accepts formula names (e.g., mol-polecat-arm) in addition
to issue IDs. When a formula name is given:

1. Looks up the formula using formula.Parser
2. Resolves inheritance and applies transformations (control flow, advice,
   expansions, aspects)
3. Cooks the formula inline to create an ephemeral proto
4. Uses the cooked proto for bonding

This eliminates the need for pre-cooked proto beads in the database,
enabling more dynamic workflow composition.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:39:27 -08:00
Steve Yegge
d2f71773cb fix: Chain iterations after nested loop expansion (gt-zn35j)
Fixes a bug where outer iteration chaining was lost when nested loops
were expanded. The problem was:

1. chainLoopIterations set: outer.iter2.inner depends on outer.iter1.inner
2. ApplyLoops recursively expanded nested loops
3. outer.iter2.inner became outer.iter2.inner.iter1.work, etc.
4. The dependency was lost (referenced non-existent ID)

The fix:
- Move recursive ApplyLoops BEFORE chaining
- Add chainExpandedIterations that finds iteration boundaries by ID prefix
- Works with variable step counts per iteration (nested loops expand differently)

Now outer.iter2's first step correctly depends on outer.iter1's LAST step,
ensuring sequential execution of outer iterations.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:35:28 -08:00
Steve Yegge
bce4f8f2d4 feat: Add source tracing metadata to cooked steps (gt-8tmz.18)
Add SourceFormula and SourceLocation fields to track where each step
came from during the cooking process. This enables debugging of complex
compositions with inheritance, expansion, and advice.

Changes:
- Added SourceFormula and SourceLocation fields to Step struct (formula/types.go)
- Added same fields to Issue struct (types/types.go)
- Added SetSourceInfo() to parser.go - sets source on all steps after parsing
- Updated cook.go to copy source fields from Step to Issue
- Updated dry-run output to display source info: [from: formula@location]
- Updated advice.go to set source on advice-generated steps
- Updated controlflow.go to preserve source on loop-expanded steps
- Updated expand.go to preserve source on template-expanded steps

The source location format is:
- steps[N] - regular step at index N
- steps[N].children[M] - child step
- steps[N].loop.body[M] - loop body step
- template[N] - expansion template step
- advice - step inserted by advice transformation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:27:48 -08:00
Steve Yegge
b43358b600 feat: Add nested loop support in control flow (gt-zn35j)
Enables loops within loop bodies to be properly expanded:

- Copy Loop field in expandLoopIteration (was intentionally omitted)
- Add cloneLoopSpec for deep copying of LoopSpec with body steps
- Recursively call ApplyLoops at end of expandLoop to expand nested loops
- Also copy OnComplete field for consistency

Nested IDs follow natural chaining pattern:
  outer.iter1.inner.iter2.step

Tested with 2-level and 3-level nesting scenarios.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:22:58 -08:00
Steve Yegge
47cc84de3a fix(docs): standardize sync branch name and daemon syntax (GH#376)
- Replace beads-metadata with beads-sync throughout docs
  (matches code default and internal examples)
- Fix bd daemon start → bd daemon --start (correct flag syntax)

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

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