Commit Graph

952 Commits

Author SHA1 Message Date
Steve Yegge
475dcb37fa gt sling: enable wisp spawning for patrol roles (gt-jsup)
Revert IsWisp: false → true for patrol spawning. bd mol run now
auto-discovers the main database for templates when --db contains
.beads-wisp, so patrol molecules can spawn correctly into ephemeral storage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:39:46 -08:00
Steve Yegge
41bf7da3af bd sync: 2025-12-23 16:39:32 2025-12-23 16:39:32 -08:00
Steve Yegge
521f5d6272 bd sync: 2025-12-23 16:31:08 2025-12-23 16:31:08 -08:00
Steve Yegge
901d0a1528 bd sync: 2025-12-23 16:29:05 2025-12-23 16:29:20 -08:00
Steve Yegge
58c0fae614 gt sling: use mail queue for patrol roles (gt-afn0)
When slinging work to patrol agents (witness, refinery, deacon), queue via
mail instead of replacing the hook. This preserves patrol continuity.

New behavior:
- Default: Check if patrol is running, start default patrol if not, send
  work via mail. Patrol processes queued work during its cycle.
- --urgent: Marks mail as urgent (🚨 URGENT prefix)
- --replace: Legacy behavior, explicitly terminates patrol (break-glass)

New helper functions:
- isPatrolRole(kind): Returns true for witness/refinery/deacon
- getDefaultPatrolMolecule(role): Returns patrol template name
- resolvePatrolMoleculeID(path, title): Looks up beads issue ID by title
- isPatrolRunning(path, addr): Checks if patrol molecule is attached

Note: Patrol spawning currently uses main DB (not wisp storage) because
templates must be looked up from the main database. Wisp support for
patrol instances is a future enhancement.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:24:55 -08:00
Steve Yegge
7b619b75d6 bd sync: 2025-12-23 16:24:52 2025-12-23 16:24:52 -08:00
Steve Yegge
b2bdb85ac4 bd sync: 2025-12-23 16:23:48 2025-12-23 16:23:48 -08:00
Steve Yegge
6806a6146b bd sync: 2025-12-23 16:13:05 2025-12-23 16:13:05 -08:00
Steve Yegge
419015b59b bd sync: 2025-12-23 16:08:22 2025-12-23 16:08:31 -08:00
Steve Yegge
fd8a5d028d bd sync: 2025-12-23 16:07:48 2025-12-23 16:08:31 -08:00
Steve Yegge
7f37d41da3 gt sling --force: return displaced work to ready pool (gt-o40t)
When slinging with --force to an agent with occupied hook, the displaced
molecule is now returned to the ready pool rather than silently orphaned.

Changes:
- Modified checkHookCollision to take force param and return displaced ID
- Added releaseDisplacedWork helper to unpin and release displaced molecules
- Updated all 5 sling handlers (polecat, crew, witness, refinery, mayor)

Behavior:
- Without --force: still errors "hook already occupied by X"
- With --force: prints warning, releases old work, proceeds with new sling

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:07:42 -08:00
Steve Yegge
5e093dadff Fix witness session to start in witness directory
The witness session was starting in the rig root (e.g., /gt/gastown)
instead of the witness directory (e.g., /gt/gastown/witness/rig).
This caused gt prime to detect the Mayor role instead of Witness role.

Now ensureWitnessSession uses the same pattern as ensureRefinerySession:
1. Try <rig>/witness/rig/ first (for rigs with worktree setup)
2. Fall back to <rig>/witness/ (for simpler setups)
3. Last resort: use rig root (shouldn't happen normally)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:07:23 -08:00
Steve Yegge
d507bf6516 bd sync: 2025-12-23 16:07:14 2025-12-23 16:07:14 -08:00
Steve Yegge
f61570c079 bd sync: 2025-12-23 16:05:40 2025-12-23 16:05:40 -08:00
Steve Yegge
7185d01911 bd sync: 2025-12-23 16:00:29 2025-12-23 16:00:29 -08:00
Steve Yegge
7caf3ff28e bd sync: 2025-12-23 15:57:06 2025-12-23 15:57:06 -08:00
Steve Yegge
143959943b bd sync: 2025-12-23 15:56:29 2025-12-23 15:56:39 -08:00
Steve Yegge
76697c5105 bd sync: 2025-12-23 15:05:40 2025-12-23 15:56:39 -08:00
Steve Yegge
3e72146673 Clarify molecule vs epic distinction in beads-data-plane.md
The document conflated epics and molecules. This revision:
- Explains molecules as the general abstraction for executable work
- Introduces the concept of molecular shapes (Epic, Christmas Ornament, etc.)
- Clarifies that epics are just ONE shape (a simple TODO list pattern)
- Adds the key insight: All epics are molecules. Not all molecules are epics.
- Explains why the data plane stores all shapes the same way
- Updates Related Documents with better descriptions

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:24:16 -08:00
Steve Yegge
c8bb8ac6b9 Add Dependency Trap warning to all gt prime role templates
Temporal language like "Phase 1 blocks Phase 2" triggers incorrect
dependency direction. Added a concise warning to all 6 role templates
(crew, polecat, mayor, witness, refinery, deacon) reminding agents:
- Think "X needs Y", not "X comes before Y"
- Verify with `bd blocked`

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:13:32 -08:00
Steve Yegge
683989dfd8 Add session-lifecycle.md: unified context cycling model
Documents foundational architecture for session lifecycle:
- Single-Bond Principle (one bead ≈ one session)
- Context Budget Model (what N-heuristics really proxy for)
- Unified cycling model across all roles
- Mid-step handoff mechanics
- Happy Path (decomposition) vs Sad Path (compaction)
- Oversized Bead Protocol

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:02:33 -08:00
Steve Yegge
c3e7baf3f9 Document session cycling protocol in templates (gt-5xph)
- Crew: Updated to use 'gt handoff' instead of manual mail
- Crew: Added note about relaxed cycling (no fixed heuristic)
- Polecat: Added note that 'gt handoff' redirects to 'gt done'

Patrol workers (Deacon, Witness, Refinery) already had their
N-rounds heuristics documented in previous commits.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:43:11 -08:00
Steve Yegge
3a8a81a59f bd sync: 2025-12-23 14:43:07 2025-12-23 14:43:07 -08:00
Steve Yegge
127fde8943 bd sync: 2025-12-23 14:35:29 2025-12-23 14:35:29 -08:00
Steve Yegge
cf16bfa309 bd sync: 2025-12-23 14:32:27 2025-12-23 14:35:16 -08:00
Steve Yegge
774bed3fba Fix beads architecture: two tiers with persistent+ephemeral each
Corrected from 'three-tier' to 'two-tier' model:
- Town level: persistent (.beads/) + ephemeral (.beads-wisp/)
- Rig level: persistent (.beads/) + ephemeral (.beads-wisp/)

Each tier has both durable and wisp storage, not three separate tiers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:35:03 -08:00
Steve Yegge
804dc75722 Update beads-data-plane.md with three-tier architecture
- Renamed from "Two-Level" to "Three-Tier" to include wisps
- Added rig wisps tier (.beads-wisp/) for ephemeral patrol state
- Clarified deacon uses town beads (not rig beads)
- Added git tracking status for each tier

Related: gt-ci84 (deacon wisp storage bug)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:29:27 -08:00
Steve Yegge
0a8234ba78 bd sync: 2025-12-23 14:29:18 2025-12-23 14:29:18 -08:00
Steve Yegge
d47f77aaa6 bd sync: 2025-12-23 14:27:54 2025-12-23 14:28:03 -08:00
Steve Yegge
d8745569f9 bd sync: 2025-12-23 14:23:01 2025-12-23 14:28:03 -08:00
Steve Yegge
3a6e0afe51 bd sync: 2025-12-23 14:17:00 2025-12-23 14:28:03 -08:00
Steve Yegge
54c82694d0 Add Beads Universal Data Plane documentation
Documents how beads serves as the universal data store for all agent
coordination: work molecules, mail messages, hooks, and inboxes are
all issues with consistent field semantics.

Key insights:
- Mail reuses assignee (to), title (subject), labels (from:)
- Hooks and inboxes are queries, not containers
- Two-level architecture: town beads (mail) vs rig beads (work)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:14:59 -08:00
Steve Yegge
884a26afa5 bd sync: 2025-12-23 14:14:48 2025-12-23 14:14:48 -08:00
Steve Yegge
d823ced14c refactor: Nuanced refinery context heuristic - 20 simple or immediate on complex (gt-nqrh)
Most MRs are button-pushes (clean rebase + push). Only complex rebases
(conflicts, test failures) consume significant context.

- 20 simple MRs before handoff
- Immediate handoff after any complex rebase

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:11:40 -08:00
Steve Yegge
366d3c8ca7 feat: Add context management heuristics to patrol role templates (gt-nqrh)
Each patrol role now has role-specific context management:
- Deacon: 20 loops or immediate on extraordinary action
- Witness: 15 polecats processed (spawns + nudges + decommissions)
- Refinery: 7 merge requests processed

Templates include state.json format and handoff instructions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:08:35 -08:00
Steve Yegge
ee2e0b566d bd sync: 2025-12-23 13:38:37 2025-12-23 14:08:35 -08:00
Steve Yegge
90de119a09 bd sync: 2025-12-23 13:38:14 2025-12-23 14:08:35 -08:00
Steve Yegge
c5d36ee395 bd sync: 2025-12-23 13:37:50 2025-12-23 14:08:35 -08:00
Steve Yegge
e7f2b295f9 bd sync: 2025-12-23 13:37:26 2025-12-23 14:08:35 -08:00
Steve Yegge
92c04042a6 bd sync: 2025-12-23 13:37:03 2025-12-23 14:08:35 -08:00
Steve Yegge
ced054b118 bd sync: 2025-12-23 13:36:40 2025-12-23 14:08:35 -08:00
Steve Yegge
f228b78382 bd sync: 2025-12-23 13:36:18 2025-12-23 14:08:35 -08:00
Steve Yegge
e7b631efcc bd sync: 2025-12-23 13:35:56 2025-12-23 14:08:35 -08:00
Steve Yegge
fbab402d89 bd sync: 2025-12-23 13:35:34 2025-12-23 14:08:35 -08:00
Steve Yegge
b7fd837258 bd sync: 2025-12-23 13:35:13 2025-12-23 14:08:35 -08:00
Steve Yegge
266818b117 bd sync: 2025-12-23 13:34:52 2025-12-23 14:08:35 -08:00
Steve Yegge
76914a6c57 bd sync: 2025-12-23 13:34:32 2025-12-23 14:08:35 -08:00
Steve Yegge
297a2f85d3 bd sync: 2025-12-23 13:34:12 2025-12-23 14:08:35 -08:00
Steve Yegge
9c85b834cd Support full session paths in gt handoff (gt-tocb)
resolveRoleToSession now accepts paths like <rig>/crew/<name>,
<rig>/witness, and <rig>/refinery in addition to role shortcuts.
For example: 'gt handoff gastown/crew/max' now works.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:25:59 -08:00
Steve Yegge
e804d4d52d bd sync: 2025-12-23 13:25:47 2025-12-23 13:25:47 -08:00