@zalom/plastic 2.0.0-alpha.22 → 2.0.0-alpha.23
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.
- package/agents/plastic-enforcer.md +6 -3
- package/agents/plastic-executor.md +4 -0
- package/agents/plastic-node-research.md +28 -0
- package/agents/plastic-node-verify.md +27 -0
- package/agents/plastic-node-work.md +32 -0
- package/bin/lib/context_budget.rb +1 -1
- package/hooks/hooks.json +12 -0
- package/hooks/statusline +28 -0
- package/hooks/stop +5 -0
- package/package.json +1 -1
- package/scripts/doctor.rb +80 -6
- package/scripts/end-intent +3 -3
- package/scripts/graph-measure +249 -0
- package/scripts/hook-capture +1 -0
- package/scripts/hook-savepoint +24 -2
- package/scripts/hook-session-start +40 -0
- package/scripts/hook-stop +57 -0
- package/scripts/lib/active_delivery.rb +61 -0
- package/scripts/lib/agent_models.rb +10 -1
- package/scripts/lib/codex_adapter.rb +197 -0
- package/scripts/lib/doctor_core.rb +8 -3
- package/scripts/lib/engine_permissions.rb +88 -0
- package/scripts/lib/graph_edges.rb +4 -4
- package/scripts/lib/graph_file.rb +4 -4
- package/scripts/lib/graph_measure.rb +645 -0
- package/scripts/lib/graph_measure_budget.rb +408 -0
- package/scripts/lib/graph_measure_cohorts.rb +487 -0
- package/scripts/lib/graph_measure_models.rb +411 -0
- package/scripts/lib/graph_measure_report.rb +532 -0
- package/scripts/lib/graph_tree.rb +2 -2
- package/scripts/lib/handoff.rb +36 -5
- package/scripts/lib/harness_adapter.rb +184 -0
- package/scripts/lib/hook_registry.rb +13 -1
- package/scripts/lib/hook_replay.rb +23 -5
- package/scripts/lib/index_projection.rb +1 -1
- package/scripts/lib/installer_core.rb +109 -3
- package/scripts/lib/intent_screen.rb +1 -1
- package/scripts/lib/intent_validator.rb +2 -2
- package/scripts/lib/meter_watch.rb +15 -9
- package/scripts/lib/node_file.rb +3 -3
- package/scripts/lib/node_ledger.rb +8 -1
- package/scripts/lib/node_progress.rb +153 -0
- package/scripts/lib/outcome_report.rb +1 -1
- package/scripts/lib/report_screen.rb +10 -6
- package/scripts/lib/roadmap_graph.rb +1 -1
- package/scripts/lib/roadmap_queue.rb +1 -1
- package/scripts/lib/roadmap_render.rb +1 -1
- package/scripts/lib/runner_absorb.rb +31 -5
- package/scripts/lib/runner_dispatch.rb +26 -11
- package/scripts/lib/runner_until_empty.rb +252 -0
- package/scripts/lib/runner_watch.rb +389 -0
- package/scripts/lib/savepoint.rb +3 -3
- package/scripts/lib/session_git.rb +2 -2
- package/scripts/lib/stop_gate.rb +95 -0
- package/scripts/lib/verify_intent.rb +2 -2
- package/scripts/lib/work_graph_validator.rb +6 -6
- package/scripts/new-intent +1 -1
- package/scripts/node-run +224 -0
- package/scripts/read-config +6 -0
- package/scripts/runner +203 -19
- package/scripts/verify-intent +1 -1
- package/skills/auto/SKILL.md +1 -1
- package/skills/conventions/references/knowledge-graph.md +9 -0
- package/skills/doctor/SKILL.md +3 -3
- package/skills/intent-creating/evals/evals.json +1 -1
- package/skills/intent-executing/SKILL.md +6 -0
- package/skills/tutorial/references/track-2-auto.md +1 -1
package/scripts/runner
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
# encoding: UTF-8
|
|
3
3
|
# frozen_string_literal: true
|
|
4
4
|
|
|
5
|
+
require "yaml"
|
|
6
|
+
require "stringio"
|
|
5
7
|
require_relative "lib/savepoint"
|
|
6
8
|
require_relative "lib/ready_set"
|
|
7
9
|
require_relative "lib/runner_core"
|
|
10
|
+
require_relative "lib/harness_adapter"
|
|
8
11
|
require_relative "lib/runner_proposals"
|
|
9
12
|
|
|
10
13
|
# runner - the one executable over the graph-ready loop's declared node graph
|
|
11
14
|
# (intent 340, G7, n1). A subcommand table: the public verbs (step, status,
|
|
12
15
|
# answer) are the only ones the skill body ever names; the internal verbs
|
|
13
|
-
# (ready, sweep, rewind) route and work so `step` can compose
|
|
14
|
-
# each can be tested alone, but stay out of the usage text (327
|
|
16
|
+
# (ready, sweep, rewind, until-empty) route and work so `step` can compose
|
|
17
|
+
# them and so each can be tested alone, but stay out of the usage text (327
|
|
18
|
+
# spec, 340b n7).
|
|
15
19
|
#
|
|
16
|
-
# `step`, `sweep`, `answer` and `
|
|
17
|
-
# deliver (RunnerDispatch and RunnerAbsorb for `step`;
|
|
18
|
-
# RunnerAnswer, RunnerRewind for the rest).
|
|
19
|
-
# its own verb branch: a verb whose module
|
|
20
|
-
# plainly and exits nonzero, and every other verb
|
|
21
|
-
# `status`, which an operator polls constantly across all
|
|
22
|
-
# intent's dispatches - keeps working.
|
|
20
|
+
# `step`, `sweep`, `answer`, `rewind` and `until-empty` route to modules
|
|
21
|
+
# later nodes deliver (RunnerDispatch and RunnerAbsorb for `step`;
|
|
22
|
+
# RunnerSweep, RunnerAnswer, RunnerRewind, RunnerUntilEmpty for the rest).
|
|
23
|
+
# Each is required LAZILY, inside its own verb branch: a verb whose module
|
|
24
|
+
# has not landed yet reports plainly and exits nonzero, and every other verb
|
|
25
|
+
# - most importantly `status`, which an operator polls constantly across all
|
|
26
|
+
# five of this intent's dispatches - keeps working.
|
|
23
27
|
#
|
|
24
28
|
# Usage:
|
|
25
29
|
# runner <step|status|answer> <intent_dir> [--node ID] [--answer TEXT]
|
|
@@ -34,7 +38,7 @@ module Runner
|
|
|
34
38
|
module_function
|
|
35
39
|
|
|
36
40
|
PUBLIC_VERBS = %w[step status answer].freeze
|
|
37
|
-
INTERNAL_VERBS = %w[ready sweep rewind].freeze
|
|
41
|
+
INTERNAL_VERBS = %w[ready sweep rewind until-empty watch].freeze
|
|
38
42
|
VERBS = (PUBLIC_VERBS + INTERNAL_VERBS).freeze
|
|
39
43
|
|
|
40
44
|
# verb -> [[ModuleName, lib_file], ...], required lazily inside the verb's
|
|
@@ -47,6 +51,8 @@ module Runner
|
|
|
47
51
|
"sweep" => [["RunnerSweep", "runner_sweep"]],
|
|
48
52
|
"answer" => [["RunnerAnswer", "runner_answer"]],
|
|
49
53
|
"rewind" => [["RunnerRewind", "runner_rewind"]],
|
|
54
|
+
"until-empty" => [["RunnerUntilEmpty", "runner_until_empty"]],
|
|
55
|
+
"watch" => [["RunnerWatch", "runner_watch"]],
|
|
50
56
|
}.freeze
|
|
51
57
|
|
|
52
58
|
def usage
|
|
@@ -77,11 +83,21 @@ module Runner
|
|
|
77
83
|
# a mistyped `--session` used to vanish with no effect and the runner
|
|
78
84
|
# simply acted as whichever session `CLAUDE_CODE_SESSION_ID` names.
|
|
79
85
|
KNOWN_FLAGS = {
|
|
80
|
-
"step" => %w[--return --allow-core-drift],
|
|
86
|
+
"step" => %w[--return --allow-core-drift --harness],
|
|
81
87
|
"answer" => %w[--node --answer],
|
|
82
88
|
"rewind" => %w[--node --confirm],
|
|
89
|
+
"until-empty" => %w[--harness],
|
|
90
|
+
"watch" => %w[--dispatch --harness --install-timer --home],
|
|
83
91
|
}.freeze
|
|
84
92
|
|
|
93
|
+
# The explicit YAML document-end marker (intent 340b, G7c, n1, row 1.28)
|
|
94
|
+
# separating the dispatch plan `step` has always printed from the
|
|
95
|
+
# harness-rendered block underneath it: stdout has never been one YAML
|
|
96
|
+
# document (absorb/reclaim/extend/reap lines print before the plan,
|
|
97
|
+
# decision/park lines after it), so a reader splits on this marker rather
|
|
98
|
+
# than guessing where the plan ends.
|
|
99
|
+
DOCUMENT_BOUNDARY = "...".freeze
|
|
100
|
+
|
|
85
101
|
# unrecognized_flag(verb, args) -> the first token in `args` that looks
|
|
86
102
|
# like a flag (`--...`) and is not in `verb`'s own KNOWN_FLAGS, or nil. A
|
|
87
103
|
# verb absent from KNOWN_FLAGS (status, ready, sweep) accepts none.
|
|
@@ -203,6 +219,10 @@ module Runner
|
|
|
203
219
|
run_answer(intent_dir, args)
|
|
204
220
|
when "rewind"
|
|
205
221
|
run_rewind(intent_dir, args)
|
|
222
|
+
when "until-empty"
|
|
223
|
+
run_until_empty(intent_dir, args)
|
|
224
|
+
when "watch"
|
|
225
|
+
run_watch(intent_dir, args)
|
|
206
226
|
else
|
|
207
227
|
warn "runner: #{verb}'s module loaded but no dispatcher is wired up yet"
|
|
208
228
|
exit 3
|
|
@@ -284,14 +304,156 @@ module Runner
|
|
|
284
304
|
exit 0
|
|
285
305
|
end
|
|
286
306
|
|
|
287
|
-
#
|
|
288
|
-
#
|
|
289
|
-
#
|
|
290
|
-
#
|
|
291
|
-
#
|
|
292
|
-
#
|
|
293
|
-
#
|
|
307
|
+
# run_until_empty (intent 340b, G7c, n7): the Codex loop. Internal, like
|
|
308
|
+
# `rewind` (row 7.13) - `RunnerUntilEmpty.run` composes `step` and
|
|
309
|
+
# `node-run` itself, since Codex has no session on the other end to make
|
|
310
|
+
# the subagent calls `step` only ever prints a plan for. `--harness`
|
|
311
|
+
# threads into every turn the loop runs (row 7.5), never re-resolved per
|
|
312
|
+
# iteration from a literal. The lock check here is the same defence in
|
|
313
|
+
# depth `run_step_body` carries (B4): `RunnerUntilEmpty.step_once` refuses
|
|
314
|
+
# `lock_not_held` on its own first call regardless, so this exits before
|
|
315
|
+
# even constructing the loop's own state.
|
|
316
|
+
def run_until_empty(intent_dir, args)
|
|
317
|
+
harness_override = opt(args, "--harness")
|
|
318
|
+
context = RunnerCore.context(intent_dir: intent_dir, env: ENV["CLAUDE_CODE_SESSION_ID"])
|
|
319
|
+
|
|
320
|
+
unless context.session
|
|
321
|
+
warn "runner: until-empty refused (lock_not_held)"
|
|
322
|
+
exit 1
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
result = RunnerUntilEmpty.run(context, harness: harness_override)
|
|
326
|
+
|
|
327
|
+
case result[:status]
|
|
328
|
+
when "complete", "stalled", "needs_decision", "iteration_cap"
|
|
329
|
+
exit 0
|
|
330
|
+
else
|
|
331
|
+
exit 1
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# run_watch (intent 340a, G7b, n2): one tick over disk truth. Internal,
|
|
336
|
+
# like until-empty and rewind - the timer that carries it lives outside
|
|
337
|
+
# this process (a local `/loop` on Claude Code, a launchd job on Codex,
|
|
338
|
+
# n3/n4). `--dispatch` is unattended start (graph.md D7): refused here,
|
|
339
|
+
# before RunnerWatch.tick ever takes the tick lock or writes anything,
|
|
340
|
+
# when the resolved harness's `HarnessAdapter.unattended_start?` is
|
|
341
|
+
# false, so a refusal never leaves a `watch.record` line behind that
|
|
342
|
+
# looks like a completed tick.
|
|
343
|
+
# --install-timer (intent 340a, G7b, n3, graph.md D9): the Codex carrier.
|
|
344
|
+
# Writes the plist and prints the path plus the `launchctl load` command;
|
|
345
|
+
# never runs `launchctl` itself, so the owner stays in control of when the
|
|
346
|
+
# job actually loads. `--home` defaults to the OS home, as
|
|
347
|
+
# `scripts/meter-watch --install-timer` already does.
|
|
348
|
+
def run_watch(intent_dir, args)
|
|
349
|
+
dispatch = args.include?("--dispatch")
|
|
350
|
+
harness_override = opt(args, "--harness")
|
|
351
|
+
context = RunnerCore.context(intent_dir: intent_dir, env: ENV["CLAUDE_CODE_SESSION_ID"])
|
|
352
|
+
agent_config = load_agent_config(context.plastic_home)
|
|
353
|
+
harness = HarnessAdapter.resolve_key(config: agent_config, override: harness_override)
|
|
354
|
+
|
|
355
|
+
if args.include?("--install-timer")
|
|
356
|
+
home = opt(args, "--home") || Dir.home
|
|
357
|
+
plist_path = RunnerWatch.install_timer(context, home: home, harness_key: harness)
|
|
358
|
+
puts "plist: #{plist_path}"
|
|
359
|
+
puts "launchctl load #{plist_path}"
|
|
360
|
+
exit 0
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
if dispatch && !HarnessAdapter.unattended_start?(harness)
|
|
364
|
+
warn HarnessAdapter::UNATTENDED_START_SENTENCE
|
|
365
|
+
exit 1
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
result = RunnerWatch.tick(context, dispatch: dispatch, harness: harness)
|
|
369
|
+
|
|
370
|
+
puts "class: #{result[:class]}"
|
|
371
|
+
result[:blockers].each { |b| puts "blocked: #{b}" }
|
|
372
|
+
puts "ready: #{result[:ready].empty? ? '(none)' : result[:ready].join(', ')}"
|
|
373
|
+
puts "dispatched: #{result[:dispatched].empty? ? '(none)' : result[:dispatched].join(', ')}"
|
|
374
|
+
exit 0
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# run_step (intent 340, G7, n5): one turn of the loop. The real work lives
|
|
378
|
+
# in #run_step_body below; this wrapper (intent 340b, G7c, n1, rows
|
|
379
|
+
# 1.21-1.25 and 1.29-1.31) exists ONLY to capture every byte `step` prints
|
|
380
|
+
# - stdout and stderr both, refusals included - and persist it to
|
|
381
|
+
# `<intent_dir>/runner-step.last` before the process actually exits, so a
|
|
382
|
+
# PreCompact hand-off (n3) always has something to render, even after one
|
|
383
|
+
# of the three pre-plan refusals that used to warn to stderr alone.
|
|
384
|
+
#
|
|
385
|
+
# `run_step_body` still calls Kernel#exit(N) at every one of its own exit
|
|
386
|
+
# points, exactly as before this node; wrapping it in a rescue for
|
|
387
|
+
# SystemExit lets this method capture the intended status, persist the
|
|
388
|
+
# file, replay the captured output onto the REAL stdout/stderr (so a
|
|
389
|
+
# subprocess caller like Open3.capture3 sees byte-identical output to
|
|
390
|
+
# before this node), and only then perform the one real process exit.
|
|
294
391
|
def run_step(intent_dir, args)
|
|
392
|
+
out_buf = StringIO.new
|
|
393
|
+
err_buf = StringIO.new
|
|
394
|
+
real_stdout = $stdout
|
|
395
|
+
real_stderr = $stderr
|
|
396
|
+
exit_code = 0
|
|
397
|
+
begin
|
|
398
|
+
$stdout = out_buf
|
|
399
|
+
$stderr = err_buf
|
|
400
|
+
run_step_body(intent_dir, args)
|
|
401
|
+
rescue SystemExit => e
|
|
402
|
+
exit_code = e.status || 1
|
|
403
|
+
ensure
|
|
404
|
+
$stdout = real_stdout
|
|
405
|
+
$stderr = real_stderr
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
real_stdout.print(out_buf.string)
|
|
409
|
+
real_stderr.print(err_buf.string)
|
|
410
|
+
persist_runner_step_last(intent_dir, out_buf.string, err_buf.string)
|
|
411
|
+
|
|
412
|
+
exit(exit_code)
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
# Row 1.24: lives beside savepoint.md, never inside packets/ (which the
|
|
416
|
+
# reaper treats as attempt evidence). Row 1.32: registers itself in the
|
|
417
|
+
# store's own top-level `.gitignore` (Worktree.ensure_gitignored's own
|
|
418
|
+
# idempotent, non-raising append) the same way `*.lock` already is, so a
|
|
419
|
+
# file rewritten on every step never dirties the store tree. Row 1.25:
|
|
420
|
+
# wrapped in its own rescue - an unwritable intent directory must never
|
|
421
|
+
# crash a step that has already written its transitions.
|
|
422
|
+
def persist_runner_step_last(intent_dir, stdout_text, stderr_text)
|
|
423
|
+
home_root = Arm.home_for(intent_dir)
|
|
424
|
+
Worktree.ensure_gitignored(File.join(home_root, ".plastic"), "runner-step.last")
|
|
425
|
+
|
|
426
|
+
path = File.join(intent_dir, "runner-step.last")
|
|
427
|
+
File.write(path, "#{stdout_text}#{stderr_text}")
|
|
428
|
+
rescue StandardError => e
|
|
429
|
+
warn "runner: could not persist runner-step.last: #{e.message}"
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Intent 340b, G7c, n1, row 1.1: the config `HarnessAdapter.resolve_key`
|
|
433
|
+
# reads `agent.type` from. `context.plastic_home` is derived from the
|
|
434
|
+
# intent_dir's OWN ancestry (Arm.home_for -> Worktree.home_from_store), so
|
|
435
|
+
# a sandboxed test fixture never reaches the real ~/.plastic/config.yml
|
|
436
|
+
# (Arm.home_for's own docstring: "a sandboxed store never resolves to the
|
|
437
|
+
# real Dir.home") - this stays hermetic for free, the same way every other
|
|
438
|
+
# `context.plastic_home` read in this file already does. A missing or
|
|
439
|
+
# unparseable config.yml reads as {}, never raises.
|
|
440
|
+
def load_agent_config(plastic_home)
|
|
441
|
+
path = File.join(plastic_home.to_s, "config.yml")
|
|
442
|
+
return {} unless File.exist?(path)
|
|
443
|
+
|
|
444
|
+
YAML.safe_load(File.read(path)) || {}
|
|
445
|
+
rescue StandardError
|
|
446
|
+
{}
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
# run_step_body (intent 340, G7, n5): one turn of the loop, in the fixed
|
|
450
|
+
# order 327 D14 and RunnerSweep's own docstring name - abort on a stuck
|
|
451
|
+
# merge, the delivery-lease heartbeat, absorb every `--return NODE=PATH`
|
|
452
|
+
# this call carries, THEN reclaim (so a node this very call just absorbed
|
|
453
|
+
# is never reclaimed out from under its own return, matrix row 2.19/2.20) -
|
|
454
|
+
# and only then dispatch whatever is left ready. Never spawns an agent (327
|
|
455
|
+
# D42): the session makes every subagent call from the plan this prints.
|
|
456
|
+
def run_step_body(intent_dir, args)
|
|
295
457
|
context = RunnerCore.context(intent_dir: intent_dir, env: ENV["CLAUDE_CODE_SESSION_ID"])
|
|
296
458
|
|
|
297
459
|
# v1 minor 3/row 11.18: RunnerSweep.abort_if_merging already prints the
|
|
@@ -322,6 +484,12 @@ module Runner
|
|
|
322
484
|
# never defaulted true.
|
|
323
485
|
allow_core_drift = args.include?("--allow-core-drift")
|
|
324
486
|
|
|
487
|
+
# Intent 340b, G7c, n1, row 1.2/1.4: `--harness KEY` overrides config
|
|
488
|
+
# `agent.type` for this one call - how one machine drives both adapters
|
|
489
|
+
# without editing config. `nil` when absent, so HarnessAdapter falls
|
|
490
|
+
# through to config's own value untouched.
|
|
491
|
+
harness_override = opt(args, "--harness")
|
|
492
|
+
|
|
325
493
|
returns = {}
|
|
326
494
|
opt_all(args, "--return").each do |pair|
|
|
327
495
|
node, path = pair.to_s.split("=", 2)
|
|
@@ -351,7 +519,8 @@ module Runner
|
|
|
351
519
|
reaped = NodeWorktree.reap(context)
|
|
352
520
|
reaped[:removed].each { |r| puts "reaped #{r[:node]} worktree" }
|
|
353
521
|
|
|
354
|
-
|
|
522
|
+
agent_config = load_agent_config(context.plastic_home)
|
|
523
|
+
result = RunnerDispatch.dispatch(context, config: agent_config, harness: harness_override)
|
|
355
524
|
unless result[:ok]
|
|
356
525
|
warn "runner: step refused (#{result[:reason]}): #{Array(result[:errors]).join('; ')}"
|
|
357
526
|
warn result[:rearm_command] if result[:rearm_command]
|
|
@@ -374,6 +543,21 @@ module Runner
|
|
|
374
543
|
result[:blockers].each { |b| puts "blocked: #{b}" }
|
|
375
544
|
end
|
|
376
545
|
|
|
546
|
+
# Intent 340b, G7c, n1, rows 1.6/1.13/1.14/1.27/1.28: the YAML plan keeps
|
|
547
|
+
# printing exactly as it did before this node (327's contract) - this is
|
|
548
|
+
# the rendered block UNDERNEATH it, for the harness `result[:harness]`
|
|
549
|
+
# resolved (config's `agent.type`, or this call's own `--harness`
|
|
550
|
+
# override), separated by an explicit YAML document-end marker so a
|
|
551
|
+
# reader splits on that marker rather than a heuristic. `render` returns
|
|
552
|
+
# nil for an empty dispatch list (row 1.14), so nothing extra ever
|
|
553
|
+
# prints when this step dispatched nothing.
|
|
554
|
+
block = HarnessAdapter.render(result[:dispatched], harness: result[:harness],
|
|
555
|
+
return_contract: RunnerDispatch::RETURN_CONTRACT)
|
|
556
|
+
if block
|
|
557
|
+
puts DOCUMENT_BOUNDARY
|
|
558
|
+
puts block
|
|
559
|
+
end
|
|
560
|
+
|
|
377
561
|
# M11/row 10.14: a `needs_decision` stop must print even when THIS SAME
|
|
378
562
|
# step also dispatched other nodes ahead of the decision node in ranked
|
|
379
563
|
# order - `result[:status]` reads "dispatched" in that case (dispatched
|
package/scripts/verify-intent
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# --base overrides the auto-detected diff base (default: the merge base with the repo's
|
|
13
13
|
# detected default branch) for repos where detection is ambiguous. --suite is an optional
|
|
14
|
-
# caller-supplied command to run (in the repo directory) and
|
|
14
|
+
# caller-supplied command to run (in the repo directory) and merge into the verdict. No
|
|
15
15
|
# other flags exist.
|
|
16
16
|
#
|
|
17
17
|
# Checks, all run every invocation (the fourth only when --suite is given):
|
package/skills/auto/SKILL.md
CHANGED
|
@@ -165,7 +165,7 @@ ledger is missing (then rebuild it with `Savepoint.rebuild_savepoint`).
|
|
|
165
165
|
| `How plan.md created` / `How checklist.md created` / `Exec started` | Exec (verify plan, matrix, checklist) |
|
|
166
166
|
| `Exec outcome.md created` | Exec done; complete the intent |
|
|
167
167
|
| A terminal savepoint line (`delivered` or `abandoned`) | Terminal; do not resume |
|
|
168
|
-
| A node or `Intent` transition line (`n1 running ...`, `Intent needs_decision ...`) | Exec; a graph delivery is in progress - drive it through `scripts/runner`'s three public verbs, `step` (one turn of the dispatch loop), `status` (renders ledger state, safe to poll constantly), and `answer` (closes a `needs_decision` node) - read node status through `NodeLedger.status` before dispatching anything, never re-derive it by eye |
|
|
168
|
+
| A node or `Intent` transition line (`n1 running ...`, `Intent needs_decision ...`) | Exec; a graph delivery is in progress - drive it through `scripts/runner`'s three public verbs, `step` (one turn of the dispatch loop), `status` (renders ledger state, safe to poll constantly), and `answer` (closes a `needs_decision` node) - read node status through `NodeLedger.status` before dispatching anything, never re-derive it by eye. `scripts/graph-measure` is the read-only sibling over that same ledger, with its own three public verbs `intent`, `budget`, and `cohorts` - it never dispatches and never writes |
|
|
169
169
|
|
|
170
170
|
Filesystem fallback, in order: `checklist.md` with items checked means resume Exec from the
|
|
171
171
|
first unchecked item; `plan.md` plus `checklist.md` means enter Exec; `spec.md` alone means
|
|
@@ -45,3 +45,12 @@ This chapter holds the linking doctrine from Frontmatter and the branch-vs-root
|
|
|
45
45
|
the relation on the PREDECESSOR's `chain` (and mirror it as a
|
|
46
46
|
`[[id--slug|<target's full intent: text>]]` wikilink in `## Links`).
|
|
47
47
|
- **Rule of thumb:** if the intent could exist without its parent, it's a root.
|
|
48
|
+
|
|
49
|
+
## Naming
|
|
50
|
+
|
|
51
|
+
A thing is named after the concept family it lives under. A node is a graph-engineering
|
|
52
|
+
concept, so its name comes from graph engineering (node, edge, ready set, critical path),
|
|
53
|
+
from the Plastic concepts coined on top of it (intent, ledger, packet, lease, gate, runner),
|
|
54
|
+
and from the software and AI engineering concepts those rest on (review, fix, test, verify,
|
|
55
|
+
dispatch, executor, reviewer). A name from outside that stack is refused. Where no existing
|
|
56
|
+
concept fits, that is a design finding to raise, not a word to coin.
|
package/skills/doctor/SKILL.md
CHANGED
|
@@ -223,7 +223,7 @@ knowingly-exempt `(intent_id, rule)` pairs. Format: one `rule_name id id id` lin
|
|
|
223
223
|
blank lines and `#` comments ignored. v1 honors exactly one rule, `savepoint_operational`.
|
|
224
224
|
|
|
225
225
|
**Reading the count.** When any exclusion applies, the `savepoint_operational` check's message
|
|
226
|
-
|
|
226
|
+
includes the count and the file's path, e.g. `"... (3 excluded via ~/.plastic/doctor-exclusions)"`.
|
|
227
227
|
A malformed line in the file forces the check to `warn` with the parse error in `details`, even
|
|
228
228
|
when zero real gaps remain, so a broken file is never silently permissive.
|
|
229
229
|
|
|
@@ -262,7 +262,7 @@ Locks exist for auto teams: a `delivery.lock` file in the intent directory names
|
|
|
262
262
|
session, and the `record` hook refreshes its mtime on every edit (the lease heartbeat; stale
|
|
263
263
|
means older than the TTL). Direct work takes no lock. When a lock reads held by a session
|
|
264
264
|
that is gone, when work resumes after a crash, reboot, or `/tmp` wipe, or when the user says
|
|
265
|
-
"fix the lock", "who holds the lock", or "reclaim the lock", use the CLI (intent 304
|
|
265
|
+
"fix the lock", "who holds the lock", or "reclaim the lock", use the CLI (intent 304 merged
|
|
266
266
|
the former locking skill here):
|
|
267
267
|
|
|
268
268
|
| Verb | What it does | When |
|
|
@@ -290,7 +290,7 @@ these verbs (claims, worktrees, the station ledger).
|
|
|
290
290
|
## Provisioning a project store
|
|
291
291
|
|
|
292
292
|
When a project is registered in `~/.plastic/projects.yml` but has no store on disk (doctor
|
|
293
|
-
reports `project_store_dir`), provision it (intent 304
|
|
293
|
+
reports `project_store_dir`), provision it (intent 304 merged the former provisioning skill
|
|
294
294
|
here). The slug is the project's key under `projects`; an unregistered slug exits non-zero and
|
|
295
295
|
creates nothing, and this procedure never edits `projects.yml`.
|
|
296
296
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"scope": "behavior",
|
|
36
36
|
"set": "validation",
|
|
37
37
|
"prompt": "Create an intent that is the direct continuation of intent 41: it emerged from intent 41's lifecycle and could not exist without it.",
|
|
38
|
-
"expected_output": "Because the new intent was genuinely CREATED FROM 41 (D1), it carries 41 in --sources (or branches from 41, which
|
|
38
|
+
"expected_output": "Because the new intent was genuinely CREATED FROM 41 (D1), it carries 41 in --sources (or branches from 41, which merges 41 into sources via the redundant-explicit rule). The reciprocal I1 backlink lands: intent 41's frontmatter chain gains the new intent's id. This is the created-from case, contrasted with the related-but-not-spawned case in eval 1.",
|
|
39
39
|
"files": [],
|
|
40
40
|
"assertions": [
|
|
41
41
|
{
|
|
@@ -35,6 +35,12 @@ node returns.
|
|
|
35
35
|
The dispatch step is the paste, not a lead's hand-typed brief: copy each spawn block into the
|
|
36
36
|
Agent tool as its own dispatch, verbatim.
|
|
37
37
|
|
|
38
|
+
On Claude Code, the session spawns each dispatched node as a background subagent of its
|
|
39
|
+
per-kind agent (`plastic-node-work`, `plastic-node-verify`, `plastic-node-research`) named in
|
|
40
|
+
the spawn block. On Codex, one node runs over `codex exec` in a sandbox scoped to its kind and
|
|
41
|
+
writes only a return file, which the next `step` absorbs the same way it absorbs a Claude Code
|
|
42
|
+
return.
|
|
43
|
+
|
|
38
44
|
## status
|
|
39
45
|
|
|
40
46
|
`ruby scripts/runner status <intent_dir>` renders the graph's ledger state: which nodes are
|
|
@@ -67,7 +67,7 @@ No new command. At each stage boundary (What, Why, How, Exec) the agent briefs i
|
|
|
67
67
|
fixed three-line shape: State (what happened and why it matters), Risk (the one thing that
|
|
68
68
|
could bite, or "nothing flagged"), and Call (the decision left to the user, or the call the
|
|
69
69
|
agent is taking on its own). That is the depth for a medium or large intent. A small intent
|
|
70
|
-
gets one briefing, at How,
|
|
70
|
+
gets one briefing, at How, merging in what the earlier stages would have said.
|
|
71
71
|
|
|
72
72
|
Checkpoint: in the most recent report, point at the State line, the Risk line, and the Call
|
|
73
73
|
line.
|