Implement DFS-based cycle detection in ValidateMolecule to catch
circular dependencies in molecule step graphs. The algorithm uses
three-color marking (unvisited/visiting/visited) to detect back
edges that indicate cycles.
When a cycle is detected, the error message shows the cycle path
(e.g., "a -> b -> c -> a") for easy debugging.
Add 4 new tests:
- SimpleCycle: A -> B -> A
- LongerCycle: A -> B -> C -> A
- DiamondNoCycle: ensures valid diamond patterns pass
- CycleInSubgraph: cycle not involving root node
Closes gt-ai1z.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add getRig() helper in rig_helpers.go that encapsulates the common
boilerplate for finding town root, loading rigs config, and retrieving
a rig. This reduces duplication across 5 get*Manager functions:
- getPolecatManager
- getSessionManager
- getCrewManager
- getRefineryManager
- getWitnessManager
Closes gt-7sqi.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two mechanisms, different purposes:
- Pinned molecule (bd mol run) = What you are working on, tracked by beads
- Handoff mail = Optional context notes for session restarts
Updated templates, architecture.md, and builtin_molecules.go
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes gt-b6qm: redirect files can get deleted by git clean, causing
"no beads database found" errors.
Changes:
- crew.Manager.Add() now creates .beads/redirect during setup
- gt prime regenerates missing redirects silently on startup
The redirect points to the shared beads database at either:
- rig/mayor/rig/.beads/ (preferred)
- rig/.beads/ (fallback)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New docs/deacon-plugins.md with full plugin architecture
- Directory-based discovery at ~/gt/plugins/
- Gate types: cooldown, cron, condition, event
- Parallel execution support via Task tool subagents
- Updated mol-deacon-patrol plugin-run step to reference new docs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CRITICAL FIX: Both `gt done` and `gt mq submit` were creating MR
records without pushing the branch to origin first. When polecat
worktrees were deleted, the unpushed branches were lost forever.
This caused 12 MQ items to become orphaned - merge requests existed
but their branches had vanished.
The fix adds a mandatory `git push origin <branch>` before creating
the MR record. If push fails, the MR is not created.
Fixes: gt-aqku
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates Deacon CLAUDE.md template with patrol execution instructions:
- Patrol molecule workflow (mol-deacon-patrol)
- Startup protocol: check for attached molecule, resume or bond
- Patrol execution loop: execute steps, close, loop or exit
- Nondeterministic idempotence for handoff
Enhances gt prime for Deacon:
- Adds patrol status section showing attached/naked state
- Shows molecule progress when patrol is in progress
- Includes Deacon-specific startup directive
Also adds standalone prompts/roles/deacon.md for reference.
Closes: gt-rana.4
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added comprehensive CLI reference documentation for the three molecule
lifecycle commands:
- bd mol bond: Instantiate proto into Mol (durable) or Wisp (ephemeral)
- bd mol squash: Complete molecule and generate digest
- bd mol burn: Abandon molecule without digest
Includes argument tables, behavior descriptions, examples, and a
lifecycle diagram showing the steam engine metaphor mapping.
Closes: gt-odvf
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add visual diagram showing Proto → Mol/Wisp → Digest state transitions
with the "states of matter" metaphor (crystal → liquid/gas → distillate).
Document when to use Mol (durable) vs Wisp (ephemeral) based on audit
requirements and work importance.
Closes: gt-c6zs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>