space-architect 9.1.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,53 @@
1
1
  # Builder dispatch reference
2
2
 
3
+ ## The coordinator path (default) — how builders actually launch
4
+
5
+ When a plan runs under the coordinator (see SKILL.md §Starting a loop), the
6
+ coordinator itself spawns each role as a **pi subagent** — native async
7
+ completion wakes, not `architect dispatch` headless runs. Per iteration:
8
+
9
+ 1. **spec** — agent `architect-spec`, cwd = the space root, task = the plan
10
+ ENTRY verbatim. Writes Grounds/Specification/Acceptance Criteria via
11
+ `architect section`, rehearses, freezes, assembles each lane's prompt in a
12
+ scratch file, records the scratch paths in its report, and writes the
13
+ `notes/spec-digest-*` handoff. `timeoutMs` 3600000 (1h).
14
+ 2. **provision** — the coordinator runs `architect provision <iteration>` via
15
+ bash; the CLI materializes every declared lane's worktree + lane branch.
16
+ 3. **prompt copy** — the coordinator copies each spec-assembled scratch prompt
17
+ to `build/<id>-<lane>/prompt.md` (canonical path, CLI-owned in the
18
+ interactive path; the coordinator's `cp` is the sanctioned equivalent).
19
+ 4. **builder per lane** — agent `architect-builder`, cwd = that lane's
20
+ worktree, task = read `build/<id>-<lane>/prompt.md` before anything else.
21
+ `timeoutMs` 7200000 (2h). The lane-prompt template below is the contract
22
+ the spec assembles against.
23
+ 5. **judge** — agent `architect-judge`, cwd = the space root, task = judge the
24
+ iteration by id. `timeoutMs` 7200000 (2h). The judge is a fresh session —
25
+ §1 fresh-session judgment holds structurally: the judge session never
26
+ dispatched or built anything.
27
+ 6. **narrator** — one `architect-narrator` spawn per settled event
28
+ (builders-settled, judge-settled, verdict-landed, exception, plan-complete),
29
+ `timeoutMs` 300000 (5m), best-effort, never a gate on the loop.
30
+
31
+ Spawn contract (all paths): every spawn pins its model explicitly
32
+ (provider/id[:thinking]) and carries an explicit `timeoutMs` — never the
33
+ 30-minute default. A child that hit its timeout is **replaced in-place, never
34
+ resumed** (upstream resume of a timed-out session fails deterministically):
35
+ exactly one replacement, same cwd, larger `timeoutMs`, and auditing the
36
+ inherited uncommitted diff is its first task. Infrastructure death (failed to
37
+ start, crashed before work) gets one relaunch. Anything unrootable is an
38
+ exception: `notes/exception-<ts>.md`, narrate, terminate — no improvised
39
+ repairs.
40
+
41
+ The coordinator never edits files except its own `notes/` reports and never
42
+ writes into `architecture/`.
43
+
44
+ `architect dispatch` (everything below) remains the **interactive-path**
45
+ mechanism — and the reference implementation of the lane contract the
46
+ coordinator's spawns inherit (same prompt template, same builder guard
47
+ discipline — interactive dispatch injects the guard via `-e`; a coordinator
48
+ spawn relies on the playbook's no-git-writes rule plus the judge's post-flight
49
+ `git log` check, which stays the authoritative proof in both paths).
50
+
3
51
  Verified against `pi` 1.1.0 (badlogic/pi-mono) headless print mode — the reference
4
52
  harness. The builder is `pi -p` (`--print`, the non-interactive mode) pinned to
5
53
  the configured builder model (`<builder-model>`) — a cheaper model run headless
@@ -29,9 +77,14 @@ not airtight (a builder can shell out — `sh -c 'git commit …'` — past the
29
77
  parse), so the post-flight `git log` is what the loop actually trusts.
30
78
  If a lane committed, treat the worktree as tampered: reset and re-dispatch.
31
79
 
32
- **Preflight (once per environment):** run `pi --version`, and confirm the
80
+ **Preflight (once per environment):** run `pi --version`, confirm the
33
81
  builder model resolves with a one-message probe
34
- (`echo ok | pi -p --model <builder-model>`). No API-key/env ceremony — provider
82
+ (`echo ok | pi -p --model <builder-model>`), confirm the role playbooks are
83
+ installed (`architect install-agents` — once per machine, idempotent), and
84
+ for a coordinator run confirm the routing config resolves — an
85
+ `architect.yaml` role pinning a model the registry doesn't know throws loudly
86
+ at /loop pre-flight, before any spawn (/loop pre-flight does this for you).
87
+ No API-key/env ceremony — provider
35
88
  config (e.g. the Fireworks key) resolves from `~/.pi/agent`; pi needs no
36
89
  `ANTHROPIC_*` env. Past that one-time check, no dispatch needs a manual
37
90
  start-check: every foreground dispatch self-verifies. Shortly after launch it
@@ -154,17 +207,19 @@ The guard is a first line, not a sandbox — the post-flight `git log` check
154
207
  ### Integration (judging session — after per-lane post-flight passes)
155
208
 
156
209
  This block runs in the judging session, not the dispatch session — the dispatch
157
- session's job ends when builders finish (see SKILL.md §5–6). You decide which
210
+ session's job ends when builders finish (see SKILL.md §Interactive path). You decide which
158
211
  lanes pass; the CLI does the git mechanics. Canonical path:
159
212
 
160
213
  ```bash
161
214
  architect integrate <iteration> --lanes <passing-set> # e.g. --lanes lane-a,lane-b
162
- architect gate <iteration> # integration smoke (raw output; verdict stays yours)
215
+ architect gate <iteration> # integration smoke — writes the full transcript to
216
+ # build/gate/<id>-<ts>.md and prints the path; the
217
+ # inline report is bounded, the file is the record
163
218
  architect integrate <iteration> --lanes <passing-set> --teardown # or remove worktrees + lane branches after
164
219
  # end of project: landing is the architect's, not a CLI command — write the PR
165
220
  # body to a fresh build/land/<repo>-pr-body-<yyyymmdd-hhmm>.md yourself, then
166
221
  # present the paste-and-run block (cd, git push -u origin project/<slug>,
167
- # gh pr create) — see SKILL.md §6
222
+ # gh pr create) — see SKILL.md §After a loop lands
168
223
  ```
169
224
 
170
225
  `architect integrate` commits each named lane on its branch and merges it
@@ -184,6 +239,9 @@ per lane when that lane's worktree still holds uncommitted work, untracked
184
239
  files included, because that's what a dispatched lane always holds; `--force`
185
240
  overrides and discards it. The `--lanes <passing-set>` integration path itself
186
241
  is unaffected — `integrate` commits each lane's work before tearing it down.
242
+ `architect gate` never evaluates — it streams raw output for the judging
243
+ session to read; its transcript file (`build/gate/…`) holds every gate's
244
+ complete stdout/stderr when the terminal report has been trimmed.
187
245
 
188
246
  Under the hood / manual fallback (one lane shown):
189
247
 
@@ -369,6 +427,11 @@ instruction.
369
427
  blocking `while pgrep …; sleep` wait loop as a Bash command — that is itself
370
428
  a launcher that ties up a turn. When you return to a lane, check liveness via
371
429
  run-log growth (the stall rules below still apply unchanged).
430
+ - Visibility while anything runs: `architect looplog` follows every active
431
+ subagent run in the space (transcripts from pi's sessions dir and the
432
+ space's `build/` tree); `--list` inventories without following;
433
+ `architect runlog build/<id>-<lane>/run.jsonl` pretty-prints one dispatch
434
+ event stream (or streams it: `tail -f … | architect runlog`).
372
435
  - Pin the model explicitly. The tool does this automatically (`--model
373
436
  <builder-model>`). A floating alias (a bare "latest"/tier tag) drifts to
374
437
  whatever ships next — fine interactively, but automations pin the full id so a
@@ -457,6 +520,14 @@ Paste the lane-prompt into an interactive `pi` session (no `-p`). pi's agent
457
520
  loop runs plan→act→test against the block's stopping condition while you watch
458
521
  and steer. Use when the human wants to babysit a run.
459
522
 
523
+ A coordinator can be launched the same way when /loop is unavailable: spawn
524
+ the agent `architect-coordinator` (role agents resolve from
525
+ `~/.pi/agent/agents/`, user-level, installed by `architect install-agents` —
526
+ no project trust involved) with cwd = the space root, the plan text verbatim
527
+ as the task, the coordinator's model pin from `architect.yaml` in the spawn's
528
+ model field, and `timeoutMs` 43200000 (12h) — the exact contract
529
+ `coordinatorSpawnScript` in architect-loop.ts assembles.
530
+
460
531
  ## Lane-prompt template
461
532
 
462
533
  ```
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: architect-plan
3
+ description: "Plan work for the architect loop and launch it as an autonomous coordinator run (/loop). Use when the user's intention is to START a loop: planning iterations, writing the plan doc (notes/plan-*.md), pinning role routing, launching the coordinator, and watching it run. For general architecture work without launching a loop (arbitration, judging, landing, iteration surgery, conversation), use /architect instead."
4
+ ---
5
+
6
+ # Architect Plan
7
+
8
+ You are the ARCHITECT planning a coordinator run. The deliverable of this
9
+ skill is exactly one thing: a committed plan doc and a launched coordinator.
10
+ The loop's roles (spec → builders → judge, driven by the coordinator) do
11
+ everything after that — you never absorb a builder wakeup.
12
+
13
+ Read `/architect` (the main skill) first for roles, routing, and the hard
14
+ rules. This skill covers only the start.
15
+
16
+ ## Procedure
17
+
18
+ 1. **Ground (never skip).**
19
+ - `architect status` — iteration/verdict state; anything in flight?
20
+ - `architect looplog --list` — is a loop already running? Fresh transcripts
21
+ mean a live loop: don't double-start; report and ask.
22
+ - Read `architecture/ARCHITECT.md` (TOC + backlog), `architecture/BRIEF.md`
23
+ (the durable §-contract — cite it as BRIEF §N), the in-flight iteration
24
+ file if any, and the latest `notes/spec-digest-*.md` (the previous spec's
25
+ handoff: verification commands actually used, repo seams, house
26
+ conventions, open unknowns — carry its facts forward or they are lost).
27
+ - Read the target repo's `AGENTS.md`/`CLAUDE.md` → `README.md` → docs;
28
+ confirm the exact verification gate command.
29
+ - Learn the verification gate (test/lint/typecheck/build) from docs or CI
30
+ config — the plan's acceptance direction must name it.
31
+ 2. **Scale the work.** Trivial fixes don't need the loop — say so and do it
32
+ inline. One PR-sized iteration = one ENTRY. Multi-iteration plans get
33
+ ordered ENTRYs (the coordinator works them in order, skipping finished
34
+ ones). If the open question is too uncertain to build, make the ENTRY a
35
+ spike (investigate-only; deliverable is a recommendation — see /architect).
36
+ 3. **Write the plan doc** to `notes/plan-<UTC timestamp>-<name>.md`:
37
+
38
+ ```markdown
39
+ # Plan — <name> (<one line>)
40
+
41
+ Operator plan <date>. <Repos/lanes in scope.>
42
+
43
+ Standing context the spec needs: prior iterations this builds on, routing
44
+ pins, and the post-landing follow-ups (outside-the-loop work the plan
45
+ deliberately excludes — name it so it isn't lost).
46
+
47
+ ## ENTRY N — iteration <name> (repo: <repo>, <lane count> lane(s))
48
+
49
+ **Objective.** What to build and why — the reason, not just the ask. Cite
50
+ BRIEF §N. If this ENTRY pins model/thinking for a role, say it here (the
51
+ coordinator passes it in that spawn's model field).
52
+
53
+ **Grounds to read.** Exact paths: research/bug reports, source files being
54
+ ported, seam files, prior verdicts. The spec reads these before writing a
55
+ word.
56
+
57
+ **Acceptance direction (spec refines into frozen AC).** The properties the
58
+ finished iteration must have — at the level the spec can freeze, not
59
+ pre-written gates (freezing is the spec's job).
60
+
61
+ **Constraints.** Repos; files that must not change; out-of-scope;
62
+ house-style expectations; what the lane must NOT delete or move (say so
63
+ when a port is replacing something that lives elsewhere).
64
+ ```
65
+
66
+ Each ENTRY must be self-contained — the spec agent receives the entry
67
+ verbatim and nothing else. Put the verification gate command in ENTRY
68
+ constraints or grounds.
69
+ 4. **Pin routing if needed.** This plan's models come from `architect.yaml`
70
+ (space root overrides `~/.config/space-architect/architect.yaml` per role).
71
+ A one-plan pin goes in the plan header/ENTRY (the coordinator passes it in
72
+ that spawn's model field); a standing change edits `architect.yaml` —
73
+ routing rides the spawn contract and `/loop` resolves it at launch, so
74
+ there are no generated agent files to hand-sync (the role playbooks are
75
+ static, user-level, installed once by `architect install-agents`).
76
+ 5. **Commit the plan doc** to the space — an uncommitted plan is scratch, and
77
+ decision-bearing documents live in `notes/` (not-committed = didn't
78
+ happen).
79
+ 6. **Launch.** From an interactive pi session at the space root:
80
+
81
+ ```
82
+ /loop --from notes/plan-<ts>-<name>.md
83
+ ```
84
+
85
+ `/loop` refuses an empty plan, resolves the routing config (validates
86
+ every pin against the model registry — a pin it doesn't know throws
87
+ loudly, before any spawn — and injects the per-role pins into the
88
+ coordinator's task), and spawns `architect-coordinator` detached — your
89
+ session may end; the coordinator (12h ceiling) works the plan, narrating
90
+ every settled event to `notes/narrative-*.md`. If pi-subagents' RPC is not
91
+ up in the session, /loop says so — spawn the coordinator directly instead
92
+ (agent `architect-coordinator`, the space as cwd, the plan text verbatim as
93
+ the task, the coordinator's model pin from `architect.yaml`, `timeoutMs`
94
+ 43200000).
95
+ 7. **Report the handoff, then stop.** Tell the human: the plan path, the
96
+ coordinator run id, and how to watch —
97
+ `architect looplog` (live), `--list` (inventory),
98
+ `architect status`, `architect cost`. Escalations route through the
99
+ coordinator to your supervisor seat: rule and the coordinator steers; if
100
+ your session won't stay alive, say so — a coordinator with no listener
101
+ parks the question in `notes/escalation-<ts>.md` and stops via the exception
102
+ path rather than improvising.
103
+
104
+ ## Failure modes to check before launching
105
+
106
+ - **Frozen-region edits** — never edit `architecture/` directly; the plan
107
+ steers, the spec writes sections via the CLI.
108
+ - **Stale base** — outside-the-loop commits that landed on a repo's main since
109
+ the last provision are fine (`architect provision` fast-forward-syncs
110
+ `project/<slug>` from the default branch or refuses loudly on divergence);
111
+ a deliberately diverged integration branch must be named in the plan.
112
+ - **Stale gem / extension** — if the plan exercises CLI behavior newer than
113
+ the installed gem, note the rebuild in standing context: a config that
114
+ moved ahead of the installed CLI rejects every command.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: space-architect
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.1.0
4
+ version: 9.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Jacobs
@@ -186,11 +186,13 @@ files:
186
186
  - lib/space_architect/cli/architect.rb
187
187
  - lib/space_architect/cli/research.rb
188
188
  - lib/space_architect/conversations_client.rb
189
+ - lib/space_architect/extension_installer.rb
189
190
  - lib/space_architect/gate_evaluator.rb
190
191
  - lib/space_architect/gate_lint.rb
191
192
  - lib/space_architect/harness.rb
192
193
  - lib/space_architect/jobs_client.rb
193
194
  - lib/space_architect/loop_cost.rb
195
+ - lib/space_architect/looplog.rb
194
196
  - lib/space_architect/pi/builder-guard.ts
195
197
  - lib/space_architect/research.rb
196
198
  - lib/space_architect/research/mux.rb
@@ -201,6 +203,7 @@ files:
201
203
  - lib/space_architect/research/supervisor.rb
202
204
  - lib/space_architect/routing.rb
203
205
  - lib/space_architect/run_creator.rb
206
+ - lib/space_architect/runlog.rb
204
207
  - lib/space_architect/session_sync.rb
205
208
  - lib/space_architect/session_sync/bin_path.rb
206
209
  - lib/space_architect/session_sync/cursor.rb
@@ -208,10 +211,12 @@ files:
208
211
  - lib/space_architect/session_sync/runner.rb
209
212
  - lib/space_architect/session_sync/session_id.rb
210
213
  - lib/space_architect/skill_installer.rb
214
+ - lib/space_architect/space_push.rb
211
215
  - lib/space_architect/templates/architect.md.erb
212
216
  - lib/space_architect/templates/brief.md.erb
213
217
  - lib/space_architect/templates/iteration.md.erb
214
218
  - lib/space_architect/version.rb
219
+ - skill/architect-plan/SKILL.md
215
220
  - skill/architect-research/SKILL.md
216
221
  - skill/architect-research/lanes.md
217
222
  - skill/architect-vocabulary/SKILL.md