space-architect 7.1.0 → 9.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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +108 -0
  3. data/README.md +58 -246
  4. data/lib/space_architect/architect_project.rb +40 -180
  5. data/lib/space_architect/bug_report.rb +2 -1
  6. data/lib/space_architect/cli/architect.rb +69 -103
  7. data/lib/space_architect/cli/research.rb +1 -1
  8. data/lib/space_architect/cli.rb +9 -14
  9. data/lib/space_architect/harness.rb +97 -344
  10. data/lib/space_architect/pi/builder-guard.ts +103 -0
  11. data/lib/space_architect/research/mux.rb +47 -32
  12. data/lib/space_architect/research/pi_events.rb +70 -0
  13. data/lib/space_architect/research/renderer.rb +39 -39
  14. data/lib/space_architect/research/supervisor.rb +35 -14
  15. data/lib/space_architect/research.rb +1 -6
  16. data/lib/space_architect/session_sync/bin_path.rb +1 -1
  17. data/lib/space_architect/session_sync/cursor.rb +1 -1
  18. data/lib/space_architect/session_sync/plist.rb +1 -1
  19. data/lib/{space_core → space_architect}/version.rb +2 -2
  20. data/lib/space_architect.rb +1 -2
  21. data/skill/architect/SKILL.md +30 -25
  22. data/skill/architect/dispatch.md +137 -115
  23. data/skill/architect/research.md +14 -8
  24. data/skill/architect-research/SKILL.md +18 -11
  25. data/skill/architect-vocabulary/SKILL.md +3 -3
  26. metadata +20 -178
  27. data/exe/space +0 -13
  28. data/exe/src +0 -13
  29. data/lib/space_architect/cli/space.rb +0 -29
  30. data/lib/space_architect/cli/src.rb +0 -38
  31. data/lib/space_architect/dispatcher.rb +0 -25
  32. data/lib/space_core/atomic_write.rb +0 -21
  33. data/lib/space_core/cli/base_command.rb +0 -19
  34. data/lib/space_core/cli/build.rb +0 -27
  35. data/lib/space_core/cli/config.rb +0 -49
  36. data/lib/space_core/cli/current.rb +0 -16
  37. data/lib/space_core/cli/help.rb +0 -195
  38. data/lib/space_core/cli/helpers.rb +0 -115
  39. data/lib/space_core/cli/init.rb +0 -29
  40. data/lib/space_core/cli/list.rb +0 -24
  41. data/lib/space_core/cli/loop_status.rb +0 -47
  42. data/lib/space_core/cli/new.rb +0 -38
  43. data/lib/space_core/cli/pack.rb +0 -29
  44. data/lib/space_core/cli/path.rb +0 -16
  45. data/lib/space_core/cli/repeatable_options.rb +0 -84
  46. data/lib/space_core/cli/repo.rb +0 -76
  47. data/lib/space_core/cli/run.rb +0 -44
  48. data/lib/space_core/cli/shell.rb +0 -125
  49. data/lib/space_core/cli/show.rb +0 -21
  50. data/lib/space_core/cli/status.rb +0 -74
  51. data/lib/space_core/cli/use.rb +0 -17
  52. data/lib/space_core/cli.rb +0 -177
  53. data/lib/space_core/commands.rb +0 -51
  54. data/lib/space_core/config.rb +0 -152
  55. data/lib/space_core/errors.rb +0 -14
  56. data/lib/space_core/git_client.rb +0 -49
  57. data/lib/space_core/mise_client.rb +0 -37
  58. data/lib/space_core/oci_builder.rb +0 -56
  59. data/lib/space_core/oci_packer.rb +0 -103
  60. data/lib/space_core/oci_runner.rb +0 -89
  61. data/lib/space_core/paths.rb +0 -58
  62. data/lib/space_core/repo_reference.rb +0 -19
  63. data/lib/space_core/repo_resolver.rb +0 -167
  64. data/lib/space_core/shell_integration.rb +0 -438
  65. data/lib/space_core/slugger.rb +0 -16
  66. data/lib/space_core/space.rb +0 -174
  67. data/lib/space_core/space_store.rb +0 -319
  68. data/lib/space_core/state.rb +0 -86
  69. data/lib/space_core/templates/oci/dockerfile.erb +0 -73
  70. data/lib/space_core/templates/oci/dockerignore.erb +0 -17
  71. data/lib/space_core/templates/oci/entrypoint.sh.erb +0 -16
  72. data/lib/space_core/terminal.rb +0 -161
  73. data/lib/space_core/warnings.rb +0 -13
  74. data/lib/space_core/xdg.rb +0 -33
  75. data/lib/space_core.rb +0 -26
  76. data/lib/space_src/cli/clone.rb +0 -54
  77. data/lib/space_src/cli/config.rb +0 -65
  78. data/lib/space_src/cli/daemon.rb +0 -362
  79. data/lib/space_src/cli/options.rb +0 -21
  80. data/lib/space_src/cli/org.rb +0 -199
  81. data/lib/space_src/cli/repo.rb +0 -169
  82. data/lib/space_src/cli/shell.rb +0 -121
  83. data/lib/space_src/cli/status.rb +0 -75
  84. data/lib/space_src/cli/sync.rb +0 -161
  85. data/lib/space_src/cli.rb +0 -159
  86. data/lib/space_src/cloner.rb +0 -77
  87. data/lib/space_src/config/contract.rb +0 -54
  88. data/lib/space_src/config/duration.rb +0 -79
  89. data/lib/space_src/config/model.rb +0 -49
  90. data/lib/space_src/config/store.rb +0 -156
  91. data/lib/space_src/forge/client.rb +0 -31
  92. data/lib/space_src/forge/github.rb +0 -98
  93. data/lib/space_src/launchd/agent.rb +0 -195
  94. data/lib/space_src/launchd/plist.rb +0 -129
  95. data/lib/space_src/log_rotator.rb +0 -46
  96. data/lib/space_src/migration.rb +0 -43
  97. data/lib/space_src/nav.rb +0 -99
  98. data/lib/space_src/paths.rb +0 -72
  99. data/lib/space_src/scm/client.rb +0 -87
  100. data/lib/space_src/scm/git.rb +0 -232
  101. data/lib/space_src/scm/status.rb +0 -24
  102. data/lib/space_src/shell.rb +0 -90
  103. data/lib/space_src/shell_integration.rb +0 -321
  104. data/lib/space_src/state/lock.rb +0 -59
  105. data/lib/space_src/state/store.rb +0 -140
  106. data/lib/space_src/sync/engine.rb +0 -503
  107. data/lib/space_src/sync/repo_plan.rb +0 -215
  108. data/lib/space_src/sync/report.rb +0 -18
  109. data/lib/space_src/ui/interactive_reporter.rb +0 -280
  110. data/lib/space_src/ui/json_reporter.rb +0 -39
  111. data/lib/space_src/ui/mode.rb +0 -68
  112. data/lib/space_src/ui/plain_reporter.rb +0 -53
  113. data/lib/space_src/ui/reporter.rb +0 -48
  114. data/lib/space_src/version.rb +0 -7
  115. data/lib/space_src.rb +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17559f544d11b36996a3e8f927a8e4c9d2db3f178687c726fee14793c7ec6de4
4
- data.tar.gz: 5b7c00fc0748f05e5c557339d011f3583816399a2261c79ae45e93e3f9e78ae5
3
+ metadata.gz: 02caeb5cc690ab3d847e54fed5eb88c1493fa2402ace662ef7f25d2aeb4d055b
4
+ data.tar.gz: 5fa1fc73aaf8e912a74b1daf36e392c4d8afdc19cf1e6af22cc94702ef4146fd
5
5
  SHA512:
6
- metadata.gz: db1f7cf0ed0ce5401483b7f3e2e429e5caf2200d1baeb450940f6afddd017744bd449a5b05dc2cfbbfc70787967ec01b6542adbd301c69e470917f6b8887f41c
7
- data.tar.gz: b1c4fb81c6eeb1c9158e77a4e75aa21e01d4d77ac203e448c8ba564c76c2977bff9959fb481f480858a647f52262f3bcc516743220f6113d8a17c3f614f0f5fc
6
+ metadata.gz: b0f3278ba088effaba68eb1942872bb38dc7b73301bc7f0c5229ab773a69174da531d76009a2725912ab2615c67f1b6321ac3e20648e919adfd471e8a41eb309
7
+ data.tar.gz: 550862ccc0030a536896d219c2645c7194ec56357eebe9ae3eb08024811b60aca7fd857fd2e86daa80a406fa54e0050b922f80926ea66a14fcbb6fa71bcfda5b
data/CHANGELOG.md CHANGED
@@ -5,6 +5,114 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [9.0.0] - 2026-10-09
9
+
10
+ ### Changed
11
+
12
+ - **The split: space-architect is now the Architect Loop only.** The monolith
13
+ carved the space tool and the evergreen engine into their own gems —
14
+ **space-cadet** 9.0.0 (`Space::Core`, the `space` binary) and **repo-tender**
15
+ 1.0.0 (`RepoTender`, the `repo-tender` binary with the deprecated `src`
16
+ shim) — and this gem consumes them as libraries instead of vendoring them.
17
+ Dropped: the vendored `lib/space_core` / `lib/space_src` subtrees, the
18
+ `exe/space` and `exe/src` binaries, and the `architect space …` / `architect
19
+ src …` forwarder intercepts. `architect space …` / `architect src …` are now
20
+ ordinary unknown commands (dry-cli usage + non-zero exit) — the `space`
21
+ binary comes from space-cadet and the `src` binary from repo-tender; re-point
22
+ 8.x scripts and aliases accordingly.
23
+ - **Upgrading from 8.x:** `gem uninstall space-architect` first — the 8.x gem's
24
+ `space` and `src` executables collide with the ones the new gems ship — then
25
+ `gem install space-architect` (pulls space-cadet) and, for the session-sync
26
+ rail, `gem install repo-tender`. Config/state: space-cadet ≥ 9.1 migrates the
27
+ substrate's `config.yml`/`state.yml` from the old
28
+ `~/.config|state/space-architect/` dirs automatically on first run of either
29
+ `space` or `architect` (on 9.0.0, move them across by hand); the loop's own
30
+ session-sync cursor stays where it is.
31
+ - **Host-branded help header.** `architect --help`'s root header now brands
32
+ the loop (`architect 9.0.0 — …`) via space-cadet's product-name/version seam
33
+ instead of the substrate's identity — hence the `space-cadet ~> 9.1`
34
+ dependency floor.
35
+ - **Own version line.** The loop's version is now
36
+ `Space::Architect::VERSION = "9.0.0"` (`lib/space_architect/version.rb`) —
37
+ its first, decoupled from `Space::Core::VERSION`. The gemspec version,
38
+ `architect --version`, the bug-report diagnostics, and the bug-report command
39
+ footer all derive from the loop's own constant; the bug report additionally
40
+ lists `space-cadet: <version>` as a dependency diagnostic.
41
+ - **Dependency posture.** Hard dependency: `space-cadet ~> 9.0`. The declared
42
+ set shrank to what the loop itself requires (`async-http`, `async-process`,
43
+ `protocol-http`, `pastel`, `dry-cli`, `dry-monads`, `dry-validation` — `xdg`,
44
+ `tty-cursor`, `dry-struct`/`dry-types`, and bare `async` were the vendored
45
+ trees' deps, not the loop's). repo-tender is deliberately **not** a gemspec
46
+ runtime dependency: the `sessions agent` launchd seam requires it lazily and,
47
+ when the gem is absent, fails with a short actionable error naming the fix
48
+ (`gem install repo-tender`) instead of a LoadError backtrace. The dev
49
+ Gemfile includes repo-tender so the suite exercises the real integration.
50
+ - **Tests and mutation subjects classified, not carried.** Tests whose subject
51
+ was the vendored tools' functionality (everything under `test/space_core/`
52
+ and `test/space_src/`, the forwarder tests, the space-tool surface,
53
+ shell-integration, slugger, repo-resolver, warnings) dropped with the code —
54
+ their coverage lives in the two gems. Loop tests keep running against the
55
+ gem-served `Space::Core`; fixture setup routes through the gem's own CLI.
56
+ The `:mutant` task now subjects `Space::Architect::GateEvaluator` and
57
+ `Space::Architect::GateLint` only.
58
+ - **Docs and skills updated to the split reality** (README, command reference,
59
+ releasing guide, design doc, skills): one binary, two gem dependencies, no
60
+ forwarders or vendored subtrees.
61
+
62
+ ## [8.0.0] - 2026-10-09
63
+
64
+ ### Changed
65
+
66
+ - **pi is the only dispatch harness.** The `claude-code` and `opencode`
67
+ backends are deleted, along with everything that only served them: the
68
+ per-harness `DEFAULT_MODELS` map (one `Harness::DEFAULT_MODEL`:
69
+ `accounts/fireworks/models/glm-5p3-flash`), the three-way thinking-level
70
+ dispatch, the `--allowed-tools`/`--append-allowed-tools` flags and their
71
+ #89 resolution machinery (the frozen lanes block records `name`/`repo`/
72
+ `touch` only), `dispatch --as-job` with its `--host`/`--token`/
73
+ `--backend-url`/`--job-model`/`--api-key-ref` flags, and the backward-
74
+ compat `Dispatcher` wrapper. The `Harness.for` seam stays: any name but
75
+ `pi` — including a stored legacy harness in an old space.yaml — raises an
76
+ actionable error naming `pi` as the only valid harness. The push kwargs
77
+ (`--push-url`/`--push-token`/`--push-host`) and `--quiet` now apply to pi
78
+ dispatches, with liveness lines parsed from pi's own JSONL stream.
79
+ - **`PiHarness` reaches parity with the old default backend:** a liveness
80
+ line per run (first assistant-role JSONL event carrying `model`; OK when
81
+ it matches the pin, WARN on no growth / no assistant model within the
82
+ budget / pinned-vs-streamed mismatch; incremental scan, `--quiet`
83
+ suppressible), stdout tee through a pipe to the run log and — when push
84
+ is wired — streamed to the ingest endpoint, and TERM→grace→KILL timeout
85
+ escalation unchanged.
86
+ - **A vendored builder-guard extension ships with every dispatch.**
87
+ `lib/space_architect/pi/builder-guard.ts` is copied byte-for-byte into the
88
+ run's build dir and injected via `pi -e`, denying git-write subcommands
89
+ (parsed per command segment — `git -C <path> commit` is caught, `git log
90
+ --grep=commit` passes) and `bash -n`-unparseable commands before they run.
91
+ The deny reason tells the builder what was denied and what to do instead;
92
+ the architect CLI owns all commits.
93
+ - **Research runs run on pi too.** The research supervisor constructs a
94
+ `PiHarness` per run (sessions under `build/research/<id>/`), passes the
95
+ same vendored guard, and defaults to the pi default model; read-only
96
+ remains prompt-enforced. `run.detached` research classification keys off
97
+ pi's terminal assistant `stopReason` instead of a stream-json `result`
98
+ event.
99
+
100
+ ### Fixed
101
+
102
+ - **`architect research wait` works on pi runs.** `Research::Mux` and
103
+ `Research::Renderer` now speak pi's JSONL event vocabulary natively (the
104
+ last claude-code stream-json dialect in the gem): the tail breaks on
105
+ `agent_settled`, `wait` classifies via the last assistant `stopReason` plus
106
+ `agent_settled.aborted` and the final assistant text (no final text →
107
+ `:failed` "no final assistant text"), and the report is the final assistant
108
+ message's joined text blocks. The shared pi-shape predicates live in one
109
+ new module, `Research::PiEvents` (last assistant message/stopReason, joined
110
+ text, run span from `session.timestamp` → last assistant `timestamp`,
111
+ `turn_end` count) — `Supervisor#classify` consumes it too. The renderer's
112
+ §5.3 verbosity ladder, `--thinking`, and `--jsonl` passthrough are
113
+ unchanged, fed by pi events (`message_end`, `tool_execution_start/end`)
114
+ with the terminal line built from native facts (no fabricated fields).
115
+
8
116
  ## [7.1.0] - 2026-08-16
9
117
 
10
118
  One iteration of the Architect Loop (I01, space
data/README.md CHANGED
@@ -2,24 +2,28 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/space-architect.svg)](https://badge.fury.io/rb/space-architect)
4
4
 
5
- > **Task-scoped workspaces that double as Architect Loop projects — for humans and their agents!** ✨🛰️
5
+ > **The Architect Loop — structured judgment-and-build cycles for humans and their agents!** ✨🛰️
6
6
 
7
- `space-architect` is a Ruby toolkit for **spaces** — task-scoped project
8
- workspaces that hold repos, notes, and artifacts under one obvious filesystem
9
- root — fused with the **Architect Loop**: a structured judgment-and-build cycle
10
- for you and a fleet of headless AI builders. 🌌
7
+ `space-architect` is the gem behind the **Architect Loop**: a structured
8
+ judgment-and-build cycle for you and a fleet of headless AI builders, run
9
+ inside task-scoped **spaces** — directories that hold repos, notes, and
10
+ artifacts under one obvious filesystem root. 🌌
11
11
 
12
- The gem ships **three composable binaries** over clean library seams:
12
+ It installs **one executable**, `architect`. The spaces substrate and the
13
+ evergreen-checkout engine live in two sibling gems:
13
14
 
14
- | Binary | What it does | Library |
15
- |--------|--------------|---------|
16
- | **`space`** 🪐 | Create, manage & containerize task-scoped workspaces | `Space::Core` |
17
- | **`architect`** 🏗️ | Run the Architect Loop — judgment + headless builders | `Space::Architect` |
18
- | **`src`** 🌲 | Tend evergreen repo checkouts for copy-on-write provisioning | `Space::Src` |
15
+ | Gem | Dependency | What it provides |
16
+ |-----|------------|------------------|
17
+ | **space-cadet** | hard | The spaces substrate (`Space::Core`): create, manage & containerize task-scoped workspaces — the `space` binary — plus the copy-on-write evergreen-checkout substrate (`Cloner`, `SCM`) repos provision from |
18
+ | **repo-tender** | soft | Evergreen clone tending — the `repo-tender` binary (with the deprecated `src` shim) — and the launchd agent the `architect sessions agent` commands drive. Install with `gem install repo-tender` when you want the session-sync rail — everything else works without it |
19
19
 
20
- Each is a first-class executable. `architect` also forwards `architect space …`
21
- and `architect src …` to the other two, so a project can drive everything from
22
- one command when that's handier. 🎀
20
+ Until 8.x this gem was the monolith: it shipped `space`, `architect`, and `src`
21
+ binaries (and `architect space …` / `architect src …` forwarders) plus the
22
+ vendored `Space::Core` / `Space::Src` subtrees. The 9.0.0 split carved the
23
+ tools into their own gems; this gem is the loop only. If you're on 8.x, get
24
+ `space` from the **space-cadet** gem and `src` from **repo-tender** now — and
25
+ `gem uninstall space-architect` first: the 8.x gem's `space`/`src` executables
26
+ collide with the ones the new gems ship.
23
27
 
24
28
  ## What's a space? 🪐
25
29
 
@@ -37,10 +41,17 @@ everything a task needs:
37
41
  tmp/ # workspace-local temp — use this instead of /tmp
38
42
  ```
39
43
 
40
- Run a command from anywhere inside a space and it just works — `space` and
41
- `architect` walk up from `$PWD` until they find the nearest `space.yaml`. No
42
- "current space" state to get out of sync; where you *are* is the space you
43
- mean. 🧭
44
+ Run an `architect` command from inside a space and it just works — the loop
45
+ walks up from `$PWD` until it finds the nearest `space.yaml`. No "current
46
+ space" state to get out of sync; where you *are* is the space you mean. 🧭
47
+
48
+ Create and manage spaces with the **space-cadet** gem:
49
+
50
+ ```sh
51
+ space init # create XDG config + state files
52
+ space new "Name of Space" -r org/repo -r org/lib # blast off a new space 🚀
53
+ space list # see all your spaces
54
+ ```
44
55
 
45
56
  ## Installation 📦
46
57
 
@@ -58,25 +69,18 @@ Or grab it yourself:
58
69
 
59
70
  ```bash
60
71
  gem install space-architect
72
+ gem install repo-tender # optional: enables the sessions launchd agent
61
73
  ```
62
74
 
63
- The gem is `space-architect`; it installs three executables — `space`,
64
- `architect`, and `src`. 🎀
75
+ The gem installs one executable: `architect`. 🎀
65
76
 
66
77
  ## Quick start 🎀
67
78
 
68
79
  ```sh
69
- # Spaces
80
+ # Spaces (space-cadet gem)
70
81
  space init # create XDG config + state files
71
- space new "Name of Space" # blast off a new space 🚀
72
- space new "Name of Space" -r org/repo -r org/lib # …with repos cloned in (repeat -r)
73
- space list # see all your spaces
74
- space show # show the space you're standing in
75
-
76
- # Evergreen checkouts (copy-on-write sources for fast provisioning)
77
- src repo add github.com/example-org/example-app # tend it 🌲
78
- src sync # one sync pass
79
- src status # per-repo evergreen status
82
+ space new "Name of Space" -r org/repo -r org/lib # blast off a new space 🚀
83
+ space use 20260531-name-of-space # cd into a space by id
80
84
 
81
85
  # Architect Loop (run from inside a space)
82
86
  architect install-skills # install agent skills (once per machine)
@@ -84,157 +88,8 @@ architect init # scaffold ARCHITECT.md + arch
84
88
  architect new my-feature # scaffold the next iteration file
85
89
  architect freeze my-feature # lock the Acceptance Criteria ❄️
86
90
  architect dispatch my-feature lane-a # send a headless builder to work
87
-
88
- # Containers (run from inside a space) — a portable, reproducible-by-SHA image of the space
89
- space pack # render build/oci/ (Dockerfile + entrypoint)
90
- space build # pack + build & tag <space-id>:<git-sha>
91
- space run # run it — login shell, auth from your env
92
91
  ```
93
92
 
94
- ## `space` — task-scoped workspaces 🌌
95
-
96
- ```sh
97
- space init
98
- space new "Name of Space"
99
- space new "Name of Space" -r org/repo -r example-tools/alpha -r example-tools/beta
100
- space list # alias: space ls
101
- space show 20260531-name-of-space
102
- space path 20260531-name-of-space
103
- space current # based on $PWD
104
- space show # based on $PWD
105
- space status # report: metadata + loop status (based on $PWD)
106
- space status 20260531-name-of-space # report another space
107
- space status done # set: active | paused | done | archived
108
- space status 20260531-name-of-space done
109
- space config set default_provider github.com
110
- space config set default_organization example-org
111
- space repo add example-app # github.com/example-org/example-app
112
- space repo add example-tools/alpha example-tools/beta
113
- space repo add gitlab.com/example-org/api
114
- space repo resolve example-app example-tools/async
115
- space repo ls # alias: space repos ls
116
- space use 20260531-name-of-space # records recent state, prints the path
117
- space ls --color=always # auto | always | never (--colors also accepted)
118
- ```
119
-
120
- `space status` is **report-or-set**: with no status keyword (bare, or with just
121
- a space id) it *reports* the space — its metadata plus a compact loop-status
122
- block (project status, current iteration, derived state) when the space runs an
123
- Architect project, quietly omitted otherwise; pass a status keyword (`active`,
124
- `paused`, `done`, `archived`) to *set* it instead. 🔁
125
-
126
- Repos are passed with a repeatable `-r` flag (`-r org/repo -r org/lib`); the
127
- comma form (`-r a,b`) works too. Space ids are date-prefixed
128
- (`20260531-name-of-space`) so they sort naturally, and duplicate names on the
129
- same day get a counter (`…-name-of-space-2`). 📅
130
-
131
- Everything `space` does is also reachable as `architect space …` from within a
132
- project.
133
-
134
- ## Containerize a space: `pack` · `build` · `run` 📦
135
-
136
- A space is self-describing enough to become a container. `space pack` renders a
137
- portable OCI build context from the space; `space build` packs and builds it into
138
- a **reproducible-by-SHA** image; `space run` runs that image with your auth
139
- injected at runtime and stateful paths bind-mounted back to the host. 🐳
140
-
141
- ```sh
142
- space pack # render build/oci/ (Dockerfile + entrypoint + ignore file)
143
- space pack -o /tmp/ctx # …to a different output directory
144
- space build # pack, then build & tag <space-id>:<git-sha> and :latest
145
- space run # run <space-id>:latest — login shell, auth from your env
146
- space run architect status # …or run a one-off command instead of the login shell
147
- space run --tty # force an interactive TTY (default: auto-detect)
148
- ```
149
-
150
- **What lands in the image.** The context copies the whole space tree (filtered by
151
- a generated `Dockerfile.dockerignore`) onto a `ruby:4.0.5` base with `git`, the
152
- Claude Code CLI, and the `space-architect` gem — installed from the in-space
153
- `repos/space-architect` checkout when present (a pinned build), else from
154
- RubyGems. Secrets never enter the layers: `.env`, `*.key`, `*.pem`, ssh keys,
155
- `build/`, and `tmp/` are all excluded by the generated ignore file. 🔒
156
-
157
- **Reproducible by SHA.** `space build` tags the image `<space-id>:<sha>`, where
158
- `<sha>` is the space repo's 12-char `HEAD` (suffixed `-dirty` when the tree has
159
- uncommitted changes), plus a moving `:latest`. Same commit → same tag → same
160
- image. It drives the `container` CLI, but the output is an ordinary OCI/Docker
161
- build context, so `docker build -f build/oci/Dockerfile .` (from the space root)
162
- works just as well.
163
-
164
- **Auth stays out of the layers.** `space run` injects only the auth environment
165
- variables that are actually set — `ANTHROPIC_API_KEY`, `CLAUDE_CODE_OAUTH_TOKEN`,
166
- `ANTHROPIC_BASE_URL` — with `-e` at run time, so credentials live in your shell,
167
- never in the image. 🗝️
168
-
169
- **Forwarding payload credentials.** Beyond the always-on auth trio, a space can declare
170
- `run.env:` in `space.yaml` — a list of host env var names forwarded into the container at
171
- run time. You can also pass `space run --env VAR` (repeatable) for ad hoc additions. All
172
- forwarding is bare `-e VAR` passthrough: values never appear in argv, `ps`, or the image.
173
- A requested-but-unset var warns on stderr instead of silently failing inside the guest.
174
-
175
- ```yaml
176
- run:
177
- env: # run-time: host var names, forwarded as bare -e VAR
178
- - FIREWORKS_API_KEY
179
- - OPENAI_API_KEY
180
- ```
181
-
182
- **Declaring provisioning & persistence** — two optional keys in `space.yaml`:
183
-
184
- ```yaml
185
- pack:
186
- provision: # build-time: relative scripts, baked in by `space build`
187
- - scripts/setup-toolchain.sh
188
- persist: # run-time: absolute guest paths, bind-mounted per run
189
- - /root/.claude
190
- - /root/.local/state
191
- ```
192
-
193
- `provision` scripts must live under the space root and be executable. Each script is
194
- copied into the image individually (`COPY <script> /space/<script>`) and then invoked
195
- (`RUN /space/<script>`) **before** the full space tree lands and **before** the gem is
196
- installed. This ordering is the cache-hygiene guarantee: editing any other space file
197
- leaves the provision and gem-install layers cached, so a rebuild completes in seconds
198
- instead of minutes. Scripts must therefore be self-contained — they run with only the
199
- base system layers and any earlier provision scripts' outputs; they cannot read other
200
- space files or call `architect`/`space`. Scripts must have the executable bit set; COPY
201
- preserves the mode from the build context.
202
-
203
- `persist` paths must be absolute; `space run` bind-mounts each one from
204
- `<space>/.state<path>` on the host (created on first run) so a container's mutable state
205
- survives across runs. Both are validated at pack time.
206
-
207
- Like everything else, these are reachable as `architect space pack|build|run`
208
- from inside a project.
209
-
210
- ## `src` — the evergreen engine 🌲
211
-
212
- `src` keeps local clones under `<src_dir>/<host>/<owner>/<repo>` (default
213
- `~/architect/src/…`) clean, on their default branch, and freshly fetched — so
214
- spaces can provision repos by **copy-on-write** instead of cloning over the
215
- network.
216
-
217
- ```sh
218
- src repo add github.com/example-org/example-app # track + tend a repo
219
- src org add github.com/example-org # track a whole org
220
- src sync # run one sync pass (--repo to scope)
221
- src status # per-repo evergreen status table
222
- src clone example-app # APFS copy-on-write into $PWD
223
- src daemon install # per-user launchd agent for background sync
224
- ```
225
-
226
- When `space repo add` finds a matching evergreen checkout, it copy-on-writes
227
- from it instead of hitting the network — instant provisioning. ⚡ The two
228
- surfaces share one layout by design, so they line up with zero configuration:
229
-
230
- ```sh
231
- src repo add github.com/example-org/example-app # tend it: keep it evergreen 🌲
232
- space repo add example-app # copies it instantly ⚡
233
- ```
234
-
235
- `src` has its own `--plain` / `--json` output modes for scripting, and its own
236
- fish integration (`src shell fish install`).
237
-
238
93
  ## `architect` — the Architect Loop 🏗️
239
94
 
240
95
  The **Architect Loop** is a structured build cycle for you and headless AI
@@ -343,7 +198,8 @@ architect integrate my-feature --lanes lane-a # merge passing lanes → proje
343
198
 
344
199
  ### Streaming builder output 📡
345
200
 
346
- `architect dispatch` can push the builder's stream-json to an ingest server for
201
+ `architect dispatch` can push the builder's pi JSONL event stream to an ingest
202
+ server for
347
203
  live viewing:
348
204
 
349
205
  ```sh
@@ -367,8 +223,9 @@ can be combined with `--detach` (the push tees the live pipe in-process).
367
223
  ### Research lanes 🔭
368
224
 
369
225
  When an iteration needs facts the repo doesn't already have, fan out parallel
370
- **read-only** research lanes — detached `claude -p` researchers (no
371
- Edit/Write/Bash) that you supervise:
226
+ **read-only** research lanes — detached `pi -p --mode json` researchers
227
+ (read-only by prompt contract; the supervisor-injected guard denies git writes)
228
+ that you supervise:
372
229
 
373
230
  ```sh
374
231
  architect research dispatch 01-official-api.prompt.md 02-changelog.prompt.md
@@ -394,80 +251,35 @@ architect install-skills --dry-run # show what would change
394
251
  `architect-vocabulary` loads the system's terms and a short orientation when
395
252
  you're in a space but don't want to run the loop.
396
253
 
397
- ## Fish shell integration 🐟
398
-
399
- Shells can't let a child process change *their* working directory, so `space`
400
- and `src` each ship a small fish wrapper function plus completions (commands,
401
- subcommands, spaces, statuses, config keys, repo refs). Install into fish's
402
- autoloaded directories:
254
+ ### Sessions: the launchd rail 🛰️ (requires repo-tender)
403
255
 
404
- ```fish
405
- space shell fish install
406
- src shell fish install
407
- exec fish
408
- ```
409
-
410
- After restarting fish (or `exec fish`), `space new "…"` and
411
- `space use <id>` will `cd` into the selected space once the command succeeds;
412
- every other command keeps normal CLI behavior. 🚪 The functions and completions
413
- are written under `~/.config/fish/`, so there's no need to edit `config.fish`.
414
- For one-off testing without installing:
415
-
416
- ```fish
417
- space shell init fish | source
418
- ```
256
+ `architect sessions sync` uploads new conversation transcripts (`~/.pi/agent/sessions`
257
+ and `~/.claude/projects`) to a space-server; `architect sessions agent
258
+ install|uninstall|status` manages the per-user launchd agent that runs the sync
259
+ on an interval. These commands drive **repo-tender**'s launchd agent — a *soft*
260
+ dependency, deliberately absent from the gemspec: without the gem, the sessions
261
+ agent commands print a short error naming the fix (`gem install repo-tender`)
262
+ and the rest of `architect` is unaffected.
419
263
 
420
264
  ## Configuration ⚙️
421
265
 
422
- Config lives at `~/.config/space-architect/config.yml` (XDG-aware) and defaults to:
423
-
424
- ```yaml
425
- version: 1
426
- base_dir: ~/architect # spaces_dir + src_dir hang off this by default
427
- default_provider: github.com
428
- default_organization:
429
- git_clone_protocol: ssh # ssh | https
430
- ```
431
-
432
- Derived defaults: `spaces_dir` → `<base_dir>/spaces`, `src_dir` (evergreen
433
- checkout root) → `<base_dir>/src`. Override either explicitly. View values with
434
- `space config show`; set one with `space config set KEY VALUE`. Editable keys:
435
- `base_dir`, `spaces_dir`, `src_dir`, `default_provider`, `default_organization`,
436
- `git_clone_protocol`.
437
-
438
- ## Repos: evergreen, copy-on-write, concurrent ⚡
439
-
440
- Repos are added to the current space under `repos/` and tracked in `space.yaml`.
441
- When an up-to-date evergreen checkout exists at
442
- `<src_dir>/<host>/<owner>/<name>` (e.g.
443
- `~/architect/src/github.com/example-org/example-app`), `space` copies it into the
444
- space instead of cloning over the network — a copy-on-write clone on APFS. ⚡
445
- Set `src_dir` empty to always clone:
446
-
447
- ```sh
448
- space config set src_dir ""
449
- ```
450
-
451
- Clone URLs default to SSH (`git@github.com:example-org/example-app.git`); switch
452
- with `space config set git_clone_protocol https`. Multiple repos passed to
453
- `space repo add` are fetched **concurrently**, up to five at a time, on fibers —
454
- no threads, all cooperative. 🧵 After each repo lands, `space` runs `mise trust`
455
- in it. Each space also gets a workspace-local `tmp/` — use it instead of `/tmp`.
266
+ The spaces config the loop reads lives at `~/.config/space-cadet/config.yml`
267
+ (XDG-aware, owned by the space-cadet gem) — see `space config show`. The loop
268
+ itself has no config of its own: a space's `space.yaml` `project:` block *is*
269
+ the loop's state.
456
270
 
457
271
  ## Embedding 📚
458
272
 
459
- The library is split into three namespaces you can require independently:
273
+ Two namespaces, published as two gems:
460
274
 
461
- - **`Space::Core`** — the foundation: config, state, XDG, terminal, git/mise
462
- clients, the space store. The `space` CLI runs on this alone.
463
- - **`Space::Architect`** — project state, the builder harness, dispatch, and the
464
- research supervisor.
465
- - **`Space::Src`** — the evergreen engine (tracking, sync, copy-on-write clone).
275
+ - **`Space::Core`** (the space-cadet gem) — the substrate: config, state, XDG,
276
+ terminal, git/mise clients, the space store. The `space` CLI runs on this.
277
+ - **`Space::Architect`** (this gem) — project state, the builder harness,
278
+ dispatch, and the research supervisor, over the `Space::Core` substrate.
466
279
 
467
280
  ```ruby
468
- require "space_core" # just spaces
469
- require "space_architect" # the full loop (pulls in core + src)
470
- require "space_src" # just the evergreen engine
281
+ require "space_core" # just spaces (space-cadet gem)
282
+ require "space_architect" # the loop (pulls in the space-cadet gem)
471
283
  ```
472
284
 
473
285
  ## Documentation 📖