@astrosheep/keiyaku 4.5.9 → 4.5.11
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/skills/keiyaku-workflow/SKILL.md +43 -27
- package/build/src/akuma/request-serve.js +1 -1
- package/build/src/cli/commands/contract-help.d.ts +166 -0
- package/build/src/cli/commands/contract-help.js +167 -0
- package/build/src/cli/commands/contract.d.ts +2 -167
- package/build/src/cli/commands/contract.js +3 -160
- package/build/src/contract-guidance.js +5 -1
- package/build/src/git/reconcile.js +45 -21
- package/build/src/git/repository.d.ts +1 -0
- package/build/src/git/repository.js +3 -0
- package/build/src/git/workspace.d.ts +20 -14
- package/build/src/git/workspace.js +91 -38
- package/build/src/library/contract-forwarding-result.d.ts +1230 -1424
- package/build/src/library/contract-forwarding-result.js +44 -44
- package/build/src/library/contract-operations.d.ts +21 -1
- package/build/src/library/contract-operations.js +65 -5
- package/build/src/library/reconcile.js +15 -2
- package/build/src/protocol/deliver.js +21 -2
- package/package.json +1 -1
|
@@ -266,25 +266,41 @@ Deliver when the worktree content is the candidate you intend to land:
|
|
|
266
266
|
keiyaku deliver <contract> --include-dirty
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
269
|
+
Each `deliver` observes the target as it stands for that invocation, prepares
|
|
270
|
+
the candidate's current-target integration in Keiyaku-owned Git custody, runs
|
|
271
|
+
or reuses Verification, records the candidate, and requests placement. If the
|
|
272
|
+
target moves, read the Contract and run `audit` or `deliver` again. Keiyaku
|
|
273
|
+
recomputes the integration; a manual rebase is optional candidate shaping, not
|
|
274
|
+
target refresh.
|
|
275
|
+
|
|
276
|
+
Deliver when the work is ready to be judged, not when Git looks tidy. `git
|
|
277
|
+
commit` only shapes the candidate; skipping it is fine — `deliver
|
|
278
|
+
--include-dirty` captures the complete non-ignored worktree. If delivery reports
|
|
279
|
+
an integration conflict, run `deliver --materialize-conflict`, resolve the
|
|
280
|
+
judged conflict in the appointed worktree, then deliver the resolved bytes with
|
|
281
|
+
`--include-dirty`.
|
|
282
|
+
|
|
283
|
+
Deliver and review answer different questions: deliver records the candidate
|
|
284
|
+
and places and claims by itself only when every placement obligation is current;
|
|
285
|
+
a review gate is satisfied only by review testimony over the current candidate,
|
|
286
|
+
and a satisfied review may itself be the invocation that places and claims.
|
|
287
|
+
Reviewing before any delivery is legal but records testimony only — it creates
|
|
288
|
+
no candidate and authorizes nothing. A Contract without a review gate needs no
|
|
289
|
+
review.
|
|
290
|
+
|
|
291
|
+
A current audit attestation is reused only when its integration snapshot and
|
|
292
|
+
Verification segment still match; changes to the worktree, target, policy,
|
|
293
|
+
document, Verification, or snapshot-producing options make it stale.
|
|
278
294
|
|
|
279
295
|
## Review Gates
|
|
280
296
|
|
|
281
297
|
The Reviewer owns the answer. A gate review compares the full current candidate
|
|
282
298
|
against every journaled Criterion — the floor that cannot be reduced — and
|
|
283
299
|
testifies satisfied or unsatisfied over the current document identity and
|
|
284
|
-
worktree
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
300
|
+
worktree. A current defect, missing, failed, or stale required evidence, or
|
|
301
|
+
terms too ambiguous or contradictory to judge all yield unsatisfied, with the
|
|
302
|
+
summary naming what blocks. Advice beyond the terms belongs in the summary and
|
|
303
|
+
never changes the verdict by itself.
|
|
288
304
|
|
|
289
305
|
```bash
|
|
290
306
|
keiyaku review <contract> --satisfied --summary "<conclusion>"
|
|
@@ -318,22 +334,22 @@ persist a train or add a second placement authority.
|
|
|
318
334
|
gate-visible judgment for placement.
|
|
319
335
|
- Before recording a satisfied review, or delivering a Contract with no
|
|
320
336
|
declared gates, ask whether the exact patch will survive until placement. A
|
|
321
|
-
|
|
322
|
-
do not re-review content addressing kept
|
|
323
|
-
changes the `ChangeId` makes earlier testimony
|
|
324
|
-
review: re-inspect the resolved candidate and record
|
|
325
|
-
review follows the reviewer-reuse rule above; prefer the
|
|
326
|
-
reviewer when its judgment frame remains sound, especially
|
|
327
|
-
can be checked within the complete fresh judgment.
|
|
328
|
-
- For Contracts known to overlap,
|
|
329
|
-
the authoritative review. Preliminary feedback may happen
|
|
330
|
-
is not a satisfied gate until its reviewed patch is the
|
|
331
|
-
for placement. Land overlapping Contracts one at a time;
|
|
332
|
-
non-overlapping Contracts proceed without ceremony. Treat
|
|
333
|
-
planning signal, not a correctness verdict.
|
|
337
|
+
freshly prepared current-target integration whose `ChangeId` is unchanged
|
|
338
|
+
keeps the existing review current; do not re-review content addressing kept
|
|
339
|
+
alive. Conflict resolution that changes the `ChangeId` makes earlier testimony
|
|
340
|
+
stale and requires a fresh review: re-inspect the resolved candidate and record
|
|
341
|
+
new testimony. Fresh review follows the reviewer-reuse rule above; prefer the
|
|
342
|
+
existing independent reviewer when its judgment frame remains sound, especially
|
|
343
|
+
so earlier findings can be checked within the complete fresh judgment.
|
|
344
|
+
- For Contracts known to overlap, rerun `audit` or `deliver` against the current
|
|
345
|
+
target before the authoritative review. Preliminary feedback may happen
|
|
346
|
+
earlier, but it is not a satisfied gate until its reviewed patch is the
|
|
347
|
+
candidate intended for placement. Land overlapping Contracts one at a time;
|
|
348
|
+
let independent, non-overlapping Contracts proceed without ceremony. Treat
|
|
349
|
+
overlap as a planning signal, not a correctness verdict.
|
|
334
350
|
- After target movement, a changed candidate, or a placement refusal, read the
|
|
335
351
|
current Contract facts again. Recompute the next landing judgment from those
|
|
336
|
-
facts; do not rely on a remembered
|
|
352
|
+
facts; do not rely on a remembered target or one-time integration.
|
|
337
353
|
|
|
338
354
|
## Target Placement
|
|
339
355
|
|
|
@@ -43,7 +43,7 @@ async function projectCommandReceipt(input, fact, command, outcome, failure) {
|
|
|
43
43
|
async function serveCommand(input, command) {
|
|
44
44
|
const request = command.resolve(input.claim.payload);
|
|
45
45
|
if (request === null)
|
|
46
|
-
|
|
46
|
+
throw new Error(`registered request action ${input.claim.action} rejected its payload`);
|
|
47
47
|
let fact = await admitRequest(input.paths, {
|
|
48
48
|
id: input.claim.id,
|
|
49
49
|
action: input.claim.action,
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export type ContractFlagKind = "boolean" | "value" | "raw-value" | "repeat-value";
|
|
2
|
+
export type ContractCommandSpec = Readonly<{
|
|
3
|
+
positional: "none" | "optional";
|
|
4
|
+
stdin: "none" | "optional" | "required";
|
|
5
|
+
flags: Readonly<Record<string, ContractFlagKind>>;
|
|
6
|
+
usage: string;
|
|
7
|
+
purpose: string;
|
|
8
|
+
details?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const CONTRACT_COMMAND_SPECS: {
|
|
11
|
+
readonly bind: {
|
|
12
|
+
readonly positional: "none";
|
|
13
|
+
readonly stdin: "optional";
|
|
14
|
+
readonly flags: {
|
|
15
|
+
readonly actor: "value";
|
|
16
|
+
readonly task: "value";
|
|
17
|
+
readonly target: "value";
|
|
18
|
+
readonly after: "repeat-value";
|
|
19
|
+
readonly gates: "raw-value";
|
|
20
|
+
readonly "fork-of": "value";
|
|
21
|
+
readonly json: "boolean";
|
|
22
|
+
};
|
|
23
|
+
readonly usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] [--json] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>] [--json]";
|
|
24
|
+
readonly purpose: "Create one Contract from stdin Markdown or a sibling fork.";
|
|
25
|
+
};
|
|
26
|
+
readonly amend: {
|
|
27
|
+
readonly positional: "optional";
|
|
28
|
+
readonly stdin: "optional";
|
|
29
|
+
readonly flags: {
|
|
30
|
+
readonly actor: "value";
|
|
31
|
+
readonly after: "repeat-value";
|
|
32
|
+
readonly "clear-after": "boolean";
|
|
33
|
+
readonly gates: "raw-value";
|
|
34
|
+
readonly json: "boolean";
|
|
35
|
+
};
|
|
36
|
+
readonly usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [--json] [-]";
|
|
37
|
+
readonly purpose: "Amend one Contract's document operations or structured terms.";
|
|
38
|
+
readonly details: string;
|
|
39
|
+
};
|
|
40
|
+
readonly deliver: {
|
|
41
|
+
readonly positional: "optional";
|
|
42
|
+
readonly stdin: "none";
|
|
43
|
+
readonly flags: {
|
|
44
|
+
readonly message: "value";
|
|
45
|
+
readonly "include-dirty": "boolean";
|
|
46
|
+
readonly "materialize-conflict": "boolean";
|
|
47
|
+
readonly json: "boolean";
|
|
48
|
+
};
|
|
49
|
+
readonly usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--json]";
|
|
50
|
+
readonly purpose: "Deliver your work as this Contract's candidate.";
|
|
51
|
+
readonly details: string;
|
|
52
|
+
};
|
|
53
|
+
readonly review: {
|
|
54
|
+
readonly positional: "optional";
|
|
55
|
+
readonly stdin: "optional";
|
|
56
|
+
readonly flags: {
|
|
57
|
+
readonly satisfied: "boolean";
|
|
58
|
+
readonly unsatisfied: "boolean";
|
|
59
|
+
readonly summary: "value";
|
|
60
|
+
readonly json: "boolean";
|
|
61
|
+
};
|
|
62
|
+
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--json]";
|
|
63
|
+
readonly purpose: "Record one review verdict.";
|
|
64
|
+
};
|
|
65
|
+
readonly arc: {
|
|
66
|
+
readonly positional: "optional";
|
|
67
|
+
readonly stdin: "required";
|
|
68
|
+
readonly flags: {
|
|
69
|
+
readonly actor: "value";
|
|
70
|
+
readonly json: "boolean";
|
|
71
|
+
};
|
|
72
|
+
readonly usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -";
|
|
73
|
+
readonly purpose: "Record stdin arc Markdown for one Contract.";
|
|
74
|
+
};
|
|
75
|
+
readonly abandon: {
|
|
76
|
+
readonly positional: "optional";
|
|
77
|
+
readonly stdin: "none";
|
|
78
|
+
readonly flags: {
|
|
79
|
+
readonly actor: "value";
|
|
80
|
+
readonly note: "value";
|
|
81
|
+
readonly json: "boolean";
|
|
82
|
+
};
|
|
83
|
+
readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]";
|
|
84
|
+
readonly purpose: "Abandon one Contract with an optional note.";
|
|
85
|
+
};
|
|
86
|
+
readonly status: {
|
|
87
|
+
readonly positional: "optional";
|
|
88
|
+
readonly stdin: "none";
|
|
89
|
+
readonly flags: {
|
|
90
|
+
readonly json: "boolean";
|
|
91
|
+
};
|
|
92
|
+
readonly usage: "status [<contract>|@name|<aku/...>]... [--json]";
|
|
93
|
+
readonly purpose: "Read the world status board or one or more Contract and Akuma projections.";
|
|
94
|
+
};
|
|
95
|
+
readonly show: {
|
|
96
|
+
readonly positional: "optional";
|
|
97
|
+
readonly stdin: "none";
|
|
98
|
+
readonly flags: {
|
|
99
|
+
readonly json: "boolean";
|
|
100
|
+
};
|
|
101
|
+
readonly usage: "show [<contract>|@<contract>] [--json]";
|
|
102
|
+
readonly purpose: "Read one Contract guidance projection.";
|
|
103
|
+
};
|
|
104
|
+
readonly ls: {
|
|
105
|
+
readonly positional: "optional";
|
|
106
|
+
readonly stdin: "none";
|
|
107
|
+
readonly flags: {
|
|
108
|
+
readonly json: "boolean";
|
|
109
|
+
};
|
|
110
|
+
readonly usage: "ls task[/] [--json]\nls kei[/] [--json]\nls aku[/] [--json]\nls aku/<akuma>[/] [--json]\nls \"aku/*/*\" [--json]";
|
|
111
|
+
readonly purpose: "List one identity directory.";
|
|
112
|
+
};
|
|
113
|
+
readonly audit: {
|
|
114
|
+
readonly positional: "optional";
|
|
115
|
+
readonly stdin: "none";
|
|
116
|
+
readonly flags: {
|
|
117
|
+
readonly "include-dirty": "boolean";
|
|
118
|
+
readonly diff: "boolean";
|
|
119
|
+
readonly json: "boolean";
|
|
120
|
+
};
|
|
121
|
+
readonly usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--json]";
|
|
122
|
+
readonly purpose: "Ask what candidate preparation, Verification, and target placement would do.";
|
|
123
|
+
};
|
|
124
|
+
readonly reconcile: {
|
|
125
|
+
readonly positional: "optional";
|
|
126
|
+
readonly stdin: "none";
|
|
127
|
+
readonly flags: {
|
|
128
|
+
readonly "retry-hooks": "boolean";
|
|
129
|
+
readonly json: "boolean";
|
|
130
|
+
};
|
|
131
|
+
readonly usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]";
|
|
132
|
+
readonly purpose: "Reconcile one Contract or the invocation world.";
|
|
133
|
+
};
|
|
134
|
+
readonly nuke: {
|
|
135
|
+
readonly positional: "none";
|
|
136
|
+
readonly stdin: "none";
|
|
137
|
+
readonly flags: {
|
|
138
|
+
readonly confirm: "value";
|
|
139
|
+
readonly json: "boolean";
|
|
140
|
+
};
|
|
141
|
+
readonly usage: "nuke [--confirm <WorldRoot>] [--json]";
|
|
142
|
+
readonly purpose: "Remove Keiyaku-owned data from one confirmed World.";
|
|
143
|
+
};
|
|
144
|
+
readonly settings: {
|
|
145
|
+
readonly positional: "none";
|
|
146
|
+
readonly stdin: "none";
|
|
147
|
+
readonly flags: {
|
|
148
|
+
readonly json: "boolean";
|
|
149
|
+
};
|
|
150
|
+
readonly usage: "settings [--json]";
|
|
151
|
+
readonly purpose: "Show effective Settings (user + project, read-only)";
|
|
152
|
+
};
|
|
153
|
+
readonly region: {
|
|
154
|
+
readonly positional: "optional";
|
|
155
|
+
readonly stdin: "none";
|
|
156
|
+
readonly flags: {
|
|
157
|
+
readonly path: "repeat-value";
|
|
158
|
+
readonly json: "boolean";
|
|
159
|
+
};
|
|
160
|
+
readonly usage: "region [<contract>] [--json]\nregion --path <pattern> [--path <pattern> ...] [--json]";
|
|
161
|
+
readonly purpose: "Read active declared Contract Regions.";
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export type ContractCommand = keyof typeof CONTRACT_COMMAND_SPECS;
|
|
165
|
+
export declare function renderContractHelp(command: ContractCommand): string;
|
|
166
|
+
export declare function renderContractUsage(command: ContractCommand): string;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { usageLine } from "../usage.js";
|
|
2
|
+
export const CONTRACT_COMMAND_SPECS = {
|
|
3
|
+
bind: {
|
|
4
|
+
positional: "none",
|
|
5
|
+
stdin: "optional",
|
|
6
|
+
flags: {
|
|
7
|
+
actor: "value",
|
|
8
|
+
task: "value",
|
|
9
|
+
target: "value",
|
|
10
|
+
after: "repeat-value",
|
|
11
|
+
gates: "raw-value",
|
|
12
|
+
"fork-of": "value",
|
|
13
|
+
json: "boolean",
|
|
14
|
+
},
|
|
15
|
+
usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] [--json] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>] [--json]",
|
|
16
|
+
purpose: "Create one Contract from stdin Markdown or a sibling fork.",
|
|
17
|
+
},
|
|
18
|
+
amend: {
|
|
19
|
+
positional: "optional",
|
|
20
|
+
stdin: "optional",
|
|
21
|
+
flags: { actor: "value", after: "repeat-value", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
|
|
22
|
+
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [--json] [-]",
|
|
23
|
+
purpose: "Amend one Contract's document operations or structured terms.",
|
|
24
|
+
details: [
|
|
25
|
+
" ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add new extension)",
|
|
26
|
+
" ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
|
|
27
|
+
" ## Append: Context|Objective|Design|Criteria|<extension>",
|
|
28
|
+
" ## Add: Criteria|<new-extension-title>",
|
|
29
|
+
" ## Update: <existing-extension-title>",
|
|
30
|
+
" ## Remove: <existing-extension-title>",
|
|
31
|
+
].join("\n"),
|
|
32
|
+
},
|
|
33
|
+
deliver: {
|
|
34
|
+
positional: "optional",
|
|
35
|
+
stdin: "none",
|
|
36
|
+
flags: {
|
|
37
|
+
message: "value",
|
|
38
|
+
"include-dirty": "boolean",
|
|
39
|
+
"materialize-conflict": "boolean",
|
|
40
|
+
json: "boolean",
|
|
41
|
+
},
|
|
42
|
+
usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--json]",
|
|
43
|
+
purpose: "Deliver your work as this Contract's candidate.",
|
|
44
|
+
details: [
|
|
45
|
+
"A clean worktree delivers its HEAD; --include-dirty captures every non-ignored",
|
|
46
|
+
"byte as an immutable commit object without changing the appointed worktree's HEAD",
|
|
47
|
+
"or real index. Runs or reuses Verification and requests placement: when every",
|
|
48
|
+
"prerequisite and declared gate is current, the same invocation places and claims.",
|
|
49
|
+
"Otherwise the candidate is recorded and the Contract is tendered. A prior git",
|
|
50
|
+
"commit is optional preparation — it never delivers, and delivering never",
|
|
51
|
+
"satisfies a review gate.",
|
|
52
|
+
"",
|
|
53
|
+
" --include-dirty Include all non-ignored worktree bytes, including an",
|
|
54
|
+
" unmerged shared index, in the candidate commit.",
|
|
55
|
+
" --materialize-conflict After a conflict result, project the judged targetHead",
|
|
56
|
+
" into the worktree as an uncommitted merge. Not a",
|
|
57
|
+
" delivery: resolve, then deliver with --include-dirty.",
|
|
58
|
+
].join("\n"),
|
|
59
|
+
},
|
|
60
|
+
review: {
|
|
61
|
+
positional: "optional",
|
|
62
|
+
stdin: "optional",
|
|
63
|
+
flags: { satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" },
|
|
64
|
+
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--json]",
|
|
65
|
+
purpose: "Record one review verdict.",
|
|
66
|
+
},
|
|
67
|
+
arc: {
|
|
68
|
+
positional: "optional",
|
|
69
|
+
stdin: "required",
|
|
70
|
+
flags: { actor: "value", json: "boolean" },
|
|
71
|
+
usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -",
|
|
72
|
+
purpose: "Record stdin arc Markdown for one Contract.",
|
|
73
|
+
},
|
|
74
|
+
abandon: {
|
|
75
|
+
positional: "optional",
|
|
76
|
+
stdin: "none",
|
|
77
|
+
flags: { actor: "value", note: "value", json: "boolean" },
|
|
78
|
+
usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]",
|
|
79
|
+
purpose: "Abandon one Contract with an optional note.",
|
|
80
|
+
},
|
|
81
|
+
status: {
|
|
82
|
+
positional: "optional",
|
|
83
|
+
stdin: "none",
|
|
84
|
+
flags: { json: "boolean" },
|
|
85
|
+
usage: "status [<contract>|@name|<aku/...>]... [--json]",
|
|
86
|
+
purpose: "Read the world status board or one or more Contract and Akuma projections.",
|
|
87
|
+
},
|
|
88
|
+
show: {
|
|
89
|
+
positional: "optional",
|
|
90
|
+
stdin: "none",
|
|
91
|
+
flags: { json: "boolean" },
|
|
92
|
+
usage: "show [<contract>|@<contract>] [--json]",
|
|
93
|
+
purpose: "Read one Contract guidance projection.",
|
|
94
|
+
},
|
|
95
|
+
ls: {
|
|
96
|
+
positional: "optional",
|
|
97
|
+
stdin: "none",
|
|
98
|
+
flags: { json: "boolean" },
|
|
99
|
+
usage: 'ls task[/] [--json]\nls kei[/] [--json]\nls aku[/] [--json]\nls aku/<akuma>[/] [--json]\nls "aku/*/*" [--json]',
|
|
100
|
+
purpose: "List one identity directory.",
|
|
101
|
+
},
|
|
102
|
+
audit: {
|
|
103
|
+
positional: "optional",
|
|
104
|
+
stdin: "none",
|
|
105
|
+
flags: { "include-dirty": "boolean", diff: "boolean", json: "boolean" },
|
|
106
|
+
usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--json]",
|
|
107
|
+
purpose: "Ask what candidate preparation, Verification, and target placement would do.",
|
|
108
|
+
},
|
|
109
|
+
reconcile: {
|
|
110
|
+
positional: "optional",
|
|
111
|
+
stdin: "none",
|
|
112
|
+
flags: { "retry-hooks": "boolean", json: "boolean" },
|
|
113
|
+
usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]",
|
|
114
|
+
purpose: "Reconcile one Contract or the invocation world.",
|
|
115
|
+
},
|
|
116
|
+
nuke: {
|
|
117
|
+
positional: "none",
|
|
118
|
+
stdin: "none",
|
|
119
|
+
flags: { confirm: "value", json: "boolean" },
|
|
120
|
+
usage: "nuke [--confirm <WorldRoot>] [--json]",
|
|
121
|
+
purpose: "Remove Keiyaku-owned data from one confirmed World.",
|
|
122
|
+
},
|
|
123
|
+
settings: {
|
|
124
|
+
positional: "none",
|
|
125
|
+
stdin: "none",
|
|
126
|
+
flags: { json: "boolean" },
|
|
127
|
+
usage: "settings [--json]",
|
|
128
|
+
purpose: "Show effective Settings (user + project, read-only)",
|
|
129
|
+
},
|
|
130
|
+
region: {
|
|
131
|
+
positional: "optional",
|
|
132
|
+
stdin: "none",
|
|
133
|
+
flags: { path: "repeat-value", json: "boolean" },
|
|
134
|
+
usage: "region [<contract>] [--json]\nregion --path <pattern> [--path <pattern> ...] [--json]",
|
|
135
|
+
purpose: "Read active declared Contract Regions.",
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
export function renderContractHelp(command) {
|
|
139
|
+
const spec = CONTRACT_COMMAND_SPECS[command];
|
|
140
|
+
if (command === "settings") {
|
|
141
|
+
return [
|
|
142
|
+
"Show effective Settings — the merged read-only view of:",
|
|
143
|
+
" user ~/.keiyaku/settings.json",
|
|
144
|
+
" project <WorldRoot>/.keiyaku/settings.json",
|
|
145
|
+
"A project record wholly shadows the same-name user record.",
|
|
146
|
+
"",
|
|
147
|
+
"Shape: namespace -> entry -> JSON value. There is no write",
|
|
148
|
+
"command; edit the files directly.",
|
|
149
|
+
"",
|
|
150
|
+
"Recognized settings:",
|
|
151
|
+
" gates gate bundles selected by bind and amend",
|
|
152
|
+
" worktree commands run when worktrees are created or destroyed",
|
|
153
|
+
" git.requireBranchesToBeUpToDate whether deliver and audit require up-to-date target branches",
|
|
154
|
+
" providers the available Akuma and how each is run",
|
|
155
|
+
"",
|
|
156
|
+
"Each entry is validated by the feature that reads it. A rejected",
|
|
157
|
+
"value's diagnostic states the expected shape.",
|
|
158
|
+
"",
|
|
159
|
+
usageLine(spec.usage),
|
|
160
|
+
].join("\n");
|
|
161
|
+
}
|
|
162
|
+
const help = `${spec.purpose}\n\n${usageLine(spec.usage)}`;
|
|
163
|
+
return spec.details === undefined ? help : `${help}\n\n${spec.details}`;
|
|
164
|
+
}
|
|
165
|
+
export function renderContractUsage(command) {
|
|
166
|
+
return usageLine(CONTRACT_COMMAND_SPECS[command].usage);
|
|
167
|
+
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { CatalogQuery } from "../../library/catalog.js";
|
|
2
|
-
|
|
3
|
-
export type ContractCommandSpec
|
|
4
|
-
positional: "none" | "optional";
|
|
5
|
-
stdin: "none" | "optional" | "required";
|
|
6
|
-
flags: Readonly<Record<string, ContractFlagKind>>;
|
|
7
|
-
usage: string;
|
|
8
|
-
purpose: string;
|
|
9
|
-
details?: string;
|
|
10
|
-
}>;
|
|
2
|
+
import { type ContractCommand } from "./contract-help.js";
|
|
3
|
+
export { CONTRACT_COMMAND_SPECS, renderContractHelp, renderContractUsage, type ContractCommand, type ContractCommandSpec, type ContractFlagKind, } from "./contract-help.js";
|
|
11
4
|
type Output = Readonly<{
|
|
12
5
|
output: "text" | "json";
|
|
13
6
|
}>;
|
|
@@ -94,161 +87,6 @@ export type ParsedShow = Output & Readonly<{
|
|
|
94
87
|
command: "show";
|
|
95
88
|
contract?: string;
|
|
96
89
|
}>;
|
|
97
|
-
export declare const CONTRACT_COMMAND_SPECS: {
|
|
98
|
-
readonly bind: {
|
|
99
|
-
readonly positional: "none";
|
|
100
|
-
readonly stdin: "optional";
|
|
101
|
-
readonly flags: {
|
|
102
|
-
readonly actor: "value";
|
|
103
|
-
readonly task: "value";
|
|
104
|
-
readonly target: "value";
|
|
105
|
-
readonly after: "repeat-value";
|
|
106
|
-
readonly gates: "raw-value";
|
|
107
|
-
readonly "fork-of": "value";
|
|
108
|
-
readonly json: "boolean";
|
|
109
|
-
};
|
|
110
|
-
readonly usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] [--json] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>] [--json]";
|
|
111
|
-
readonly purpose: "Create one Contract from stdin Markdown or a sibling fork.";
|
|
112
|
-
};
|
|
113
|
-
readonly amend: {
|
|
114
|
-
readonly positional: "optional";
|
|
115
|
-
readonly stdin: "optional";
|
|
116
|
-
readonly flags: {
|
|
117
|
-
readonly actor: "value";
|
|
118
|
-
readonly after: "repeat-value";
|
|
119
|
-
readonly "clear-after": "boolean";
|
|
120
|
-
readonly gates: "raw-value";
|
|
121
|
-
readonly json: "boolean";
|
|
122
|
-
};
|
|
123
|
-
readonly usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [--json] [-]";
|
|
124
|
-
readonly purpose: "Amend one Contract's document operations or structured terms.";
|
|
125
|
-
readonly details: string;
|
|
126
|
-
};
|
|
127
|
-
readonly deliver: {
|
|
128
|
-
readonly positional: "optional";
|
|
129
|
-
readonly stdin: "none";
|
|
130
|
-
readonly flags: {
|
|
131
|
-
readonly message: "value";
|
|
132
|
-
readonly "include-dirty": "boolean";
|
|
133
|
-
readonly "materialize-conflict": "boolean";
|
|
134
|
-
readonly json: "boolean";
|
|
135
|
-
};
|
|
136
|
-
readonly usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--json]";
|
|
137
|
-
readonly purpose: "Deliver one Contract candidate from the appointed worktree.";
|
|
138
|
-
readonly details: string;
|
|
139
|
-
};
|
|
140
|
-
readonly review: {
|
|
141
|
-
readonly positional: "optional";
|
|
142
|
-
readonly stdin: "optional";
|
|
143
|
-
readonly flags: {
|
|
144
|
-
readonly satisfied: "boolean";
|
|
145
|
-
readonly unsatisfied: "boolean";
|
|
146
|
-
readonly summary: "value";
|
|
147
|
-
readonly json: "boolean";
|
|
148
|
-
};
|
|
149
|
-
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--json]";
|
|
150
|
-
readonly purpose: "Record one review verdict.";
|
|
151
|
-
};
|
|
152
|
-
readonly arc: {
|
|
153
|
-
readonly positional: "optional";
|
|
154
|
-
readonly stdin: "required";
|
|
155
|
-
readonly flags: {
|
|
156
|
-
readonly actor: "value";
|
|
157
|
-
readonly json: "boolean";
|
|
158
|
-
};
|
|
159
|
-
readonly usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -";
|
|
160
|
-
readonly purpose: "Record stdin arc Markdown for one Contract.";
|
|
161
|
-
};
|
|
162
|
-
readonly abandon: {
|
|
163
|
-
readonly positional: "optional";
|
|
164
|
-
readonly stdin: "none";
|
|
165
|
-
readonly flags: {
|
|
166
|
-
readonly actor: "value";
|
|
167
|
-
readonly note: "value";
|
|
168
|
-
readonly json: "boolean";
|
|
169
|
-
};
|
|
170
|
-
readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]";
|
|
171
|
-
readonly purpose: "Abandon one Contract with an optional note.";
|
|
172
|
-
};
|
|
173
|
-
readonly status: {
|
|
174
|
-
readonly positional: "optional";
|
|
175
|
-
readonly stdin: "none";
|
|
176
|
-
readonly flags: {
|
|
177
|
-
readonly json: "boolean";
|
|
178
|
-
};
|
|
179
|
-
readonly usage: "status [<contract>|@name|<aku/...>]... [--json]";
|
|
180
|
-
readonly purpose: "Read the world status board or one or more Contract and Akuma projections.";
|
|
181
|
-
};
|
|
182
|
-
readonly show: {
|
|
183
|
-
readonly positional: "optional";
|
|
184
|
-
readonly stdin: "none";
|
|
185
|
-
readonly flags: {
|
|
186
|
-
readonly json: "boolean";
|
|
187
|
-
};
|
|
188
|
-
readonly usage: "show [<contract>|@<contract>] [--json]";
|
|
189
|
-
readonly purpose: "Read one Contract guidance projection.";
|
|
190
|
-
};
|
|
191
|
-
readonly ls: {
|
|
192
|
-
readonly positional: "optional";
|
|
193
|
-
readonly stdin: "none";
|
|
194
|
-
readonly flags: {
|
|
195
|
-
readonly json: "boolean";
|
|
196
|
-
};
|
|
197
|
-
readonly usage: "ls task[/] [--json]\nls kei[/] [--json]\nls aku[/] [--json]\nls aku/<akuma>[/] [--json]\nls \"aku/*/*\" [--json]";
|
|
198
|
-
readonly purpose: "List one identity directory.";
|
|
199
|
-
};
|
|
200
|
-
readonly audit: {
|
|
201
|
-
readonly positional: "optional";
|
|
202
|
-
readonly stdin: "none";
|
|
203
|
-
readonly flags: {
|
|
204
|
-
readonly "include-dirty": "boolean";
|
|
205
|
-
readonly diff: "boolean";
|
|
206
|
-
readonly json: "boolean";
|
|
207
|
-
};
|
|
208
|
-
readonly usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--json]";
|
|
209
|
-
readonly purpose: "Ask what candidate preparation, Verification, and target placement would do.";
|
|
210
|
-
};
|
|
211
|
-
readonly reconcile: {
|
|
212
|
-
readonly positional: "optional";
|
|
213
|
-
readonly stdin: "none";
|
|
214
|
-
readonly flags: {
|
|
215
|
-
readonly "retry-hooks": "boolean";
|
|
216
|
-
readonly json: "boolean";
|
|
217
|
-
};
|
|
218
|
-
readonly usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]";
|
|
219
|
-
readonly purpose: "Reconcile one Contract or the invocation world.";
|
|
220
|
-
};
|
|
221
|
-
readonly nuke: {
|
|
222
|
-
readonly positional: "none";
|
|
223
|
-
readonly stdin: "none";
|
|
224
|
-
readonly flags: {
|
|
225
|
-
readonly confirm: "value";
|
|
226
|
-
readonly json: "boolean";
|
|
227
|
-
};
|
|
228
|
-
readonly usage: "nuke [--confirm <WorldRoot>] [--json]";
|
|
229
|
-
readonly purpose: "Remove Keiyaku-owned data from one confirmed World.";
|
|
230
|
-
};
|
|
231
|
-
readonly settings: {
|
|
232
|
-
readonly positional: "none";
|
|
233
|
-
readonly stdin: "none";
|
|
234
|
-
readonly flags: {
|
|
235
|
-
readonly json: "boolean";
|
|
236
|
-
};
|
|
237
|
-
readonly usage: "settings [--json]";
|
|
238
|
-
readonly purpose: "Show effective Settings (user + project, read-only)";
|
|
239
|
-
};
|
|
240
|
-
readonly region: {
|
|
241
|
-
readonly positional: "optional";
|
|
242
|
-
readonly stdin: "none";
|
|
243
|
-
readonly flags: {
|
|
244
|
-
readonly path: "repeat-value";
|
|
245
|
-
readonly json: "boolean";
|
|
246
|
-
};
|
|
247
|
-
readonly usage: "region [<contract>] [--json]\nregion --path <pattern> [--path <pattern> ...] [--json]";
|
|
248
|
-
readonly purpose: "Read active declared Contract Regions.";
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
export type ContractCommand = keyof typeof CONTRACT_COMMAND_SPECS;
|
|
252
90
|
export type ParsedContractParts = Readonly<{
|
|
253
91
|
command: ContractCommand;
|
|
254
92
|
flags: Readonly<Record<string, string | true | readonly string[]>>;
|
|
@@ -258,7 +96,4 @@ export type ParsedContractParts = Readonly<{
|
|
|
258
96
|
actor?: string;
|
|
259
97
|
}>;
|
|
260
98
|
export type ParsedContractCommand = ParsedBind | ParsedAmend | ParsedDeliver | ParsedReview | ParsedArc | ParsedAbandon | ParsedStatus | ParsedShow | ParsedLs | ParsedAudit | ParsedReconcile | ParsedNuke | ParsedSettings | ParsedRegion;
|
|
261
|
-
export declare function renderContractHelp(command: ContractCommand): string;
|
|
262
|
-
export declare function renderContractUsage(command: ContractCommand): string;
|
|
263
99
|
export declare function parseContractCommand(parts: ParsedContractParts): ParsedContractCommand;
|
|
264
|
-
export {};
|