@astrosheep/keiyaku 4.6.29 → 4.6.30

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 (50) hide show
  1. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  2. package/build/plugins/claude/skills/keiyaku/SKILL.md +24 -24
  3. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +43 -167
  4. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +58 -228
  5. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +45 -56
  6. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +43 -184
  7. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +39 -88
  8. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +54 -114
  9. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  10. package/build/plugins/codex/skills/keiyaku/SKILL.md +24 -24
  11. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +43 -167
  12. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +58 -228
  13. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +45 -56
  14. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +43 -184
  15. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +39 -88
  16. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +54 -114
  17. package/build/plugins/opencode/package.json +1 -1
  18. package/build/plugins/opencode/skills/keiyaku/SKILL.md +24 -24
  19. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +43 -167
  20. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +58 -228
  21. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +45 -56
  22. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +43 -184
  23. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +39 -88
  24. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +54 -114
  25. package/build/skills/keiyaku/SKILL.md +24 -24
  26. package/build/skills/keiyaku-akuma/SKILL.md +43 -167
  27. package/build/skills/keiyaku-akuma/references/automation.md +58 -228
  28. package/build/skills/keiyaku-babysit/SKILL.md +45 -56
  29. package/build/skills/keiyaku-bind/SKILL.md +43 -184
  30. package/build/skills/keiyaku-debt/SKILL.md +39 -88
  31. package/build/skills/keiyaku-workflow/SKILL.md +54 -114
  32. package/build/src/cli/render/akuma-activity.js +33 -1
  33. package/build/src/cli/render/kanshi-akuma.d.ts +3 -2
  34. package/build/src/cli/render/kanshi-akuma.js +1 -1
  35. package/build/src/cli/render/kanshi.js +19 -5
  36. package/build/src/contract-worktree.js +19 -4
  37. package/build/src/git/observe.d.ts +2 -1
  38. package/build/src/git/observe.js +29 -20
  39. package/build/src/kanshi/read.js +1 -1
  40. package/build/src/protocol/read/status.d.ts +2 -2
  41. package/build/src/protocol/read/status.js +8 -6
  42. package/build/src/runtime/proc/windows-launch.exe +0 -0
  43. package/package.json +1 -1
  44. package/skills/keiyaku/SKILL.md +24 -24
  45. package/skills/keiyaku-akuma/SKILL.md +43 -167
  46. package/skills/keiyaku-akuma/references/automation.md +58 -228
  47. package/skills/keiyaku-babysit/SKILL.md +45 -56
  48. package/skills/keiyaku-bind/SKILL.md +43 -184
  49. package/skills/keiyaku-debt/SKILL.md +39 -88
  50. package/skills/keiyaku-workflow/SKILL.md +54 -114
@@ -7,120 +7,60 @@ description: >-
7
7
 
8
8
  # Keiyaku Workflow
9
9
 
10
- The holder runs one Contract's fulfillment loop from preparation to completion.
11
-
12
- ## 1. Before Binding
13
-
14
- Shape and author the `kei` with `keiyaku-bind`. Do not bind while design or
15
- acceptance is open; only private implementation details may stay with the
16
- Deliverer.
17
-
18
- ## 2. Roles
19
-
20
- A `kei` has three roles. They are responsibilities, not people, and one agent
21
- may fill more than one of them, with one exception below.
22
-
23
- - **Holder:** exactly one per `kei`. Owns the fulfillment loop and acceptance
24
- until the Contract is accepted or abandoned. Handing work to others never
25
- transfers this responsibility.
26
- - **Deliverer:** produces the candidate in the appointed worktree and tenders
27
- it with `deliver`.
28
- - **Reviewer:** judges the complete Contract against its acceptance conditions
29
- and records the verdict with `review`.
30
-
31
- Review is independent when the Reviewer did not deliver the candidate under
32
- review. That is the whole requirement. The holder may review its own `kei`; a
33
- fresh Akuma is not what makes review independent. Keiyaku does not check who
34
- reviews, so keeping the Reviewer apart from the Deliverer is the holder's duty.
35
-
36
- Any role may be filled directly or handed to an Akuma. Hand one over when other
37
- hands help the work, not to make review count.
38
-
39
- ## 3. Lifecycle
40
-
41
- Each act changes a different part of the world:
42
-
43
- - **Bind:** Journal gains the Contract and its terms. Workspace appointment
44
- names one managed worktree; the receipt reports its path. Appointment lag
45
- leaves the bind admitted without a path and reports pending reconciliation.
46
- `reconcile` retries workspace realization.
47
- - **Work:** Changes and commits belong in the appointed worktree. Another
48
- lane's claim can move the target beneath it. Check target movement before
49
- delivery preview; when needed, merge the selected target's committed head in
50
- the worktree and resolve conflicts there before previewing again. A Contract
51
- target is its appointed detached worktree, not its ordinary branch.
52
- - **Delivery preview:** `deliver --dry-run` shows the candidate, existing
53
- Verification evidence, and target followability without submitting work or
54
- running Verification or hooks. With the `verified` gate, missing or stale
55
- evidence remains unmet; preview never promises acceptance.
56
- - **Verify:** `verify [<contract>] [--index <n>] [--include-dirty]` explicitly
57
- executes all current declarations or one by positive one-based position. It
58
- captures the appointed worktree under delivery's clean-worktree and dirty
59
- authorization rules and prepares the exact prospective integration without
60
- delivering it. Conflicts refuse without a handoff. Each check gets independent
61
- scratch, setup, cleanup, and requirement testimony. Normal failure or timeout
62
- does not stop other selected checks; operational stops admit no verdict for
63
- the affected check and preserve earlier results. Verify always executes its
64
- selection, even if identical testimony can reuse admission. It then requests
65
- ordinary placement of an already-delivered Contract when every prerequisite
66
- and gate passes; pre-delivery verify records evidence without placement.
67
- - **Deliver:** Captures a tender and integration against the observed target;
68
- journal gains a delivered candidate. It never executes Verification. Ready
69
- prerequisites and existing gate evidence trigger placement and claim in this
70
- invocation; otherwise the candidate waits.
71
- Changed candidate content stales earlier review. Identical content retains
72
- review across rebase or target movement.
73
- - **Review:** Records verdict evidence for the current document and worktree
74
- content, even before delivery. Satisfied review requests placement: with a
75
- delivered candidate, current gates, and ready prerequisites, it accepts in
76
- this invocation. Unsatisfied review records testimony without placement.
77
- Neither verdict executes Verification.
78
- - **Abandon:** Records the alternate terminal outcome without accepting. Accepted
79
- and abandoned Contracts cannot be reopened.
80
-
81
- Placement judges declared gates, not the producer's identity. Every current
82
- requirement needs current satisfied testimony; missing, stale, and current
83
- unsatisfied evidence remain distinct. Whole-gate satisfaction follows the generic
84
- judgment over all requirements. Verification requirement identity follows
85
- canonical executor, script, and declared deadline; declaration position only
86
- selects work. Reordering preserves evidence,
87
- editing one check affects only that requirement, and exact duplicates share a
88
- requirement. Removed declarations leave historical testimony intact.
89
-
90
- Deliver, review, target refresh, and dependent completion consume existing
91
- evidence only. Review does not replace Verification; preview never requests
92
- placement. Verify evidence applies to its exact captured integration snapshot:
93
- an unchanged later delivery can use pre-delivery evidence, while target or
94
- candidate movement cannot retarget it. Read the final receipt for every executed
95
- check, admission or admission reuse, stops, retained scenes, completion, and
96
- reconciliation lag.
97
-
98
- ## 4. Handing A Role To An Akuma
99
-
100
- This is the one commissioning map. `--contract` records association, not
101
- authority.
10
+ The holder drives one Contract from binding to `accepted` or `abandoned`.
11
+
12
+ ## 1. Roles
13
+
14
+ A `kei` has three roles (one agent may fill multiple roles, except the Reviewer
15
+ must not be the Deliverer of the candidate under review):
16
+
17
+ - **Holder (one and only one per `kei`):** owns the fulfillment loop and
18
+ acceptance until terminal. You are the holder unless you explicitly hand the
19
+ entire loop for that `kei` to one dedicated Akuma; delegating Deliverer or
20
+ Reviewer tasks never transfers or splits holder ownership.
21
+ - **Deliverer:** builds the change in the appointed worktree and tenders it
22
+ with `deliver`.
23
+ - **Reviewer:** judges the candidate against the Contract terms and records
24
+ `satisfied` or `unsatisfied` with `review`. The holder may review a worker's
25
+ delivery directly.
26
+
27
+ ## 2. Lifecycle And Evidence
28
+
29
+ - **Work & Preview:** commit in the appointed worktree (use `arc` to advance
30
+ complex `kei`s chapter by chapter). Run a delivery preview to inspect the
31
+ candidate, standing evidence, and target movement without mutating state. If
32
+ the target branch moved and conflicts, merge the target head in the
33
+ appointed worktree (or use delivery conflict handoff + dirty capture).
34
+ - **Verify (`verify`):** runs `## Verification` fences in clean scratch against
35
+ the prospective integration when the `verified` gate is selected (without
36
+ `verified`, the section serves as reference documentation).
37
+ - **Deliver (`deliver`) & Review (`review`):** `deliver` tenders the worktree
38
+ candidate; `review` records verdict testimony before or after delivery.
39
+ Neither runs Verification.
40
+ - **Automatic placement:** whichever of `deliver`, satisfied `review`, or
41
+ post-delivery `verify` satisfies the last gate and `after` prerequisite
42
+ automatically lands the candidate (retiring the worktree, settling bound
43
+ Debts, and cascading any ready `after` dependents).
44
+ - **Target movement:** do not manually rebase or re-`deliver` just because the
45
+ target branch moved. Keiyaku re-integrates clean target movement
46
+ automatically, and `review` stays valid as long as the candidate's diff does
47
+ not change. You only need to act if the receipt reports a merge conflict
48
+ (resolve in the worktree and re-`deliver`) or `⧗ awaiting verification ...`
49
+ (run a fresh `verify` directly without re-delivering).
50
+
51
+ ## 3. Commissioning And Next Moves
52
+
53
+ Assign a role `@alias` when calling an Akuma (`keiyaku-akuma`), pass the
54
+ appointed worktree as its working directory, and state the Contract ID,
55
+ worktree path, and current Arc in the prompt:
102
56
 
103
57
  | Role | Commission | Return |
104
58
  | --- | --- | --- |
105
- | Holder | Commission the `kei`, current Arc when one exists, appointed worktree, and holder duties. | Acceptance or abandonment, with receipts. |
106
- | Deliverer | Commission the objective, including explicit Verification when needed: `keiyaku -C <repo> call worker --alias @deliverer --contract <kei/...> --workdir <appointed-path> -` | Requested verify results and delivery receipt. |
107
- | Reviewer | `keiyaku -C <repo> call review-akuma --alias @reviewer --contract <kei/...> --workdir <appointed-path> -` | The verdict receipt. |
108
-
109
- Commission with a clear objective, current Arc when one exists, appointed
110
- worktree, and expected result. Never ask the Akuma that delivered a candidate
111
- to review it. Use `keiyaku-akuma` for invocation and observation, and command
112
- help for exact syntax.
113
-
114
- ## 5. Decide What Happens Next
115
-
116
- The holder checks candidate, verification, review, prerequisites, and gates.
117
-
118
- - A ready delivered candidate claims on delivery, satisfied review, or explicit
119
- verify after its selected work; no separate claim command is needed.
120
- - Missing evidence or unfinished work calls for another commission or chapter.
121
- - Amend when the objective and acceptance boundary remain the same but terms
122
- must change.
123
- - Abandon and bind a new `kei` when the objective or acceptance boundary changes.
124
-
125
- Read `keiyaku-bind` for authoring, `keiyaku-akuma` for delegation, and
126
- `keiyaku-babysit` for supervising multiple lanes.
59
+ | Holder (`@holder-<name>`) | Full `kei`, current Arc, appointed worktree, and holder loop. | Terminal receipt (`accepted` or `abandoned`). |
60
+ | Deliverer (`@deliverer`) | Objective/current Arc, appointed worktree, and whether to run `verify` and `deliver`. | Verify and delivery receipts. |
61
+ | Reviewer (`@reviewer`) | Contract ID, appointed worktree, and instruction to inspect and record `review`. | Review receipt. |
62
+
63
+ - **Unmet gates or review findings:** steer `@deliverer` with `tell`, or open
64
+ the next `arc`.
65
+ - **Terms change within the same objective and boundary:** run `amend`.
66
+ - **Objective or acceptance boundary changes:** `abandon` and bind a new `kei`.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keiyaku",
3
- "version": "4.6.29+codex.20260905023250",
3
+ "version": "4.6.30+codex.20260905023250",
4
4
  "description": "Use the Keiyaku contract, debt, and Akuma CLI.",
5
5
  "author": {
6
6
  "name": "Keiyaku"
@@ -1,36 +1,36 @@
1
1
  ---
2
2
  name: keiyaku
3
3
  description: >-
4
- Keiyaku is a CLI that records unresolved work, writes handoff terms for deliveries,
5
- and calls delegates. Use this skill when you need to figure out which
6
- Keiyaku skill or command to reach for.
4
+ Keiyaku records unresolved work, writes handoff terms for deliveries, and
5
+ calls delegates. Use this skill when deciding which Keiyaku concept or skill
6
+ to reach for.
7
7
  ---
8
8
 
9
9
  # Keiyaku
10
10
 
11
- ## Model
11
+ ## Three Independent Pillars
12
12
 
13
- Keiyaku has three independent pillars: **Debt** records unresolved work,
14
- **Contract** makes acceptance auditable, **Akuma** runs delegates. Use any one
15
- alone. Each Contract in flight has one holder who runs its loop: you by
16
- default, or one Aku you hand the whole loop to.
13
+ Keiyaku has three pillars that work alone or together:
17
14
 
18
- - Shaping and binding a Contract: `keiyaku-bind`
19
- - Holding a Contract to acceptance: `keiyaku-workflow`
20
- - Calling and steering Akumas: `keiyaku-akuma`
21
- - Recording unresolved work: `keiyaku-debt`
22
- - Watching many lanes at once: `keiyaku-babysit`
15
+ - **Debt (`keiyaku-debt`):** confirmed unresolved work and its dependencies.
16
+ Does **not** require a closed design — record a Debt as soon as a problem or
17
+ prerequisite is confirmed, even while the solution is still open.
18
+ - **Contract (`kei`):** one independently acceptable delivery whose objective,
19
+ design, and acceptance boundary are already closed, owned by **one and only
20
+ one holder** (you by default, or one Akuma handed the whole Contract loop). If
21
+ the design is not closed yet, investigate the codebase yourself or send an
22
+ Akuma to settle the approach before binding. Complex `kei`s divide their
23
+ execution into **Arcs** (chapters inside that one acceptance boundary).
24
+ - **Akuma (`keiyaku-akuma`):** delegated workers addressed by `@alias` or
25
+ `AkuId` across parallel lanes.
23
26
 
24
- ## Quick Start
27
+ ## Which Skill To Read
25
28
 
26
- ```bash
27
- keiyaku -C <repo> debt add "title"
28
- keiyaku -C <repo> bind [--debt <debt/...>] -
29
- keiyaku -C <repo> status
30
- keiyaku -C <repo> deliver [<contract>|@<contract>]
31
- keiyaku -C <repo> review [<contract>|@<contract>] --satisfied --summary "<evidence>"
32
- ```
29
+ - Recording or querying unresolved work and prerequisites: `keiyaku-debt`
30
+ - Splitting acceptance boundaries and authoring a Contract: `keiyaku-bind`
31
+ - Running a Contract's fulfillment loop (deliver, verify, review): `keiyaku-workflow`
32
+ - Calling, aliasing, steering, and waiting on Akumas: `keiyaku-akuma`
33
+ - Supervising multiple active Contracts and Akumas in parallel: `keiyaku-babysit`
33
34
 
34
- `-C <path>` sets the invocation directory and with it the World. `--repo <path>`
35
- only picks the Contract repository. `call --workdir <path>` only picks where the
36
- Akuma runs.
35
+ Get exact command or tool syntax from CLI `--help` or the exposed tool
36
+ descriptions.
@@ -8,170 +8,46 @@ description: >-
8
8
 
9
9
  # Keiyaku Akuma
10
10
 
11
- Use Akumas to delegate work to another worker. `call` creates a new Akuma;
12
- `tell` admits a Tell for an existing Akuma; `ask` admits one and observes its
13
- exact answer. Keep the complete AkuId, such as `aku/worker/1234abcd`, when you
14
- need to address the same worker later. An alias such as `@reviewer` is a
15
- shorter, world-local name.
16
-
17
- ## Call a new Akuma
18
-
19
- ```bash
20
- keiyaku call worker "Summarize the recent changes in src/cli"
21
- keiyaku call worker --alias @reviewer --wait 10m - < brief.md
22
- keiyaku call worker
23
- ```
24
-
25
- The prompt is optional for prompt-free birth. Otherwise it is the new Akuma's
26
- first prompt: give it as one argument, or use `-` to read stdin, never both.
27
- Calls are detached by default: they return the new identity after birth without
28
- waiting for the first answer. Use explicit `--wait <duration>` when this
29
- invocation should block while observing that initial work. `--wait` only bounds
30
- this command; it never stops the Akuma. Read `call --help` for flag syntax and
31
- defaults.
32
- To hand a Contract role to an Akuma, use the commissioning table in
33
- `keiyaku-workflow`.
34
-
35
- The selected Akuma name is a reusable worker configuration, not an individual.
36
- Calling it again creates an independent Akuma. Use different names for
37
- capabilities, not merely for parallelism.
38
-
39
- ## Commission Context
40
-
41
- `--contract` only records the association. It neither tells the Akuma about the
42
- Contract nor picks its worktree: pass `--workdir`, and put both in the prompt.
43
-
44
- ```bash
45
- keiyaku call worker --contract kei/add-rate-limit-a1b2 --workdir /path/to/worktree - <<'EOF'
46
- Contract: kei/add-rate-limit-a1b2
47
- Worktree: /path/to/worktree
48
- This Arc: implement the limiter and its tests
49
- EOF
50
- ```
51
-
52
- An Akuma can `keiyaku report` to you mid-turn without stopping. For long work,
53
- ask for it in the prompt (e.g. "report each milestone or blocker"); reports
54
- show up in its `history`.
55
-
56
- ### Verification brief
57
-
58
- When commissioning checks, name the appointed worktree, Contract, all declarations
59
- or current one-based index, and whether dirty capture is authorized:
60
-
61
- ```bash
62
- keiyaku -C <appointed-path> verify <kei/...>
63
- keiyaku -C <appointed-path> verify <kei/...> --index 2 --include-dirty
64
- ```
65
-
66
- Only explicit verify executes declarations. Deliver, review, preview, target
67
- refresh, and dependent completion consume current evidence only. Each check has
68
- independent clean scratch, setup, and cleanup: a required build belongs in that
69
- check's script or setup, never another fence. Evidence names the exact prospective
70
- integration and stable content-derived requirement; the index is only a current
71
- selector. Verify admits no delivery and can place only a previously delivered
72
- candidate whose prerequisites and every gate pass.
73
-
74
- Ask for every executed check's verdict, new or reused testimony admission,
75
- operational stops, retained diagnostic paths, and completion. Reused admission
76
- never means execution was skipped. Normal failure or timeout affects only that
77
- requirement and full verify continues; an operational stop admits no verdict for
78
- the affected check and preserves prior admissions. A selected success establishes
79
- no verdict for other requirements; the generic gate judgment decides whole-gate
80
- satisfaction. Verify runs in the invoking process with its native Git and
81
- process custody.
82
-
83
- ## Tell or ask an existing Akuma
84
-
85
- ```bash
86
- keiyaku tell @reviewer "The candidate moved; re-examine the worktree"
87
- keiyaku tell @reviewer --interrupt - < new-priority.md
88
- keiyaku ask @reviewer --wait 10m "What is your verdict?"
89
- keiyaku ask @reviewer --schema verdict.schema.json - < question.md
90
- ```
91
-
92
- `tell` queues the next instruction and returns without waiting for an answer.
93
- `ask` queues it and waits for that exact answer, bounded by `--wait`.
94
- `--interrupt` admits the Tell and asks current work to yield; the Tell remains
95
- admitted even if yielding cannot be confirmed. A deadline never withdraws it.
96
- Only `ask` takes `--schema`. Read `tell --help` and `ask --help` for syntax.
97
-
98
- ## Observe work
99
-
100
- ```bash
101
- keiyaku wait @deliverer @reviewer
102
- keiyaku wait --all --timeout 30m @deliverer @reviewer
103
- ```
104
-
105
- `wait` returns when any selected Akuma finishes (`--all`: every one). `--timeout`
106
- ends the wait, not the workers. An already finished Akuma counts immediately.
107
- Unlike `ask`, this observes existing work, not a newly submitted instruction.
108
-
109
- `keiyaku wait kei/...` instead waits for the named Contract's next journal
110
- change or terminal state, even without a dispatched Akuma. Each invocation
111
- starts at the current head; an already accepted or abandoned Contract counts
112
- immediately, without being reported as changed. Use `--all` to wait for every
113
- selected Contract, and do not mix Contract and Akuma selectors in one wait.
114
- `kill kei/...` still selects the associated Akumas.
115
-
116
- ## Inspect and retrieve results
117
-
118
- ```bash
119
- keiyaku whoami
120
- keiyaku status
121
- keiyaku status @reviewer
122
- keiyaku ls aku/
123
- keiyaku ls "aku/*/*"
124
- keiyaku ls --mine
125
- keiyaku history @reviewer --last
126
- keiyaku history @reviewer --id turn/3
127
- keiyaku history @reviewer --id report/5
128
- ```
129
-
130
- - `whoami`: who you are; for an Akuma, also who started its current turn.
131
- - `status [<aku>]`: the roster, or one Akuma's state and workdir.
132
- - `ls aku/`: callable names. `ls "aku/*/*"`: recent instances.
133
- `ls --mine`: Akumas you called, plus their descendants in this World.
134
- `--caller` selects another caller; see `ls --help`.
135
- - `history <aku> --id report/N`: the exact retained report text, including during an open Turn.
136
- - `history <aku> --last`: latest answer. `--id turn/N`: one exact turn's
137
- answer or failure diagnostic (ids are in `history <aku> --json`).
138
- Keep the complete AkuId if an alias may move.
139
-
140
- ## Retention
141
-
142
- Akumas idle for more than fifteen days may be cleaned up after a later
143
- successful `call` or `fork`. Running Akumas, alias targets, and Akumas
144
- dispatched to an open Contract are kept, and nothing is killed. Read-only
145
- commands and `tell`/`ask`/`wait` never trigger cleanup.
146
-
147
- ## Stop and branch
148
-
149
- ```bash
150
- keiyaku kill @reviewer
151
- keiyaku fork @reviewer --at turn/3
152
- ```
153
-
154
- `kill` stops current work without admitting a Tell, deleting the Akuma, or
155
- removing its history. `fork` creates a new Akuma from one exact retained
156
- answered history point; the source is unchanged, and providers that cannot
157
- fork report that refusal. See `kill --help` and `fork --help` for the
158
- complete grammar.
159
-
160
- ## JavaScript automation
161
-
162
- Use [Automation With The Akuma API](references/automation.md) for a
163
- job-specific JavaScript coordinator, structured answers, or multi-worker
164
- orchestration. The CLI is enough for one commission and its return. A
165
- prompt-free birth followed by one input-bound ask uses the same identity:
166
-
167
- ```ts
168
- import { Akuma, Akumas, World } from "@astrosheep/keiyaku";
169
-
170
- const root = await World.at(process.cwd());
171
- const called = await Akumas.of(root).call({ archetype: "worker" });
172
- const worker = Akuma.select(root, called.akuma);
173
- const result = await worker.ask("Inspect the change");
174
- console.log(result.observation);
175
- ```
176
-
177
- The automation guide covers schema-based answer handling and longer workflows.
11
+ Use Akumas to delegate implementation, review, verification, or parallel
12
+ research.
13
+
14
+ ## 1. Aliases And Operations (`call`, `tell`, `ask`, `wait`)
15
+
16
+ - **Give every worker an `@alias` at birth:** assign a role or lane alias when
17
+ calling an Akuma (`@deliverer`, `@reviewer`, `@scout`). Aliases make
18
+ `status`, `wait`, `tell`, `ask`, and `history` readable by role across
19
+ parallel lanes; keep the underlying `aku/<name>/<id>` only when reassigning
20
+ that `@alias` to a replacement worker. Calling an archetype name (`worker`,
21
+ `review-akuma`) always spawns a new instance — address the existing `@alias`
22
+ or `AkuId` with `tell`/`ask` to continue with the same worker.
23
+ - **Detached `call` + `wait` for real work:** launch workers detached, then
24
+ supervise them together with `wait` (wakes on any settlement by default, or
25
+ all; a wait deadline never kills workers). `wait` on `kei/...` waits for a
26
+ Contract's next journal change or terminal state.
27
+ - **`ask` for single-turn answers:** submits an instruction and waits for that
28
+ exact Turn's answer (optionally validated against a JSON schema).
29
+ - **`tell` vs. interrupting `tell`:** `tell` queues steering instructions
30
+ without blocking; request an interrupt only when the worker is on the wrong
31
+ track and should yield its current attempt first.
32
+
33
+ ## 2. Commissioning Context
34
+
35
+ - **Set both Contract association and working directory:** associating a
36
+ `kei/...` records Dispatch for `status`, but neither sets the working
37
+ directory nor injects Contract terms into the prompt. Point the working
38
+ directory at the appointed worktree and write the Contract ID, worktree path,
39
+ current Arc, and expected return in the prompt.
40
+ - **Request `report` on long tasks:** a worker can record mid-turn progress
41
+ reports without stopping; inspect them in `history`.
42
+
43
+ ## 3. Observing, Branching, And Automation
44
+
45
+ - **`status` and `history`:** `status` shows the World board or one Akuma's
46
+ live snapshot and file-change summary; `history` reads recent timeline
47
+ events, the latest answer, or one exact `turn/N` or `report/N` item.
48
+ - **`ls`, `fork`, and `kill`:** `ls` lists archetypes (`aku/`), recent
49
+ instances (`"aku/*/*"`), or your own call tree; `fork` branches a new Akuma
50
+ from an answered `turn/N`; `kill` stops active work while keeping history.
51
+ - **JavaScript orchestration:** for multi-agent tournaments, adversarial claim
52
+ checking, or custom concurrency control in code, read
53
+ [Automation With The Akuma API](references/automation.md).