@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,94 +7,34 @@ description: >-
7
7
 
8
8
  # Before Binding A Keiyaku
9
9
 
10
- Bind records a Contract whose objective, design, and acceptance boundary are
11
- settled. Do not use it to leave an open design for someone else to decide.
12
-
13
- ## 1. What Must Be Clear Before Binding
14
-
15
- Settle these facts first:
16
-
17
- - objective and intended outcome;
18
- - architecture and module boundaries;
19
- - detailed design and implementation approach;
20
- - public interfaces, behavior, data, and persistence;
21
- - ordering, concurrency, dependencies, and failure behavior;
22
- - acceptance conditions;
23
- - verification and required evidence;
24
- - the affected Region;
25
- - the one holder responsible for the `kei`.
26
-
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.
30
-
31
- ### Contract Shape: Mandatory Acceptance Boundary Check
32
-
33
- Before every bind, identify the independently acceptable outcomes. For each
34
- proposed part, ask whether it can be reviewed and accepted while another part
35
- remains unfinished. If it can, you MUST bind it as a separate `kei`. Do not bind
36
- an aggregate Contract containing independently acceptable outcomes.
37
-
38
- A shared request, audit, theme, product name, worker, verification command, or
39
- overlapping Region does NOT justify combining acceptance boundaries. Worker
40
- assignment and Contract boundaries are separate decisions: one worker may
41
- serve several Contracts, and several workers may contribute to one outcome.
42
- A request to "open a kei" does not by itself instruct you to combine outcomes.
43
-
44
- Keep parts together only when they jointly establish one outcome that cannot
45
- be meaningfully accepted in parts. State that inseparability in Context and
46
- make Criteria judge the same outcome. Do not manufacture inseparability by
47
- writing one broad Objective around unrelated fixes.
48
-
49
- - Use an Arc only for a chapter inside that one acceptance boundary; an Arc is
50
- not separately accepted and MUST NOT substitute for an independent `kei`.
51
- - Use a Debt for confirmed unresolved work and dependencies that must outlive
52
- the current conversation.
53
-
54
- A `kei` owns one independently acceptable outcome and its delivery lifecycle. A
55
- Debt records confirmed unresolved work; it may exist without a `kei`,
56
- and it does not create a second acceptance or lifecycle. Associate a `kei` with
57
- an existing Debt only when the delivery actually settles that unresolved work.
58
- Do not create a Debt just to mirror a `kei`.
59
-
60
- ### Parallel Work
61
-
62
- Parallel work is the default.
63
-
64
- - Bind and advance independent `kei`s in parallel. Each has its own acceptance
65
- boundary and holder.
66
- - Within one `kei`, run independent Debts or Arc chapters in parallel whenever
67
- their work can proceed independently. They converge on the one acceptance
68
- boundary, which the holder owns.
69
-
70
- Region overlap is planning information. It does not prevent parallel work and
71
- is not a lock, ownership claim, exact diff, or dependency. Use `--after` only
72
- when one result must exist before another can proceed because of a real logical
73
- dependency. Do not add `--after` merely because work touches the same Region.
74
-
75
- ## 2. Bind Syntax
76
-
77
- Read the command's help for the complete option grammar:
78
-
79
- ```bash
80
- keiyaku -C <repo> bind --help
81
- ```
82
-
83
- Inspect declared Regions when planning parallel work:
84
-
85
- ```bash
86
- keiyaku -C <repo> region
87
- keiyaku -C <repo> region <kei/...>
88
- keiyaku -C <repo> region --path 'src/**' --path 'tests/**'
89
- ```
90
-
91
- These list active Regions, read one Contract's Region, or show active Regions
92
- overlapping the supplied patterns. Overlap is coordination information only.
93
-
94
- Bind from stdin with a heredoc or a saved Markdown file:
95
-
96
- ~~~~bash
97
- keiyaku -C <repo> bind - <<'KEIYAKU'
10
+ `bind` records a Contract whose objective, design, and acceptance boundary are
11
+ closed. Never bind a wish list ("support X", "clean up Y") that leaves the
12
+ mechanism for the Deliverer to invent — if the design is still open, inspect
13
+ the codebase yourself or send an Akuma to settle the approach first (or record
14
+ a Debt if deferring the work).
15
+
16
+ ## 1. Boundaries, Arcs, And Parallelism
17
+
18
+ - **One independently acceptable outcome per `kei`:** if part of the work can
19
+ be reviewed and accepted while another part remains unfinished, bind them as
20
+ separate `kei`s. Shared themes, workers, verification commands, or
21
+ overlapping Regions do not justify combining outcomes.
22
+ - **Divide complex `kei`s into Arcs:** when one indivisible outcome is still
23
+ large or multi-stage, break its execution into **Arcs** (`arc`) so each
24
+ commission tackles one focused chapter (`This Arc: ...`) rather than a
25
+ monolith.
26
+ - **Parallel lanes and `after`:** run independent `kei`s in parallel. Inspect
27
+ active write surfaces with `region` for planning, and declare `after` only
28
+ for true logical prerequisites. Omitting the target selects the current
29
+ branch; targeting another active `kei` stacks on its appointed worktree.
30
+
31
+ ## 2. Authoring The Contract Document
32
+
33
+ Put weight on **`### Approach And Flow`**: state the concrete mechanism, data
34
+ and control flow, invariants, and failure handling clearly enough that two
35
+ Deliverers would not invent incompatible designs.
36
+
37
+ ~~~~markdown
98
38
  # <Delivery name>
99
39
 
100
40
  ## Context
@@ -114,13 +54,13 @@ keiyaku -C <repo> bind - <<'KEIYAKU'
114
54
  <Data shape, identity, lifecycle facts, and persistence decisions.>
115
55
 
116
56
  ### Approach And Flow
117
- <Implementation approach, dependencies, ordering, concurrency, and failure.>
57
+ <Concrete mechanism, step-by-step flow, ordering, concurrency, and failure handling.>
118
58
 
119
59
  ### Pseudocode
120
- <Algorithms and control flow.>
60
+ <Key algorithms and control flow.>
121
61
 
122
62
  ## Region
123
- <One repository-relative write pattern per nonblank line.>
63
+ <One repository-relative write pattern per nonblank line; trailing / means /**.>
124
64
 
125
65
  ## Criteria
126
66
  ### <observable acceptance condition>
@@ -130,101 +70,20 @@ keiyaku -C <repo> bind - <<'KEIYAKU'
130
70
  ```bash timeout=5m
131
71
  <commands runnable exactly as written>
132
72
  ```
133
- KEIYAKU
134
73
  ~~~~
135
74
 
136
- Use the narrowest justified Region patterns for likely writes. A trailing `/`
137
- is directory shorthand for `/**`. Patterns may be fenced lines, list items, or
138
- bare lines; those forms are combined. Region patterns are planning evidence,
139
- not a prediction of the exact diff.
140
-
141
- Verification is optional. Each declaration is a closed bash, zsh, or pwsh
142
- fence containing commands runnable as written. Separate fences give independent
143
- checks and deadlines. Each check gets its own clean scratch, setup, and cleanup;
144
- put any prerequisite build in that check's script or setup, never in a preceding
145
- fence. Use an explicit timeout for bounded commands; `5m` is the normal baseline.
146
-
147
- Only explicit `verify` executes declarations, and only with the `verified` gate
148
- selected. It captures the exact prospective integration using delivery's clean
149
- worktree rule and explicit dirty-capture authorization, without admitting a
150
- delivery. `deliver`, `review`, `deliver --dry-run`, and dependent completion only
151
- consume existing evidence. Without `verified`, the section is inert and creates
152
- no requirements. `reviewed` independently requires review evidence.
153
-
154
- ```bash
155
- keiyaku -C <appointed-path> verify <kei/...>
156
- keiyaku -C <appointed-path> verify <kei/...> --index 1 --include-dirty
157
- ```
158
-
159
- Omit `--index` to execute all declarations; a positive one-based index selects
160
- one current declaration. Every invocation executes its selection, even when
161
- satisfied testimony already exists. Each terminal check admits testimony before
162
- later checks begin; an identical admission may be reused without skipping
163
- execution. Normal failures and timeouts affect only their requirement and full
164
- verify continues; operational stops admit no verdict for the affected check and
165
- preserve earlier results.
166
-
167
- Every selected gate needs current satisfied testimony for every requirement.
168
- Review and custom gates have a singleton requirement. Verification requirements
169
- follow canonical executor, script, and declared deadline, never declaration
170
- position: reordering preserves evidence, changing one check affects only that
171
- requirement, and exact duplicates share one requirement. Removing a declaration
172
- removes its obligation but preserves historical testimony. Evidence captured
173
- before delivery can satisfy a later delivery of the exact same integration;
174
- changed candidate or target snapshots need applicable evidence. Verify can place
175
- only an already-delivered Contract when all gates and prerequisites pass.
176
-
177
- For an existing Debt that this delivery settles:
178
-
179
- ```bash
180
- keiyaku -C <repo> bind --debt <debt/...> - < CONTRACT.md
181
- ```
182
-
183
- For a real logical dependency between Contracts:
184
-
185
- ```bash
186
- keiyaku -C <repo> bind --after <kei/...> - < CONTRACT.md
187
- ```
188
-
189
- Gate selection is part of binding:
190
-
191
- ```bash
192
- keiyaku -C <repo> bind --gates <name,...> - < CONTRACT.md
193
- keiyaku -C <repo> bind --gates "" - < CONTRACT.md
194
- keiyaku -C <repo> bind --gates reviewed - < CONTRACT.md
195
- ```
196
-
197
- Omitting `--gates` uses `gates.default`, or `reviewed` when no default group
198
- exists. `--gates ""` selects no gates. Gates are named acceptance obligations,
199
- not work assignments. Named gate groups and worktree hooks live in Settings;
200
- see the README Configuration section or `keiyaku settings --help`.
75
+ - **Gates and `verified`:** omitting gates uses `gates.default` if configured,
76
+ otherwise `reviewed`. Without the `verified` gate, `## Verification` serves
77
+ as reference documentation for the Deliverer and Reviewer rather than a gate
78
+ requirement executed by `verify`.
79
+ - **Independent scratch:** each closed fence in `## Verification` runs in its
80
+ own clean scratch directory; include any required build in that fence or its
81
+ setup hook.
201
82
 
202
83
  ## 3. After Binding
203
84
 
204
- Binding appoints one managed worktree for the `kei`. Read the receipt as the
205
- handoff. Keep the complete `kei/...` identity and note:
206
-
207
- - the holder;
208
- - the appointed worktree path (absent when appointment lagged);
209
- - the target;
210
- - gates and prerequisites;
211
- - whether the `kei` is ready or waiting.
212
-
213
- Work in the appointed worktree. When appointment lags, the receipt carries no
214
- path and the `kei` shows pending reconciliation instead. If the receipt is
215
- waiting, the stated prerequisites remain; do not bind a duplicate Contract.
216
-
217
- The holder now owns the lifecycle:
218
-
219
- 1. Start the work directly or delegate Debts, Arc chapters, Akumas, or Contract roles.
220
- 2. Run independent work in parallel and let it converge on the one acceptance
221
- boundary.
222
- 3. Prepare the candidate and explicitly verify selected declarations when
223
- `verified` is required; deliver those same bytes before or after verification.
224
- 4. Coordinate requirement evidence, review, gates, and prerequisites; inspect
225
- per-check verdicts, admission reuse, stops, and retained diagnostic paths.
226
- 5. Continue until the `kei` is accepted, amend terms while keeping the same
227
- objective and acceptance boundary, or abandon it when either has changed.
228
-
229
- Continue with `keiyaku-workflow` for this lifecycle. For Akuma invocation,
230
- telling, waiting, and history, read `keiyaku-akuma`.
85
+ Every `kei` has **one and only one holder** accountable for driving it to a
86
+ terminal outcome — you by default, unless you explicitly hand the entire holder
87
+ loop to one dedicated Akuma. Work and commit inside the appointed worktree path
88
+ from the receipt (run `reconcile` if appointment lagged), advance multi-stage
89
+ work with `arc`, and continue with `keiyaku-workflow`.
@@ -6,91 +6,42 @@ description: >-
6
6
 
7
7
  # Keiyaku Debt
8
8
 
9
- A Debt records confirmed unresolved work and its relationships. Debt is an
10
- independent product; it is not a Contract, Arc, Akuma, permission, acceptance
11
- boundary, or fulfillment lifecycle.
12
-
13
- ## 1. When To Use A Debt
14
-
15
- Use a Debt when confirmed unresolved work or a dependency must outlive the
16
- current conversation. Keep plans and execution progress in reasoning or session
17
- notes instead.
18
-
19
- - Use a `kei` for one independently acceptable outcome.
20
- - Use an Arc for a chapter inside one `kei`.
21
- - Use a Debt for confirmed unresolved work and its prerequisites.
22
- - Do not create a Debt just to mirror a `kei`.
23
-
24
- A Debt may exist without a Contract. Associating a Debt with a `kei` does not
25
- transfer the Contract's holder, acceptance, or lifecycle to the Debt.
26
-
27
- ## 2. Relationships And Parallel Work
28
-
29
- Independent work may proceed in parallel when its dependencies allow it.
30
- Debt records no execution-progress state.
31
-
32
- Use the relationships for their actual meanings:
33
-
34
- - `needs` means this Debt must wait for another Debt to become terminal.
35
- - `parent` groups decomposition; it does not create a dependency.
36
- - `supersedes` points to work replaced by this Debt.
37
- - `relates` records a connection without affecting readiness.
38
-
39
- Only `needs` orders work. Do not add it because Debts touch the same Region or
40
- because one Debt is related to another. A terminal Debt releases its dependents.
41
-
42
- ## 3. Debt Commands
43
-
44
- Create and inspect Debts:
45
-
46
- ```bash
47
- keiyaku debt add "<title>"
48
- keiyaku debt add "<title>" --priority 1 --needs <debt/...>
49
- keiyaku debt show <debt/...>
50
- keiyaku debt ls
51
- keiyaku debt ready
52
- keiyaku debt blocked
53
- keiyaku debt tree <debt/...>
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
58
- ```
59
-
60
- Use complete Debt IDs for targeted commands. `ls`, `ready`, and `blocked` use
61
- the current namespace; use `--world` to inspect the complete Debt world.
62
-
63
- Close work:
64
-
65
- ```bash
66
- keiyaku debt done <debt/...>...
67
- keiyaku debt drop <debt/...>... --note "<reason>"
68
- ```
69
-
70
- Use `done` when the Debt is complete. Use `drop` when it is no longer owed.
71
- Both terminal states release dependent Debts. Unresolved `needs` appear in
72
- `blocked`; open work with all prerequisites terminal appears in `ready`.
73
-
74
- Update a Debt without changing its lifecycle:
75
-
76
- ```bash
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/...>
82
- ```
83
-
84
- ## 4. After Creating A Debt
85
-
86
- Read the returned Debt identity. Then:
87
-
88
- 1. Add or remove relationships when the confirmed prerequisites change.
89
- 2. Mark completed work `done`, or work no longer owed `drop` with a reason.
90
- 3. Use `ready`, `blocked`, `tree`, or `doctor` to inspect the current ledger.
91
-
92
- Debt records unresolved work. It does not perform the work, claim acceptance,
93
- assign a holder, or decide what a Contract may accept.
94
-
95
- Read `keiyaku-bind` for Contract authoring and `keiyaku-workflow` for Contract
96
- lifecycle.
9
+ A Debt records confirmed unresolved work and its relationships (`open`, `done`,
10
+ `drop`). Unlike a `kei`, a Debt does not require a closed design — use it to
11
+ capture a confirmed problem or prerequisite that must outlive the current
12
+ conversation, while keeping transient scratch plans in session notes.
13
+
14
+ ## 1. Recording A Useful Debt
15
+
16
+ - **Self-contained body:** write enough concrete evidence (files, symbols,
17
+ repro, or why work was deferred) that a future reader can act on the Debt
18
+ cold without rediscovering the problem.
19
+ - **Priority (`0..3` ascending):** `0` is highest urgency (`priority <= 1`
20
+ selects high-priority work in queries).
21
+ - **No mirror Debts:** never create a Debt just to mirror an already-bound `kei`.
22
+
23
+ ## 2. Relationships And Readiness
24
+
25
+ Only `needs` orders work: a Debt with unresolved `needs` is `blocked`, and
26
+ becomes `ready` once every prerequisite is `done` or `drop`. Do not add `needs`
27
+ merely because two Debts touch the same Region or are related.
28
+
29
+ - `needs`: prerequisite that must become terminal first.
30
+ - `parent`: decomposition grouping (does not block).
31
+ - `supersedes`: earlier Debt replaced by this one.
32
+ - `relates`: non-blocking link.
33
+
34
+ `show` displays only outbound relations declared on that Debt; use `tree`,
35
+ parent-scoped `ready`/`blocked`, or `query` (`blocks`, `under`) to inspect
36
+ reverse links.
37
+
38
+ ## 3. Scope And Contract Settlement
39
+
40
+ - **Namespace scope:** an appointed Contract worktree scopes its default Debt
41
+ context to `debt/<contract>/...`. Select the root namespace `/` when filing a
42
+ repo-wide Debt from inside a worktree, and enable world scope on `ls`,
43
+ `ready`, `blocked`, or `query` to inspect across all namespaces. Always
44
+ address a specific Debt by its complete `debt/...` ID.
45
+ - **Contract settlement:** associating a Debt when binding a `kei` holds that
46
+ Debt; accepting the `kei` marks it `done`, while abandoning the `kei`
47
+ releases it back to `open`.
@@ -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-harness",
3
- "version": "4.6.29",
3
+ "version": "4.6.30",
4
4
  "type": "module",
5
5
  "main": "./index.js"
6
6
  }