@astrosheep/keiyaku 2.9.6 → 2.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/agents/harness/outcome.js +10 -0
  3. package/build/cli/commands/contract/bind/handler.js +10 -4
  4. package/build/cli/commands/contract/bind/meta.js +6 -6
  5. package/build/cli/commands/contract/petition/handler.js +16 -3
  6. package/build/cli/commands/contract/petition/meta.js +4 -4
  7. package/build/cli/commands/metadata.js +3 -2
  8. package/build/cli/commands/projection/tell/handler.js +10 -2
  9. package/build/cli/commands/projection/tell/meta.js +3 -3
  10. package/build/cli/commands/task/catalog.js +2 -0
  11. package/build/cli/commands/task/log/handler.js +12 -0
  12. package/build/cli/commands/task/log/meta.js +8 -0
  13. package/build/cli/flags.js +8 -0
  14. package/build/cli/index.js +10 -6
  15. package/build/cli/parse-flags.js +6 -0
  16. package/build/cli/parse-metadata.js +1 -1
  17. package/build/cli/render/line-width.js +33 -0
  18. package/build/cli/render/path-prefix-compaction.js +88 -0
  19. package/build/cli/render/petition.js +4 -0
  20. package/build/cli/render/projection-activity.js +93 -20
  21. package/build/cli/render/shared.js +34 -12
  22. package/build/cli/render/success-response.js +2 -0
  23. package/build/cli/render/tool-presentation.js +3 -3
  24. package/build/cli/render/wait.js +68 -48
  25. package/build/cli/subagent-guard.js +3 -0
  26. package/build/cli/types.js +1 -1
  27. package/build/core/bind.js +111 -6
  28. package/build/core/draft.js +1 -1
  29. package/build/core/projection/generation/database.js +21 -2
  30. package/build/core/projection/generation/model.js +24 -3
  31. package/build/core/projection/generation/projection-generation-continuation.js +75 -10
  32. package/build/core/projection/generation/projection-generation-execution.js +4 -3
  33. package/build/core/projection/generation/projection-generation-runner.js +96 -53
  34. package/build/core/projection/generation/projection-generation-runtime.js +19 -0
  35. package/build/core/projection/generation/store.js +9 -0
  36. package/build/core/projection/generation/transitions.js +105 -3
  37. package/build/core/projection/index.js +2 -2
  38. package/build/core/projection/projection-core.js +1 -1
  39. package/build/core/projection/projection-kill.js +31 -0
  40. package/build/core/projection/projection-life-protocol.js +10 -0
  41. package/build/core/projection/projection-wait.js +53 -15
  42. package/build/core/projection/projection-wake.js +35 -3
  43. package/build/core/projection/tell/database.js +18 -0
  44. package/build/core/projection/tell/model.js +1 -0
  45. package/build/core/projection/tell/store.js +102 -55
  46. package/build/core/registry.js +82 -69
  47. package/build/core/scope.js +9 -9
  48. package/build/core/task/index.js +2 -2
  49. package/build/core/task/task-contract.js +18 -0
  50. package/build/core/task/task-git-store.js +50 -0
  51. package/build/generated/version.js +2 -2
  52. package/package.json +1 -1
  53. package/skills/keiyaku-akuma/SKILL.md +10 -0
  54. package/skills/keiyaku-workflow/SKILL.md +76 -7
@@ -22,6 +22,32 @@ Lifecycle:
22
22
  bound → active → petitioned → claimed | forfeited
23
23
  ```
24
24
 
25
+ ## Before Bind
26
+
27
+ `bind` begins implementation from a settled executable contract.
28
+
29
+ Before binding, complete the fact and decision work needed to state the delivery:
30
+
31
+ - reproduce or otherwise establish the motivating fact;
32
+ - read the registered authority and locate the current owning modules;
33
+ - settle inputs, outputs, state consequences, failure behavior, invariants, and
34
+ forbidden expansion;
35
+ - declare one coherent ownership region and account for known write overlap and
36
+ delivery dependencies;
37
+ - write checks that prove the critical success path, the highest-risk rejection,
38
+ and the relevant durability, concurrency, or recovery boundary.
39
+
40
+ Use tasks, fact scans, and bare read-only exploration while gathering evidence
41
+ and settling decisions. Task `ready` reports that its dependencies are
42
+ satisfied; the coordinator promotes it after establishing semantic contract
43
+ readiness. Bind when Objective, Scope, and Checks describe one complete
44
+ implementation journey and contain every product or architecture decision the
45
+ worker needs.
46
+
47
+ After bind, the worker implements and verifies that contract. `amend` records
48
+ new evidence or a change of intent that genuinely emerges during implementation
49
+ or review, then implementation continues from the updated contract.
50
+
25
51
  ## The default flow
26
52
 
27
53
  ```bash
@@ -51,8 +77,9 @@ EOF
51
77
  # The oath is required (OATH_MISSING otherwise) and checked for presence, not content.
52
78
  ```
53
79
 
54
- A task is optional planning, not a prerequisite. Bind directly for new work;
55
- use `--task` only when promoting existing tracked planning into this contract.
80
+ A task is optional planning, not a prerequisite. Bind settled new work directly;
81
+ use `--task` when promoting existing tracked planning after the same readiness
82
+ judgment.
56
83
 
57
84
  That's the whole small case: bind → worker dirty-tree handoff → host review/commit → petition.
58
85
 
@@ -62,7 +89,7 @@ contracts/worktrees; it does not replace `needs` or contract `--after` ordering.
62
89
 
63
90
  `audit` is read-only and never invokes an Akuma or settles the contract. Exit 0
64
91
  means it constructed the report, not that the candidate is acceptable. Use
65
- `--diff-budget BYTES` for bounded output and `--json` for complete typed facts.
92
+ `--diff-budget BYTES` when bounded diff evidence is useful.
66
93
 
67
94
  Commissioned workers never write Git metadata. The host alone reviews and
68
95
  commits accepted bytes before `arc`, `renew`, or `petition`.
@@ -73,6 +100,46 @@ worker to read the worktree-root `.keiyaku/KEIYAKU.md` first and follow its
73
100
  objective, scope, and checks. The file is the contract-body carrier; do not
74
101
  copy its rendered body into a dispatch prompt.
75
102
 
103
+ ## Review findings
104
+
105
+ Review findings are evidence for diagnosis, not a queue of local patches. Before
106
+ changing code, classify each finding as a contract hole, missing invariant or
107
+ owner, execution slip, test gap, or provider/capability failure. A second
108
+ finding in the same transition, a race that crosses module owners, or a finding
109
+ that contradicts the contract is a root-cause signal: stop symptom patching,
110
+ record the governing invariant and ownership correction with `amend`, and
111
+ refactor the boundary before sending another tell or accepting another diff.
112
+
113
+ A default review dispatch is:
114
+
115
+ > First read the worktree-root `.keiyaku/KEIYAKU.md`. Review the candidate end
116
+ > to end against the contract and repository law. On every review round, treat
117
+ > the current candidate as a new complete implementation: reassess its overall
118
+ > coherence and regression risks rather than checking only whether prior
119
+ > findings were patched. Report material findings first. For each problem,
120
+ > explain the underlying cause and recommend a root-cause correction direction,
121
+ > not a patch-sized edit. If the evidence is insufficient, state what remains
122
+ > unknown. Do not modify files or Git metadata.
123
+
124
+ Add candidate-specific evidence only when it helps the reviewer judge coverage;
125
+ do not copy the contract body or seed an expected defect. Reviewer suggestions
126
+ inform the coordinator's judgment but do not amend the contract. The
127
+ coordinator owns the final diagnosis; a worker may implement a settled
128
+ correction but may not invent a new state machine or compatibility rule.
129
+
130
+ Do not claim a contract while related findings remain unresolved merely because
131
+ each individual test or patch passes. Re-run the focused interleaving or
132
+ boundary evidence and an independent review against the corrected ownership
133
+ model. Repeated tells that only add guards to the same disputed path are not
134
+ progress; if the contract cannot express the required invariant, amend or
135
+ forfeit and bind a coherent replacement.
136
+
137
+ After a worker fixes review findings, prefer telling the same review projection
138
+ to re-check those findings and the corrected candidate. Start a fresh reviewer
139
+ only when the earlier projection is unavailable or incompatible, its context is
140
+ no longer trustworthy, or a genuinely fresh independent perspective is useful.
141
+ This is an efficiency preference, not an acceptance gate.
142
+
76
143
  ## Mid-flight commands (use when needed, skip otherwise)
77
144
 
78
145
  ```bash
@@ -94,20 +161,22 @@ keiyaku log # this contract's history
94
161
  Clarify the owned documentation surface.
95
162
 
96
163
  ## Scope Append
97
- ```
164
+ ~~~
98
165
  docs/**
99
166
  !docs/generated/**
100
- ```
167
+ ~~~
101
168
  ````
102
169
 
103
170
  `Scope Append` appends ordered raw gitignore-subset lines in one column-zero
104
- backtick fence; `Scope Add` and Markdown bullets are rejected. A later
171
+ tilde fence; direct input also accepts a matching backtick fence. `Scope Add`
172
+ and Markdown bullets are rejected. A later
105
173
  `!pattern` can narrow earlier scope. Use `--append-scope PATTERN` when a
106
174
  lifecycle operation discovers one durable term.
107
175
 
108
176
  Gotchas:
109
177
  - `-C DIR` selects the effective working directory; repository discovery starts there.
110
- - Base drift blocks petition — if main moved, `renew` first; petition tells you.
178
+ - Base drift blocks ordinary petition. `petition --renew` runs the same renew
179
+ first and settles only after that renew succeeds; it never auto-opens an arc.
111
180
  - After an explicit `arc` seals, new loose commits need another `arc` before `renew`/`petition` accept them.
112
181
  - Not in the worktree? Address a contract with `--contract ADDR` (place, slug, or full id) or the `keiyaku @addr <verb>` prefix.
113
182