diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-11 20:02:18 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-11 20:02:18 -0500 |
| commit | 00fc6f10d132e61adde26613372cf845a5abe776 (patch) | |
| tree | f5b27dafb6f477c1eede25347f72e8eb797dd293 /todo.org | |
| parent | b405fff94d6ddcdd5b2278f20c327c583aad487d (diff) | |
| download | rulesets-00fc6f10d132e61adde26613372cf845a5abe776.tar.gz rulesets-00fc6f10d132e61adde26613372cf845a5abe776.zip | |
docs(spec): detection-first helper routing, no operator action needed
A second agent now discovers concurrency itself instead of being told: a stateless process scan (running agent processes, /proc cwd matched within the project root, own ancestry excluded) runs as the first action of every session, before any pull. Alone with no anchor is a fresh session, alone with an anchor is today's crash recovery, and not-alone skips startup and routes to helper-mode.org, the role-contract workflow. The scan also splits the previously ambiguous live-anchor signal into crashed versus concurrent primary.
Verified the signal live with four concurrent agents on this machine. The ai --helper launcher flag drops from mechanism to convenience. Known v1 limits recorded: sessions not running as local processes are invisible to the scan, and the match is process-cwd based.
Diffstat (limited to 'todo.org')
| -rw-r--r-- | todo.org | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -47,8 +47,11 @@ Cancelled 2026-06-11: Craig confirmed the decision — one todo queue with a sin :END: Implement Phase 1.5 of the generic-agent-runtime spec ([[file:docs/design/2026-05-28-generic-agent-runtime-spec.org][spec]], amended 2026-06-11 with the "Concurrent same-project agents" section). Craig's case: spawn a second Claude in the same project to look things up or update tasks safely while the primary works. The session-context split (AI_AGENT_ID + session-context.d/) already shipped; this builds the rest: -- =ai --helper= flag: live-anchor detection, auto AI_AGENT_ID + AI_HELPER export, tmux window naming, warn-and-run-normal when no primary is live. -- Shared-file read/write contract into protocols.org (helper: scoped single-heading org edits only; file-wide passes, inbox processing, and all git mutation stay primary-only); helper branches in startup.org (light path, no pulls/rsync) and wrap-it-up.org (archive own file, skip hygiene + commit). +- =agent-roster= detection script (the load-bearing piece, replaces operator action entirely): pgrep + /proc cwd match within project root + self-ancestry exclusion; verified live 2026-06-11 with 4 concurrent agents. Bats coverage. +- Startup detection-first: the roster check runs before Phase A.0's pulls; not-alone routes to the new =helper-mode.org= role contract and runs nothing else; alone keeps crashed-vs-fresh anchor logic (the roster also disambiguates crashed primary from live primary). +- =helper-mode.org= template workflow: identity self-assignment (helper-<rand4>, recorded in its own .d/ context file), the read/write tiers, light start, helper wrap-up. Auto-routed, no trigger phrase. +- =ai --helper= flag demoted to convenience: AI_AGENT_ID + AI_HELPER export, tmux window naming. +- Shared-file read/write contract into protocols.org pointing at helper-mode.org (helper: scoped single-heading org edits only; file-wide passes, inbox processing, and all git mutation stay primary-only); helper branches in startup.org (light path, no pulls/rsync) and wrap-it-up.org (archive own file, skip hygiene + commit). - Bats: launcher id assignment/sanitization, helper-vs-primary resolution, two simultaneous context files. - Data-integrity items (spec second pass, 2026-06-11): live-helper gate before any file-wide hygiene pass (todo-cleanup/lint-org/wrap-org-table check session-context.d/, pause + ask on live files, surface stale ones); todo-cleanup.el brought up to the backup-to-/tmp invariant (lint-org and wrap-org-table already conform — verified); log-before-write journaling for helper shared-file edits; memory writes primary-only (MEMORY.md has no heading anchors — helpers log candidates instead); agent id in helper-originated inbox-send slugs (minute-resolution filenames can collide). - Manual validation with Craig: live helper against a live primary — lookup, one scoped todo.org edit, wrap-up, primary commits the helper's edit cleanly. Then the corruption drill: primary attempts wrap-up while the helper is mid-task and the hygiene gate visibly pauses. |
