Commit Graph

1086 Commits

Author SHA1 Message Date
Steve Yegge
a7c843f72d feat: witness closes mol-polecat-arm when polecat cleaned up (gt-59zd.5)
Add arm closing to witness cleanup:

- Add closePolecatArm(name, reason) method that:
  - Looks up arm ID in handoff state
  - Closes the arm issue with the given reason
  - Clears arm ID from handoff state

- Call closePolecatArm() at end of cleanupPolecat()

This completes the arm lifecycle: created when polecat discovered,
closed when polecat cleaned up. The Christmas Ornament pattern now
tracks the full polecat lifecycle.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:32:12 -08:00
Steve Yegge
af360662d9 feat: witness bonds mol-polecat-arm for each polecat (gt-59zd.4)
Add arm bonding to witness health check:

- Add ensurePolecatArm() method that:
  - Checks if arm already exists for polecat (ArmID in WorkerState)
  - If not, calls `gt mol bond mol-polecat-arm` with template vars
  - Parses arm ID from output and stores in handoff state

- Call ensurePolecatArm() in healthCheck() for each running polecat

This creates the Christmas Ornament pattern where mol-witness-patrol
has dynamically bonded mol-polecat-arm children, one per active polecat.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:31:03 -08:00
Steve Yegge
c81f02de56 feat: witness instantiates mol-witness-patrol on start (gt-59zd.3)
Add patrol instance tracking to witness manager:

- Add PatrolInstanceID to WitnessHandoffState for tracking
- Add ArmID to WorkerState for per-polecat arm tracking
- Add ensurePatrolInstance() method that:
  - Checks if patrol instance already exists (from previous session)
  - Creates new patrol instance if needed
  - Persists instance ID in handoff state

This enables the molecule-based tracking ledger pattern where the
Go-based witness creates beads issues to track its patrol state.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:28:39 -08:00
Steve Yegge
2b8d246122 bd sync: 2025-12-23 22:28:25 2025-12-23 22:28:25 -08:00
Steve Yegge
18694d7181 bd sync: 2025-12-23 22:22:51 2025-12-23 22:22:51 -08:00
Steve Yegge
43eaf461b3 feat: add Christmas Ornament pattern integration tests (gt-tnow.4)
Add comprehensive integration tests for the mol-witness-patrol and
mol-polecat-arm molecule pattern:

- TestChristmasOrnamentPattern: verifies mol-witness-patrol structure,
  WaitsFor: all-children on aggregate step, mol-polecat-arm structure,
  template variable expansion, and bonding metadata parsing
- TestEmptyPatrol: tests 0 polecats case (empty arms)
- TestNudgeProgression: verifies nudge matrix documentation
- TestPreKillVerification: tests pre-kill verification flow
- TestWaitsForAllChildren: tests fanout gate semantics
- TestMultipleWaitsForConditions: tests parsing multiple conditions
- TestMolBondCLI: simulates mol bond command behavior
- TestActivityFeed: verifies generate-summary step documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:07:11 -08:00
Steve Yegge
1656fb9c11 bd sync: 2025-12-23 22:06:43 2025-12-23 22:06:43 -08:00
Steve Yegge
a99d057331 bd sync: 2025-12-23 21:58:35 2025-12-23 21:58:35 -08:00
Steve Yegge
d34fb6a2c3 bd sync: 2025-12-23 21:57:44 2025-12-23 21:57:59 -08:00
Steve Yegge
528ce0008d bd sync: 2025-12-23 21:57:08 2025-12-23 21:57:59 -08:00
Steve Yegge
c7ee1e2f56 Merge beads-sync into main 2025-12-23 21:57:35 -08:00
Steve Yegge
a8739f5548 fix: remove bd sync from polecat startup sequence (gt-aobh)
Polecats share the same beads database at the rig level. The refinery
and witness manage syncing beads. Running bd sync on polecat startup
causes contention when multiple polecats spawn simultaneously and
creates potential race conditions.

This change removes bd sync --from-main from:
- prompts/roles/polecat.md On Startup section
- internal/beads/molecules_session.go orient step
- internal/beads/molecules_work.go orient step
- docs/polecat-wisp-architecture.md load context section

Troubleshooting sections that recommend bd sync --from-main for
recovery scenarios are preserved.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:53:31 -08:00
Steve Yegge
9f2eefe9ce fix: verify polecat branch pushed before cleanup (gt-gl6s)
Add BranchPushedToRemote() to git package that properly handles
polecat branches without upstream tracking. Update verifyPolecatState
in witness to check that branches are pushed before allowing cleanup.

This prevents the scenario where polecats close issues without pushing
their work, causing all commits to be lost when the worktree is deleted.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:50:31 -08:00
Steve Yegge
031a27c062 feat: add WaitsFor parsing and mol bond command (gt-odfr, gt-isje)
WaitsFor parsing:
- Add WaitsFor []string field to MoleculeStep struct
- Parse WaitsFor lines in molecule descriptions
- Enables fanout gate semantics (e.g., WaitsFor: all-children)
- Case-insensitive parsing like Needs/Tier

mol bond command:
- Add gt mol bond for dynamic child molecule creation
- Supports --parent, --ref, and --var flags
- Enables Christmas Ornament pattern for parallel child execution
- Creates child issue with expanded template variables
- Instantiates proto steps under the bonded child

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:44:25 -08:00
Steve Yegge
92a3da90a8 bd sync: 2025-12-23 21:44:16 2025-12-23 21:44:16 -08:00
Steve Yegge
f9585fc3ab bd sync: 2025-12-23 21:44:14 2025-12-23 21:44:14 -08:00
Steve Yegge
b685879b63 Refinery as worktree: local MR integration (gt-4u5z)
Architecture changes:
- Refinery created as worktree of mayor clone (shares .git)
- Polecat branches stay local (never pushed to origin)
- MRs stored as wisps in .beads-wisp/mq/ (ephemeral)
- Only main gets pushed to origin after merge

New mrqueue package for wisp-based MR storage.
Updated spawn, done, mq_submit, refinery, molecule templates.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:25:01 -08:00
Steve Yegge
e895e51ee4 bd sync: 2025-12-23 21:24:10 2025-12-23 21:25:01 -08:00
Steve Yegge
33f8584e77 feat: implement Christmas Ornament pattern for mol-witness-patrol (gt-tnow.1, gt-tnow.2)
- Update WitnessPatrolMolecule() with dynamic bonding pattern:
  - PREFLIGHT: inbox-check, check-refinery, load-state
  - DISCOVERY: survey-workers (bonds mol-polecat-arm per polecat)
  - CLEANUP: aggregate (WaitsFor: all-children), save-state, generate-summary,
    context-check, burn-or-loop
  - Reduced from 11 sequential steps to 9 with parallel arm execution

- Add PolecatArmMolecule() for per-polecat inspection:
  - 5 sequential steps: capture, assess, load-history, decide, execute
  - Uses {{polecat_name}} and {{rig}} variable substitution
  - Bonded dynamically by survey-workers step

- Update tests: 14 builtin molecules, new test cases

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:22:22 -08:00
Steve Yegge
6a7662ba6b bd sync: 2025-12-23 21:22:08 2025-12-23 21:22:08 -08:00
Steve Yegge
b3d95191dd bd sync: 2025-12-23 21:19:04 2025-12-23 21:19:04 -08:00
Steve Yegge
ce0ce7bc50 bd sync: 2025-12-23 20:33:30 2025-12-23 20:33:30 -08:00
Steve Yegge
eced6494f8 bd sync: 2025-12-23 20:30:06 2025-12-23 20:30:06 -08:00
Steve Yegge
e972d983c1 bd sync: 2025-12-23 20:25:57 2025-12-23 20:25:58 -08:00
Steve Yegge
17ae76fbd2 docs: remove remaining Breaking Bad references
Clean up Walter White quotes, 99.1% pure, secret formula references.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:15:41 -08:00
Steve Yegge
de3a3e0813 docs: remove explicit Breaking Bad/Mad Max metaphor section
The metaphors inspired the naming, but explicit mapping does not
belong in user-facing documentation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:11:17 -08:00
Steve Yegge
a84eb179db docs: consolidate Rig/Cook/Run into molecular-chemistry.md (gt-8tmz.32)
- Add Work Lifecycle section (Rig → Cook → Run phases)
- Add Complete Artifact Graph showing full generation/bond relationships
- Add Two Composition Operators section (rig vs bond distinction)
- Add Formulas section covering source layer above protos
- Add symmetric Bond Table
- Update vocabulary appendix with new terms
- Redirect rig-cook-run.md to consolidated doc
- Update references in molecule-algebra.md and vision.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:11:17 -08:00
Steve Yegge
22c5fb6bdf bd sync: 2025-12-23 20:10:06 2025-12-23 20:10:06 -08:00
Steve Yegge
16f6b4ee67 bd sync: 2025-12-23 20:02:30 2025-12-23 20:02:30 -08:00
Steve Yegge
0835a7066e bd sync: 2025-12-23 19:53:48 2025-12-23 19:53:48 -08:00
Steve Yegge
4fbeccd005 bd sync: 2025-12-23 19:39:11 2025-12-23 19:39:11 -08:00
Steve Yegge
ac4e1a6249 bd sync: 2025-12-23 19:38:04 2025-12-23 19:38:04 -08:00
Steve Yegge
c2d87cb261 bd sync: 2025-12-23 19:37:40 2025-12-23 19:37:40 -08:00
Steve Yegge
a3cb8f33aa bd sync: 2025-12-23 19:28:20 2025-12-23 19:28:20 -08:00
Steve Yegge
3bc676ee2e bd sync: 2025-12-23 19:27:58 2025-12-23 19:27:58 -08:00
Steve Yegge
32048ceaaa bd sync: 2025-12-23 19:27:37 2025-12-23 19:27:37 -08:00
Steve Yegge
837cad67b8 feat: add Towers of Hanoi formula prototype (gt-8tmz)
Demonstrates that molecule algebra solves the "million step workflow"
problem that MAKER addressed with distributed voting.

Key insight: structure is mechanical, only leaf execution needs AI.
- The move sequence is 100% deterministic (2^n - 1 moves)
- Each step is trivial ("move disk 3 from A to C")
- No voting needed - formula generates perfect structure

New beads filed:
- gt-8tmz.26: Direct formula-to-wisp (skip proto for huge ephemeral work)
- gt-8tmz.27: Computed range expansion (for-each over expressions)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 19:27:21 -08:00
Steve Yegge
c13eb39908 bd sync: 2025-12-23 19:27:17 2025-12-23 19:27:17 -08:00
Steve Yegge
6fe32bb5a8 bd sync: 2025-12-23 19:26:56 2025-12-23 19:26:56 -08:00
Steve Yegge
ef6959e4dd bd sync: 2025-12-23 19:19:56 2025-12-23 19:20:09 -08:00
Steve Yegge
4716b2ee57 docs: discover Rig/Cook/Run lifecycle - the three phases of work (gt-8tmz)
Key insight: Rig and Bond operate at different abstraction levels:
- Rig = source-level composition (formula YAML with extends/compose)
- Bond = artifact-level composition (protos, mols, wisps)

This preserves the symmetric bond table while cleanly separating
authoring (rig) from runtime composition (bond).

New docs:
- rig-cook-run.md: Canonical spec for the three phases

Updated docs:
- molecule-algebra.md: Three Phases section, rig/bond distinction
- molecular-chemistry.md: Rig/bond clarification in bond section
- vision.md: Core Innovation 3 now covers Rig/Cook/Run

"This is a discovery, not an invention."

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 19:19:21 -08:00
Steve Yegge
733039a6d6 bd sync: 2025-12-23 19:19:11 2025-12-23 19:19:11 -08:00
Steve Yegge
4113b18be5 bd sync: 2025-12-23 19:13:06 2025-12-23 19:13:06 -08:00
Steve Yegge
d07f3be9ca bd sync: 2025-12-23 19:12:35 2025-12-23 19:12:35 -08:00
Steve Yegge
3228a93453 bd sync: 2025-12-23 18:48:25 2025-12-23 18:48:56 -08:00
Steve Yegge
04c6ba048a bd sync: 2025-12-23 18:20:23 2025-12-23 18:48:56 -08:00
Steve Yegge
b9705fc35b bd sync: 2025-12-23 18:04:57 2025-12-23 18:48:56 -08:00
Steve Yegge
0a7630c263 refactor: formulas use YAML instead of JSON (gt-8tmz)
- Convert .formula.json files to .formula.yaml
- Update molecule-algebra.md to specify YAML format
- Update molecular-chemistry.md proto examples
- Add Safety Constraints section: cycle detection, aspect
  self-matching prevention, max expansion depth, graceful degradation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 18:48:43 -08:00
Steve Yegge
74430a1019 refactor: formulas use JSON instead of YAML (gt-8tmz)
JSON for consistency with beads (issues.jsonl, molecules.jsonl).
Agents create/manage formulas; humans use visualizers.

- Simpler parsing (Go built-in JSON)
- No YAML gotchas
- Agents generate JSON flawlessly
2025-12-23 18:23:36 -08:00
Steve Yegge
93d9726bbc docs: add Formula + Cook terminology and example formulas (gt-8tmz)
Updates to molecule-algebra.md:
- Added Formulas and Cooking section
- Four-tier model: Formula → cook → Proto → pour/wisp → Mol/Wisp
- Breaking Bad × Mad Max naming (Let's cook!)
- Updated vision diagram

New example formulas:
- shiny.formula.yaml (Engineer in a Box)
- rule-of-five.formula.yaml (Jeffrey's Rule expansion macro)
- security-audit.formula.yaml (AOP aspect)
- shiny-enterprise.formula.yaml (composed example)
2025-12-23 18:20:39 -08:00