@astrosheep/keiyaku 4.5.27 → 4.5.29
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/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 +82 -163
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +153 -78
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +68 -64
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +115 -146
- package/build/src/akuma/akuma-handle.d.ts +8 -0
- package/build/src/akuma/akuma-handle.js +23 -7
- package/build/src/akuma/akuma-instance.d.ts +0 -1
- package/build/src/akuma/akuma-instance.js +2 -4
- package/build/src/akuma/akuma-observe.d.ts +6 -0
- package/build/src/akuma/akuma-observe.js +3 -2
- package/build/src/akuma/akuma-product.d.ts +4 -8
- package/build/src/akuma/akuma-product.js +3 -20
- package/build/src/akuma/akuma.d.ts +1 -8
- package/build/src/akuma/akuma.js +1 -5
- package/build/src/akuma/archetype.d.ts +6 -6
- package/build/src/akuma/archetype.js +18 -28
- package/build/src/akuma/body.d.ts +4 -26
- package/build/src/akuma/body.js +18 -2
- package/build/src/akuma/call-initial-tell.d.ts +55 -0
- package/build/src/akuma/call-initial-tell.js +32 -0
- package/build/src/akuma/call-input.d.ts +0 -3
- package/build/src/akuma/call-input.js +0 -7
- package/build/src/akuma/call-request.d.ts +13 -10
- package/build/src/akuma/call-request.js +26 -14
- package/build/src/akuma/fleet-execution.d.ts +20 -2
- package/build/src/akuma/fleet-execution.js +75 -21
- package/build/src/akuma/fleet-observation.d.ts +29 -18
- package/build/src/akuma/fleet-observation.js +7 -1
- package/build/src/akuma/heart/facts.d.ts +2 -3
- package/build/src/akuma/heart/soul.js +1 -6
- package/build/src/akuma/identity.js +11 -9
- package/build/src/akuma/projection-read.js +1 -2
- package/build/src/akuma/provider-recipe.d.ts +0 -10
- package/build/src/akuma/provider-recipe.js +0 -23
- package/build/src/akuma/provider.d.ts +1 -2
- package/build/src/akuma/providers/acp/index.js +0 -11
- package/build/src/akuma/providers/claude/index.js +2 -14
- package/build/src/akuma/providers/codex-app-server/index.js +0 -22
- package/build/src/akuma/providers/grok-build/index.js +0 -11
- package/build/src/akuma/providers/opencode-sdk/index.js +0 -10
- package/build/src/akuma/providers/pi/index.js +1 -5
- package/build/src/akuma/requests.d.ts +0 -1
- package/build/src/akuma/requests.js +0 -7
- package/build/src/akuma/turn-drive.d.ts +3 -0
- package/build/src/akuma/turn-drive.js +2 -2
- package/build/src/alias/index.js +3 -3
- package/build/src/{library → cli}/catalog.d.ts +7 -30
- package/build/src/cli/catalog.js +1 -0
- package/build/src/cli/commands/akuma-invoke.d.ts +3 -3
- package/build/src/cli/commands/akuma-invoke.js +80 -98
- package/build/src/cli/commands/akuma.js +33 -32
- package/build/src/cli/commands/bind.js +4 -5
- package/build/src/cli/commands/contract-help.d.ts +21 -17
- package/build/src/cli/commands/contract-help.js +44 -83
- package/build/src/cli/commands/contract-invoke.js +6 -6
- package/build/src/cli/commands/contract.d.ts +1 -1
- package/build/src/cli/commands/contract.js +1 -6
- package/build/src/cli/commands/install.d.ts +1 -1
- package/build/src/cli/commands/install.js +1 -1
- package/build/src/cli/commands/nuke.js +2 -2
- package/build/src/cli/commands/task.js +48 -16
- package/build/src/cli/invoke.js +49 -12
- package/build/src/cli/parse.js +2 -0
- package/build/src/cli/render/akuma-activity.d.ts +42 -11
- package/build/src/cli/render/akuma-activity.js +312 -125
- package/build/src/cli/render/akuma-tool.d.ts +7 -1
- package/build/src/cli/render/akuma-tool.js +35 -23
- package/build/src/cli/render/akuma.d.ts +14 -9
- package/build/src/cli/render/akuma.js +76 -66
- package/build/src/cli/render/audit.js +2 -2
- package/build/src/cli/render/catalog.d.ts +1 -1
- package/build/src/cli/render/catalog.js +1 -0
- package/build/src/cli/render/contract.js +3 -3
- package/build/src/cli/render/kanshi.js +2 -2
- package/build/src/cli/render/receipt.js +4 -4
- package/build/src/cli/render/refusal.js +2 -2
- package/build/src/cli/render/settings.js +2 -2
- package/build/src/cli/render/task.js +2 -2
- package/build/src/cli/render/terminal.d.ts +5 -0
- package/build/src/cli/render/terminal.js +13 -0
- package/build/src/cli/result.d.ts +1 -1
- package/build/src/cli/runtime.js +10 -4
- package/build/src/cli/selectors.js +2 -2
- package/build/src/identity/normalize.d.ts +3 -0
- package/build/src/identity/normalize.js +10 -0
- package/build/src/identity/selector.d.ts +1 -0
- package/build/src/identity/selector.js +15 -4
- package/build/src/index.d.ts +1 -0
- package/build/src/index.js +1 -0
- package/build/src/library/address.js +2 -2
- package/build/src/library/akuma-creation.d.ts +29 -16
- package/build/src/library/akuma-creation.js +151 -159
- package/build/src/library/akumas.d.ts +42 -0
- package/build/src/library/akumas.js +61 -0
- package/build/src/library/composition.d.ts +14 -401
- package/build/src/library/composition.js +24 -25
- package/build/src/library/contract-handle.d.ts +7 -2
- package/build/src/library/contract-handle.js +14 -2
- package/build/src/library/contract-types.d.ts +9 -2
- package/build/src/library/contract.d.ts +8 -15
- package/build/src/library/contract.js +21 -39
- package/build/src/library/fleet.d.ts +2 -1
- package/build/src/library/fleet.js +18 -14
- package/build/src/library/keiyaku.d.ts +8 -423
- package/build/src/library/keiyaku.js +3 -17
- package/build/src/protocol/completion.js +9 -2
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/package.json +5 -1
- package/build/src/akuma/akuma-product-symbols.d.ts +0 -1
- package/build/src/akuma/akuma-product-symbols.js +0 -1
- package/build/src/library/catalog.js +0 -130
|
@@ -1,100 +1,104 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keiyaku-task
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Must read when using Tasks for durable work planning, decomposition, or
|
|
5
|
+
dependencies.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Keiyaku Task
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
A Task is durable planning memory. It records work, decomposition, and
|
|
11
|
+
relationships that must remain after the current conversation. Task is an
|
|
12
|
+
independent product; it is not a Contract, Arc, Akuma, permission, acceptance
|
|
13
|
+
boundary, or fulfillment lifecycle.
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
decided about sequence. It grants nothing — no acceptance, no permission, no
|
|
14
|
-
scope, no fulfillment loop. Whoever holds a Contract's loop uses Tasks when the
|
|
15
|
-
plan is worth remembering and skips them when it is not; nothing binds Tasks to
|
|
16
|
-
Arcs, Contracts, or Akuma as a package.
|
|
15
|
+
## 1. When To Use A Task
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
Use a Task when the plan or dependency must outlive the current conversation.
|
|
18
|
+
Skip it when the work is small and no durable planning memory is needed.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
- Use a `kei` for one independently acceptable outcome.
|
|
21
|
+
- Use an Arc for a chapter inside one `kei`.
|
|
22
|
+
- Use a Task for decomposition or dependency memory.
|
|
23
|
+
- Do not create a Task just to mirror a `kei`.
|
|
24
|
+
|
|
25
|
+
A Task may exist without a Contract. Associating a Task with a `kei` does not
|
|
26
|
+
transfer the Contract's holder, acceptance, or lifecycle to the Task.
|
|
27
|
+
|
|
28
|
+
## 2. Relationships And Parallel Work
|
|
29
|
+
|
|
30
|
+
Independent Tasks may start and progress in parallel when their dependencies
|
|
31
|
+
allow it.
|
|
32
|
+
|
|
33
|
+
Use the relationships for their actual meanings:
|
|
34
|
+
|
|
35
|
+
- `needs` means this Task must wait for another Task to become terminal.
|
|
36
|
+
- `parent` groups decomposition; it does not create a dependency.
|
|
37
|
+
- `supersedes` points to work replaced by this Task.
|
|
38
|
+
- `relates` records a connection without affecting readiness.
|
|
39
|
+
|
|
40
|
+
Only `needs` orders work. Do not add it because Tasks touch the same Region or
|
|
41
|
+
because one Task is related to another. A terminal Task releases its dependents.
|
|
42
|
+
An `on_hold` Task is deliberately paused; it is neither ready nor blocked.
|
|
25
43
|
|
|
26
|
-
|
|
27
|
-
or in-progress tasks with unresolved needs. `on_hold` appears in neither view.
|
|
28
|
-
Both `done` and `drop` release dependents. `doctor` diagnoses the complete
|
|
29
|
-
world and never repairs it.
|
|
44
|
+
## 3. Task Commands
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
Create and inspect Tasks:
|
|
32
47
|
|
|
33
48
|
```bash
|
|
34
|
-
keiyaku task add "title"
|
|
35
|
-
keiyaku task add "title" --priority 1 --needs <task-id>
|
|
36
|
-
keiyaku task add --namespace <ns> -
|
|
49
|
+
keiyaku task add "<title>"
|
|
50
|
+
keiyaku task add "<title>" --priority 1 --needs <task-id>
|
|
37
51
|
keiyaku task show <task-id>
|
|
38
52
|
keiyaku task ls
|
|
39
|
-
keiyaku task ls --closed
|
|
40
|
-
keiyaku task ls --all --world
|
|
41
53
|
keiyaku task ready
|
|
42
54
|
keiyaku task blocked
|
|
43
55
|
keiyaku task tree <task-id>
|
|
44
56
|
keiyaku task doctor
|
|
45
57
|
```
|
|
46
58
|
|
|
47
|
-
`ls`, `ready`, and `blocked` use
|
|
48
|
-
|
|
49
|
-
commands require a complete TaskId and never infer namespace.
|
|
59
|
+
Use complete Task IDs for targeted commands. `ls`, `ready`, and `blocked` use
|
|
60
|
+
the current namespace; use `--world` to inspect the complete Task world.
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
Change lifecycle state:
|
|
52
63
|
|
|
53
64
|
```bash
|
|
54
65
|
keiyaku task start <task-id>...
|
|
55
66
|
keiyaku task stop <task-id>
|
|
56
|
-
keiyaku task hold <task-id
|
|
67
|
+
keiyaku task hold <task-id>...
|
|
57
68
|
keiyaku task resume <task-id>
|
|
58
69
|
keiyaku task done <task-id>...
|
|
59
|
-
keiyaku task drop <task-id>...
|
|
60
|
-
keiyaku task update <task-id> --title <text>
|
|
61
|
-
keiyaku task context [<namespace>]
|
|
70
|
+
keiyaku task drop <task-id>... --note "<reason>"
|
|
62
71
|
```
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
single-mutation result; multiple IDs use the ordered batch result, continue
|
|
68
|
-
after per-Task refusals, and preserve retry-over-refusal exit precedence.
|
|
73
|
+
Use `done` when the Task is complete. Use `drop` when it will not be done.
|
|
74
|
+
Both terminal states release dependent Tasks. Use `hold` for a deliberate pause,
|
|
75
|
+
not for an unresolved dependency; unresolved `needs` appear in `blocked`.
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Use `task compose -` to create and modify multiple Tasks in one planning
|
|
73
|
-
document. Its input grammar is documented by the Task CLI owner:
|
|
77
|
+
Update a Task without changing its lifecycle:
|
|
74
78
|
|
|
75
79
|
```bash
|
|
76
|
-
keiyaku task
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
+ Parent
|
|
80
|
-
as = parent
|
|
81
|
-
state = in_progress
|
|
82
|
-
pri = 0
|
|
83
|
-
body <<BODY
|
|
84
|
-
Parent body.
|
|
85
|
-
BODY
|
|
86
|
-
|
|
87
|
-
+ Child
|
|
88
|
-
parent = ^parent
|
|
89
|
-
needs = @task/existing
|
|
90
|
-
EOF
|
|
80
|
+
keiyaku task update <task-id> --title "<title>"
|
|
81
|
+
keiyaku task update <task-id> --body "<body>"
|
|
82
|
+
keiyaku task update <task-id> --needs <task-id>
|
|
91
83
|
```
|
|
92
84
|
|
|
93
|
-
Use
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
Use `task compose -` when several Tasks and their relationships should be
|
|
86
|
+
planned or admitted together. Use `--plan` to inspect the composition without
|
|
87
|
+
writing it.
|
|
88
|
+
|
|
89
|
+
## 4. After Creating A Task
|
|
90
|
+
|
|
91
|
+
Read the returned Task identity. Then:
|
|
92
|
+
|
|
93
|
+
1. Start ready work.
|
|
94
|
+
2. Run independent Tasks in parallel.
|
|
95
|
+
3. Add or remove relationships when the plan changes.
|
|
96
|
+
4. Hold work that is deliberately paused.
|
|
97
|
+
5. Mark completed work `done`, or mark abandoned work `drop` with a reason.
|
|
98
|
+
6. Use `ready`, `blocked`, `tree`, or `doctor` to rebuild the current view.
|
|
99
|
+
|
|
100
|
+
Task records planning memory. It does not perform the work, claim acceptance,
|
|
101
|
+
assign a holder, or decide what a Contract may accept.
|
|
102
|
+
|
|
103
|
+
Read `keiyaku-bind` for Contract authoring and `keiyaku-workflow` for Contract
|
|
104
|
+
lifecycle.
|
|
@@ -1,151 +1,120 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keiyaku-workflow
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Must read before binding a `kei` (Contract) or when acting as its holder.
|
|
5
|
+
Use when deciding when to bind a kei, how to shape and hold it, how to
|
|
6
|
+
delegate its work, and how to accept, amend, or end it.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
holder
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
##
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
`
|
|
120
|
-
|
|
121
|
-
real index. The candidate includes the complete non-ignored worktree, not
|
|
122
|
-
just the Contract's Region or the conflict paths. Candidate capture and target
|
|
123
|
-
placement are separate: this authorization does not permit overwriting
|
|
124
|
-
blocking changes in the target checkout.
|
|
125
|
-
|
|
126
|
-
Audit observes: prospective candidate, integration, Verification,
|
|
127
|
-
diff, target. It records no candidate and satisfies no gate.
|
|
128
|
-
|
|
129
|
-
Evidence goes stale by subject identity: a changed candidate or
|
|
130
|
-
amended terms stales the testimony over that subject. Amend only
|
|
131
|
-
while the same objective and acceptance boundary remain truthful —
|
|
132
|
-
amendment reshapes terms inside the same promise. When the objective
|
|
133
|
-
or the boundary itself has changed, abandon and bind a truthful new
|
|
134
|
-
Contract; do not steer old terms onto a different delivery. Abandon
|
|
135
|
-
ends a Contract without moving the target.
|
|
136
|
-
|
|
137
|
-
## Decision 5 — schedule landing
|
|
138
|
-
|
|
139
|
-
You schedule overlapping Contracts; nothing persists an ordering — no
|
|
140
|
-
train exists in the tool. When the target has moved, prepare the
|
|
141
|
-
current-target integration before the authoritative review. A
|
|
142
|
-
content-equivalent preparation retains standing testimony; a changed
|
|
143
|
-
conflict resolution stales it. Target movement requires fresh deliver
|
|
144
|
-
or audit preparation.
|
|
145
|
-
|
|
146
|
-
A placement refusal preserves the candidate and the testimony and
|
|
147
|
-
leaves target and checkout untouched: resolve the blocking obligation
|
|
148
|
-
and request placement again. Reconcile finishes accepted lagging
|
|
149
|
-
effects; it does not retry a placement refusal. Rebuild your picture
|
|
150
|
-
at any time from the read surfaces — status, show, region — whose
|
|
151
|
-
grammar lives in their help.
|
|
9
|
+
# Keiyaku Workflow
|
|
10
|
+
|
|
11
|
+
This skill manages a `kei` (Contract) from preparation to completion.
|
|
12
|
+
|
|
13
|
+
## 1. Prepare Before Binding
|
|
14
|
+
|
|
15
|
+
Before `bind`, settle the information that makes the `kei` truthful:
|
|
16
|
+
|
|
17
|
+
- objective and intended outcome;
|
|
18
|
+
- design and approach;
|
|
19
|
+
- affected Region;
|
|
20
|
+
- acceptance conditions;
|
|
21
|
+
- verification and required evidence;
|
|
22
|
+
- prerequisites;
|
|
23
|
+
- holder.
|
|
24
|
+
|
|
25
|
+
If the design, approach, or acceptance conditions are still open, do not bind.
|
|
26
|
+
Resolve them with their owner first. Private implementation details may remain
|
|
27
|
+
for the Deliverer; the public meaning and acceptance boundary may not.
|
|
28
|
+
|
|
29
|
+
Bind independent `kei`s in parallel. Do not split one acceptance boundary just
|
|
30
|
+
to create parallel work.
|
|
31
|
+
|
|
32
|
+
## 2. Split the Work
|
|
33
|
+
|
|
34
|
+
Use these rules:
|
|
35
|
+
|
|
36
|
+
- Separate `kei`s have independently acceptable outcomes.
|
|
37
|
+
- An Arc is a chapter of one `kei`; it is not separately accepted.
|
|
38
|
+
- A Task stores decomposition or dependencies that must outlive the current
|
|
39
|
+
conversation.
|
|
40
|
+
|
|
41
|
+
Use `after` only when one `kei` requires another `kei` to be completed first.
|
|
42
|
+
Ordinary overlap is not a dependency.
|
|
43
|
+
|
|
44
|
+
## 3. Hold the `kei`
|
|
45
|
+
|
|
46
|
+
Every `kei` has exactly one holder. The holder owns it until completion or
|
|
47
|
+
termination, coordinates its work, delegates when useful, and is responsible
|
|
48
|
+
for acceptance.
|
|
49
|
+
|
|
50
|
+
The holder may work directly or delegate Akumas, Deliverers, Reviewers, Tasks,
|
|
51
|
+
or Arcs. An Akuma holder must receive the `kei`, current Arc when one exists,
|
|
52
|
+
worktree, and holder responsibilities in its prompt, and must have
|
|
53
|
+
`contract.*` and `akuma.*`.
|
|
54
|
+
|
|
55
|
+
## 4. Lifecycle
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
bind -> tender -> gates and prerequisites pass -> automatic claim
|
|
59
|
+
\\-> abandon
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- `bind` creates the `kei` with its terms, acceptance conditions, gates, and
|
|
63
|
+
dependencies.
|
|
64
|
+
- `tender` submits the candidate for acceptance.
|
|
65
|
+
- After tender, the `kei` is claimed automatically when its prerequisites and
|
|
66
|
+
every required gate pass.
|
|
67
|
+
- `abandon` ends a `kei` without claiming it.
|
|
68
|
+
- A claimed or abandoned `kei` is terminal.
|
|
69
|
+
|
|
70
|
+
The holder may continue work and tender again while the `kei` is not terminal.
|
|
71
|
+
|
|
72
|
+
## 5. Gates
|
|
73
|
+
|
|
74
|
+
A gate is a named acceptance obligation. A tendered `kei` cannot be claimed
|
|
75
|
+
until every selected gate has satisfied evidence.
|
|
76
|
+
|
|
77
|
+
Bind gate options:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
keiyaku bind --gates <name,...> -
|
|
81
|
+
keiyaku bind --gates "" -
|
|
82
|
+
keiyaku bind --gates reviewed -
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- Omitting `--gates` selects `gates.default`; when no default bundle exists,
|
|
86
|
+
it selects `reviewed`.
|
|
87
|
+
- `--gates <name,...>` selects gate names and configured bundles. Bundles
|
|
88
|
+
expand to their configured gates.
|
|
89
|
+
- `--gates ""` binds the `kei` with no gates.
|
|
90
|
+
- `--gates reviewed` selects the `reviewed` gate directly.
|
|
91
|
+
|
|
92
|
+
Gates are acceptance requirements, not work assignments. The Deliverer
|
|
93
|
+
produces the candidate, the relevant producer supplies evidence, and the holder
|
|
94
|
+
coordinates the remaining work.
|
|
95
|
+
|
|
96
|
+
## 6. Delegate the Work
|
|
97
|
+
|
|
98
|
+
Delegate with a clear owner, objective, worktree, and expected result. Include
|
|
99
|
+
the current Arc when one exists. A Deliverer produces the candidate. A Reviewer
|
|
100
|
+
checks it against the `kei`'s acceptance conditions and returns evidence.
|
|
101
|
+
Delegation does not transfer the holder's responsibility.
|
|
102
|
+
|
|
103
|
+
Use `keiyaku-akuma` for Akuma invocation, telling, waiting, permissions, and
|
|
104
|
+
history. Use command help for exact syntax.
|
|
105
|
+
|
|
106
|
+
## 7. Decide What Happens Next
|
|
107
|
+
|
|
108
|
+
The holder checks the tendered candidate, verification, review evidence,
|
|
109
|
+
prerequisites, and gates.
|
|
110
|
+
|
|
111
|
+
- If everything passes, automatic claim completes the `kei`.
|
|
112
|
+
- If something is missing, continue the work or delegate the next chapter.
|
|
113
|
+
- Amend when the objective and acceptance boundary remain the same but the
|
|
114
|
+
terms need to change.
|
|
115
|
+
- Abandon and bind a new `kei` when the objective or acceptance boundary has
|
|
116
|
+
changed.
|
|
117
|
+
|
|
118
|
+
For Contract authoring, read `keiyaku-bind`. For Akuma delegation, read
|
|
119
|
+
`keiyaku-akuma`. For supervising many waiting `kei`s, read
|
|
120
|
+
`keiyaku-babysit`.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CallInitialTell, type CallInitialTellAdmission } from "./call-initial-tell.js";
|
|
1
2
|
import { type TellResult, type TellWakeRuntime } from "./body.js";
|
|
2
3
|
import { HeldAkumaLeash, type KillEvidence, type TellFact, type TurnOutcome } from "./heart/index.js";
|
|
3
4
|
import { type AkuId, type AkumaPaths } from "./identity.js";
|
|
@@ -18,6 +19,7 @@ export type TellAdmission = Readonly<{
|
|
|
18
19
|
tell: TellFact;
|
|
19
20
|
wake: Promise<TellResult>;
|
|
20
21
|
}>;
|
|
22
|
+
export type InitialTellAdmission = CallInitialTellAdmission;
|
|
21
23
|
export type InterruptAdmission = Readonly<{
|
|
22
24
|
kind: "unavailable";
|
|
23
25
|
evidence: "hung" | "untidy" | "unavailable";
|
|
@@ -53,6 +55,10 @@ export declare class AkumaHandle {
|
|
|
53
55
|
timeoutMs?: number;
|
|
54
56
|
signal?: AbortSignal;
|
|
55
57
|
}>): Promise<AkumaStatus>;
|
|
58
|
+
admitInitialTell(initialTell: CallInitialTell, options?: Readonly<{
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
runtime?: TellWakeRuntime;
|
|
61
|
+
}>): Promise<InitialTellAdmission>;
|
|
56
62
|
tell(body: string, tellId?: string, recordedAt?: string, runtime?: TellWakeRuntime, options?: Readonly<{
|
|
57
63
|
schemaJson?: string;
|
|
58
64
|
initiator?: string;
|
|
@@ -78,9 +84,11 @@ export declare class AkumaHandle {
|
|
|
78
84
|
tellOutcome(tellId: string, options?: Readonly<{
|
|
79
85
|
timeoutMs?: number;
|
|
80
86
|
signal?: AbortSignal;
|
|
87
|
+
observe?: (observation: import("./akuma-observe.js").LiveStatusObservation) => void | Promise<void>;
|
|
81
88
|
}>): Promise<Readonly<{
|
|
82
89
|
reason: WaitReason;
|
|
83
90
|
outcome: TurnOutcome | null;
|
|
91
|
+
completedAt: string | null;
|
|
84
92
|
}>>;
|
|
85
93
|
private boundTellOutcome;
|
|
86
94
|
interrupt(body: string, options?: Readonly<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { admitCallInitialTell } from "./call-initial-tell.js";
|
|
2
3
|
import { handoffPendingTells, wakeRecordedTell } from "./body.js";
|
|
3
4
|
import { HeldAkumaLeash, activitySlice, readForkPoint, readHeart, readKill, readLastAnsweredTurn, readSoul, readTell, readTurn, recordTell, requestPause, requestStop, projectTell, } from "./heart/index.js";
|
|
4
5
|
import { acquireLeash } from "./control.js";
|
|
@@ -8,7 +9,7 @@ import { resolveProviderExecution } from "./providers/index.js";
|
|
|
8
9
|
import { publishAkuma } from "./publication.js";
|
|
9
10
|
import { spawnAkumaBody } from "./body.js";
|
|
10
11
|
import { AkumaNotBornError, AkumaProviderError } from "./akuma-errors.js";
|
|
11
|
-
import { bornStatus, defaultWaitComplete, readWaitComplete, waitForObservation, } from "./akuma-observe.js";
|
|
12
|
+
import { bornStatus, bornLiveStatus, defaultWaitComplete, readWaitComplete, waitForObservation, } from "./akuma-observe.js";
|
|
12
13
|
const CALL_EXECUTION = Symbol("akuma-call-execution");
|
|
13
14
|
function diagnostic(error) {
|
|
14
15
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -150,6 +151,15 @@ export class AkumaHandle {
|
|
|
150
151
|
async wait(predicate = defaultWaitComplete, options = {}) {
|
|
151
152
|
return (await this.waitReceipt(predicate, options)).status;
|
|
152
153
|
}
|
|
154
|
+
async admitInitialTell(initialTell, options = {}) {
|
|
155
|
+
return await admitCallInitialTell({
|
|
156
|
+
world: this.worldPath,
|
|
157
|
+
id: this.id,
|
|
158
|
+
initialTell,
|
|
159
|
+
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
160
|
+
wake: (tell) => wakeRecordedTell(this.paths, tell.id, options.runtime, options.signal),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
153
163
|
async tell(body, tellId = randomUUID(), recordedAt = new Date().toISOString(), runtime, options = {}) {
|
|
154
164
|
const admitted = await this.admitTell(body, tellId, recordedAt, runtime, options);
|
|
155
165
|
if (admitted.kind === "not-born")
|
|
@@ -209,17 +219,24 @@ export class AkumaHandle {
|
|
|
209
219
|
if (tell === null)
|
|
210
220
|
throw new AkumaProviderError(`recorded Tell ${tellId} is missing from Heart`);
|
|
211
221
|
const outcome = await this.boundTellOutcome(tell);
|
|
212
|
-
|
|
222
|
+
if (options.observe !== undefined) {
|
|
223
|
+
await options.observe(await bornLiveStatus(this.paths, this.id, { aperture: "monitoring", admittedTellId: tellId }));
|
|
224
|
+
}
|
|
225
|
+
return { ...outcome, terminalWithoutTurn: tell.state === "told" && tell.binding === undefined };
|
|
213
226
|
},
|
|
214
227
|
complete: (observed) => observed.outcome !== null || observed.terminalWithoutTurn,
|
|
215
228
|
});
|
|
216
|
-
return {
|
|
229
|
+
return {
|
|
230
|
+
reason: waited.reason,
|
|
231
|
+
outcome: waited.value.outcome,
|
|
232
|
+
completedAt: waited.value.completedAt,
|
|
233
|
+
};
|
|
217
234
|
}
|
|
218
235
|
async boundTellOutcome(tell) {
|
|
219
236
|
if (tell.binding === undefined)
|
|
220
|
-
return null;
|
|
221
|
-
const
|
|
222
|
-
return
|
|
237
|
+
return { outcome: null, completedAt: null };
|
|
238
|
+
const end = (await readTurn(this.paths, tell.binding.turnSequence))?.end;
|
|
239
|
+
return { outcome: end?.outcome ?? null, completedAt: end?.completedAt ?? null };
|
|
223
240
|
}
|
|
224
241
|
async interrupt(body, options = {}) {
|
|
225
242
|
const admitted = await this.admitInterrupt(body, options);
|
|
@@ -328,7 +345,6 @@ export class AkumaHandle {
|
|
|
328
345
|
...(source.description === undefined ? {} : { description: source.description }),
|
|
329
346
|
provider: source.provider,
|
|
330
347
|
options: source.options,
|
|
331
|
-
...(source.readonly === undefined ? {} : { readonly: source.readonly }),
|
|
332
348
|
allowed: source.allowed,
|
|
333
349
|
cwd: source.cwd,
|
|
334
350
|
origin: { kind: "fork", parent: this.id, at: input.at },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { canonicalBirthCwd } from "./call-input.js";
|
|
3
3
|
import { spawnAkumaBody } from "./body.js";
|
|
4
4
|
import { decodeAllowedActions, unionAllowedActions } from "./allowed.js";
|
|
5
5
|
import { AkumaDecodeError, AkumaProviderError } from "./akuma-errors.js";
|
|
@@ -98,8 +98,7 @@ export class Akuma {
|
|
|
98
98
|
const name = archetype;
|
|
99
99
|
const home = input.home === undefined ? {} : { home: input.home };
|
|
100
100
|
const settings = input.settings ?? (await readSettings({ root: input.root, ...home }));
|
|
101
|
-
const
|
|
102
|
-
const loaded = await loadArchetype({ name, project: input.root, ...home, settings, ...readonly });
|
|
101
|
+
const loaded = await loadArchetype({ name, project: input.root, ...home, settings });
|
|
103
102
|
const allowed = input.allowed === undefined
|
|
104
103
|
? loaded.allowed
|
|
105
104
|
: unionAllowedActions(loaded.allowed, decodeAllowedActions(input.allowed, "Akuma birth allowed"));
|
|
@@ -115,7 +114,6 @@ export class Akuma {
|
|
|
115
114
|
...(loaded.description === undefined ? {} : { description: loaded.description }),
|
|
116
115
|
provider: loaded.provider,
|
|
117
116
|
options: loaded.options,
|
|
118
|
-
...(loaded.readonly === undefined ? {} : { readonly: loaded.readonly }),
|
|
119
117
|
allowed,
|
|
120
118
|
cwd,
|
|
121
119
|
origin: { kind: "direct" },
|
|
@@ -15,6 +15,12 @@ export type BudgetedStatusObservation = Readonly<{
|
|
|
15
15
|
export type LiveStatusObservation = BudgetedStatusObservation & Readonly<{
|
|
16
16
|
rows: readonly ActivityRow[];
|
|
17
17
|
}>;
|
|
18
|
+
/** Internal live companion for an observation loop; it is not a public result. */
|
|
19
|
+
export declare function bornLiveStatus(paths: AkumaPaths, expected: AkuId, input: Readonly<{
|
|
20
|
+
aperture: "monitoring" | "receipt";
|
|
21
|
+
ordinaryBudget?: number;
|
|
22
|
+
admittedTellId?: string;
|
|
23
|
+
}>): Promise<LiveStatusObservation>;
|
|
18
24
|
export declare function bornStatus(paths: AkumaPaths, expected: AkuId, input: Readonly<{
|
|
19
25
|
aperture: "monitoring" | "receipt";
|
|
20
26
|
ordinaryBudget?: number;
|
|
@@ -56,7 +56,8 @@ async function bornObservation(paths, expected, read, snapshot) {
|
|
|
56
56
|
claim?.release();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
/** Internal live companion for an observation loop; it is not a public result. */
|
|
60
|
+
export async function bornLiveStatus(paths, expected, input) {
|
|
60
61
|
if (input.ordinaryBudget !== undefined && (!Number.isSafeInteger(input.ordinaryBudget) || input.ordinaryBudget < 0))
|
|
61
62
|
throw new TypeError("ordinary budget must be a nonnegative safe integer");
|
|
62
63
|
const { snapshot, soul, currentLife } = await bornObservation(paths, expected, () => readLifeSnapshot(paths));
|
|
@@ -74,8 +75,8 @@ async function bornLiveStatus(paths, expected, input) {
|
|
|
74
75
|
status: {
|
|
75
76
|
id: soul.id,
|
|
76
77
|
life: currentLife,
|
|
78
|
+
cwd: soul.cwd,
|
|
77
79
|
allowed: soul.allowed,
|
|
78
|
-
...(soul.readonly === undefined ? {} : { readonly: soul.readonly }),
|
|
79
80
|
...(resumeUnsupported ? { strandedReason: "resume-unsupported" } : {}),
|
|
80
81
|
timeline: selected.snapshot,
|
|
81
82
|
},
|