space-architect 9.2.1 → 9.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +89 -0
- data/README.md +2 -4
- data/lib/space_architect/architect_project.rb +3 -21
- data/lib/space_architect/cli/architect.rb +66 -295
- data/lib/space_architect/harness.rb +2 -51
- data/lib/space_architect/routing.rb +43 -0
- data/lib/space_architect/version.rb +1 -1
- data/lib/space_architect.rb +0 -4
- data/skill/architect/SKILL.md +145 -319
- data/skill/architect-action/SKILL.md +123 -0
- data/skill/architect-discuss/SKILL.md +252 -0
- data/skill/{architect → architect-discuss}/dispatch.md +5 -4
- data/skill/{architect → architect-discuss}/research.md +2 -1
- data/skill/architect-research/SKILL.md +3 -2
- data/skill/architect-status/SKILL.md +55 -0
- metadata +7 -45
- data/lib/space_architect/conversations_client.rb +0 -81
- data/lib/space_architect/jobs_client.rb +0 -147
- data/lib/space_architect/run_creator.rb +0 -53
- data/lib/space_architect/session_sync/bin_path.rb +0 -28
- data/lib/space_architect/session_sync/cursor.rb +0 -43
- data/lib/space_architect/session_sync/plist.rb +0 -111
- data/lib/space_architect/session_sync/runner.rb +0 -64
- data/lib/space_architect/session_sync/session_id.rb +0 -20
- data/lib/space_architect/session_sync.rb +0 -56
- data/lib/space_architect/space_push.rb +0 -274
- data/skill/architect-plan/SKILL.md +0 -114
- data/skill/architect-vocabulary/SKILL.md +0 -144
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "async/process"
|
|
4
|
-
require "async/http/client"
|
|
5
|
-
require "async/http/endpoint"
|
|
6
|
-
require "protocol/http/body/writable"
|
|
7
4
|
require "json"
|
|
8
5
|
require "pathname"
|
|
9
|
-
require "uri"
|
|
10
6
|
|
|
11
7
|
module Space::Architect
|
|
12
8
|
module Harness
|
|
@@ -106,8 +102,7 @@ module Space::Architect
|
|
|
106
102
|
@guard_path = guard_path
|
|
107
103
|
end
|
|
108
104
|
|
|
109
|
-
def run(prompt_path:, run_log_path:, chdir:,
|
|
110
|
-
push_client: nil, timeout: nil, liveness_delay: LIVENESS_DELAY_SECONDS, err: $stderr)
|
|
105
|
+
def run(prompt_path:, run_log_path:, chdir:, timeout: nil, liveness_delay: LIVENESS_DELAY_SECONDS, err: $stderr)
|
|
111
106
|
prompt_path = Pathname.new(prompt_path)
|
|
112
107
|
run_log_path = Pathname.new(run_log_path)
|
|
113
108
|
|
|
@@ -117,7 +112,7 @@ module Space::Architect
|
|
|
117
112
|
Sync do
|
|
118
113
|
child = Async::Process::Child.new(*argv, chdir: chdir.to_s, in: prompt_io, out: w, err: log)
|
|
119
114
|
w.close
|
|
120
|
-
tasks =
|
|
115
|
+
tasks = [Async { drain_pipe(r, log) }]
|
|
121
116
|
timed_out = false
|
|
122
117
|
timeout_task = nil
|
|
123
118
|
|
|
@@ -266,50 +261,6 @@ module Space::Architect
|
|
|
266
261
|
# Best-effort: an internal read/parse failure must never break the run.
|
|
267
262
|
end
|
|
268
263
|
|
|
269
|
-
def start_tee(r, log, push_url:, push_token:, push_client:, err: $stderr)
|
|
270
|
-
if push_url || push_client
|
|
271
|
-
body = Protocol::HTTP::Body::Writable.new(queue: Thread::SizedQueue.new(32))
|
|
272
|
-
push = Async { push_body(body, push_url: push_url, push_token: push_token, push_client: push_client, err: err) }
|
|
273
|
-
[Async { tee_pipe(r, log, body, err: err) }, push]
|
|
274
|
-
else
|
|
275
|
-
[Async { drain_pipe(r, log) }]
|
|
276
|
-
end
|
|
277
|
-
end
|
|
278
|
-
|
|
279
|
-
def push_body(body, push_url:, push_token:, push_client:, err: $stderr)
|
|
280
|
-
path = push_url ? URI.parse(push_url).path : "/"
|
|
281
|
-
headers = [["content-type", "application/x-ndjson"]]
|
|
282
|
-
headers << ["authorization", "Bearer #{push_token}"] if push_token
|
|
283
|
-
if push_client
|
|
284
|
-
push_client.post(path, headers: headers, body: body).discard
|
|
285
|
-
else
|
|
286
|
-
Async::HTTP::Client.open(Async::HTTP::Endpoint.parse(push_url)) do |c|
|
|
287
|
-
c.post(path, headers: headers, body: body).discard
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
|
-
rescue StandardError => e
|
|
291
|
-
err.puts "push_body: transport error (best-effort, run log intact): #{e.class}: #{e.message}"
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
def tee_pipe(r, log, body, err: $stderr)
|
|
295
|
-
pushing = true
|
|
296
|
-
while (chunk = r.gets)
|
|
297
|
-
log.write(chunk)
|
|
298
|
-
log.flush
|
|
299
|
-
if pushing
|
|
300
|
-
begin
|
|
301
|
-
body.write(chunk)
|
|
302
|
-
rescue StandardError => e
|
|
303
|
-
err.puts "tee_pipe: push write failed (best-effort, continuing log): #{e.class}: #{e.message}"
|
|
304
|
-
pushing = false
|
|
305
|
-
end
|
|
306
|
-
end
|
|
307
|
-
end
|
|
308
|
-
ensure
|
|
309
|
-
body.close_write
|
|
310
|
-
r.close
|
|
311
|
-
end
|
|
312
|
-
|
|
313
264
|
def drain_pipe(r, log)
|
|
314
265
|
while (chunk = r.gets)
|
|
315
266
|
log.write(chunk)
|
|
@@ -22,6 +22,49 @@ module Space::Architect
|
|
|
22
22
|
REQUIRED_ROLES = %w[spec builder judge coordinator narrator].freeze
|
|
23
23
|
ENTRY_KEYS = %w[model thinking].freeze
|
|
24
24
|
|
|
25
|
+
# I09: the `architect routing init` scaffold — the exact bytes the command
|
|
26
|
+
# writes, living beside the parsers that must accept it. Example models are
|
|
27
|
+
# loud REPLACE_MEs; the header comment carries both locations and the merge
|
|
28
|
+
# order so the file is self-documenting. Byte-exact contract: the extension
|
|
29
|
+
# lane's tests carry an inline copy, and the command round-trips the write
|
|
30
|
+
# through parse below — a template the machinery rejects is a bug.
|
|
31
|
+
TEMPLATE = <<~'YAML'.freeze
|
|
32
|
+
# architect.yaml — space-architect loop role routing, scaffolded by `architect routing init`.
|
|
33
|
+
# Locations (merged in this order; the space-local entry wins per role):
|
|
34
|
+
# global: ~/.config/space-architect/architect.yaml (machine-wide)
|
|
35
|
+
# local: architect.yaml beside this space's space.yaml (this file)
|
|
36
|
+
# A local entry overrides the global entry for THAT ROLE only; after the
|
|
37
|
+
# merge every agent role must be routed: spec, builder, judge, coordinator,
|
|
38
|
+
# narrator (architect is optional).
|
|
39
|
+
# Replace every example/REPLACE_ME below with a real provider/model-id
|
|
40
|
+
# (e.g. zai/glm-5.3). thinking is optional: off|minimal|low|medium|high|xhigh|max.
|
|
41
|
+
# Once saved, the next /loop or architect command picks the file up.
|
|
42
|
+
version: 1
|
|
43
|
+
roles:
|
|
44
|
+
architect:
|
|
45
|
+
model: example/REPLACE_ME
|
|
46
|
+
thinking: high
|
|
47
|
+
spec:
|
|
48
|
+
model: example/REPLACE_ME
|
|
49
|
+
thinking: high
|
|
50
|
+
builder:
|
|
51
|
+
model: example/REPLACE_ME
|
|
52
|
+
thinking: high
|
|
53
|
+
judge:
|
|
54
|
+
model: example/REPLACE_ME
|
|
55
|
+
thinking: high
|
|
56
|
+
coordinator:
|
|
57
|
+
model: example/REPLACE_ME
|
|
58
|
+
thinking: high
|
|
59
|
+
narrator:
|
|
60
|
+
model: example/REPLACE_ME
|
|
61
|
+
thinking: low
|
|
62
|
+
YAML
|
|
63
|
+
|
|
64
|
+
# The one canonical cure line appended to default_model_inform's last-resort
|
|
65
|
+
# inform — self-punctuating, appended after a single space by the caller.
|
|
66
|
+
INIT_HINT = "Create one: `architect routing init` (beside space.yaml) or `architect routing init --global` (~/.config/space-architect/architect.yaml).".freeze
|
|
67
|
+
|
|
25
68
|
def self.global_path
|
|
26
69
|
env = ENV["SPACE_ARCHITECT_GLOBAL_CONFIG"]
|
|
27
70
|
return Pathname.new(env) unless env.nil?
|
data/lib/space_architect.rb
CHANGED
|
@@ -5,14 +5,10 @@ require_relative "space_architect/version"
|
|
|
5
5
|
|
|
6
6
|
require_relative "space_architect/harness"
|
|
7
7
|
require_relative "space_architect/routing"
|
|
8
|
-
require_relative "space_architect/run_creator"
|
|
9
|
-
require_relative "space_architect/space_push"
|
|
10
8
|
require_relative "space_architect/gate_lint"
|
|
11
9
|
require_relative "space_architect/gate_evaluator"
|
|
12
10
|
require_relative "space_architect/architect_project"
|
|
13
11
|
require_relative "space_architect/skill_installer"
|
|
14
12
|
require_relative "space_architect/bug_report"
|
|
15
13
|
require_relative "space_architect/research"
|
|
16
|
-
require_relative "space_architect/conversations_client"
|
|
17
|
-
require_relative "space_architect/session_sync"
|
|
18
14
|
require_relative "space_architect/cli"
|