@astrosheep/keiyaku 2.9.11 → 2.9.13
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 +79 -85
- package/build/.tsbuildinfo +1 -1
- package/build/agents/call-terms.js +1 -0
- package/build/agents/providers/claude-agent-sdk/adapter.js +17 -4
- package/build/cli/commands/akuma/akuma/handler.js +2 -1
- package/build/cli/commands/akuma/akuma/meta.js +4 -3
- package/build/cli/commands/akuma/catalog.js +2 -0
- package/build/cli/commands/akuma/list/handler.js +1 -1
- package/build/cli/commands/akuma/list/meta-list.js +12 -0
- package/build/cli/commands/akuma/list/meta-ls.js +2 -2
- package/build/cli/commands/akuma.js +5 -0
- package/build/cli/commands/contract/amend/meta.js +4 -3
- package/build/cli/commands/contract/arc/meta.js +2 -0
- package/build/cli/commands/contract/audit/handler.js +28 -2
- package/build/cli/commands/contract/audit/meta.js +4 -3
- package/build/cli/commands/contract/bind/meta.js +4 -4
- package/build/cli/commands/contract/petition/handler.js +2 -1
- package/build/cli/commands/contract/petition/meta.js +2 -2
- package/build/cli/commands/contract/renew/handler.js +44 -3
- package/build/cli/commands/contract/renew/meta.js +5 -4
- package/build/cli/commands/metadata.js +14 -10
- package/build/cli/commands/projection/call/handler.js +1 -1
- package/build/cli/commands/projection/call/meta.js +1 -1
- package/build/cli/commands/projection/catalog.js +2 -2
- package/build/cli/commands/projection/{revive → fork}/handler.js +10 -5
- package/build/cli/commands/projection/fork/meta.js +12 -0
- package/build/cli/commands/projection/history/handler.js +46 -2
- package/build/cli/commands/projection/history/meta.js +3 -3
- package/build/cli/commands/projection/kill/handler.js +4 -5
- package/build/cli/commands/projection/kill/meta.js +2 -2
- package/build/cli/commands/projection/status/handler.js +29 -13
- package/build/cli/commands/projection/status/meta.js +14 -3
- package/build/cli/commands/projection/tell/handler.js +8 -4
- package/build/cli/commands/projection/tell/meta.js +1 -1
- package/build/cli/commands/projection/wait/handler.js +45 -20
- package/build/cli/commands/projection/wait/meta.js +1 -1
- package/build/cli/commands/shared.js +2 -2
- package/build/cli/commands/system/catalog.js +2 -0
- package/build/cli/commands/task/add/handler.js +28 -12
- package/build/cli/commands/task/add/meta.js +18 -6
- package/build/cli/commands/task/catalog.js +4 -0
- package/build/cli/commands/task/compose/handler.js +18 -0
- package/build/cli/commands/task/compose/meta.js +10 -0
- package/build/cli/commands/task/doctor/handler.js +2 -3
- package/build/cli/commands/task/doctor/meta.js +2 -2
- package/build/cli/commands/task/done/meta.js +2 -2
- package/build/cli/commands/task/drop/handler.js +7 -2
- package/build/cli/commands/task/drop/meta.js +6 -3
- package/build/cli/commands/task/hold/meta.js +2 -2
- package/build/cli/commands/task/log/meta.js +2 -2
- package/build/cli/commands/task/ls/meta.js +2 -2
- package/build/cli/commands/task/note/handler.js +6 -0
- package/build/cli/commands/task/note/meta.js +11 -0
- package/build/cli/commands/task/resume/meta.js +2 -2
- package/build/cli/commands/task/shared.js +29 -15
- package/build/cli/commands/task/show/meta.js +2 -2
- package/build/cli/commands/task/start/meta.js +2 -2
- package/build/cli/commands/task/stop/meta.js +2 -2
- package/build/cli/commands/task/update/meta.js +3 -2
- package/build/cli/commands/verification/handler.js +43 -0
- package/build/cli/commands/verification/meta.js +13 -0
- package/build/cli/completion.js +16 -13
- package/build/cli/flags.js +48 -12
- package/build/cli/help.js +29 -30
- package/build/cli/index.js +14 -8
- package/build/cli/parse-flags.js +60 -21
- package/build/cli/parse-metadata.js +10 -4
- package/build/cli/parse-selectors.js +22 -4
- package/build/cli/parse.js +43 -30
- package/build/cli/projection-address.js +7 -7
- package/build/cli/render/arc.js +12 -3
- package/build/cli/render/audit.js +2 -2
- package/build/cli/render/call.js +4 -4
- package/build/cli/render/kanshi.js +122 -85
- package/build/cli/render/misc.js +2 -2
- package/build/cli/render/petition.js +16 -1
- package/build/cli/render/projection-history.js +17 -4
- package/build/cli/render/shared.js +5 -5
- package/build/cli/render/status-indicator.js +47 -0
- package/build/cli/render/status.js +106 -76
- package/build/cli/render/success-response.js +20 -5
- package/build/cli/render/task.js +33 -5
- package/build/cli/render/tell.js +10 -4
- package/build/cli/render/tool-command-normalization.js +137 -0
- package/build/cli/render/tool-presentation.js +2 -1
- package/build/cli/render/verification.js +23 -0
- package/build/cli/render/wait.js +101 -33
- package/build/cli/types.js +2 -1
- package/build/config/akuma-loader.js +21 -1
- package/build/config/settings/knobs.js +7 -1
- package/build/config/settings/schema.js +10 -5
- package/build/core/addressing.js +3 -3
- package/build/core/amend.js +102 -17
- package/build/core/arc.js +4 -4
- package/build/core/audit/candidate.js +10 -18
- package/build/core/audit/coordinates.js +12 -17
- package/build/core/audit/evidence.js +6 -4
- package/build/core/audit/facade.js +3 -3
- package/build/core/audit/report.js +1 -1
- package/build/core/bind-reconciliation.js +42 -23
- package/build/core/bind.js +182 -81
- package/build/core/call/call.js +6 -7
- package/build/core/call/context.js +46 -33
- package/build/core/call/execution.js +21 -6
- package/build/core/call/prompt.js +11 -42
- package/build/core/contract-carrier-runtime.js +209 -105
- package/build/core/contract-carrier.js +156 -73
- package/build/core/contract-view.js +43 -6
- package/build/core/contract.js +2 -1
- package/build/core/derived-replay.js +168 -35
- package/build/core/draft.js +60 -27
- package/build/core/forfeit.js +1 -1
- package/build/core/lifecycle-history.js +13 -0
- package/build/core/lifecycle-recovery.js +32 -27
- package/build/core/lifecycle-runner.js +14 -14
- package/build/core/log.js +1 -1
- package/build/core/outcome-base.js +2 -2
- package/build/core/projection/akuma-name.js +43 -0
- package/build/core/projection/generation/database.js +141 -79
- package/build/core/projection/generation/ledger.js +91 -0
- package/build/core/projection/generation/model.js +19 -14
- package/build/core/projection/generation/projection-generation-continuation.js +1 -1
- package/build/core/projection/generation/projection-generation-doorbell.js +88 -0
- package/build/core/projection/generation/projection-generation-execution.js +24 -0
- package/build/core/projection/generation/projection-generation-identity.js +4 -0
- package/build/core/projection/generation/projection-generation-launcher.js +72 -138
- package/build/core/projection/generation/projection-generation-process.js +16 -15
- package/build/core/projection/generation/projection-generation-runner.js +132 -76
- package/build/core/projection/generation/projection-generation-runtime.js +10 -61
- package/build/core/projection/generation/protocol.js +68 -0
- package/build/core/projection/generation/store.js +17 -7
- package/build/core/projection/generation/transitions.js +24 -14
- package/build/core/projection/index.js +5 -5
- package/build/core/projection/projection-core.js +6 -2
- package/build/core/projection/projection-execution-observer.js +1 -1
- package/build/core/projection/projection-history.js +8 -8
- package/build/core/projection/projection-kill.js +20 -10
- package/build/core/projection/projection-life-observer.js +8 -8
- package/build/core/projection/projection-mint.js +6 -8
- package/build/core/projection/projection-status-observation.js +77 -8
- package/build/core/projection/projection-status.js +151 -4
- package/build/core/projection/projection-wait.js +48 -29
- package/build/core/projection/projection-wake.js +28 -88
- package/build/core/projection/tell/launch-store.js +1 -1
- package/build/core/projection/tell/store.js +1 -1
- package/build/core/renew-build.js +204 -74
- package/build/core/renew-plan.js +34 -9
- package/build/core/renew-rewrite.js +56 -15
- package/build/core/renew.js +39 -35
- package/build/core/repository-ledger/accepted-fold-read.js +6 -3
- package/build/core/repository-ledger/claim-evidence.js +1 -1
- package/build/core/repository-ledger/codec.js +11 -5
- package/build/core/repository-ledger/current-state-store.js +464 -349
- package/build/core/repository-ledger/fold-repository.js +5 -6
- package/build/core/repository-ledger/identity.js +60 -0
- package/build/core/repository-ledger/inventory.js +3 -3
- package/build/core/repository-ledger/read-model.js +57 -9
- package/build/core/repository-ledger/write-transaction.js +24 -17
- package/build/core/run-control/connection-bound-close.js +41 -0
- package/build/core/run-control/detached-lease-bootstrap.js +208 -0
- package/build/core/run-control/detached-process.js +14 -0
- package/build/core/run-control/index.js +6 -0
- package/build/core/{process-group.js → run-control/process-tree.js} +1 -1
- package/build/core/run-control/runner-lease.js +172 -0
- package/build/core/run-control/sqlite-process-lifetime-lock.js +174 -0
- package/build/core/seal.js +44 -32
- package/build/core/settlement/claim-delivery.js +22 -9
- package/build/core/settlement/claim.js +8 -6
- package/build/core/settlement/petition-claim-gates.js +9 -8
- package/build/core/settlement/petition-head-guard.js +5 -6
- package/build/core/settlement/petition-preview.js +21 -5
- package/build/core/settlement/petition.js +51 -17
- package/build/core/settlement/settlement.js +20 -15
- package/build/core/settlement/verdict.js +2 -2
- package/build/core/settlement/verification.js +492 -364
- package/build/core/status/board.js +184 -75
- package/build/core/status/drift.js +8 -10
- package/build/core/task/board.js +1 -0
- package/build/core/task/commands.js +25 -0
- package/build/core/task/compose.js +328 -0
- package/build/core/task/document.js +102 -39
- package/build/core/task/index.js +4 -3
- package/build/core/task/settlement-git.js +70 -30
- package/build/core/task/settlement-policy.js +27 -14
- package/build/core/task/source-board.js +1 -0
- package/build/core/task/task-bind-preparation.js +59 -9
- package/build/core/task/task-contract.js +2 -2
- package/build/core/task/task-git-store.js +1 -0
- package/build/core/task/task-store-repository.js +2 -0
- package/build/core/task/task.js +2 -2
- package/build/core/transcripts.js +4 -4
- package/build/core/verification-declaration.js +95 -0
- package/build/core/worktree-bootstrap.js +1 -1
- package/build/core/worktree-path.js +7 -11
- package/build/flow-error.js +15 -2
- package/build/generated/version.js +2 -2
- package/build/git/branches.js +41 -70
- package/build/git/commits.js +92 -21
- package/build/git/core.js +9 -161
- package/build/git/diff/preview.js +4 -4
- package/build/git/diff/read.js +4 -4
- package/build/git/diff/structured.js +5 -5
- package/build/git/process.js +229 -0
- package/build/git/refs.js +30 -5
- package/build/git/staging.js +39 -115
- package/build/git/streaming-batch.js +9 -16
- package/build/git/worktree.js +104 -91
- package/build/index.js +7 -0
- package/package.json +2 -2
- package/skills/keiyaku-akuma/SKILL.md +27 -21
- package/skills/keiyaku-task/SKILL.md +61 -5
- package/skills/keiyaku-workflow/SKILL.md +81 -26
- package/build/cli/commands/projection/revive/meta.js +0 -12
- package/build/core/projection/projection-life-protocol.js +0 -115
- package/build/core/projection/projection-runner-lock.js +0 -382
- package/build/core/projection/tell/database.js +0 -127
- package/build/core/settlement/verification-coordination.js +0 -305
- package/build/core/settlement/verification-supervisor.js +0 -275
package/README.md
CHANGED
|
@@ -2,97 +2,90 @@
|
|
|
2
2
|
|
|
3
3
|
契約 — a contract.
|
|
4
4
|
|
|
5
|
-
Keiyaku is
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
Keiyaku is an AI-first CLI: its user is a coding agent. Not a human writing
|
|
6
|
+
specs for an agent to implement — an agent delegating to other agents,
|
|
7
|
+
running the whole loop itself: writing the terms, calling the worker,
|
|
8
|
+
supervising the run, settling the outcome.
|
|
9
|
+
|
|
10
|
+
That is why it is a contract system rather than a spec system. A spec relies
|
|
11
|
+
on someone with judgment reading it charitably; here both the worker and the
|
|
12
|
+
judge are models, and a model honors what you wrote, not what you meant. So
|
|
13
|
+
terms are binding, the worker — an akuma (悪魔, demon) — runs on an isolated
|
|
14
|
+
branch, gates and a reviewer judge the diff against the criteria alone, and
|
|
15
|
+
settlement is mechanical: the change lands on main with a commit-hash
|
|
16
|
+
receipt, or the branch is deleted. No human needs to be in the loop for any
|
|
17
|
+
step; nothing depends on anyone eyeballing anything.
|
|
14
18
|
|
|
15
19
|
```bash
|
|
16
20
|
npm install -g @astrosheep/keiyaku
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
Node ≥ 22.19, inside a git repository
|
|
23
|
+
Node ≥ 22.19, inside a git repository with a clean worktree.
|
|
20
24
|
|
|
21
|
-
##
|
|
25
|
+
## One deal, end to end
|
|
22
26
|
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
```bash
|
|
28
|
+
# Write the terms: Title, Context, Objective, Design & Approach, Scope, Criteria.
|
|
29
|
+
# The criteria are read by the letter — precision goes here, not in prompts.
|
|
30
|
+
keiyaku bind - < contract.md
|
|
31
|
+
|
|
32
|
+
# Put an akuma on it. It works alone in the contract's own worktree.
|
|
33
|
+
keiyaku call worker-akuma --detach "fulfill the contract"
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
# It runs for as long as it needs. You are not its babysitter —
|
|
36
|
+
# but you can be:
|
|
37
|
+
keiyaku wait worker-akuma/3f21ab9e --timeout 10m
|
|
38
|
+
keiyaku tell worker-akuma/3f21ab9e "criteria 3 also covers the CLI output"
|
|
39
|
+
keiyaku kill worker-akuma/3f21ab9e # death is not an error state
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
# Ask for judgment: gates run, a reviewer akuma reads the diff
|
|
42
|
+
# against the criteria.
|
|
43
|
+
keiyaku petition
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
quiet one.
|
|
45
|
+
# claim → the change lands on main, with a commit-hash receipt
|
|
46
|
+
# forfeit → the branch is deleted; partial fulfillment is forfeiture
|
|
47
|
+
```
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
Every step appends to the contract's ledger. `keiyaku log` replays any deal,
|
|
50
|
+
finished or dead, from its receipts.
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
## The board
|
|
53
|
+
|
|
54
|
+
`keiyaku status` is the one screen of state. Real output:
|
|
44
55
|
|
|
45
56
|
```text
|
|
46
57
|
kanshi ─────────────────────────────────────────────────────── 現世 b4c38cc
|
|
47
58
|
|
|
48
|
-
|
|
49
|
-
□ fridge Add task arrange for atomic existing-task reorganization ▲2 · open 27m
|
|
50
|
-
□ hermitcrab Let task commands select a contract workspace bound 8m
|
|
59
|
+
marks ● active · … starting · ⧗ waiting · ○ ready · ‖ paused · ✓ success · × stopped · ! failed/broken · ? unknown
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
⋮ 12 more
|
|
56
|
-
09:17│ said “The grouped verifier stream detached again, so I’m rerunning …”
|
|
57
|
-
│ ran $ node --test tests/unit/task-compose.test.ts — 38s
|
|
58
|
-
+ 10 failed · 159 done · 4 killed
|
|
61
|
+
keiyaku 2
|
|
62
|
+
⧗ fridge Add task arrange for atomic existing-task reorganization waiting on task-reorganization.01J8TEST · active 27m
|
|
63
|
+
● hermitcrab Let task commands select a contract workspace bound 8m
|
|
59
64
|
|
|
60
65
|
task 120
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
+ 108 ready · 9 blocked
|
|
66
|
+
● in_progress P1 centralize-repository-ledger-test-construction last update 14h ago
|
|
67
|
+
‖ on_hold P0 windows-common-commands-must-eliminate-git-proc last update 3d ago
|
|
68
|
+
+ 108 ready · 9 blocked · 1 on hold
|
|
69
|
+
|
|
70
|
+
akuma 2/2
|
|
71
|
+
running 1/1
|
|
72
|
+
● worker-default/e03addad @fridge out · running for 27m · last activity 2s ago
|
|
73
|
+
recent terminal 1/1
|
|
74
|
+
! worker-default/64b92f01 failed 5m ago · ran 12m · last activity 5m ago
|
|
75
|
+
full roster: keiyaku status --akuma
|
|
64
76
|
```
|
|
65
77
|
|
|
66
|
-
The
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## Surface
|
|
74
|
-
|
|
75
|
-
| | |
|
|
76
|
-
| --- | --- |
|
|
77
|
-
| contract | `bind` `arc` `amend` `renew` `audit` `petition` `forfeit` `log` |
|
|
78
|
-
| devils | `call` `tell` `wait` `kill` `revive` `status` `history` |
|
|
79
|
-
| roster | `akuma list` `akuma show` |
|
|
80
|
-
| tasks | `task add/show/ls/log/start/stop/hold/resume/done/drop/update/doctor` |
|
|
81
|
-
| system | `guide` `completion` `dump-env` |
|
|
82
|
-
|
|
83
|
-
Conventions an agent can rely on everywhere: a literal `-` selects stdin for
|
|
84
|
-
long bodies; `--json` exists where structure matters; a rejected command names
|
|
85
|
-
the legal grammar instead of guessing intent; `keiyaku <cmd> --help` is the
|
|
86
|
-
single source of syntax.
|
|
78
|
+
The indicator grammar is shared across contracts, Akuma, and tasks; every row
|
|
79
|
+
still names its exact state. `⧗` appears only with a typed wait reason, never
|
|
80
|
+
because work is old or behind its target. Terminal failure is factual state; it
|
|
81
|
+
does not by itself mean `needs attention` or an actionable obligation.
|
|
82
|
+
Durations are measured, exit codes are real, and drift is reported as `behind
|
|
83
|
+
<ref> by <count>`, never as a `renew` recommendation.
|
|
87
84
|
|
|
88
|
-
|
|
89
|
-
distinct meanings — `parent`, `needs`, `supersedes`, `relates-to` — and every
|
|
90
|
-
mutation is validated and micro-committed on its own.
|
|
85
|
+
## An akuma is one Markdown file
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Filename is the name. Frontmatter selects the provider. The body is the
|
|
95
|
-
instructions.
|
|
87
|
+
Filename is the name, frontmatter picks the provider and model, the body is
|
|
88
|
+
the standing instructions. That's all it takes to make one callable.
|
|
96
89
|
|
|
97
90
|
```markdown
|
|
98
91
|
---
|
|
@@ -104,11 +97,11 @@ Make scoped changes and run relevant tests.
|
|
|
104
97
|
```
|
|
105
98
|
|
|
106
99
|
Providers: `codex-sdk`, `codex-app-server`, `claude-agent-sdk`,
|
|
107
|
-
`opencode-sdk`, `pi
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
`opencode-sdk`, `pi` — one contract can be worked by any of them, and a
|
|
101
|
+
finished run leaves an artifact that `fork` can continue from, even across
|
|
102
|
+
sessions.
|
|
110
103
|
|
|
111
|
-
`.keiyaku/settings.json`
|
|
104
|
+
`.keiyaku/settings.json` assigns roles and gates:
|
|
112
105
|
|
|
113
106
|
```json
|
|
114
107
|
{
|
|
@@ -118,25 +111,26 @@ field-merges.
|
|
|
118
111
|
}
|
|
119
112
|
```
|
|
120
113
|
|
|
121
|
-
##
|
|
114
|
+
## And the rest
|
|
122
115
|
|
|
123
116
|
| | |
|
|
124
117
|
| --- | --- |
|
|
125
|
-
| `
|
|
126
|
-
|
|
|
118
|
+
| contract | `bind` `arc` `amend` `renew` `audit` `petition` `forfeit` `log` |
|
|
119
|
+
| akuma | `call` `tell` `wait` `kill` `fork` `status` `history` |
|
|
120
|
+
| tasks | `task add/show/ls/log/start/stop/hold/resume/done/drop/update/doctor` |
|
|
121
|
+
| system | `guide` `completion` `dump-env` |
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.
|
|
131
|
-
```
|
|
123
|
+
`keiyaku task` is a file-backed planning board for work that isn't worth a
|
|
124
|
+
contract yet — typed dependencies, one micro-commit per change, promotion
|
|
125
|
+
into a contract when it's ready.
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
Conventions hold everywhere: a literal `-` reads stdin for long bodies,
|
|
128
|
+
`--json` where structure matters, and a rejected command states the legal
|
|
129
|
+
grammar instead of guessing intent. State lives in `KEIYAKU.md` (the active
|
|
130
|
+
contract) and `.keiyaku/` (akuma, settings, task board, history).
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
[`docs/keiyaku-v3/`](docs/keiyaku-v3/README.md). A document is normative only
|
|
137
|
-
if the registry lists it; age, location, and confident prose grant nothing.
|
|
132
|
+
Full product documentation: [`docs/keiyaku-v3/`](docs/keiyaku-v3/README.md).
|
|
138
133
|
|
|
139
|
-
Keiyaku is early and experimental
|
|
140
|
-
current version is the only version.
|
|
134
|
+
Keiyaku is early and experimental — breaking changes are intentional.
|
|
141
135
|
|
|
142
136
|
MIT.
|