space-architect 5.5.1 → 7.0.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.
@@ -145,7 +145,12 @@ spec defect: kill the conflicting lane and re-spec; don't hand-resolve builder
145
145
  conflicts. It runs **no gates and makes no verdict** — `architect gate` streams
146
146
  the raw gate output for you to judge. `--teardown` deletes only the per-lane
147
147
  `lane/<iteration>-<lane>` branches and worktrees; it never deletes the
148
- `project/<slug>` branch.
148
+ `project/<slug>` branch. Every destructive lane operation — `worktree remove`,
149
+ `integrate --teardown`, and the re-point path of `provision --base` — refuses
150
+ per lane when that lane's worktree still holds uncommitted work, untracked
151
+ files included, because that's what a dispatched lane always holds; `--force`
152
+ overrides and discards it. The `--lanes <passing-set>` integration path itself
153
+ is unaffected — `integrate` commits each lane's work before tearing it down.
149
154
 
150
155
  Under the hood / manual fallback (one lane shown):
151
156
 
@@ -223,7 +228,7 @@ AC judgment into one later session.
223
228
 
224
229
  **Recipe:**
225
230
 
226
- Per iteration, freeze and dispatch as normal. In a fresh judging session, run
231
+ Per iteration, rehearse, freeze, and dispatch as normal. In a fresh judging session, run
227
232
  post-flight, integrate, and gate — but **withhold `architect verdict`**:
228
233
 
229
234
  ```bash
@@ -261,6 +266,66 @@ rests on a foundation that a later KILL at N would revert. Accept this coupling
261
266
  only consciously, and always judge oldest-first so a KILL stops you before you
262
267
  compound it.
263
268
 
269
+ ### Long-running sweep (detached, two-phase)
270
+
271
+ Use when a lane's own work *is* a long-running detached process — a 30–70
272
+ minute sweep, migration, or batch run the lane must launch, let run
273
+ unattended, and then audit once it exits. A metered builder session paying
274
+ tokens to sit in a poll loop is the wrong instrument for that wait: split the
275
+ lane across two builder sessions instead, one before the process runs and one
276
+ after.
277
+
278
+ **Recipe:**
279
+
280
+ 1. **Phase A — launch, prove liveness, stop deliberately.** The lane-prompt's
281
+ PHASE 2 tells the builder to launch the process detached (backgrounded and
282
+ redirected to a log file, survives the builder's own process exit), capture
283
+ its pid, prove it's alive with one command result (e.g. `ps -p <pid>` plus a
284
+ growing log tail — not an assertion), pre-structure the report with the
285
+ sections phase B will fill in, and end the session there — not mid-poll —
286
+ at:
287
+ ```
288
+ STATUS: SWEEP_RUNNING (pid <pid>, run dir <path>)
289
+ ```
290
+ `SWEEP_RUNNING` is the fixed token spec authors and architects grep for;
291
+ the pid and run dir ride in the same line because nothing else in the loop
292
+ captures them.
293
+
294
+ 2. **The wait belongs to the architect's harness, not the builder session.**
295
+ Between phase A and B, a process-exit monitor on the architect's side —
296
+ notification-driven, not a poll loop — watches for the pid to exit. A
297
+ builder session spends tokens to sit idle in a wait; the harness doesn't.
298
+ Do not dispatch a phase-B session, or resume one, until the process has
299
+ actually exited.
300
+
301
+ 3. **Phase B — resume and audit.** Once the process has exited, resume the
302
+ same lane worktree with `--continue` — the one sanctioned use of
303
+ `--continue` beyond same-lane follow-ups (see `## Operating guidance`
304
+ below) — and hand it the post-run audit as the new instruction:
305
+ ```bash
306
+ ( cd build/<id>-<lane>/wt && \
307
+ echo "The sweep at <run dir> (pid <pid>) has exited. Audit its output
308
+ against the spec's acceptance criteria, finish the report you
309
+ pre-structured in phase A, and end at STATUS: COMPLETE." \
310
+ | claude -p --continue --model <builder-model> \
311
+ --permission-mode acceptEdits \
312
+ --allowedTools 'Read,Edit,Write,Grep,Glob,Bash,WebSearch,WebFetch' \
313
+ --disallowedTools 'Bash(git commit:*),Bash(git push:*),Bash(git reset:*),Bash(git merge:*),Bash(git rebase:*),Bash(git checkout:*),Bash(git branch:*)' \
314
+ --output-format stream-json --verbose \
315
+ > build/<id>-<lane>/run-b.jsonl 2>&1 )
316
+ ```
317
+ Phase B runs the post-run audits the spec asked for, then finishes the
318
+ report at `STATUS: COMPLETE` (or `COMPLETE_WITH_CONCERNS`/`BLOCKED`, per the
319
+ template) exactly as any other lane would.
320
+
321
+ **Invariant:** phase A never ends mid-poll or at a pending status of its own
322
+ invention — it ends at `SWEEP_RUNNING` with the pid and run dir recorded, or
323
+ it's indistinguishable from a lane that gave up. Spec authors: an in-lane
324
+ "poll until it finishes" / "never end the session while it runs" instruction
325
+ loses to the template's no-busy-wait clause below every time a builder holds
326
+ both — write this two-phase shape into the lane spec instead of a poll
327
+ instruction.
328
+
264
329
  ## Operating guidance
265
330
 
266
331
  - Background each lane as its own harness task and let the **per-lane
@@ -273,13 +338,28 @@ compound it.
273
338
  <builder-model>`). A floating alias (a bare "latest"/tier tag) drifts to
274
339
  whatever ships next — fine interactively, but automations pin the full id so a
275
340
  model bump can't silently change builder behavior mid-project.
276
- - Effort = thinking budget. Claude Code has no per-invocation effort flag the
277
- way Codex exposed `model_reasoning_effort`; the builder sets thinking depth
278
- **in the block** via the escalation keywords (`think` < `think hard` <
279
- `think harder` < `ultrathink`), or you floor it with the `MAX_THINKING_TOKENS`
280
- env var on the dispatch. Default unattended builder work to a high budget
281
- (open the block with "Think harder…"); downgrade a routine,
282
- tightly-specified lane to "think hard" (record which and why in the spec).
341
+ - Effort = thinking budget. Set it per dispatch: `architect dispatch --effort
342
+ <level>` (aliases `--thinking`/`--reasoning`) accepts
343
+ `off`/`minimal`/`low`/`medium`/`high`/`xhigh`/`max` and translates it to the
344
+ lane's harness `claude-code` passes `low`…`max` straight through to its own
345
+ `--effort` flag, unclamped (`minimal` clamps to `low`; `off` omits the flag).
346
+ The escalation keywords (`think` < `think hard` < `think harder` <
347
+ `ultrathink`) and the `MAX_THINKING_TOKENS` env var still raise depth from
348
+ inside the block. Default unattended builder work to a high budget; downgrade
349
+ a routine, tightly-specified lane (record which and why in the spec).
350
+ - **Tool grant.** The default `--allowedTools` list is overridable per dispatch:
351
+ `--allowed-tools <list>` replaces it, `--append-allowed-tools <list>` appends
352
+ to it. The same is settable in the frozen lane declaration's ` ```lanes ` block
353
+ — `allowed_tools:` (replaces) / `append_allowed_tools:` (appends) — so a lane
354
+ that needs an MCP or other non-default tool is granted it reviewably, judged
355
+ like every other lane boundary, rather than buried in a shell invocation. The
356
+ CLI flag wins over the lane's yaml key when both are given, and dispatch
357
+ reports which source resolved. This exists because `claude -p` **denies** a
358
+ tool not on the allow list rather than prompting for it — a lane missing a
359
+ needed grant doesn't error, it silently can't use the tool and files a
360
+ confident, dataless report instead. `--disallowedTools`/`DISALLOWED_TOOLS`
361
+ (the builder-never-commits deny rules above) has no override route, by design
362
+ — hard rule 7 depends on it staying fixed.
283
363
  - **Builders never commit, and the architect verifies it.** Claude Code has no
284
364
  sandbox to make `.git` read-only, so this is enforced by the deny rules at
285
365
  dispatch *and* checked after the run: before integrating a lane, confirm
@@ -340,7 +420,10 @@ builders toward the repo's existing test fixtures over hand-rolled long-running
340
420
  harnesses, and when a gate needs a runtime that can't run unattended
341
421
  (interactive prompts, servers without a timeout), have the builder record the
342
422
  exact failure as a disagreement/blocker and verify what it can — gate verdicts
343
- are architect-run anyway (hard rule 4). Write the gate file anticipating this.
423
+ are architect-run anyway (hard rule 4). Write the gate file anticipating this
424
+ `architect rehearse` runs the drafted gates pre-freeze, so an unattended-hostile
425
+ gate surfaces as **BROKEN** while still editable (advisory: a correct RED can
426
+ look broken).
344
427
 
345
428
  ## Manual alternative (human-driven)
346
429
 
@@ -365,7 +448,11 @@ PHASE 1 — Treat the shared contracts (schemas/interfaces) named in the spec,
365
448
  and the repo's existing public interfaces, as FROZEN: do not change them —
366
449
  other lanes depend on them. You have no access to the space's architecture/
367
450
  directory; the architect owns it. The ACCEPTANCE CRITERIA below are frozen —
368
- verify your work against them; never weaken or work around them.
451
+ verify your work against them; never weaken or work around them. If an AC's
452
+ letter can only be satisfied by making the artifact worse than the property the
453
+ AC asserts, build the right thing and raise the conflict in your report — name
454
+ the AC, the conflict, and the evidence. This is not permission to skip work or
455
+ weaken a criterion: the conflict is reported, never silently resolved.
369
456
 
370
457
  PHASE 2 — Build YOUR LANE ONLY: exactly the files listed in BOUNDARIES. You
371
458
  are one of several parallel lane agents working in isolated worktrees; files
@@ -384,14 +471,24 @@ running the acceptance criteria's gate commands and record the verbatim output.
384
471
  git write command (commit/add/branch/reset/checkout) — the architect commits
385
472
  and merges after verification, and verifies you made no commits. Do NOT delete
386
473
  lock files or escalate privileges if a command fails; record the exact error
387
- and continue. Give every potentially long command an explicit timeout; if a
474
+ and continue. Do NOT use `run_in_background` (or shell `&`) for your own work —
475
+ this process terminates when you end your turn and reaps its own children, so
476
+ backgrounded work is SIGTERMed and its output lost while the run still exits
477
+ 0; run long commands serially in the foreground instead. Give every
478
+ potentially long command an explicit timeout; if a
388
479
  runtime will not start unattended (interactive prompt, server with no timeout),
389
480
  record the exact failure in your report and route around it — never busy-wait
390
- or retry in a loop. When done, write your report to the scratch file given to
481
+ or retry in a loop. The one sanctioned exception is a deliberate wait on a
482
+ detached process this lane itself launched: end that phase at
483
+ `STATUS: SWEEP_RUNNING` (pid + run dir) per `### Long-running sweep` in
484
+ dispatch.md, instead of polling for it to finish — this clause still forbids
485
+ retry loops and sitting on an unattended runtime with no timeout. When done, write your report to the scratch file given to
391
486
  you, build/<id>-<lane>/report.md (an absolute path outside your worktree),
392
487
  with RAW results only — tables, numbers, command output — no interpretation, no
393
488
  "promising". Every status claim must be backed by a command result from this
394
- run. Keep the report compact — tables and numbers, not prose. End it with
489
+ run. Keep the report compact — tables and numbers, not prose. Do not title the
490
+ report — the architect's tooling supplies the `### <lane>` heading when it
491
+ transcribes; keep any headings inside the report at `###` or deeper. End it with
395
492
  exactly one status line: STATUS: COMPLETE | COMPLETE_WITH_CONCERNS (list them)
396
493
  | BLOCKED (exact blocker + what you tried). Verdicts belong to the architect
397
494
  and the human. Persist until your lane is fully handled end-to-end; do not stop
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: 5.5.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Jacobs
@@ -361,6 +361,7 @@ files:
361
361
  - lib/space_src/state/store.rb
362
362
  - lib/space_src/sync/engine.rb
363
363
  - lib/space_src/sync/repo_plan.rb
364
+ - lib/space_src/sync/report.rb
364
365
  - lib/space_src/ui/interactive_reporter.rb
365
366
  - lib/space_src/ui/json_reporter.rb
366
367
  - lib/space_src/ui/mode.rb