@astrosheep/keiyaku 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -5
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +3 -3
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +91 -35
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +98 -58
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +152 -53
- package/build/src/akuma/abort.d.ts +2 -0
- package/build/src/akuma/abort.js +50 -0
- package/build/src/akuma/akuma.d.ts +23 -14
- package/build/src/akuma/akuma.js +120 -104
- package/build/src/akuma/archetype.d.ts +7 -6
- package/build/src/akuma/archetype.js +68 -41
- package/build/src/akuma/body.d.ts +3 -5
- package/build/src/akuma/body.js +408 -213
- package/build/src/akuma/heart/facts.d.ts +25 -34
- package/build/src/akuma/heart/facts.js +18 -7
- package/build/src/akuma/heart/index.d.ts +39 -42
- package/build/src/akuma/heart/index.js +134 -93
- package/build/src/akuma/heart/rows.d.ts +9 -31
- package/build/src/akuma/heart/rows.js +26 -44
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +7 -15
- package/build/src/akuma/heart/soul.d.ts +8 -0
- package/build/src/akuma/heart/soul.js +136 -0
- package/build/src/akuma/heart/storage.d.ts +28 -14
- package/build/src/akuma/heart/storage.js +86 -26
- package/build/src/akuma/identity.d.ts +2 -2
- package/build/src/akuma/identity.js +9 -9
- package/build/src/akuma/index.d.ts +6 -1
- package/build/src/akuma/index.js +6 -0
- package/build/src/akuma/projection.d.ts +117 -38
- package/build/src/akuma/projection.js +208 -97
- package/build/src/akuma/provider-recipe.d.ts +24 -0
- package/build/src/akuma/provider-recipe.js +100 -0
- package/build/src/akuma/provider.d.ts +12 -4
- package/build/src/akuma/provider.js +117 -70
- package/build/src/akuma/providers/acp/core.d.ts +19 -0
- package/build/src/akuma/providers/acp/core.js +159 -0
- package/build/src/akuma/providers/acp/events.d.ts +20 -0
- package/build/src/akuma/providers/acp/events.js +73 -0
- package/build/src/akuma/providers/acp/index.d.ts +12 -0
- package/build/src/akuma/providers/acp/index.js +94 -0
- package/build/src/akuma/providers/claude/events.js +66 -13
- package/build/src/akuma/providers/claude/index.d.ts +2 -1
- package/build/src/akuma/providers/claude/index.js +35 -21
- package/build/src/akuma/providers/codex-app-server/events.js +4 -1
- package/build/src/akuma/providers/codex-app-server/index.d.ts +3 -3
- package/build/src/akuma/providers/codex-app-server/index.js +24 -31
- package/build/src/akuma/providers/grok-build/index.d.ts +4 -0
- package/build/src/akuma/providers/grok-build/index.js +70 -0
- package/build/src/akuma/providers/index.d.ts +5 -3
- package/build/src/akuma/providers/index.js +24 -59
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +40 -34
- package/build/src/akuma/providers/opencode-sdk/events.js +220 -101
- package/build/src/akuma/providers/opencode-sdk/index.d.ts +3 -2
- package/build/src/akuma/providers/opencode-sdk/index.js +233 -128
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +11 -26
- package/build/src/akuma/providers/opencode-sdk/session.js +10 -9
- package/build/src/akuma/providers/pi/events.js +49 -11
- package/build/src/akuma/providers/pi/index.d.ts +1 -1
- package/build/src/akuma/providers/pi/index.js +50 -21
- package/build/src/akuma/publication.d.ts +3 -3
- package/build/src/akuma/publication.js +28 -40
- package/build/src/akuma/requests.d.ts +9 -7
- package/build/src/akuma/requests.js +92 -65
- package/build/src/alias/index.d.ts +2 -2
- package/build/src/alias/index.js +10 -10
- package/build/src/body/decode.js +7 -1
- package/build/src/body/region.d.ts +2 -0
- package/build/src/body/region.js +77 -7
- package/build/src/cli/accepted.d.ts +17 -13
- package/build/src/cli/accepted.js +72 -34
- package/build/src/cli/actor.js +3 -3
- package/build/src/cli/commands/akuma-invoke.d.ts +4 -3
- package/build/src/cli/commands/akuma-invoke.js +14 -9
- package/build/src/cli/commands/akuma.d.ts +13 -3
- package/build/src/cli/commands/akuma.js +67 -34
- package/build/src/cli/commands/contract.d.ts +18 -5
- package/build/src/cli/commands/contract.js +9 -3
- package/build/src/cli/commands/task-invoke.d.ts +17 -4
- package/build/src/cli/commands/task-invoke.js +43 -20
- package/build/src/cli/commands/task-query.d.ts +5 -0
- package/build/src/cli/commands/task-query.js +247 -0
- package/build/src/cli/commands/task.d.ts +3 -1
- package/build/src/cli/commands/task.js +51 -13
- package/build/src/cli/coordinates.d.ts +18 -0
- package/build/src/cli/coordinates.js +120 -0
- package/build/src/cli/draft.d.ts +8 -0
- package/build/src/cli/draft.js +96 -0
- package/build/src/cli/invoke.d.ts +4 -3
- package/build/src/cli/invoke.js +160 -179
- package/build/src/cli/main.js +34 -6
- package/build/src/cli/parse.d.ts +9 -2
- package/build/src/cli/parse.js +29 -7
- package/build/src/cli/render/akuma-tool-command.d.ts +6 -0
- package/build/src/cli/render/akuma-tool-command.js +144 -0
- package/build/src/cli/render/akuma-tool.d.ts +2 -2
- package/build/src/cli/render/akuma-tool.js +30 -4
- package/build/src/cli/render/akuma.d.ts +1 -0
- package/build/src/cli/render/akuma.js +211 -116
- package/build/src/cli/render/audit.d.ts +3 -0
- package/build/src/cli/render/audit.js +104 -0
- package/build/src/cli/render/contract.d.ts +3 -3
- package/build/src/cli/render/contract.js +192 -79
- package/build/src/cli/render/kanshi.js +263 -168
- package/build/src/cli/render/receipt.d.ts +19 -0
- package/build/src/cli/render/receipt.js +106 -0
- package/build/src/cli/render/refusal.d.ts +16 -2
- package/build/src/cli/render/refusal.js +88 -20
- package/build/src/cli/render/region.d.ts +2 -0
- package/build/src/cli/render/region.js +17 -0
- package/build/src/cli/render/task.d.ts +2 -1
- package/build/src/cli/render/task.js +223 -60
- package/build/src/cli/render/terminal.d.ts +7 -0
- package/build/src/cli/render/terminal.js +46 -0
- package/build/src/cli/render/text.js +6 -3
- package/build/src/cli/result.d.ts +115 -20
- package/build/src/cli/usage.d.ts +1 -0
- package/build/src/cli/usage.js +3 -0
- package/build/src/contract-worktree.d.ts +6 -5
- package/build/src/contract-worktree.js +95 -57
- package/build/src/coordination/durable-file.d.ts +4 -3
- package/build/src/coordination/durable-file.js +29 -25
- package/build/src/coordination/sqlite-transaction-lock.d.ts +4 -0
- package/build/src/coordination/sqlite-transaction-lock.js +22 -5
- package/build/src/core/facts/fold.js +1 -6
- package/build/src/core/facts/gate.d.ts +1 -0
- package/build/src/core/facts/gate.js +1 -0
- package/build/src/core/verbs/amend.d.ts +1 -1
- package/build/src/core/verbs/amend.js +0 -11
- package/build/src/core/verbs/deliver.d.ts +1 -1
- package/build/src/core/verbs/deliver.js +1 -7
- package/build/src/core/verbs/placement.d.ts +1 -1
- package/build/src/core/verbs/placement.js +4 -1
- package/build/src/dispatch/index.d.ts +2 -2
- package/build/src/dispatch/index.js +17 -17
- package/build/src/git/admission.d.ts +1 -1
- package/build/src/git/admission.js +11 -11
- package/build/src/git/hooks.js +13 -13
- package/build/src/git/integration.d.ts +14 -15
- package/build/src/git/integration.js +80 -44
- package/build/src/git/observe.d.ts +5 -3
- package/build/src/git/observe.js +18 -12
- package/build/src/git/read-observation.js +9 -9
- package/build/src/git/reconcile.d.ts +2 -0
- package/build/src/git/reconcile.js +138 -95
- package/build/src/git/repository.d.ts +27 -19
- package/build/src/git/repository.js +155 -83
- package/build/src/git/scratch.d.ts +7 -3
- package/build/src/git/scratch.js +44 -37
- package/build/src/git/target-placement.d.ts +40 -4
- package/build/src/git/target-placement.js +221 -101
- package/build/src/git/tender.d.ts +6 -5
- package/build/src/git/tender.js +24 -43
- package/build/src/git/terminal-seal.d.ts +1 -1
- package/build/src/git/terminal-seal.js +7 -5
- package/build/src/git/workspace.d.ts +36 -4
- package/build/src/git/workspace.js +53 -18
- package/build/src/identity/selector.js +1 -1
- package/build/src/index.d.ts +3 -3
- package/build/src/index.js +1 -1
- package/build/src/kanshi/index.d.ts +2 -2
- package/build/src/kanshi/index.js +1 -1
- package/build/src/kanshi/read.d.ts +2 -1
- package/build/src/kanshi/read.js +118 -27
- package/build/src/kanshi/report.d.ts +50 -0
- package/build/src/kanshi/select.d.ts +5 -0
- package/build/src/kanshi/select.js +32 -0
- package/build/src/library/address.d.ts +12 -3
- package/build/src/library/address.js +77 -46
- package/build/src/library/akuma-creation.d.ts +6 -1
- package/build/src/library/akuma-creation.js +86 -13
- package/build/src/library/audit.d.ts +18 -0
- package/build/src/library/audit.js +44 -0
- package/build/src/library/bind.js +4 -4
- package/build/src/library/catalog.d.ts +1 -1
- package/build/src/library/catalog.js +5 -8
- package/build/src/library/contract.d.ts +5 -6
- package/build/src/library/contract.js +11 -35
- package/build/src/library/delivery.d.ts +2 -1
- package/build/src/library/fleet.d.ts +2 -2
- package/build/src/library/fleet.js +35 -71
- package/build/src/library/keiyaku.d.ts +3 -2
- package/build/src/library/keiyaku.js +1 -0
- package/build/src/library/mutation.d.ts +7 -6
- package/build/src/library/mutation.js +23 -25
- package/build/src/library/reconcile.d.ts +29 -0
- package/build/src/library/reconcile.js +179 -0
- package/build/src/library/region.d.ts +12 -0
- package/build/src/library/region.js +15 -1
- package/build/src/library/repo.d.ts +4 -16
- package/build/src/library/repo.js +13 -38
- package/build/src/protocol/attempt.js +6 -6
- package/build/src/protocol/bind.js +4 -4
- package/build/src/protocol/intent.d.ts +15 -2
- package/build/src/protocol/intent.js +21 -6
- package/build/src/protocol/operations.d.ts +73 -22
- package/build/src/protocol/operations.js +292 -88
- package/build/src/protocol/outcome.d.ts +9 -3
- package/build/src/protocol/outcome.js +3 -1
- package/build/src/protocol/placement.d.ts +15 -4
- package/build/src/protocol/placement.js +58 -25
- package/build/src/protocol/read/status.d.ts +8 -1
- package/build/src/protocol/read/status.js +61 -14
- package/build/src/runtime/proc/line-rpc.d.ts +3 -8
- package/build/src/runtime/proc/line-rpc.js +16 -43
- package/build/src/runtime/proc/run.d.ts +15 -29
- package/build/src/runtime/proc/run.js +113 -105
- package/build/src/runtime/proc/stdio.d.ts +18 -0
- package/build/src/runtime/proc/stdio.js +58 -0
- package/build/src/settings.d.ts +2 -2
- package/build/src/settings.js +8 -8
- package/build/src/settlement/fence.d.ts +0 -4
- package/build/src/settlement/fence.js +0 -9
- package/build/src/settlement/holder.d.ts +11 -1
- package/build/src/settlement/holder.js +25 -0
- package/build/src/settlement/settle.d.ts +1 -1
- package/build/src/settlement/settle.js +52 -89
- package/build/src/task/board.d.ts +3 -3
- package/build/src/task/board.js +6 -9
- package/build/src/task/compose.d.ts +1 -1
- package/build/src/task/compose.js +18 -10
- package/build/src/task/context.d.ts +3 -3
- package/build/src/task/context.js +14 -14
- package/build/src/task/document.d.ts +2 -1
- package/build/src/task/document.js +15 -5
- package/build/src/task/index.d.ts +19 -7
- package/build/src/task/index.js +42 -23
- package/build/src/task/operations.d.ts +15 -9
- package/build/src/task/operations.js +78 -48
- package/build/src/task/query.d.ts +67 -0
- package/build/src/task/query.js +279 -0
- package/build/src/task/store.d.ts +2 -2
- package/build/src/task/store.js +40 -25
- package/build/src/verification/execution.d.ts +4 -2
- package/build/src/verification/execution.js +9 -5
- package/build/src/workspace-place.d.ts +41 -0
- package/build/src/workspace-place.js +386 -0
- package/build/src/world.d.ts +13 -2
- package/build/src/world.js +81 -48
- package/package.json +3 -2
- package/build/src/protocol/read/audit.d.ts +0 -31
- package/build/src/protocol/read/audit.js +0 -55
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keiyaku-workflow
|
|
3
|
-
description: Use when authoring, binding, delivering, reviewing, amending,
|
|
3
|
+
description: Use when authoring, binding, auditing, delivering, reviewing, amending, or abandoning a Keiyaku v4 Contract.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Keiyaku Workflow
|
|
7
7
|
|
|
8
|
-
A Contract turns one bounded delivery into acceptable terms:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
the whole trip from current work to `claimed`.
|
|
8
|
+
A Contract turns one bounded delivery into acceptable terms: bind it, work in
|
|
9
|
+
the appointed worktree, audit the Contract, deliver, then review. When every
|
|
10
|
+
declared gate is current, the result lands on the target ref.
|
|
12
11
|
|
|
13
12
|
## How The Delivery Moves
|
|
14
13
|
|
|
15
14
|
```text
|
|
16
|
-
contract document -> bind -> work
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
contract document -> bind -> work -> audit -> deliver -> review gates
|
|
16
|
+
-> placement -> claimed
|
|
17
|
+
\-> abandoned
|
|
19
18
|
```
|
|
20
19
|
|
|
21
20
|
The lifecycle is `waiting -> bound -> pending-delivery -> claimed | abandoned`;
|
|
22
|
-
the last two are terminal. `--after`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
the last two are terminal. Reserve `--after` for true logical ordering: one
|
|
22
|
+
Contract's result must ultimately build on another's settled outcome, or their
|
|
23
|
+
intended work has a large or irreconcilable interaction that should be
|
|
24
|
+
sequenced. Ordinary Region overlap is not enough. Small overlaps may proceed
|
|
25
|
+
under Git's optimistic write model and be resolved manually or by a delegated
|
|
26
|
+
worker. At runtime prerequisites are placement obligations, not a delivery
|
|
27
|
+
admission gate: a Contract may record `bound` and deliver before they claim,
|
|
28
|
+
while placement waits for the current prerequisites and declared gates. Active
|
|
29
|
+
terms may amend `--after` after `bound` or `deliver`; terminal Contracts remain
|
|
30
|
+
immutable. You never push it through states by hand: `deliver` and satisfied
|
|
31
|
+
reviews request placement, and placement claims when every prerequisite and
|
|
32
|
+
gate allows it.
|
|
26
33
|
|
|
27
34
|
## Bind
|
|
28
35
|
|
|
@@ -34,15 +41,31 @@ bind inputs, and read the receipt. Continue here from that receipt.
|
|
|
34
41
|
Change and test code in the worktree the bind receipt names. `deliver` accepts
|
|
35
42
|
a clean worktree by default. You may commit first, or explicitly include all
|
|
36
43
|
non-ignored staged, unstaged, and untracked final bytes with
|
|
37
|
-
`deliver --include-dirty`.
|
|
44
|
+
`deliver --include-dirty`.
|
|
45
|
+
|
|
46
|
+
## Regain The Picture
|
|
47
|
+
|
|
48
|
+
Rebuild state from reads, not memory — after a compact, a handoff, or any
|
|
49
|
+
surprising receipt, read before acting:
|
|
38
50
|
|
|
39
51
|
```bash
|
|
40
|
-
keiyaku status
|
|
52
|
+
keiyaku status # the whole board
|
|
53
|
+
keiyaku status <contract> # lifecycle, candidate, one mark per gate
|
|
54
|
+
keiyaku show <contract> # the exact current Contract terms
|
|
55
|
+
keiyaku region # every active Contract's declared surfaces
|
|
56
|
+
keiyaku region <contract> # one Contract's declared intent
|
|
57
|
+
keiyaku region --overlap # which declared intents intersect
|
|
58
|
+
keiyaku region --path <path> # which active Contracts declare this path
|
|
41
59
|
```
|
|
42
60
|
|
|
43
|
-
`status`
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
`status` marks each gate: `✓` current satisfied, `!` current unsatisfied, `?`
|
|
62
|
+
stale because the patch or document changed after the evidence, `○` missing.
|
|
63
|
+
A Region is a Contract's declared write intent — not ownership, not a gate,
|
|
64
|
+
and not a Git conflict. Read the world before decomposing or commissioning
|
|
65
|
+
into an occupied repository; read `--overlap` before choosing a landing order
|
|
66
|
+
or an `--after` edge; read `--path` before touching a file that may belong to
|
|
67
|
+
another lane. Regions are declarations only, a coarse planning signal: actual
|
|
68
|
+
touched paths and conflicts remain Git's.
|
|
46
69
|
|
|
47
70
|
## Commission A Contract
|
|
48
71
|
|
|
@@ -71,25 +94,60 @@ frontmatter names `Contract`, then reads the listed owner documents and source
|
|
|
71
94
|
files before acting. Do not substitute a generic repository tour for the files
|
|
72
95
|
that actually govern the assignment.
|
|
73
96
|
|
|
74
|
-
A `Deliverer` implements and verifies the terms
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
A `Deliverer` implements and verifies the terms in `Worktree`. Commission a
|
|
98
|
+
`Reviewer` after delivery. The reviewer inspects the complete current Contract
|
|
99
|
+
worktree snapshot, not a worker report or named candidate commit, and does not
|
|
100
|
+
modify it. Missing or contradictory seat, worktree, or reading list means stop
|
|
101
|
+
and ask.
|
|
102
|
+
|
|
103
|
+
Observe commissioned workers through their Contract association instead of
|
|
104
|
+
collecting Aku ids by hand:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
keiyaku wait kei/<contract> --all --timeout 5m
|
|
108
|
+
keiyaku wait kei/<first> kei/<second> --any --timeout 5m
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
A Contract selector snapshots its dispatched workers when the command starts.
|
|
112
|
+
Use `--all` to wait for every selected worker or `--any` to return when one
|
|
113
|
+
finishes; an expanded set with more than one worker requires an explicit mode.
|
|
114
|
+
|
|
115
|
+
## Decompose Complex Work
|
|
80
116
|
|
|
81
|
-
|
|
117
|
+
Complex Keiyaku should be divided along independently acceptable delivery
|
|
118
|
+
boundaries. Use judgment to find those boundaries from the work's objectives,
|
|
119
|
+
dependencies, Regions, and acceptance criteria; raw size or file count is not
|
|
120
|
+
the test. Give each resulting Contract coherent terms. Connect them with
|
|
121
|
+
`--after` only when one must proceed from another's settled result or their
|
|
122
|
+
intended work is unsafe to run concurrently.
|
|
82
123
|
|
|
83
|
-
When
|
|
84
|
-
|
|
124
|
+
When a complex Keiyaku cannot be split without breaking one acceptance
|
|
125
|
+
boundary, organize its fulfillment into arcs. Do not hand the whole
|
|
126
|
+
undifferentiated Contract to one Deliverer and trust one pass to finish it.
|
|
127
|
+
Record and work one current chapter at a time.
|
|
128
|
+
|
|
129
|
+
An arc is a chapter as in a work of literature: one named part of the
|
|
130
|
+
delivery's story, not a task list, progress slice, or claim that the work is
|
|
131
|
+
mechanically sequential. Its title names the chapter, Objective states that
|
|
132
|
+
chapter's aim, and Brief commissions work for that chapter. When an Arc is
|
|
133
|
+
active, stay within that current chapter. `.keiyaku/KEIYAKU.md` renders the
|
|
134
|
+
current Arc.
|
|
135
|
+
Record the next chapter before entering it:
|
|
85
136
|
|
|
86
137
|
```bash
|
|
87
|
-
keiyaku arc <contract> -
|
|
138
|
+
keiyaku arc <contract> - <<'KEIYAKU'
|
|
139
|
+
# <chapter title>
|
|
140
|
+
|
|
141
|
+
## Objective
|
|
142
|
+
<nonblank objective>
|
|
143
|
+
|
|
144
|
+
## Brief
|
|
145
|
+
<nonblank dispatch brief>
|
|
146
|
+
KEIYAKU
|
|
88
147
|
```
|
|
89
148
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
independent acceptance is a new Contract, not an arc.
|
|
149
|
+
All chapters live inside that Contract's single delivery and acceptance
|
|
150
|
+
boundary. The document grammar authority is `docs/document.md`.
|
|
93
151
|
|
|
94
152
|
## Amend Or Start Over
|
|
95
153
|
|
|
@@ -105,14 +163,35 @@ See `amend --help` for the operation grammar. If the objective or boundary
|
|
|
105
163
|
itself changed, `abandon` with a note and bind a new Contract; do not steer an
|
|
106
164
|
old Contract onto a different delivery.
|
|
107
165
|
|
|
166
|
+
## Audit Before Delivery
|
|
167
|
+
|
|
168
|
+
Audit is how you see a delivery before it exists:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
keiyaku audit <contract> --diff
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Audit answers three already-adjudicated questions: candidate, Verification,
|
|
175
|
+
and target. It uses the same candidate preparation as deliver, shows the
|
|
176
|
+
prospective identity and optional requested diff, and runs declared
|
|
177
|
+
Verification against that candidate. A terminal run records ordinary
|
|
178
|
+
subject-bound `verified` testimony; it does not record a delivery or request
|
|
179
|
+
placement. Read those three answers instead of trusting a worker's completion
|
|
180
|
+
report.
|
|
181
|
+
|
|
108
182
|
## Deliver
|
|
109
183
|
|
|
184
|
+
Deliver when the worktree content is the candidate you intend to land:
|
|
185
|
+
|
|
110
186
|
```bash
|
|
111
187
|
keiyaku deliver <contract>
|
|
112
188
|
```
|
|
113
189
|
|
|
114
|
-
`deliver` tenders the clean `HEAD`,
|
|
115
|
-
|
|
190
|
+
`deliver` freshly tenders the clean `HEAD`, records the candidate, and requests
|
|
191
|
+
placement. When a current audit attestation names the identical integration
|
|
192
|
+
snapshot and Verification segment, deliver reuses it; otherwise it runs the
|
|
193
|
+
declarations. Worktree, target, policy, document, Verification, or
|
|
194
|
+
snapshot-producing option changes prevent reuse. If the workspace is dirty, the refusal
|
|
116
195
|
lists staged, unstaged, and untracked paths, a short statistic, and the
|
|
117
196
|
`--include-dirty` option. Use that option only when the complete current
|
|
118
197
|
workspace is the intended delivery; dirty submodule internals cannot be
|
|
@@ -123,10 +202,9 @@ included. Read the receipt:
|
|
|
123
202
|
- When a gate is not current, the receipt shows the recorded candidate and the
|
|
124
203
|
placement stop. This is not a failed delivery. The Contract stays
|
|
125
204
|
`pending-delivery` while you complete the gates.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
attribute for an unbounded declaration; there is no Verification-wide timeout.
|
|
205
|
+
- A lag row reports an accepted physical effect that has not finished. The
|
|
206
|
+
delivery stands; `reconcile` completes the effect later. It never changes
|
|
207
|
+
the verdict.
|
|
130
208
|
|
|
131
209
|
## Review Gates
|
|
132
210
|
|
|
@@ -137,17 +215,40 @@ keiyaku review <contract> --satisfied --summary "<conclusion>"
|
|
|
137
215
|
keiyaku review <contract> --unsatisfied --summary "<finding>"
|
|
138
216
|
```
|
|
139
217
|
|
|
140
|
-
Have an independent reviewer
|
|
141
|
-
`review` command records the
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
`
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
218
|
+
Have an independent reviewer inspect the delivered Contract worktree snapshot.
|
|
219
|
+
The `review` command records the verdict. `--satisfied` requests placement; if
|
|
220
|
+
the other gates are current, the receipt shows `claimed`.
|
|
221
|
+
|
|
222
|
+
Fixing findings changes the patch and makes earlier evidence stale (`?` in
|
|
223
|
+
`status`). Audit the rework, deliver it, then review again. Record
|
|
224
|
+
`--unsatisfied` only when the negative judgment should remain in Contract
|
|
225
|
+
history.
|
|
226
|
+
|
|
227
|
+
## When Multiple Contracts Overlap On One Target
|
|
228
|
+
|
|
229
|
+
When active Contracts write a shared surface, landing order is a coordinator
|
|
230
|
+
judgment, not Contract state. Keep the decision in the workflow skill; do not
|
|
231
|
+
persist a train or add a second placement authority.
|
|
232
|
+
|
|
233
|
+
- `audit` and a reviewer's report are preliminary. `review --satisfied` is
|
|
234
|
+
authoritative gate testimony: it requests placement and claims when
|
|
235
|
+
delivery, prerequisites, and all gates are current. Record it only when the
|
|
236
|
+
reviewed bytes are intended to land now.
|
|
237
|
+
- Before recording a satisfied review, or delivering a Contract with no
|
|
238
|
+
declared gates, ask whether the exact patch will survive until placement. A
|
|
239
|
+
pure rebase whose `ChangeId` is unchanged keeps the existing review current;
|
|
240
|
+
do not re-review content addressing kept alive. Conflict resolution that
|
|
241
|
+
changes the `ChangeId` makes earlier testimony stale and requires a fresh
|
|
242
|
+
review against the resolved candidate.
|
|
243
|
+
- For Contracts known to overlap, resolve the current-target integration before
|
|
244
|
+
the authoritative review. Preliminary feedback may happen earlier, but it
|
|
245
|
+
is not a satisfied gate until its reviewed patch is the candidate intended
|
|
246
|
+
for placement. Land overlapping Contracts one at a time; let independent,
|
|
247
|
+
non-overlapping Contracts proceed without ceremony. Treat overlap as a
|
|
248
|
+
planning signal, not a correctness verdict.
|
|
249
|
+
- After target movement, a changed candidate, or a placement refusal, read the
|
|
250
|
+
current Contract facts again. Recompute the next landing judgment from those
|
|
251
|
+
facts; do not rely on a remembered queue or promise exactly one rebase.
|
|
151
252
|
|
|
152
253
|
## Target Placement
|
|
153
254
|
|
|
@@ -168,18 +269,16 @@ Placement follows the Git mental model you already have:
|
|
|
168
269
|
After a refusal, handle the listed paths, then `deliver` again or record a
|
|
169
270
|
satisfied review; either command requests placement again.
|
|
170
271
|
|
|
171
|
-
##
|
|
272
|
+
## Recover Or End
|
|
172
273
|
|
|
173
274
|
```bash
|
|
174
|
-
keiyaku audit <contract> [--show-diff-body] # report only; never places
|
|
175
275
|
keiyaku reconcile <contract> # finish accepted lagging effects
|
|
176
276
|
keiyaku abandon <contract> --note "<why>" # terminal; target untouched
|
|
177
277
|
```
|
|
178
278
|
|
|
179
|
-
`
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
`abandon` ends the Contract and never touches the target.
|
|
279
|
+
`reconcile` completes physical effects of already accepted placements; it does
|
|
280
|
+
not retry an ordinary placement refusal. `abandon` ends the Contract and never
|
|
281
|
+
touches the target.
|
|
183
282
|
|
|
184
283
|
## Routine Output
|
|
185
284
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export function abortable(operation, signal, disposeLate) {
|
|
2
|
+
signal.throwIfAborted();
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
let aborted = false;
|
|
5
|
+
const abort = () => {
|
|
6
|
+
aborted = true;
|
|
7
|
+
if (disposeLate === undefined)
|
|
8
|
+
reject(signal.reason);
|
|
9
|
+
};
|
|
10
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
11
|
+
if (signal.aborted)
|
|
12
|
+
abort();
|
|
13
|
+
void operation.then(async (value) => {
|
|
14
|
+
signal.removeEventListener("abort", abort);
|
|
15
|
+
if (!aborted) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
await disposeLate?.(value);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
reject(error);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
reject(signal.reason);
|
|
27
|
+
}, (error) => {
|
|
28
|
+
signal.removeEventListener("abort", abort);
|
|
29
|
+
reject(aborted ? signal.reason : error);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function abortableDelay(milliseconds, signal) {
|
|
34
|
+
if (signal === undefined)
|
|
35
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
36
|
+
signal.throwIfAborted();
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const timeout = setTimeout(() => {
|
|
39
|
+
signal.removeEventListener("abort", abort);
|
|
40
|
+
resolve();
|
|
41
|
+
}, milliseconds);
|
|
42
|
+
const abort = () => {
|
|
43
|
+
clearTimeout(timeout);
|
|
44
|
+
reject(signal.reason);
|
|
45
|
+
};
|
|
46
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
47
|
+
if (signal.aborted)
|
|
48
|
+
abort();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AkumaLife, type
|
|
1
|
+
import { type AkumaLife, type KillEvidence, type ResumeCoordinate, type Soul } from "./heart/index.js";
|
|
2
2
|
import { type AkuId } from "./identity.js";
|
|
3
3
|
import { type ActivityHistory, type ActivitySnapshot } from "./projection.js";
|
|
4
4
|
import { type Settings } from "../settings.js";
|
|
@@ -8,18 +8,19 @@ export type AkumaListRow = Readonly<{
|
|
|
8
8
|
archetype: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
life: AkumaLife;
|
|
11
|
-
|
|
11
|
+
lifeAt: string | null;
|
|
12
12
|
confinement: Soul["confinement"];
|
|
13
13
|
pending: readonly string[];
|
|
14
14
|
}>;
|
|
15
15
|
export type AkumaStatus = Readonly<{
|
|
16
16
|
id: AkuId;
|
|
17
17
|
life: AkumaLife;
|
|
18
|
-
|
|
18
|
+
readonly?: Soul["readonly"];
|
|
19
19
|
timeline: ActivitySnapshot;
|
|
20
20
|
strandedReason?: "resume-unsupported";
|
|
21
21
|
}>;
|
|
22
|
-
export type {
|
|
22
|
+
export type { ReadonlyRestraint } from "./provider-recipe.js";
|
|
23
|
+
export type * from "./projection.js";
|
|
23
24
|
export type UnbornAkumaListRow = Readonly<{
|
|
24
25
|
id: AkuId;
|
|
25
26
|
life: "unborn" | "stillborn";
|
|
@@ -46,11 +47,11 @@ export type TellResult = Readonly<{
|
|
|
46
47
|
}>;
|
|
47
48
|
}>;
|
|
48
49
|
export type InterruptReceipt = Readonly<{
|
|
49
|
-
kind: "
|
|
50
|
-
evidence: "
|
|
50
|
+
kind: "unavailable";
|
|
51
|
+
evidence: "hung" | "untidy" | "unavailable";
|
|
51
52
|
}> | Readonly<{
|
|
52
53
|
kind: "interrupted";
|
|
53
|
-
putDown: "was-idle" | "self-aborted"
|
|
54
|
+
putDown: "was-idle" | "self-aborted";
|
|
54
55
|
tell: TellResult;
|
|
55
56
|
}>;
|
|
56
57
|
export type ForkReceipt = Readonly<{
|
|
@@ -75,19 +76,27 @@ export declare class AkumaNotBornError extends Error {
|
|
|
75
76
|
readonly kind = "akuma-not-born";
|
|
76
77
|
constructor(id: AkuId);
|
|
77
78
|
}
|
|
78
|
-
/** Package-internal
|
|
79
|
-
export declare function readActionFeedbackStatus(worldPath: WorldRoot, id: AkuId): AkumaStatus
|
|
79
|
+
/** Package-internal action observation; it uses the same snapshot selector as status. */
|
|
80
|
+
export declare function readActionFeedbackStatus(worldPath: WorldRoot, id: AkuId): Promise<AkumaStatus>;
|
|
81
|
+
export type BudgetedStatusObservation = Readonly<{
|
|
82
|
+
status: AkumaStatus;
|
|
83
|
+
ordinarySelected: number;
|
|
84
|
+
}>;
|
|
85
|
+
/** Package-internal budgeted observation; Fleet allocates, Akuma still selects. */
|
|
86
|
+
export declare function readBudgetedStatus(worldPath: WorldRoot, id: AkuId, input: Readonly<{
|
|
87
|
+
ordinaryBudget: number;
|
|
88
|
+
}>): Promise<BudgetedStatusObservation>;
|
|
80
89
|
export declare class AkumaHandle {
|
|
81
90
|
readonly id: AkuId;
|
|
82
91
|
private readonly worldPath;
|
|
83
92
|
constructor(id: AkuId, worldPath: WorldRoot);
|
|
84
93
|
private get paths();
|
|
85
|
-
status(): AkumaStatus
|
|
94
|
+
status(): Promise<AkumaStatus>;
|
|
86
95
|
history(input?: Readonly<{
|
|
87
96
|
before?: number;
|
|
88
97
|
since?: number;
|
|
89
98
|
limit?: number;
|
|
90
|
-
}>): ActivityHistory
|
|
99
|
+
}>): Promise<ActivityHistory>;
|
|
91
100
|
wait(predicate?: (status: AkumaStatus) => boolean, options?: Readonly<{
|
|
92
101
|
timeoutMs?: number;
|
|
93
102
|
}>): Promise<AkumaStatus>;
|
|
@@ -97,7 +106,7 @@ export declare class AkumaHandle {
|
|
|
97
106
|
at: string;
|
|
98
107
|
}>): Promise<ForkReceipt>;
|
|
99
108
|
kill(): Promise<KillEvidence>;
|
|
100
|
-
lastAnswer(): LastAnswer
|
|
109
|
+
lastAnswer(): Promise<LastAnswer>;
|
|
101
110
|
}
|
|
102
111
|
export type LastAnswer = Readonly<{
|
|
103
112
|
kind: "answer";
|
|
@@ -114,11 +123,11 @@ export declare class Akuma {
|
|
|
114
123
|
of(input: Readonly<{
|
|
115
124
|
id: string;
|
|
116
125
|
}>): AkumaHandle;
|
|
117
|
-
listArchetypes(): readonly string[]
|
|
126
|
+
listArchetypes(): Promise<readonly string[]>;
|
|
118
127
|
call(input: Readonly<{
|
|
119
128
|
archetype: string;
|
|
120
129
|
body: string;
|
|
121
130
|
cwd?: string;
|
|
122
131
|
}>): Promise<AkumaHandle>;
|
|
123
|
-
list(input?: AkumaListInput): AkumaList
|
|
132
|
+
list(input?: AkumaListInput): Promise<AkumaList>;
|
|
124
133
|
}
|