@astrosheep/keiyaku 4.6.26 → 4.6.27

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 (41) hide show
  1. package/README.md +37 -0
  2. package/build/plugins/claude/skills/keiyaku/SKILL.md +14 -26
  3. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +26 -41
  4. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +9 -18
  5. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +3 -14
  6. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +13 -8
  7. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +14 -38
  8. package/build/plugins/codex/skills/keiyaku/SKILL.md +14 -26
  9. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +26 -41
  10. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +9 -18
  11. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +3 -14
  12. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +13 -8
  13. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +14 -38
  14. package/build/plugins/opencode/skills/keiyaku/SKILL.md +14 -26
  15. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +26 -41
  16. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +9 -18
  17. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +3 -14
  18. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +13 -8
  19. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +14 -38
  20. package/build/skills/keiyaku/SKILL.md +14 -26
  21. package/build/skills/keiyaku-akuma/SKILL.md +26 -41
  22. package/build/skills/keiyaku-akuma/references/automation.md +9 -18
  23. package/build/skills/keiyaku-bind/SKILL.md +3 -14
  24. package/build/skills/keiyaku-debt/SKILL.md +13 -8
  25. package/build/skills/keiyaku-workflow/SKILL.md +14 -38
  26. package/build/src/akuma/providers/codex-app-server/events.d.ts +1 -1
  27. package/build/src/akuma/providers/codex-app-server/events.js +1 -3
  28. package/build/src/cli/commands/akuma-grammar.js +4 -4
  29. package/build/src/cli/commands/contract-help.js +49 -73
  30. package/build/src/cli/commands/debt-grammar.js +15 -15
  31. package/build/src/cli/commands/install.d.ts +1 -1
  32. package/build/src/cli/commands/install.js +1 -2
  33. package/build/src/cli/parse.js +1 -1
  34. package/build/src/runtime/proc/windows-launch.exe +0 -0
  35. package/package.json +1 -1
  36. package/skills/keiyaku/SKILL.md +14 -26
  37. package/skills/keiyaku-akuma/SKILL.md +26 -41
  38. package/skills/keiyaku-akuma/references/automation.md +9 -18
  39. package/skills/keiyaku-bind/SKILL.md +3 -14
  40. package/skills/keiyaku-debt/SKILL.md +13 -8
  41. package/skills/keiyaku-workflow/SKILL.md +14 -38
@@ -41,18 +41,16 @@ export const CONTRACT_COMMAND_SPECS = {
41
41
  " # <title>",
42
42
  " ## Context motivation, authority, baseline, and boundaries",
43
43
  " ## Objective one observable end state",
44
- " ## Design the approach, important decisions, and ordering",
45
- " leave implementation details to the person doing the work",
44
+ " ## Design settled design: decisions the implementation must follow",
46
45
  " ## Region narrowest justified intended writes for this approach, one pattern per line",
47
46
  " ## Criteria one or more ### <criterion> entries",
48
47
  " ## Verification optional fenced executor declarations",
49
48
  "",
50
- "Region accepts the narrowest justified intended writes for this approach, not every potentially",
51
- "involved file. Do not use broad directory fallbacks or redundant parent/child patterns. Patterns",
52
- "are fenced lines, list items, or bare lines; the three forms union. Put one repository-relative",
53
- "path pattern on each nonblank line. A trailing '/' is directory shorthand for 'path/**'.",
54
- "A pattern containing whitespace binds with a warning. A fence carries no",
55
- "info string or exactly 'txt'.",
49
+ "Region lists the narrowest writes this approach needs, not every file involved;",
50
+ "avoid broad directories and redundant parent/child patterns. Put one repository-relative",
51
+ "pattern per nonblank line: bare lines, list items, or fences (no info string, or",
52
+ "txt) are combined. A trailing '/' means 'path/**'. Whitespace in a pattern",
53
+ "binds with a warning.",
56
54
  "",
57
55
  "Verification runs only with the verified gate; without it the section is inert text.",
58
56
  "Verification uses one or more closed bash, zsh, or pwsh fences. Its fence",
@@ -67,17 +65,13 @@ export const CONTRACT_COMMAND_SPECS = {
67
65
  usage: "amend [<contract>|@<contract>] [--after <kei/...> [--after <kei/...>]... | --clear-after] [--gates <name,...>] [--actor <actor>] [--repo <path>] [-]",
68
66
  purpose: "Change a Contract's document, prerequisites, or acceptance gates.",
69
67
  details: [
70
- "Gates are acceptance obligations checked at placement: reviewed awaits a",
71
- "satisfied review, verified awaits a passing Verification run.",
72
- "",
73
- "--gates <name,...> replaces gates using reviewed, verified, or named gate groups",
74
- "from Settings (keiyaku settings). A group expands into its gates; unknown names",
75
- "are rejected with the known names listed. Custom gates must be declared in a",
76
- "configured group. Duplicates are removed in first-seen order.",
77
- "Names match ^[a-z][a-z0-9-]{0,63}$.",
78
- 'Omitting --gates leaves gates unchanged; --gates "" clears them.',
68
+ "Gates are checked at integration: reviewed needs a satisfied review;",
69
+ "verified needs passing Verification. --gates <name,...> replaces them with",
70
+ "reviewed, verified, or configured groups (see keiyaku settings).",
71
+ 'Omitting --gates keeps them; --gates "" clears them.',
79
72
  "",
80
- " ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add new extension)",
73
+ "stdin is an amendment; each heading is one edit:",
74
+ " ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add a new extension)",
81
75
  " ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
82
76
  " ## Append: Context|Objective|Design|Criteria|<extension>",
83
77
  " ## Add: Criteria|<new-extension-title>",
@@ -100,22 +94,33 @@ export const CONTRACT_COMMAND_SPECS = {
100
94
  usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--overwrite] [--repo <path>]\ndeliver [<contract>|@<contract>] --dry-run [--include-dirty] [--show-diff] [--repo <path>]",
101
95
  purpose: "Submit work for a Contract and integrate it when its requirements are met.",
102
96
  details: [
103
- "The Contract, not the current Arc, sets what delivery must satisfy. An Arc records progress; it does not narrow acceptance.",
104
- "With the verified gate, delivery runs Verification or reuses current satisfied evidence.",
105
- "Verification, integration, and cleanup progress appears on stderr; stdout contains one final result.",
106
- "By default, delivery uses HEAD. --include-dirty includes all non-ignored worktree changes, staged or not; it leaves your branch and index unchanged, so staging or committing is unnecessary.",
107
- "Repeating delivery with unchanged work resumes unfinished verification or integration. Changed work replaces the candidate.",
108
- "Delivery requests integration. If prerequisites and gates pass, it integrates now and accepts the Contract; otherwise the candidate remains waiting.",
109
- "Only changed candidate work invalidates earlier review. If Verification did not finish, repeating delivery resumes that candidate; --overwrite replaces it.",
110
- "Delivery never counts as an independent review verdict.",
111
- "--dry-run observes the candidate, preparation conflicts, standing Verification evidence and target followability without submitting work. It never runs Verification or hooks, places, reconciles, settles, or continues dependents. Real delivery observes again; a prepared candidate is not a promise of acceptance.",
112
- "--show-diff includes the proposed diff and requires --dry-run. --message, --materialize-conflict and --overwrite are refused with --dry-run.",
113
- "Preview may create ref-free Git objects and a transient private index; refs, the real index, worktree bytes and worktree registrations are preserved.",
114
- "Content identity names the change's content hash, never a commit; it survives rebase and Git cannot look it up.",
97
+ "Delivery is judged against the whole Contract, not the current Arc. It uses",
98
+ "HEAD. With the verified gate it runs Verification or reuses current satisfied",
99
+ "evidence. If prerequisites and gates pass, it integrates and accepts now;",
100
+ "otherwise the candidate waits. Delivery never counts as a review.",
101
+ "",
102
+ "Repeating delivery with unchanged work resumes unfinished Verification or",
103
+ "integration. Changed work replaces the candidate and invalidates earlier review.",
104
+ "Identical content keeps review across rebase or target movement.",
105
+ "",
106
+ "Progress goes to stderr; stdout carries one final result. Ctrl-C requests a",
107
+ "stop and waits for the final receipt; it does not roll back admitted work.",
108
+ "Content identity is a content hash, not a commit: it survives rebase, and Git",
109
+ "cannot look it up.",
110
+ "",
111
+ " --include-dirty Include all non-ignored changes, staged or not;",
112
+ " capturing them leaves your branch and index unchanged.",
113
+ " --message Set the delivery commit's subject.",
114
+ " --dry-run Preview candidate, conflicts, standing evidence and",
115
+ " target followability. No Verification, hooks or",
116
+ " integration; refs, index and worktrees stay untouched.",
117
+ " Real delivery checks again; preview promises no acceptance.",
118
+ " --show-diff Include the proposed diff; requires --dry-run.",
119
+ " --materialize-conflict Write the observed conflict as an uncommitted merge.",
120
+ " With --include-dirty, preserve current changes first.",
121
+ " --overwrite Bypass reuse of a candidate with unfinished Verification.",
115
122
  "",
116
- " --materialize-conflict Write the observed integration conflict into the worktree as an uncommitted merge.",
117
- " With --include-dirty, current non-ignored changes are preserved first.",
118
- " --overwrite Replace a candidate whose Verification has not finished.",
123
+ "--message, --materialize-conflict and --overwrite are refused with --dry-run.",
119
124
  ].join("\n"),
120
125
  },
121
126
  review: {
@@ -230,55 +235,26 @@ export function renderContractHelp(command) {
230
235
  const spec = CONTRACT_COMMAND_SPECS[command];
231
236
  if (command === "settings") {
232
237
  return [
233
- "Show effective Settings — the merged read-only view of:",
238
+ "Show effective Settings (read-only), merged from:",
234
239
  " user ~/.keiyaku/settings.json",
235
240
  " project <WorldRoot>/.keiyaku/settings.json",
236
- "A project record wholly shadows the same-name user record.",
241
+ "A project record wholly shadows the same-name user record. Edit the files",
242
+ "directly; there is no write command.",
237
243
  "",
238
- "Shape: namespace -> entry -> JSON value. There is no write",
239
- "command; edit the files directly.",
244
+ usageLine(spec.usage),
240
245
  "",
241
246
  "Recognized settings:",
242
- " gates named gate groups selected by bind and amend",
243
- " worktree commands run when worktrees are created or destroyed",
244
- " git.requireBranchesToBeUpToDate whether delivery and its preview require up-to-date target branches",
245
- " providers the available Akuma and how each is run",
246
- "",
247
- "Each entry is validated by the feature that reads it. A rejected",
248
- "value's diagnostic states the expected shape.",
247
+ " gates named gate groups for bind/amend --gates",
248
+ " worktree commands run when Contract worktrees are created or destroyed",
249
+ " git.requireBranchesToBeUpToDate whether delivery and preview require an up-to-date target",
250
+ " providers Akuma providers and how each is run",
249
251
  "",
250
252
  "Akuma definitions are Markdown files, one per name:",
251
253
  " user ~/.keiyaku/akumas/<name>.md",
252
254
  " project <WorldRoot>/.keiyaku/akumas/<name>.md",
253
- "A project file wholly shadows the same-name user file. YAML",
254
- "frontmatter selects the provider and may declare base, model,",
255
- "effort, network, allowed, systemPromptMode, and description; the body is",
256
- "an optional system prompt.",
257
- "",
258
- "Local Paseo provider in settings.json:",
259
- ' { "providers": { "paseo": {',
260
- ' "kind": "paseo",',
261
- ' "config": { "url": "ws://127.0.0.1:6767/ws", "provider": "claude" }',
262
- " } } }",
263
- "The native provider id is bare (claude, codex, pi), not provider/model.",
264
- "Example .keiyaku/akumas/paseo-worker.md frontmatter:",
265
- " ---",
266
- " provider: paseo",
267
- " model: <native-model-id>",
268
- " effort: high",
269
- " ---",
270
- "Model and effort must be offered by the selected native provider;",
271
- "effort names its native thinking option id.",
272
- 'PASEO_PASSWORD=<password> keiyaku call paseo-worker "<prompt>"',
273
- "Paseo must already be running locally. Resume keeps its live native",
274
- "runtime; after Paseo native reload/restart create a fresh Akuma.",
275
- "Observed busy agents refuse; native steer still has a check/send race.",
276
- "Explicit control cancels native current execution session-wide and may",
277
- "affect concurrent human work. Normal completion only retires the client",
278
- "and its sockets; it never cancels later work or closes the native runtime.",
279
- "Socket closure does not prove native cancellation succeeded.",
280
- "",
281
- usageLine(spec.usage),
255
+ "Project wins. Frontmatter: provider, base, model, effort, network, allowed,",
256
+ "systemPromptMode, description. The body is an optional system prompt.",
257
+ "Provider setup: see README Configuration.",
282
258
  ].join("\n");
283
259
  }
284
260
  const help = `${spec.purpose}\n\n${usageLine(spec.usage)}`;
@@ -24,8 +24,8 @@ const DEBT_COMMAND_SPECS = {
24
24
  usage: `debt add <TITLE> [--namespace <ns>] [--priority 0..3]
25
25
  [--state open|done|drop]
26
26
  [--note <text>] [--actor <actor>]
27
- [--needs <DebtId>]... [--parent <DebtId>]
28
- [--supersedes <DebtId>]... [--relates <DebtId>]...
27
+ [--needs <debt/...>]... [--parent <debt/...>]
28
+ [--supersedes <debt/...>]... [--relates <debt/...>]...
29
29
  [--body <text>]
30
30
  debt add [--namespace <ns>] [--actor <actor>] -`,
31
31
  purpose: "Create a Debt from flags or a Debt document on stdin.",
@@ -34,13 +34,13 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
34
34
  show: {
35
35
  arity: [1, Number.POSITIVE_INFINITY],
36
36
  flags: COMMON,
37
- usage: "debt show <DebtId>...",
37
+ usage: "debt show <debt/...>...",
38
38
  purpose: "Read one or more Debts and their relationships.",
39
39
  },
40
40
  ls: {
41
41
  arity: [0, 1],
42
42
  flags: { ...COMMON, closed: "boolean", all: "boolean", world: "boolean", limit: "value" },
43
- usage: "debt ls [<namespace-selector>] [--closed | --all] [--world] [--limit <n>]",
43
+ usage: "debt ls [<namespace-selector>] [--closed | --all] [--world] [--limit <count>]",
44
44
  purpose: "List Debts in the selected namespace.",
45
45
  details: [
46
46
  "With no selector, lists the current directory Debt context.",
@@ -50,14 +50,14 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
50
50
  ready: {
51
51
  arity: [0, 0],
52
52
  flags: { ...COMMON, world: "boolean", parent: "value", limit: "value" },
53
- usage: "debt ready [--world] [--parent <DebtId>] [--limit <n>]",
53
+ usage: "debt ready [--world] [--parent <debt/...>] [--limit <count>]",
54
54
  purpose: "List open Debts whose every dependency is complete or dropped.",
55
55
  details: "--world lists every namespace in the current Debt world.",
56
56
  },
57
57
  blocked: {
58
58
  arity: [0, 0],
59
59
  flags: { ...COMMON, world: "boolean", parent: "value", limit: "value" },
60
- usage: "debt blocked [--world] [--parent <DebtId>] [--limit <n>]",
60
+ usage: "debt blocked [--world] [--parent <debt/...>] [--limit <count>]",
61
61
  purpose: "List Debts with unmet dependencies.",
62
62
  details: "--world lists every namespace in the current Debt world.",
63
63
  },
@@ -73,7 +73,7 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
73
73
  limit: "value",
74
74
  },
75
75
  usage: `debt query [--where <expression>] [--closed | --all] [--world]
76
- [--sort priority|created|updated|id] [--limit <n>]`,
76
+ [--sort priority|created|updated|id] [--limit <count>]`,
77
77
  purpose: "Filter and sort Debts with a boolean expression.",
78
78
  details: [
79
79
  "fields: state priority title id parent under needs blocks ready blocked created updated",
@@ -89,7 +89,7 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
89
89
  tree: {
90
90
  arity: [1, 1],
91
91
  flags: COMMON,
92
- usage: "debt tree <DebtId>",
92
+ usage: "debt tree <debt/...>",
93
93
  purpose: "Show a Debt and its parent/child breakdown.",
94
94
  },
95
95
  doctor: {
@@ -116,12 +116,12 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
116
116
  relates: "repeat",
117
117
  "drop-relates": "repeat",
118
118
  },
119
- usage: `debt update <DebtId> [--title <text>] [--body <text>|- | --append <text>]
119
+ usage: `debt update <debt/...> [--title <text>] [--body <text>|- | --append <text>]
120
120
  [--note <text>]
121
- [--priority 0..3] [--needs <DebtId>]... [--drop-needs <DebtId>]...
122
- [--parent <DebtId> | --no-parent]
123
- [--supersedes <DebtId>]... [--drop-supersedes <DebtId>]...
124
- [--relates <DebtId>]... [--drop-relates <DebtId>]...`,
121
+ [--priority 0..3] [--needs <debt/...>]... [--drop-needs <debt/...>]...
122
+ [--parent <debt/...> | --no-parent]
123
+ [--supersedes <debt/...>]... [--drop-supersedes <debt/...>]...
124
+ [--relates <debt/...>]... [--drop-relates <debt/...>]...`,
125
125
  purpose: "Change a Debt's fields and relationships.",
126
126
  details: [
127
127
  "--body replaces the body; --append adds text after it, separated by a newline when needed.",
@@ -131,13 +131,13 @@ debt add [--namespace <ns>] [--actor <actor>] -`,
131
131
  done: {
132
132
  arity: [1, Number.POSITIVE_INFINITY],
133
133
  flags: { ...COMMON, note: "value" },
134
- usage: "debt done <DebtId>... [--note <text>]",
134
+ usage: "debt done <debt/...>... [--note <text>]",
135
135
  purpose: "Mark one or more Debts done.",
136
136
  },
137
137
  drop: {
138
138
  arity: [1, Number.POSITIVE_INFINITY],
139
139
  flags: { ...COMMON, note: "value" },
140
- usage: "debt drop <DebtId>... [--note <text>]",
140
+ usage: "debt drop <debt/...>... [--note <text>]",
141
141
  purpose: "Mark one or more Debts as no longer needed.",
142
142
  },
143
143
  context: {
@@ -1,4 +1,4 @@
1
- import { type CliOutcome } from "../streams.js";
1
+ import type { CliOutcome } from "../streams.js";
2
2
  import type { ProcessInput, ProcessOutcome } from "../../runtime/proc/run.js";
3
3
  declare const HARNESS_NAMES: readonly ["codex", "claude", "opencode", "pi"];
4
4
  type HarnessName = (typeof HARNESS_NAMES)[number];
@@ -1,4 +1,3 @@
1
- import { cliExitCode } from "../streams.js";
2
1
  import { dirname, resolve } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
4
3
  import { CliUsageError, commandGuide, usageLine } from "../usage.js";
@@ -45,7 +44,7 @@ export function parseInstallCommand(argv) {
45
44
  };
46
45
  }
47
46
  export function renderInstallHelp() {
48
- return `${INSTALL_ROOT_PURPOSE}\n\n${usageLine(INSTALL_USAGE)}\n\n--all continues past failures; any failure exits ${cliExitCode("failed")}.`;
47
+ return `${INSTALL_ROOT_PURPOSE}\n\n${usageLine(INSTALL_USAGE)}\n\n--all continues past failures and fails if any harness failed.`;
49
48
  }
50
49
  const INSTALL_TIMEOUT_MS = 5 * 60 * 1000;
51
50
  const ASSET_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../../../plugins");
@@ -87,7 +87,7 @@ export function renderHelp(coordinate, columns) {
87
87
  case "install":
88
88
  return renderInstallHelp();
89
89
  case "whoami":
90
- return `${WHOAMI_PURPOSE}\n\n${usageLine(WHOAMI_USAGE)}\n\nRead-only; an Akuma's current initiator and birth parent are distinct. Absent, invalid, and unavailable facts remain explicit.`;
90
+ return `${WHOAMI_PURPOSE}\n\n${usageLine(WHOAMI_USAGE)}\n\nRead-only. For an Akuma, who started its current turn is shown apart from who called it. Missing or unreadable facts stay explicit.`;
91
91
  case "akuma":
92
92
  return renderAkumaHelp(coordinate.action);
93
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrosheep/keiyaku",
3
- "version": "4.6.26",
3
+ "version": "4.6.27",
4
4
  "workspaces": [
5
5
  "plugins/square",
6
6
  "plugins/paseo/forwarder"
@@ -10,39 +10,27 @@ description: >-
10
10
 
11
11
  ## Model
12
12
 
13
- Keiyaku is three independent pillars, not a bundle: **Debt** records unresolved
14
- work and dependencies, **Contract** makes acceptance standing and auditable,
15
- **Akuma** invokes capability. Use any one alone; combine them only when the
16
- work calls for it. Behind every Contract in flight there is one holder of its
17
- fulfillment loop — whoever turns intent into commissions and returns into
18
- decisions. The flagship holds it by default, and may hand a whole Contract's
19
- loop to one Aku in a single commission; the harness serves both styles
20
- equally. See `keiyaku-workflow` for the loop, `keiyaku-bind` for authoring,
21
- `keiyaku-akuma` for invocation.
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.
17
+
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`
22
23
 
23
24
  ## Quick Start
24
25
 
25
26
  ```bash
26
27
  keiyaku -C <repo> debt add "title"
27
- keiyaku -C <repo> bind [--debt <debt-id>] -
28
+ keiyaku -C <repo> bind [--debt <debt/...>] -
28
29
  keiyaku -C <repo> status
29
30
  keiyaku -C <repo> deliver [<contract>|@<contract>]
30
31
  keiyaku -C <repo> review [<contract>|@<contract>] --satisfied --summary "<evidence>"
31
32
  ```
32
33
 
33
- `-C` selects the invocation cwd and therefore the World. `--repo <path>` only
34
- selects the Contract repository; it never retargets that World. `call
35
- --workdir <path>` selects execution cwd (relative to the effective invocation
36
- cwd). Without it, the call uses the invocation cwd; `--contract` associates a
37
- Contract without selecting an execution directory.
38
-
39
- An Akuma caller can find its own delegation tree with `keiyaku ls --mine` (or an
40
- explicit `--caller`); see `keiyaku-akuma` for the roster and its text labels.
41
-
42
- `deliver` and `review` may take time after their leading admission.
43
- `deliver --dry-run` only observes the prospective candidate, standing evidence,
44
- and target followability; it never runs Verification or hooks or admits work.
45
- Their witnessed progress is ephemeral stderr output; stdout remains one final
46
- text or JSON result. Ctrl-C asks the owned operation to stop and waits for its
47
- truthful final receipt, so it is not evidence that an already admitted action
48
- was rolled back.
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.
@@ -37,8 +37,8 @@ capabilities, not merely for parallelism.
37
37
 
38
38
  ## Commission Context
39
39
 
40
- `--contract` only records the association. It does not tell the Akuma the
41
- Contract or worktree. Put them in the prompt explicitly:
40
+ `--contract` only records the association. It neither tells the Akuma about the
41
+ Contract nor picks its worktree: pass `--workdir`, and put both in the prompt.
42
42
 
43
43
  ```bash
44
44
  keiyaku call worker --contract kei/add-rate-limit-a1b2 --workdir /path/to/worktree - <<'EOF'
@@ -48,7 +48,9 @@ This Arc: implement the limiter and its tests
48
48
  EOF
49
49
  ```
50
50
 
51
- `--contract` does not choose a worktree. Use `--workdir <path>` when needed.
51
+ An Akuma can `keiyaku report` to you mid-turn without stopping. For long work,
52
+ ask for it in the prompt (e.g. "report each milestone or blocker"); reports
53
+ show up in its `history`.
52
54
 
53
55
  ## Tell or ask an existing Akuma
54
56
 
@@ -59,14 +61,11 @@ keiyaku ask @reviewer --wait 10m "What is your verdict?"
59
61
  keiyaku ask @reviewer --schema verdict.schema.json - < question.md
60
62
  ```
61
63
 
62
- `tell` admits the next instruction and returns its admission receipt; it does
63
- not await an answer. `ask` admits a Tell and observes that exact answer,
64
- unbounded unless `--wait` limits observation. Both require a prompt. With
65
- `--interrupt`, the Tell is admitted while current work is asked to yield; an
66
- admitted Tell remains recoverable even if settlement cannot be proven. Schema
67
- belongs only to `ask`; `tell --schema` and `tell --wait` refuse and point to
68
- `ask`. A deadline never withdraws an admitted Tell. Read `tell --help` and
69
- `ask --help` for the complete flag grammar.
64
+ `tell` queues the next instruction and returns without waiting for an answer.
65
+ `ask` queues it and waits for that exact answer, bounded by `--wait`.
66
+ `--interrupt` admits the Tell and asks current work to yield; the Tell remains
67
+ admitted even if yielding cannot be confirmed. A deadline never withdraws it.
68
+ Only `ask` takes `--schema`. Read `tell --help` and `ask --help` for syntax.
70
69
 
71
70
  ## Observe work
72
71
 
@@ -75,11 +74,9 @@ keiyaku wait @deliverer @reviewer
75
74
  keiyaku wait --all --timeout 30m @deliverer @reviewer
76
75
  ```
77
76
 
78
- Use `wait` for one or more existing Akumas. The default is `--any`; use
79
- `--all` for every selected Akuma. `--timeout` limits observation and does not
80
- stop workers. A completed Akuma already counts, so repeating a wait can return
81
- immediately. See `wait --help` for the complete grammar. Unlike `ask`, `wait`
82
- observes existing Akuma-wide work, not the answer to a newly admitted Tell.
77
+ `wait` returns when any selected Akuma finishes (`--all`: every one). `--timeout`
78
+ ends the wait, not the workers. An already finished Akuma counts immediately.
79
+ Unlike `ask`, this observes existing work, not a newly submitted instruction.
83
80
 
84
81
  ## Inspect and retrieve results
85
82
 
@@ -94,33 +91,21 @@ keiyaku history @reviewer --last
94
91
  keiyaku history @reviewer --id turn/3
95
92
  ```
96
93
 
97
- `whoami` shows self and, for an Akuma, its current Turn initiator and birth profile without
98
- creating a World or changing Square. `status` shows the roster or one Akuma's
99
- workdir; use `keiyaku status <aku/...|@alias> --json` to inspect `status.allowed`.
100
- `ls aku/` shows callable names; `ls "aku/*/*"` shows recent retained instances.
101
- `ls --mine` narrows that roster to Akumas this process's caller called and their
102
- transitive descendants in this World; `--caller <integration>:<id>` or
103
- `--caller aku/<name>/<suffix>` names the same selection explicitly. Descendant
104
- rows show their immediate caller as `· by <akuId>`. The selection is World-local
105
- and refuses for Contract, Debt, and Akuma-name catalogues.
106
- `history --last` reads the latest complete answer; `history --id` reads an
107
- exact retained terminal turn's answer or failure diagnostic. Find its `historyId`
108
- in paged `keiyaku history <aku/...|@alias> --json`. Use the complete AkuId when
109
- an alias may move; see `history --help` for paging.
94
+ - `whoami`: who you are; for an Akuma, also who started its current turn.
95
+ - `status [<aku>]`: the roster, or one Akuma's state and workdir. `--json` shows `allowed`.
96
+ - `ls aku/`: callable names. `ls "aku/*/*"`: recent instances.
97
+ `ls --mine`: Akumas you called, plus their descendants in this World.
98
+ `--caller` selects another caller; see `ls --help`.
99
+ - `history <aku> --last`: latest answer. `--id turn/N`: one exact turn's
100
+ answer or failure diagnostic (ids are in `history <aku> --json`).
101
+ Keep the complete AkuId if an alias may move.
110
102
 
111
103
  ## Retention
112
104
 
113
- An Akuma whose latest durable life or activity is older than fifteen days may be
114
- retired after a later successful `call` or `fork`. Retention keeps any running
115
- Akuma, any current alias target, any Akuma dispatched to a Contract that is not
116
- yet `claimed` or `abandoned`, unborn or stillborn allocations, and unreadable
117
- entries. It removes only the Akuma's recognized runtime custody; it never kills
118
- a worker and never rewrites another Akuma, Contract, Debt, or alias. Its final
119
- Heart re-read keeps a pending Tell it observes; a Tell admitted immediately
120
- after that read is best-effort, not atomic. There is no timer and no prune
121
- command. Observation and Tell commands (`whoami`, `status`, `ls`, `history`,
122
- `wait`, `tell`, `ask`) never trigger retention; without a later successful
123
- `call`/`fork`, old entries simply remain.
105
+ Akumas idle for more than fifteen days may be cleaned up after a later
106
+ successful `call` or `fork`. Running Akumas, alias targets, and Akumas
107
+ dispatched to an open Contract are kept, and nothing is killed. Read-only
108
+ commands and `tell`/`ask`/`wait` never trigger cleanup.
124
109
 
125
110
  ## Stop and branch
126
111
 
@@ -138,7 +123,7 @@ complete grammar.
138
123
  ## JavaScript automation
139
124
 
140
125
  Use [Automation With The Akuma API](references/automation.md) for a
141
- debt-specific JavaScript coordinator, structured answers, or multi-worker
126
+ job-specific JavaScript coordinator, structured answers, or multi-worker
142
127
  orchestration. The CLI is enough for one commission and its return. A
143
128
  prompt-free birth followed by one input-bound ask uses the same identity:
144
129
 
@@ -1,15 +1,14 @@
1
1
  # Automation With The Akuma API
2
2
 
3
3
  Use this guide when the work calls for a program that coordinates agents,
4
- not a sequence of manual CLI calls. Start with the current debt, invent an
5
- appropriate algorithm, write it as ordinary JavaScript, and run it. Treat
6
- examples here as material to adapt, not a mandatory workflow or a new product
7
- API. Product semantics remain owned by the repository's `docs/` chapters.
4
+ not a sequence of manual CLI calls. Start with the current job, choose an
5
+ appropriate algorithm, write it as ordinary JavaScript, and run it. Adapt the
6
+ examples to the work.
8
7
 
9
- ## Write A Harness For This Debt
8
+ ## Write A Harness For This Job
10
9
 
11
10
  A dynamic workflow is more than parallel delegation. The flagship writes a
12
- small, debt-specific program whose variables hold intermediate answers and
11
+ small, job-specific program whose variables hold intermediate answers and
13
12
  whose control flow performs comparisons, branching, filtering, experiments,
14
13
  and verification. Only the useful final result needs to enter the flagship's
15
14
  context. The program itself is an inspectable, reusable artifact.
@@ -21,7 +20,7 @@ The useful combination is:
21
20
  - JavaScript holds the plan, candidate sets, budgets, and stopping conditions.
22
21
  - AkuId lets a later step reconnect to an existing worker when continuity helps.
23
22
 
24
- Reach for this when the debt needs many independent judgments, repeated
23
+ Reach for this when the job needs many independent judgments, repeated
25
24
  experiments, adversarial checking, or a reusable orchestration artifact. A
26
25
  single bounded question usually needs one worker, not a panel.
27
26
 
@@ -30,7 +29,7 @@ single bounded question usually needs one worker, not a panel.
30
29
  Do not stop at "one reviewer per directory." Choose an algorithm around the
31
30
  judgment you need:
32
31
 
33
- | Debt | Debt-specific orchestration |
32
+ | Job | Job-specific orchestration |
34
33
  | --- | --- |
35
34
  | Find a name or visual direction with taste | Generate candidates from deliberately different directions; anonymize them; run pairwise judging agents; retain finalists and rejection reasons; generate another round against the discovered weaknesses. |
36
35
  | Rank a large qualitative backlog | Use agents as comparators, with code maintaining buckets or tournament brackets. Repeat disputed comparisons. Do not assume subjective preferences are transitive or absolute scores calibrated. |
@@ -118,7 +117,7 @@ unknowns in the requested value; acceptance still needs a suitable judge.
118
117
  The following continues the script above. One agent determines the claim set;
119
118
  code fans out verification with bounded concurrency; only supported claims go
120
119
  to fresh skeptics. The program keeps every item's success or failure. Adapt
121
- the prompts, schemas, routing, and selection to the debt rather than always
120
+ the prompts, schemas, routing, and selection to the job rather than always
122
121
  running this exact pipeline.
123
122
 
124
123
  ```js
@@ -206,7 +205,7 @@ console.log(JSON.stringify(
206
205
 
207
206
  This script has a bounded work set (12 claims), at most two item pipelines in
208
207
  flight, and at most two fresh judges per claim. Each item advances to its own
209
- next stage without waiting for unrelated items. A different debt might need
208
+ next stage without waiting for unrelated items. A different job might need
210
209
  pairwise comparisons, experiment queues, or adaptive sampling instead.
211
210
 
212
211
  ## Failure, Control, And Reconnection
@@ -259,11 +258,3 @@ CLI's `akuma.initiating` observation. A Tell may carry an explicit `initiator`,
259
258
  but a name alone is not registration of its callable Square route. Completion
260
259
  signals remain optional observer side effects. Use awaited results and durable
261
260
  observations for program control, not delivery notifications as receipts.
262
-
263
- ## Inspiration
264
-
265
- These are sources of techniques, not Keiyaku runtime guarantees:
266
-
267
- - [A harness for every debt: dynamic workflows in Claude Code](https://claude.com/blog/a-harness-for-every-debt-dynamic-workflows-in-claude-code)
268
- - [Orchestrate subagents at scale with dynamic workflows](https://platform.claude.com/cookbook/claude-agent-sdk-08-dynamic-workflows)
269
- - [Claude Code workflow runtime](https://code.claude.com/docs/en/workflows)
@@ -24,20 +24,9 @@ Settle these facts first:
24
24
  - the affected Region;
25
25
  - the one holder responsible for the `kei`.
26
26
 
27
- The Design section is a detailed design document. It may contain subsections
28
- such as:
29
-
30
- - Architecture: components, module boundaries, ownership, and connections;
31
- - Interfaces And Behavior: public surfaces, inputs, outputs, success, and
32
- refusal behavior;
33
- - Data And Persistence: data shape, identity, lifecycle facts, and persistence;
34
- - Approach And Flow: implementation approach, dependencies, ordering,
35
- concurrency, and failure handling;
36
- - Pseudocode: algorithms and control flow.
37
-
38
- Record every design decision the implementation must follow. Add other Design
39
- subsections when needed. Do not bind while the architecture, design, approach,
40
- or acceptance conditions are open.
27
+ The Design section is a detailed design document. Use the subsections in the
28
+ template below as needed, add others when useful, and record every decision the
29
+ implementation must follow. Do not bind while design or acceptance is open.
41
30
 
42
31
  ### Contract Shape: Mandatory Acceptance Boundary Check
43
32
 
@@ -45,13 +45,16 @@ Create and inspect Debts:
45
45
 
46
46
  ```bash
47
47
  keiyaku debt add "<title>"
48
- keiyaku debt add "<title>" --priority 1 --needs <debt-id>
49
- keiyaku debt show <debt-id>
48
+ keiyaku debt add "<title>" --priority 1 --needs <debt/...>
49
+ keiyaku debt show <debt/...>
50
50
  keiyaku debt ls
51
51
  keiyaku debt ready
52
52
  keiyaku debt blocked
53
- keiyaku debt tree <debt-id>
53
+ keiyaku debt tree <debt/...>
54
54
  keiyaku debt doctor
55
+ keiyaku debt query --where 'priority <= 1 and ready' --world
56
+ keiyaku debt context # read the default namespace
57
+ keiyaku debt context <namespace> # set it; / resets to root
55
58
  ```
56
59
 
57
60
  Use complete Debt IDs for targeted commands. `ls`, `ready`, and `blocked` use
@@ -60,8 +63,8 @@ the current namespace; use `--world` to inspect the complete Debt world.
60
63
  Close work:
61
64
 
62
65
  ```bash
63
- keiyaku debt done <debt-id>...
64
- keiyaku debt drop <debt-id>... --note "<reason>"
66
+ keiyaku debt done <debt/...>...
67
+ keiyaku debt drop <debt/...>... --note "<reason>"
65
68
  ```
66
69
 
67
70
  Use `done` when the Debt is complete. Use `drop` when it is no longer owed.
@@ -71,9 +74,11 @@ Both terminal states release dependent Debts. Unresolved `needs` appear in
71
74
  Update a Debt without changing its lifecycle:
72
75
 
73
76
  ```bash
74
- keiyaku debt update <debt-id> --title "<title>"
75
- keiyaku debt update <debt-id> --body "<body>"
76
- keiyaku debt update <debt-id> --needs <debt-id>
77
+ keiyaku debt update <debt/...> --title "<title>"
78
+ keiyaku debt update <debt/...> --body "<body>"
79
+ keiyaku debt update <debt/...> --needs <debt/...>
80
+ keiyaku debt update <debt/...> --parent <debt/...> --relates <debt/...>
81
+ keiyaku debt update <debt/...> --drop-needs <debt/...>
77
82
  ```
78
83
 
79
84
  ## 4. After Creating A Debt