space-architect 1.1.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 (80) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +284 -0
  4. data/exe/architect +13 -0
  5. data/exe/space +13 -0
  6. data/lib/space_architect/architect_mission.rb +436 -0
  7. data/lib/space_architect/atomic_write.rb +21 -0
  8. data/lib/space_architect/cli/architect.rb +388 -0
  9. data/lib/space_architect/cli/config.rb +61 -0
  10. data/lib/space_architect/cli/current.rb +22 -0
  11. data/lib/space_architect/cli/helpers.rb +117 -0
  12. data/lib/space_architect/cli/init.rb +35 -0
  13. data/lib/space_architect/cli/list.rb +30 -0
  14. data/lib/space_architect/cli/new.rb +43 -0
  15. data/lib/space_architect/cli/options.rb +12 -0
  16. data/lib/space_architect/cli/path.rb +22 -0
  17. data/lib/space_architect/cli/repo.rb +88 -0
  18. data/lib/space_architect/cli/shell.rb +137 -0
  19. data/lib/space_architect/cli/show.rb +27 -0
  20. data/lib/space_architect/cli/space.rb +35 -0
  21. data/lib/space_architect/cli/src.rb +32 -0
  22. data/lib/space_architect/cli/status.rb +39 -0
  23. data/lib/space_architect/cli/use.rb +23 -0
  24. data/lib/space_architect/cli.rb +102 -0
  25. data/lib/space_architect/config.rb +152 -0
  26. data/lib/space_architect/dispatcher.rb +21 -0
  27. data/lib/space_architect/errors.rb +14 -0
  28. data/lib/space_architect/git_client.rb +49 -0
  29. data/lib/space_architect/harness.rb +168 -0
  30. data/lib/space_architect/mise_client.rb +37 -0
  31. data/lib/space_architect/repo_reference.rb +19 -0
  32. data/lib/space_architect/repo_resolver.rb +167 -0
  33. data/lib/space_architect/shell_integration.rb +438 -0
  34. data/lib/space_architect/slugger.rb +16 -0
  35. data/lib/space_architect/space.rb +110 -0
  36. data/lib/space_architect/space_store.rb +319 -0
  37. data/lib/space_architect/state.rb +86 -0
  38. data/lib/space_architect/templates/architect.md.erb +48 -0
  39. data/lib/space_architect/templates/iteration.md.erb +66 -0
  40. data/lib/space_architect/terminal.rb +163 -0
  41. data/lib/space_architect/version.rb +5 -0
  42. data/lib/space_architect/warnings.rb +13 -0
  43. data/lib/space_architect/xdg.rb +33 -0
  44. data/lib/space_architect.rb +26 -0
  45. data/vendor/repo-tender/lib/space_architect/pristine/cli/clone.rb +55 -0
  46. data/vendor/repo-tender/lib/space_architect/pristine/cli/config.rb +66 -0
  47. data/vendor/repo-tender/lib/space_architect/pristine/cli/daemon.rb +347 -0
  48. data/vendor/repo-tender/lib/space_architect/pristine/cli/options.rb +21 -0
  49. data/vendor/repo-tender/lib/space_architect/pristine/cli/org.rb +200 -0
  50. data/vendor/repo-tender/lib/space_architect/pristine/cli/repo.rb +170 -0
  51. data/vendor/repo-tender/lib/space_architect/pristine/cli/status.rb +76 -0
  52. data/vendor/repo-tender/lib/space_architect/pristine/cli/sync.rb +149 -0
  53. data/vendor/repo-tender/lib/space_architect/pristine/cli.rb +137 -0
  54. data/vendor/repo-tender/lib/space_architect/pristine/cloner.rb +75 -0
  55. data/vendor/repo-tender/lib/space_architect/pristine/config/contract.rb +54 -0
  56. data/vendor/repo-tender/lib/space_architect/pristine/config/duration.rb +79 -0
  57. data/vendor/repo-tender/lib/space_architect/pristine/config/model.rb +49 -0
  58. data/vendor/repo-tender/lib/space_architect/pristine/config/store.rb +156 -0
  59. data/vendor/repo-tender/lib/space_architect/pristine/forge/client.rb +31 -0
  60. data/vendor/repo-tender/lib/space_architect/pristine/forge/github.rb +98 -0
  61. data/vendor/repo-tender/lib/space_architect/pristine/launchd/agent.rb +195 -0
  62. data/vendor/repo-tender/lib/space_architect/pristine/launchd/plist.rb +129 -0
  63. data/vendor/repo-tender/lib/space_architect/pristine/log_rotator.rb +46 -0
  64. data/vendor/repo-tender/lib/space_architect/pristine/paths.rb +72 -0
  65. data/vendor/repo-tender/lib/space_architect/pristine/scm/client.rb +87 -0
  66. data/vendor/repo-tender/lib/space_architect/pristine/scm/git.rb +232 -0
  67. data/vendor/repo-tender/lib/space_architect/pristine/scm/status.rb +24 -0
  68. data/vendor/repo-tender/lib/space_architect/pristine/shell.rb +90 -0
  69. data/vendor/repo-tender/lib/space_architect/pristine/state/lock.rb +59 -0
  70. data/vendor/repo-tender/lib/space_architect/pristine/state/store.rb +140 -0
  71. data/vendor/repo-tender/lib/space_architect/pristine/sync/engine.rb +464 -0
  72. data/vendor/repo-tender/lib/space_architect/pristine/sync/repo_plan.rb +215 -0
  73. data/vendor/repo-tender/lib/space_architect/pristine/ui/interactive_reporter.rb +280 -0
  74. data/vendor/repo-tender/lib/space_architect/pristine/ui/json_reporter.rb +39 -0
  75. data/vendor/repo-tender/lib/space_architect/pristine/ui/mode.rb +68 -0
  76. data/vendor/repo-tender/lib/space_architect/pristine/ui/plain_reporter.rb +53 -0
  77. data/vendor/repo-tender/lib/space_architect/pristine/ui/reporter.rb +48 -0
  78. data/vendor/repo-tender/lib/space_architect/pristine/version.rb +7 -0
  79. data/vendor/repo-tender/lib/space_architect/pristine.rb +37 -0
  80. metadata +307 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ec439ebdc7e044a032f6a6736166d38dcc38b965ee26c03a2a27b1f95c9f5b2e
4
+ data.tar.gz: 3b242e89b02bd5e1aa69389aad16eb3e221da0fd000b3e7587ccce02cb565d32
5
+ SHA512:
6
+ metadata.gz: 58deb069cc61cf59161122547407699f03072cea024608e9954b568f409c2f11afe241aa585378010dfd5fe9df53aeb83f68945418482d45ba9d312b76297a85
7
+ data.tar.gz: 59c12540afc15984bc74d67051f4efc59a360e0fb93acd00bae252fcc2d7b139e2c3f63e692cd5980e0cbc1b3f378d141520b985a41a57c22a2ef08894be914d
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,284 @@
1
+ # Space Architect ๐Ÿš€
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/space-architect.svg)](https://badge.fury.io/rb/space-architect)
4
+
5
+ > **Task-scoped workspaces that double as Architect Loop missions โ€” for humans and their agents!** โœจ๐Ÿ›ฐ๏ธ
6
+
7
+ `space-architect` is a Ruby CLI for creating and managing **spaces** โ€” task-scoped
8
+ project workspaces that hold repos, notes, and artifacts under one obvious
9
+ filesystem root โ€” fused with the **Architect Loop**: a structured judgment-and-build
10
+ cycle for you and a fleet of headless AI builders. ๐ŸŒŒ
11
+
12
+ ## What's a space? ๐Ÿช
13
+
14
+ A space is just a regular directory with a tiny YAML identity file and room for
15
+ everything a task needs:
16
+
17
+ ```text
18
+ ~/src/spaces/20260531-name-of-space/
19
+ space.yaml # identity: id, title, status, repos, notes, tags
20
+ README.md
21
+ repos/ # cloned (or copy-on-write'd) repositories
22
+ notes/ # scratch, prompts, logs
23
+ architecture/ # iteration files: I<NN>-<name>.md + ARCHITECT.md index
24
+ build/ # lane worktrees + scratch (build/<id>-<lane>/)
25
+ tmp/ # workspace-local temp โ€” use this instead of /tmp
26
+ ```
27
+
28
+ Run a command from anywhere inside a space and it just works โ€” `architect` walks
29
+ up from `$PWD` until it finds the nearest `space.yaml`. No "current space" state to
30
+ get out of sync; where you *are* is the space you mean. ๐Ÿงญ
31
+
32
+ ## Installation ๐Ÿ“ฆ
33
+
34
+ Add it to your `Gemfile`:
35
+
36
+ ```ruby
37
+ gem "space-architect"
38
+ ```
39
+
40
+ Then:
41
+
42
+ ```bash
43
+ bundle install
44
+ ```
45
+
46
+ Or grab it yourself:
47
+
48
+ ```bash
49
+ gem install space-architect
50
+ ```
51
+
52
+ The primary executable is `architect`. The gem is `space-architect`. ๐ŸŽ€
53
+ A `space` shim is also installed and forwards all arguments to `architect space โ€ฆ`
54
+ for convenience.
55
+
56
+ ## Quick Start ๐ŸŽ€
57
+
58
+ **Space management:**
59
+
60
+ ```sh
61
+ architect space init # create XDG config + state files
62
+ architect space new "Name of Space" # blast off a new space ๐Ÿš€
63
+ architect space new "Name of Space" org/repo โ€ฆ # with repos cloned in (variadic)
64
+ architect space list # see all your spaces
65
+ architect space show # show the space you're standing in
66
+ architect space status done # mark the current mission complete
67
+ ```
68
+
69
+ **Architect Loop (run from inside a space):**
70
+
71
+ ```sh
72
+ architect init # scaffold ARCHITECT.md + architecture/
73
+ architect new <iteration> # scaffold next iteration file
74
+ architect dispatch <iteration> <lane> # dispatch a builder for a lane
75
+ architect status # show mission state (read-only)
76
+ architect freeze <iteration> # freeze Acceptance Criteria
77
+ architect verify <iteration> # post-flight mechanical checks
78
+ ```
79
+
80
+ ## Usage ๐Ÿ›ฐ๏ธ
81
+
82
+ ```sh
83
+ architect space init
84
+ architect space new "Name of Space"
85
+ architect space new "Name of Space" org/repo example-tools/alpha example-tools/beta
86
+ architect space list
87
+ architect space show 20260531-name-of-space
88
+ architect space path 20260531-name-of-space
89
+ architect space current # based on $PWD
90
+ architect space show # based on $PWD
91
+ architect space status done # based on $PWD
92
+ architect space status 20260531-name-of-space done
93
+ architect space config set default_provider github.com
94
+ architect space config set default_organization example-org
95
+ architect space repo add example-app # github.com/example-org/example-app
96
+ architect space repo add example-tools/alpha example-tools/beta
97
+ architect space repo add gitlab.com/example-org/api
98
+ architect space repo resolve example-app example-tools/async
99
+ architect space repo ls
100
+ architect space use 20260531-name-of-space # records recent state and prints the path
101
+ architect space ls --color=always # auto, always, or never; --colors is also accepted
102
+ ```
103
+
104
+ Space ids are date-prefixed (`20260531-name-of-space`) so they sort naturally,
105
+ and duplicate names on the same day get a counter (`...-name-of-space-2`). ๐Ÿ“…
106
+
107
+ ## The Architect Loop ๐Ÿ—๏ธ
108
+
109
+ Space Architect ships a structured build cycle for you and headless AI builders
110
+ called the **Architect Loop**. Each loop lives inside a space as a *mission*.
111
+
112
+ **Roles:**
113
+
114
+ - **Architect** โ€” you (or Claude Opus 4.8 in judgment mode): arbitrates disagreements,
115
+ writes and freezes iteration files, calls kill/continue, merges builder output.
116
+ - **Builder** โ€” Claude Sonnet 4.6 run headless via `architect dispatch`; reads the
117
+ iteration's Builder Prompt from `architecture/`, does the work, writes its report
118
+ to `build/<id>-<lane>/`.
119
+
120
+ **Filesystem layout:**
121
+
122
+ ```text
123
+ architecture/
124
+ ARCHITECT.md # cross-iteration index; mission-wide state
125
+ I01-<iteration>.md # one file per iteration
126
+ I02-<iteration>.md
127
+ build/
128
+ I01-<iteration>-<lane>/ # lane worktree + scratch per dispatch
129
+ run.jsonl # streamed builder output
130
+ report.md # builder report (transcribed to iteration file verbatim)
131
+ ```
132
+
133
+ **Iteration file anatomy** (in `architecture/I<NN>-<name>.md`):
134
+
135
+ | Section | Who writes it | When |
136
+ |---------|--------------|------|
137
+ | `## Grounds` | Architect | Before dispatch โ€” research, PRD, decisions |
138
+ | `## Specification` | Architect | Before dispatch โ€” full delegation contract |
139
+ | `## Acceptance Criteria` | Architect | Before `architect freeze` โ€” frozen, read-only after |
140
+ | `## Builder Prompt` | Architect | Records the exact prompt dispatched |
141
+ | `## Builder Report` | Architect | Transcribed verbatim from `build/โ€ฆ/report.md` |
142
+ | `## Verdict` | Architect | After reviewing evidence โ€” KILL / CONTINUE |
143
+
144
+ **Acceptance Criteria freeze before results** โ€” `architect freeze <iteration>` commits
145
+ the frozen sections and records `freeze_sha`; any change to Grounds, Specification,
146
+ or Acceptance Criteria after that point is an automatic iteration FAIL. The builder
147
+ never edits the iteration file.
148
+
149
+ **Typical loop session:**
150
+
151
+ ```sh
152
+ # From inside your space:
153
+ architect init # first time: scaffold ARCHITECT.md
154
+ architect new my-feature # scaffold architecture/I01-my-feature.md
155
+ # โ€ฆ write Grounds + Specification + Acceptance Criteria โ€ฆ
156
+ architect freeze my-feature # lock it
157
+ architect dispatch my-feature lane-A # send builder to work
158
+ # โ€ฆ builder runs, writes build/I01-my-feature-lane-A/report.md โ€ฆ
159
+ architect verify my-feature # mechanical post-flight checks
160
+ architect status # review mission state
161
+ # โ€ฆ architect reads evidence and writes Verdict โ€ฆ
162
+ ```
163
+
164
+ ## Fish shell integration ๐ŸŸ
165
+
166
+ Shells can't let a child process change *their* working directory, so `architect`
167
+ ships a small fish wrapper function. It also installs fish completions for commands,
168
+ subcommands, spaces, statuses, config keys, and common config values. Install both
169
+ into fish's autoloaded directories:
170
+
171
+ ```fish
172
+ architect space shell fish install
173
+ exec fish
174
+ ```
175
+
176
+ Restarting fish (or `exec fish`) lets the current terminal pick up the new autoloaded
177
+ wrapper function. After that, `architect space new "Name of Space"` and
178
+ `architect space use 20260531-name-of-space` will `cd` into the selected space once the
179
+ CLI command succeeds. Every other command keeps normal CLI behavior. ๐Ÿšช
180
+
181
+ The function is written to `~/.config/fish/functions/space.fish` and completions to
182
+ `~/.config/fish/completions/space.fish`, so there's no need to edit `config.fish`.
183
+ For one-off testing without installing:
184
+
185
+ ```fish
186
+ architect space shell init fish | source
187
+ ```
188
+
189
+ ## Configuration โš™๏ธ
190
+
191
+ Configuration follows the XDG base directory spec:
192
+
193
+ ```yaml
194
+ version: 1
195
+ spaces_dir: ~/src/spaces
196
+ evergreen_dir: ~/src/evergreen
197
+ default_provider: github.com
198
+ default_organization:
199
+ git_clone_protocol: ssh
200
+ ```
201
+
202
+ View current values: `architect space config show`. Set a value: `architect space config set KEY VALUE`.
203
+
204
+ ## Repos: evergreen, copy-on-write, concurrent ๐ŸŒฒ
205
+
206
+ Repos are added to the current space under `repos/` and tracked in `space.yaml`.
207
+ When an up-to-date local copy exists under `evergreen_dir` at
208
+ `<evergreen_dir>/<provider>/<owner>/<name>` (e.g.
209
+ `~/src/evergreen/github.com/example-org/example-app`), `architect` copies it into the
210
+ space instead of cloning over the network โ€” much faster, and a copy-on-write clone
211
+ on APFS. โšก Set `evergreen_dir` to empty to always clone:
212
+
213
+ ```sh
214
+ architect space config set evergreen_dir ""
215
+ ```
216
+
217
+ When no evergreen copy is found, the repo is cloned over the network. Clone URLs
218
+ default to SSH (`git@github.com:example-org/example-app.git`). Prefer HTTPS?
219
+
220
+ ```sh
221
+ architect space config set git_clone_protocol https
222
+ ```
223
+
224
+ When stdout/stderr are attached to a TTY, long-running repo operations show an
225
+ interactive spinner. Multiple repos passed to `architect space repo add` are fetched
226
+ **concurrently**, up to five at a time, on fibers โ€” no threads, all cooperative. ๐Ÿงต
227
+ After each repo is in place, `architect` runs `mise trust` in it so local mise config
228
+ is ready to go.
229
+
230
+ Each space also gets a workspace-local `tmp/`. Use it instead of `/tmp` or
231
+ `/var/tmp`; when using `mktemp`, point it at `tmp/`. ๐Ÿ—‘๏ธ
232
+
233
+ ## The `src` engine: evergreen checkouts ๐ŸŒฟ
234
+
235
+ `architect src โ€ฆ` exposes the **vendored** evergreen engine (from
236
+ [repo-tender](https://github.com/jetpks/repo-tender)) directly โ€” no separate
237
+ installation needed. It keeps local clones under
238
+ `~/src/evergreen/<host>/<owner>/<repo>` clean, on their default branch, and freshly
239
+ fetched.
240
+
241
+ ```sh
242
+ architect src repo add github.com/example-org/example-app # tend it ๐ŸŒฒ
243
+ architect src sync # run one sync pass
244
+ architect src status # per-repo evergreen status
245
+ ```
246
+
247
+ When `architect space repo add` sees a matching evergreen copy, it copy-on-writes
248
+ from it instead of hitting the network โ€” instant provisioning. โšก
249
+
250
+ The vendored engine and space management share the same layout by design โ€” both use
251
+ `<evergreen_dir>/<host>/<owner>/<repo>` โ€” so they line up with zero configuration:
252
+
253
+ ```sh
254
+ architect src repo add github.com/example-org/example-app # tend it: keep it evergreen ๐ŸŒฒ
255
+ architect space repo add example-app # copies it instantly โšก
256
+ ```
257
+
258
+ ## Documentation ๐Ÿ“–
259
+
260
+ - **[Command Reference](docs/reference.md)** โ€” every command, flag, and behavior
261
+ - **[Design](docs/design.md)** โ€” why spaces and the Architect Loop exist and how they're shaped
262
+
263
+ ## Development ๐Ÿ› ๏ธ
264
+
265
+ ```sh
266
+ bundle install
267
+ bundle exec rake test # the full minitest suite
268
+ bundle exec rake build # build the gem into pkg/
269
+ bundle exec rake install # build + install into your user gem home
270
+ ```
271
+
272
+ ## Contributing ๐Ÿ’
273
+
274
+ Bug reports and pull requests are welcome on GitHub at
275
+ [https://github.com/jetpks/space-architect](https://github.com/jetpks/space-architect)!
276
+
277
+ ## License ๐Ÿ“„
278
+
279
+ Available as open source under the terms of the
280
+ [MIT License](https://opensource.org/licenses/MIT).
281
+
282
+ ---
283
+
284
+ Made with ๐Ÿ’– and fibers ๐Ÿงต by Eric
data/exe/architect ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ source_gemfile = File.expand_path("../Gemfile", __dir__)
5
+ if File.exist?(source_gemfile)
6
+ ENV["BUNDLE_GEMFILE"] ||= source_gemfile
7
+ require "bundler/setup"
8
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
9
+ end
10
+
11
+ require "space_architect"
12
+
13
+ SpaceArchitect::CLI.run(ARGV, $stdout, $stderr)
data/exe/space ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ source_gemfile = File.expand_path("../Gemfile", __dir__)
5
+ if File.exist?(source_gemfile)
6
+ ENV["BUNDLE_GEMFILE"] ||= source_gemfile
7
+ require "bundler/setup"
8
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
9
+ end
10
+
11
+ require "space_architect"
12
+
13
+ SpaceArchitect::CLI.run(["space", *ARGV], $stdout, $stderr)