@bluewombat/runtime 0.11.0 → 0.11.1
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 +84 -7
- package/SPECS.md +55 -9
- package/dist/cli.js +63 -0
- package/dist/cli.js.map +1 -1
- package/dist/config/load-config.d.ts.map +1 -1
- package/dist/config/load-config.js +2 -1
- package/dist/config/load-config.js.map +1 -1
- package/dist/config/types.d.ts +7 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/loop/authority.d.ts +2 -0
- package/dist/loop/authority.d.ts.map +1 -1
- package/dist/loop/authority.js +11 -1
- package/dist/loop/authority.js.map +1 -1
- package/dist/loop/deliveries.d.ts.map +1 -1
- package/dist/loop/deliveries.js +19 -0
- package/dist/loop/deliveries.js.map +1 -1
- package/dist/loop/features.d.ts +14 -0
- package/dist/loop/features.d.ts.map +1 -1
- package/dist/loop/features.js +78 -35
- package/dist/loop/features.js.map +1 -1
- package/dist/loop/journal.d.ts +7 -0
- package/dist/loop/journal.d.ts.map +1 -1
- package/dist/loop/journal.js +23 -1
- package/dist/loop/journal.js.map +1 -1
- package/dist/loop/lock.d.ts +2 -0
- package/dist/loop/lock.d.ts.map +1 -1
- package/dist/loop/lock.js +10 -0
- package/dist/loop/lock.js.map +1 -1
- package/dist/loop/run-slot.d.ts +14 -0
- package/dist/loop/run-slot.d.ts.map +1 -1
- package/dist/loop/run-slot.js +53 -5
- package/dist/loop/run-slot.js.map +1 -1
- package/dist/loop/streams.js +2 -2
- package/dist/loop/streams.js.map +1 -1
- package/dist/loop/tick.d.ts.map +1 -1
- package/dist/loop/tick.js +2 -1
- package/dist/loop/tick.js.map +1 -1
- package/dist/loop/transformers.d.ts.map +1 -1
- package/dist/loop/transformers.js +5 -3
- package/dist/loop/transformers.js.map +1 -1
- package/dist/operator/dash-model.d.ts +65 -0
- package/dist/operator/dash-model.d.ts.map +1 -0
- package/dist/operator/dash-model.js +209 -0
- package/dist/operator/dash-model.js.map +1 -0
- package/dist/operator/dash-view.d.ts +16 -0
- package/dist/operator/dash-view.d.ts.map +1 -0
- package/dist/operator/dash-view.js +226 -0
- package/dist/operator/dash-view.js.map +1 -0
- package/dist/operator/dash.d.ts +34 -0
- package/dist/operator/dash.d.ts.map +1 -0
- package/dist/operator/dash.js +141 -0
- package/dist/operator/dash.js.map +1 -0
- package/dist/operator/doctor.d.ts.map +1 -1
- package/dist/operator/doctor.js +44 -1
- package/dist/operator/doctor.js.map +1 -1
- package/dist/operator/incident-dossier.d.ts +4 -4
- package/dist/operator/incident-dossier.d.ts.map +1 -1
- package/dist/operator/incident-dossier.js +14 -18
- package/dist/operator/incident-dossier.js.map +1 -1
- package/dist/operator/incident-system.d.ts +13 -4
- package/dist/operator/incident-system.d.ts.map +1 -1
- package/dist/operator/incident-system.js +68 -6
- package/dist/operator/incident-system.js.map +1 -1
- package/dist/operator/install.d.ts +9 -0
- package/dist/operator/install.d.ts.map +1 -0
- package/dist/operator/install.js +14 -0
- package/dist/operator/install.js.map +1 -0
- package/dist/operator/supervise/act.d.ts +37 -0
- package/dist/operator/supervise/act.d.ts.map +1 -0
- package/dist/operator/supervise/act.js +354 -0
- package/dist/operator/supervise/act.js.map +1 -0
- package/dist/operator/supervise/config.d.ts +74 -0
- package/dist/operator/supervise/config.d.ts.map +1 -0
- package/dist/operator/supervise/config.js +175 -0
- package/dist/operator/supervise/config.js.map +1 -0
- package/dist/operator/supervise/council.d.ts +45 -0
- package/dist/operator/supervise/council.d.ts.map +1 -0
- package/dist/operator/supervise/council.js +97 -0
- package/dist/operator/supervise/council.js.map +1 -0
- package/dist/operator/supervise/decision.d.ts +46 -0
- package/dist/operator/supervise/decision.d.ts.map +1 -0
- package/dist/operator/supervise/decision.js +137 -0
- package/dist/operator/supervise/decision.js.map +1 -0
- package/dist/operator/supervise/exec.d.ts +28 -0
- package/dist/operator/supervise/exec.d.ts.map +1 -0
- package/dist/operator/supervise/exec.js +47 -0
- package/dist/operator/supervise/exec.js.map +1 -0
- package/dist/operator/supervise/memory.d.ts +33 -0
- package/dist/operator/supervise/memory.d.ts.map +1 -0
- package/dist/operator/supervise/memory.js +73 -0
- package/dist/operator/supervise/memory.js.map +1 -0
- package/dist/operator/supervise/observe.d.ts +47 -0
- package/dist/operator/supervise/observe.d.ts.map +1 -0
- package/dist/operator/supervise/observe.js +73 -0
- package/dist/operator/supervise/observe.js.map +1 -0
- package/dist/operator/supervise/prompts.d.ts +60 -0
- package/dist/operator/supervise/prompts.d.ts.map +1 -0
- package/dist/operator/supervise/prompts.js +338 -0
- package/dist/operator/supervise/prompts.js.map +1 -0
- package/dist/operator/supervise/review.d.ts +24 -0
- package/dist/operator/supervise/review.d.ts.map +1 -0
- package/dist/operator/supervise/review.js +51 -0
- package/dist/operator/supervise/review.js.map +1 -0
- package/dist/operator/supervise/supervise.d.ts +26 -0
- package/dist/operator/supervise/supervise.d.ts.map +1 -0
- package/dist/operator/supervise/supervise.js +484 -0
- package/dist/operator/supervise/supervise.js.map +1 -0
- package/package.json +14 -14
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { PRODUCT } from "@bluewombat/manager-kit";
|
|
2
|
+
const CHARTER = `You belong to the supervision council of ${PRODUCT}, the process of bluewombat: a system
|
|
3
|
+
that turns tickets into delivered code with no one watching. ${PRODUCT} has stopped
|
|
4
|
+
or is about to, and no person is available. Your work decides what runs next.
|
|
5
|
+
|
|
6
|
+
How you work:
|
|
7
|
+
- You never assume. Every claim cites a file and line you read, or a command you ran and what
|
|
8
|
+
it printed. Run the read-only commands you need (git, grep, cat, the ledger, the journal).
|
|
9
|
+
A thing you could not check goes under "unverified" with what stopped you; it is never written as fact.
|
|
10
|
+
- What the code DOES, you take from the code and the real files of this run, not from memory of how such
|
|
11
|
+
systems usually behave and not from a comment: the code is the fact. What ${PRODUCT} MUST be (its
|
|
12
|
+
rules, its accepted decisions, its layers and who may depend on whom) you take from the rules listed
|
|
13
|
+
under "The rules" below, which you read first: there the document is the fact, and code that disagrees
|
|
14
|
+
with it is a defect to report, never a precedent to copy.
|
|
15
|
+
- A change must conform to those rules. Where the only way to a result is to revisit an accepted
|
|
16
|
+
decision or rule, you say so and name it; you do not design around it and you do not decide it.
|
|
17
|
+
- You do not write, delete or run anything that changes the run. You read and you reason.
|
|
18
|
+
- The goal is a ${PRODUCT} that runs without anyone watching, not a Project that is correct. A fix to
|
|
19
|
+
the state of one ticket that leaves the cause in place is a failure: the same stop returns.`;
|
|
20
|
+
function context(brief) {
|
|
21
|
+
return [
|
|
22
|
+
`## What stopped`,
|
|
23
|
+
`kind: ${brief.finding.kind}`,
|
|
24
|
+
brief.finding.key === undefined ? "" : `subject: ${brief.finding.key} (${brief.finding.scope})`,
|
|
25
|
+
brief.finding.detail,
|
|
26
|
+
"",
|
|
27
|
+
`## The rules`,
|
|
28
|
+
brief.rules.length === 0
|
|
29
|
+
? "None are configured for the repositories you may change. Say so under unverified."
|
|
30
|
+
: `Read these before anything else. The first routes to the others; open those that cover what you touch:\n${brief.rules.map((file) => `- ${file}`).join("\n")}`,
|
|
31
|
+
"",
|
|
32
|
+
`## Where to look`,
|
|
33
|
+
brief.dossierDir === undefined
|
|
34
|
+
? "No dossier: this stop has no single ticket."
|
|
35
|
+
: `Dossier: ${brief.dossierDir}/incident.md (and incident.json). It states facts and what it could not find. Start there, then go to the sources it names.`,
|
|
36
|
+
`Ledger and journal: ${brief.ledgerRoot} (events.jsonl is the journal)`,
|
|
37
|
+
brief.configPath === undefined ? "" : `Project configuration: ${brief.configPath}`,
|
|
38
|
+
`Code you may read: ${brief.codeRoots.join(", ") || "(none given)"}`,
|
|
39
|
+
"",
|
|
40
|
+
`## What was tried on this before`,
|
|
41
|
+
brief.history.length === 0
|
|
42
|
+
? "Nothing. This is the first attempt."
|
|
43
|
+
: brief.history.map((line) => `- ${line}`).join("\n"),
|
|
44
|
+
brief.history.length === 0
|
|
45
|
+
? ""
|
|
46
|
+
: "\nSomething already tried and that did not hold is evidence about the cause. Do not propose it again unchanged.",
|
|
47
|
+
]
|
|
48
|
+
.filter((line) => line !== "")
|
|
49
|
+
.join("\n");
|
|
50
|
+
}
|
|
51
|
+
export function rootcausePrompt(brief) {
|
|
52
|
+
return `${CHARTER}
|
|
53
|
+
|
|
54
|
+
# Your role: root cause
|
|
55
|
+
|
|
56
|
+
Reconstruct, from the origin, why this stopped. Not the last error: the chain.
|
|
57
|
+
|
|
58
|
+
1. Read the dossier, then the sources: the ledger aggregate, the journal around the stop, the
|
|
59
|
+
Gate reports, the agent transcripts, the git state of the branches involved.
|
|
60
|
+
2. Write the chain as numbered links, each backed by evidence. For each link say which layer is
|
|
61
|
+
responsible: "plan" (how the work was cut or ordered), "config" (the Project's ${PRODUCT}
|
|
62
|
+
configuration, prompts, Gates), "${PRODUCT}" (the code of ${PRODUCT} or of one of its packages), or
|
|
63
|
+
"project" (the Project's own code or environment).
|
|
64
|
+
3. Find the first link that could have been prevented. That is the origin; the rest are consequences.
|
|
65
|
+
4. For a "${PRODUCT}" link, read the code that did it. Name file and line. Say what the code does, which
|
|
66
|
+
is not always what its comment says.
|
|
67
|
+
5. Say whether the stop will come back by itself after a plain resume. Prove it by reading what a
|
|
68
|
+
resume resets and what it keeps (counters, budgets, workspace), with file and line.
|
|
69
|
+
|
|
70
|
+
${context(brief)}
|
|
71
|
+
|
|
72
|
+
Answer in prose, then end with one \`\`\`json block:
|
|
73
|
+
{"chain":[{"claim":"…","evidence":"file:line or command","layer":"plan|config|${PRODUCT}|project"}],
|
|
74
|
+
"origin":"…","returnsAfterPlainResume":true,"unverified":["…"]}`;
|
|
75
|
+
}
|
|
76
|
+
export function remedyPrompt(brief) {
|
|
77
|
+
return `${CHARTER}
|
|
78
|
+
|
|
79
|
+
# Your role: remedies
|
|
80
|
+
|
|
81
|
+
List every way to get this running again AND to stop it happening again. You do not judge them
|
|
82
|
+
against each other: another member does.
|
|
83
|
+
|
|
84
|
+
Sort them into:
|
|
85
|
+
- "unblock": what puts the run back in motion. The only moves available are: resume a ticket or
|
|
86
|
+
feature by key; restart a feature from its line; cancel a ticket (loses its work); start the worker;
|
|
87
|
+
restart the worker (a hung process); free disk. Check by reading the code that the move actually clears what stopped it. A resume that
|
|
88
|
+
hands the work back with no budget left stops at once, again: count the budget the way the code does.
|
|
89
|
+
- "fix": a change to a repository so that this cannot recur. Repositories you may name:
|
|
90
|
+
${brief.targets.join(", ") || "(none configured: there are no fixes to propose)"}.
|
|
91
|
+
A fix is for the cause, in the layer responsible: the plan's ordering, the Project's configuration
|
|
92
|
+
or prompts, or ${PRODUCT}'s code. Say the area, the result to reach and what proves it. Say which
|
|
93
|
+
rules and accepted decisions it touches (from the rules above) and whether it conforms or would
|
|
94
|
+
revise one. Do not write the design: whoever makes the change designs it inside the rules.
|
|
95
|
+
- "order": whether the unblock must wait for the fixes (the same stop would come straight back)
|
|
96
|
+
or can run first.
|
|
97
|
+
|
|
98
|
+
For each remedy: what it does, what proves it worked (a command and the output to expect), and
|
|
99
|
+
what it costs. Prefer a remedy that makes the class of stop impossible over one that handles a case.
|
|
100
|
+
|
|
101
|
+
${context(brief)}
|
|
102
|
+
|
|
103
|
+
Answer in prose, then end with one \`\`\`json block:
|
|
104
|
+
{"unblock":[{"do":"resume|restart|cancel|start-worker|restart-worker|cleanup-disk","key":"…","why":"…","proof":"…"}],
|
|
105
|
+
"fixes":[{"target":"…","title":"…","change":"…","proof":"…","rules":"…","revises":""}],"unblockAfterFixes":false,"unverified":["…"]}`;
|
|
106
|
+
}
|
|
107
|
+
export function skepticPrompt(brief) {
|
|
108
|
+
return `${CHARTER}
|
|
109
|
+
|
|
110
|
+
# Your role: skeptic
|
|
111
|
+
|
|
112
|
+
You are the one who finds how the obvious answer fails. Assume the first idea anyone has is
|
|
113
|
+
"resume it" or "raise the limit", and find out whether that holds.
|
|
114
|
+
|
|
115
|
+
- Read the code that a resume goes through and say what it resets and what it keeps. Does the
|
|
116
|
+
ticket escalate again at once? Does it loop? Does it cost an attempt, a budget, a workspace?
|
|
117
|
+
- Which proposed move weakens a bound (attempts, refusals, timeouts, a Gate) to get past a stop?
|
|
118
|
+
That trades the stop for a worse failure later; name it.
|
|
119
|
+
- What could a fix to ${PRODUCT}'s code break elsewhere? Read the callers. What test would catch it?
|
|
120
|
+
- What could happen to work already folded into the line? Is the move reversible, and how?
|
|
121
|
+
- What would make this supervision attempt itself loop, or hide a bug in ${PRODUCT} instead of
|
|
122
|
+
fixing it?
|
|
123
|
+
- What did the earlier attempts on this subject (below) get wrong?
|
|
124
|
+
|
|
125
|
+
Be concrete: a scenario, with the lines of code that make it happen. A worry without a path is noise.
|
|
126
|
+
|
|
127
|
+
${context(brief)}
|
|
128
|
+
|
|
129
|
+
Answer in prose, then end with one \`\`\`json block:
|
|
130
|
+
{"risks":[{"move":"…","scenario":"…","evidence":"file:line","severity":"blocking|serious|minor"}],
|
|
131
|
+
"mustBeTrue":["conditions the arbiter should require"],"unverified":["…"]}`;
|
|
132
|
+
}
|
|
133
|
+
/** The shape of the arbiter's answer, as `parseDecision` reads it. */
|
|
134
|
+
const DECISION_FORM = `{"summary":"one line","cause":"…","evidence":["file:line or command → output"],
|
|
135
|
+
"confidence":"high|medium|low","unblockAfterFixes":false,
|
|
136
|
+
"unblock":[{"do":"resume|restart|cancel|start-worker|restart-worker|cleanup-disk","key":"exact key","reason":"…"}],
|
|
137
|
+
"fixes":[{"target":"…","title":"…","instruction":"result, constraints, proof","conformity":"rule or decision → why it conforms","revises":""}],
|
|
138
|
+
"needsHuman":""}`;
|
|
139
|
+
/**
|
|
140
|
+
* The cheap second ask of an arbiter whose answer was refused for its shape:
|
|
141
|
+
* the first answer and the reason, no reports, no code to reread.
|
|
142
|
+
*/
|
|
143
|
+
export function formPrompt(answer, reason) {
|
|
144
|
+
return `You correct the form of an answer. You add no finding, read no code, and change no fact.
|
|
145
|
+
|
|
146
|
+
The answer below was refused: ${reason}
|
|
147
|
+
|
|
148
|
+
Rewrite it so that it ends with exactly one \`\`\`json block of this form, drawing every value from the
|
|
149
|
+
answer itself:
|
|
150
|
+
${DECISION_FORM}
|
|
151
|
+
|
|
152
|
+
## The answer
|
|
153
|
+
|
|
154
|
+
${answer}`;
|
|
155
|
+
}
|
|
156
|
+
export function arbiterPrompt(brief, reports) {
|
|
157
|
+
const body = Object.entries(reports)
|
|
158
|
+
.map(([role, text]) => `### ${role}\n\n${text}`)
|
|
159
|
+
.join("\n\n");
|
|
160
|
+
return `${CHARTER}
|
|
161
|
+
|
|
162
|
+
# Your role: arbiter
|
|
163
|
+
|
|
164
|
+
Three members reported on this stop. You decide. You may read the code yourself to settle a
|
|
165
|
+
disagreement, and you must when two reports contradict each other: do not pick by tone.
|
|
166
|
+
|
|
167
|
+
Decide:
|
|
168
|
+
1. The cause, in one paragraph, with the evidence that makes it so.
|
|
169
|
+
2. What puts the run back in motion ("unblock"), using keys exactly as the dossier writes them.
|
|
170
|
+
3. The fixes that make this class of stop impossible ("fixes"), one per repository change. Each states
|
|
171
|
+
the RESULT to reach (what must be true afterwards, observable), the constraints the rules put on it,
|
|
172
|
+
and the test that proves it. It does not state the design: no function to edit, no algorithm. The
|
|
173
|
+
fixer reads the code and designs inside the rules; an instruction that dictates the design makes
|
|
174
|
+
you responsible for any rule it breaks.
|
|
175
|
+
Each fix also carries "conformity": the rules and accepted decisions (cite document and entry) it
|
|
176
|
+
touches and why it conforms. If no change can reach the result without revisiting an accepted
|
|
177
|
+
decision or rule, set "revises" to which one: the fix is then not made and a person decides.
|
|
178
|
+
4. Whether the unblock has to wait for the fixes ("unblockAfterFixes": true when the same stop would
|
|
179
|
+
come straight back without them).
|
|
180
|
+
|
|
181
|
+
Rules that bind you:
|
|
182
|
+
- Prefer the fix of the cause over the patch of the state. If the cause is in ${PRODUCT}, ${PRODUCT} is fixed.
|
|
183
|
+
- Never raise a bound (attempts, refusals, timeouts, budgets) or turn off a Gate to get past a stop.
|
|
184
|
+
A bound that is too tight is a finding to fix on its merits, with evidence, not a lever for today.
|
|
185
|
+
- A move the skeptic showed to fail is not chosen. Anything marked "blocking" is answered or avoided.
|
|
186
|
+
- Say "low" confidence when you could not verify the cause. The supervisor then does nothing and asks
|
|
187
|
+
again with more history, which is better than acting on a guess.
|
|
188
|
+
- "needsHuman" only for what no agent can decide: a credential, a product choice, work already folded
|
|
189
|
+
into the line. Say precisely what the person must decide and what you recommend.
|
|
190
|
+
- Read the rules above before you write a fix. A fix that adds a dependency across layers, makes one
|
|
191
|
+
part read another's internals, loosens a bound a decision froze, or inherits behaviour silently where
|
|
192
|
+
a decision says it must be explicit, is not a fix: it is a "revises".
|
|
193
|
+
- A fix changes files that exist in the checkout of its repository. The Project's own configuration,
|
|
194
|
+
prompts and code are not in it: what must change there is for a person, so it goes in "needsHuman"
|
|
195
|
+
and is not a fix. A fix never names a file you did not find in that repository.
|
|
196
|
+
- Fixes only name these repositories: ${brief.targets.join(", ") || "(none)"}.
|
|
197
|
+
|
|
198
|
+
${context(brief)}
|
|
199
|
+
|
|
200
|
+
## The reports
|
|
201
|
+
|
|
202
|
+
${body}
|
|
203
|
+
|
|
204
|
+
Answer with a short explanation, then end with exactly one \`\`\`json block:
|
|
205
|
+
${DECISION_FORM}`;
|
|
206
|
+
}
|
|
207
|
+
export function fixerPrompt(input) {
|
|
208
|
+
return `You change one repository so that a stop of ${PRODUCT} cannot happen again. You work alone, in a
|
|
209
|
+
worktree made for this change. No one will answer a question.
|
|
210
|
+
|
|
211
|
+
Read the repository's AGENTS.md (or CLAUDE.md) first and follow it: its layout, its checks, what it
|
|
212
|
+
asks you to update in the same change (documents, decisions).
|
|
213
|
+
|
|
214
|
+
## Why
|
|
215
|
+
${input.cause}
|
|
216
|
+
|
|
217
|
+
Evidence the council gathered:
|
|
218
|
+
${input.evidence.map((line) => `- ${line}`).join("\n")}
|
|
219
|
+
|
|
220
|
+
## What to change: ${input.title}
|
|
221
|
+
${input.instruction}
|
|
222
|
+
|
|
223
|
+
The council says it conforms to the rules like this (check it, do not trust it):
|
|
224
|
+
${input.conformity}
|
|
225
|
+
|
|
226
|
+
${input.deferred === undefined || input.deferred.length === 0
|
|
227
|
+
? ""
|
|
228
|
+
: `The guard approved the proposal but could not check these until the change exists; check them yourself and say what you saw:\n${input.deferred.map((line) => `- ${line}`).join("\n")}\n\n`}The result is what is asked; how to reach it is yours. Design it inside the repository's own rules,
|
|
229
|
+
which win over this instruction: if the instruction as written would break one (a layer, a
|
|
230
|
+
dependency direction, a frozen bound, an accepted decision), do not follow it; reach the result
|
|
231
|
+
another way, or change nothing and say which rule stops you.
|
|
232
|
+
|
|
233
|
+
## Rules
|
|
234
|
+
- Fix the cause, not the symptom. Verify the cause yourself in the code before you change anything;
|
|
235
|
+
if what is written above is wrong, change what is actually wrong and say so in your last message.
|
|
236
|
+
- Smallest change that makes the class of stop impossible. Add a test that fails before and passes after.
|
|
237
|
+
- Never raise a bound, loosen a check, or skip a Gate to make something pass.
|
|
238
|
+
- Do not commit, push or open anything. The supervisor does, once the checks pass.
|
|
239
|
+
${input.deny.length === 0 ? "" : `- You may not touch: ${input.deny.join(", ")}.\n`}- The change must pass: ${input.checks.join(" ; ") || "(no check configured)"}. Run them.
|
|
240
|
+
${input.failure === undefined ? "" : `\n## The previous attempt failed its checks\nFix this, do not start over:\n${input.failure}\n`}
|
|
241
|
+
Finish with a short summary: what was wrong, what you changed, what you ran and what it printed.`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The guard. It is given a change and the repository, never the stop that
|
|
245
|
+
* caused it: it judges the change against the product, not against the problem.
|
|
246
|
+
*/
|
|
247
|
+
export function reviewerPrompt(input) {
|
|
248
|
+
return `You are the guard of ${PRODUCT}. A change to ${input.target} is about to be offered. You do not know
|
|
249
|
+
what prompted it and you must not try to find out: you do not judge whether it solves anything. You judge
|
|
250
|
+
whether it belongs in ${PRODUCT}: its features, its goals, the choices already made, the code that exists.
|
|
251
|
+
Your working directory is a checkout of the repository with the change applied. Nothing may be changed.
|
|
252
|
+
|
|
253
|
+
How you work:
|
|
254
|
+
- You never assume. Every claim cites a file and line you read, or a command you ran and what it printed.
|
|
255
|
+
What you could not check is listed under "unverified" and counts against approval; it is never written as fact.
|
|
256
|
+
- Read the repository's AGENTS.md first, then the documents it routes you to: the product rules, the
|
|
257
|
+
accepted decisions, the architecture and the specification of every area the change touches.
|
|
258
|
+
The documents can be wrong and the code is the fact: when they disagree, say so.
|
|
259
|
+
- Do not trust the change's own words, its tests or its comments. Read the code it touches and the code that
|
|
260
|
+
calls it.
|
|
261
|
+
|
|
262
|
+
The change is titled "${input.title}". Files:
|
|
263
|
+
${input.files.map((file) => `- ${file}`).join("\n")}
|
|
264
|
+
|
|
265
|
+
\`\`\`diff
|
|
266
|
+
${input.diff}
|
|
267
|
+
\`\`\`
|
|
268
|
+
|
|
269
|
+
Establish, with evidence, each of these:
|
|
270
|
+
1. behaviour: what the change makes the code do that it did not, and what it no longer does.
|
|
271
|
+
2. callers: every caller and every consumer of what changes (other packages, other Transformers, the Host,
|
|
272
|
+
the CLI, configuration files, documents); for each, whether it still holds.
|
|
273
|
+
3. decisions: every accepted decision, invariant or product rule the change touches or contradicts. A change
|
|
274
|
+
that revisits one is acceptable only if it records the new decision in the same change (and says what it
|
|
275
|
+
replaces); otherwise reject.
|
|
276
|
+
4. coherence: whether it fits the code around it (names, layers, who may import whom, the words of the
|
|
277
|
+
product's glossary) or adds a second way of doing what exists.
|
|
278
|
+
5. proof: whether the tests cover the new behaviour and the behaviour next to it, and whether they would
|
|
279
|
+
fail without the change. Run what the repository's checks run (${input.checks.join(" ; ") || "none configured"}) if you doubt them.
|
|
280
|
+
6. record: whether the documents that cover the touched files are updated in the same change, and whether
|
|
281
|
+
anything left unsure is written down as the repository asks.
|
|
282
|
+
|
|
283
|
+
Reject if any point lacks evidence, shows an interference, a contradicted decision, a missing record or a
|
|
284
|
+
loosened bound. Approve if you found no problem in everything that can be checked now. What can only be checked once
|
|
285
|
+
the change is written (running its proof, the repository's checks) goes under "unverified": it does not
|
|
286
|
+
stop the proposal, it is handed to whoever writes it and to the guard of the diff. A problem you found
|
|
287
|
+
is a finding, never an "unverified". An approval lists what you checked.
|
|
288
|
+
|
|
289
|
+
Finish with one JSON object in a \`\`\`json fence:
|
|
290
|
+
{"verdict":"approve"|"reject",
|
|
291
|
+
"checked":["file:line or command → what it showed", "..."],
|
|
292
|
+
"findings":[{"point":1-6,"problem":"...","evidence":"file:line","required":"what the change must do"}],
|
|
293
|
+
"unverified":["..."]}`;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The guard, before anything is written: it reads the proposal against the rules.
|
|
297
|
+
* The cheapest place to refuse a change that cannot conform is before it is coded.
|
|
298
|
+
*/
|
|
299
|
+
export function proposalReviewerPrompt(input) {
|
|
300
|
+
return `You are the guard of ${PRODUCT}. A change to ${input.target} is PROPOSED, not yet written. You do not
|
|
301
|
+
know what prompted it and you must not try to find out: you judge whether it can belong in ${PRODUCT}, not
|
|
302
|
+
whether it solves anything. Your working directory is a checkout of the repository. Nothing may be changed.
|
|
303
|
+
|
|
304
|
+
How you work:
|
|
305
|
+
- You never assume. Every claim cites a file and line you read, or a command you ran and what it printed.
|
|
306
|
+
What you could not check is listed under "unverified" and counts against approval.
|
|
307
|
+
- Read the rules first: ${input.rules.join(", ") || "the repository's AGENTS.md"}, then the documents they
|
|
308
|
+
route you to for the area the proposal touches (decisions, product rules, architecture, specifications).
|
|
309
|
+
Then the code the proposal would touch and the code that calls it.
|
|
310
|
+
|
|
311
|
+
The proposal is titled "${input.title}".
|
|
312
|
+
|
|
313
|
+
Instruction:
|
|
314
|
+
${input.instruction}
|
|
315
|
+
|
|
316
|
+
Its own claim of conformity (do not trust it; check it):
|
|
317
|
+
${input.conformity}
|
|
318
|
+
|
|
319
|
+
Establish, with evidence:
|
|
320
|
+
1. behaviour: what it would make the code do, and what it would stop doing. Every file it names must
|
|
321
|
+
exist in this checkout; a proposal that changes anything outside this repository is rejected.
|
|
322
|
+
2. callers: what depends on what changes, and whether it still holds.
|
|
323
|
+
3. decisions: every accepted decision, invariant, layer rule or frozen bound it touches or contradicts.
|
|
324
|
+
If it cannot reach its result without contradicting one, reject: this is a decision for a person.
|
|
325
|
+
4. coherence: whether it fits the code around it or adds a second way of doing what exists.
|
|
326
|
+
5. instruction: whether it dictates a design that breaks a rule. Say which rule, and what result could be
|
|
327
|
+
reached instead, in the rules' terms.
|
|
328
|
+
6. record: the documents a change of this kind must update in the same change.
|
|
329
|
+
|
|
330
|
+
Approve only if you found nothing and could check everything. An approval lists what you checked.
|
|
331
|
+
|
|
332
|
+
Finish with one JSON object in a \`\`\`json fence:
|
|
333
|
+
{"verdict":"approve"|"reject",
|
|
334
|
+
"checked":["file:line or command → what it showed", "..."],
|
|
335
|
+
"findings":[{"point":1-6,"problem":"...","evidence":"file:line","required":"what the change must do instead"}],
|
|
336
|
+
"unverified":["..."]}`;
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/operator/supervise/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAkBlD,MAAM,OAAO,GAAG,4CAA4C,OAAO;+DACJ,OAAO;;;;;;;;8EAQQ,OAAO;;;;;;;kBAOnE,OAAO;8FACqE,CAAC;AAE/F,SAAS,OAAO,CAAC,KAAY;IAC3B,OAAO;QACL,iBAAiB;QACjB,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE;QAC7B,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG;QAC/F,KAAK,CAAC,OAAO,CAAC,MAAM;QACpB,EAAE;QACF,cAAc;QACd,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YACtB,CAAC,CAAC,mFAAmF;YACrF,CAAC,CA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sB,CAAC,KAMtC;IACC,OAAO,wBAAwB,OAAO,iBAAiB,KAAK,CAAC,MAAM;6FACwB,OAAO;;;;;;0BAM1E,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,4BAA4B;;;;0BAItD,KAAK,CAAC,KAAK;;;EAGnC,KAAK,CAAC,WAAW;;;EAGjB,KAAK,CAAC,UAAU;;;;;;;;;;;;;;;;;;;uBAmBK,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type Verdict = {
|
|
2
|
+
ok: true;
|
|
3
|
+
approve: true;
|
|
4
|
+
checked: string[];
|
|
5
|
+
deferred: string[];
|
|
6
|
+
} | {
|
|
7
|
+
ok: true;
|
|
8
|
+
approve: false;
|
|
9
|
+
reasons: string[];
|
|
10
|
+
points: number[];
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
reason: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The guard's answer. An approval has to show what was checked, and has nothing
|
|
17
|
+
* left unverified: a guard that says yes without evidence has said nothing.
|
|
18
|
+
* A proposal is not written yet: what can only be checked once it is stays with the
|
|
19
|
+
* fixer and the guard of the diff (`deferred`) and does not stop it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseVerdict(output: string, options?: {
|
|
22
|
+
proposal?: boolean;
|
|
23
|
+
}): Verdict;
|
|
24
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/review.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAClE;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACjE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CA4C1F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { lastJson } from "./decision.js";
|
|
2
|
+
/**
|
|
3
|
+
* The guard's answer. An approval has to show what was checked, and has nothing
|
|
4
|
+
* left unverified: a guard that says yes without evidence has said nothing.
|
|
5
|
+
* A proposal is not written yet: what can only be checked once it is stays with the
|
|
6
|
+
* fixer and the guard of the diff (`deferred`) and does not stop it.
|
|
7
|
+
*/
|
|
8
|
+
export function parseVerdict(output, options = {}) {
|
|
9
|
+
const value = lastJson(output);
|
|
10
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
11
|
+
return { ok: false, reason: "no JSON object in the guard's answer" };
|
|
12
|
+
}
|
|
13
|
+
const o = value;
|
|
14
|
+
const strings = (v) => (Array.isArray(v) ? v.map(String) : []);
|
|
15
|
+
const checked = strings(o.checked);
|
|
16
|
+
const unverified = strings(o.unverified);
|
|
17
|
+
const raw = (Array.isArray(o.findings) ? o.findings : []).map((item) => (item ?? {}));
|
|
18
|
+
const points = raw.flatMap((f) => (typeof f.point === "number" ? [f.point] : []));
|
|
19
|
+
const findings = raw.map((f) => {
|
|
20
|
+
return `point ${String(f.point ?? "?")}: ${String(f.problem ?? "")} (${String(f.evidence ?? "no evidence")}) — required: ${String(f.required ?? "")}`;
|
|
21
|
+
});
|
|
22
|
+
if (o.verdict === "reject") {
|
|
23
|
+
return {
|
|
24
|
+
ok: true,
|
|
25
|
+
approve: false,
|
|
26
|
+
reasons: findings.length > 0 ? findings : ["rejected without a finding"],
|
|
27
|
+
points,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (o.verdict !== "approve") {
|
|
31
|
+
return { ok: false, reason: 'verdict must be "approve" or "reject"' };
|
|
32
|
+
}
|
|
33
|
+
if (checked.length === 0) {
|
|
34
|
+
return { ok: false, reason: "an approval must list what was checked" };
|
|
35
|
+
}
|
|
36
|
+
if (findings.length > 0 || (unverified.length > 0 && options.proposal !== true)) {
|
|
37
|
+
return {
|
|
38
|
+
ok: true,
|
|
39
|
+
approve: false,
|
|
40
|
+
reasons: [...findings, ...unverified.map((u) => `unverified: ${u}`)],
|
|
41
|
+
points,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
ok: true,
|
|
46
|
+
approve: true,
|
|
47
|
+
checked,
|
|
48
|
+
deferred: options.proposal === true ? unverified : [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/operator/supervise/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,UAAkC,EAAE;IAC/E,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,sCAAsC,EAAE,CAAC;IACvE,CAAC;IACD,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,MAAM,OAAO,GAAG,CAAC,CAAU,EAAY,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,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AAC;YACxE,MAAM;SACP,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAC;IACxE,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,wCAAwC,EAAE,CAAC;IACzE,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC;QAChF,OAAO;YACL,EAAE,EAAE,IAAI;YACR,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;YACpE,MAAM;SACP,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,OAAO,EAAE,IAAI;QACb,OAAO;QACP,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Exec } from "./exec.js";
|
|
2
|
+
export type SuperviseInput = {
|
|
3
|
+
cwd: string;
|
|
4
|
+
argv: string[];
|
|
5
|
+
write: (text: string) => void;
|
|
6
|
+
interruptFlag?: {
|
|
7
|
+
interrupted: boolean;
|
|
8
|
+
};
|
|
9
|
+
exec?: Exec;
|
|
10
|
+
now?: () => Date;
|
|
11
|
+
sleep?: (ms: number) => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Watch a mason run, and do what a person would do by hand when it stops.
|
|
15
|
+
*
|
|
16
|
+
* It is another process than `run`, on the same ledger. It reads (the ledger,
|
|
17
|
+
* the journal, the lock, the disk), decides what is wrong, has a council of
|
|
18
|
+
* agents find the cause, and carries out the arbiter's decision: the move
|
|
19
|
+
* that puts the run back in motion, and the changes to the repositories it
|
|
20
|
+
* was given so that the stop does not come back. Those changes are offered as
|
|
21
|
+
* pull requests and folded by the repository's own rules, so they can be undone.
|
|
22
|
+
*
|
|
23
|
+
* With `--dry-run` it deliberates and writes what it would do, and does none of it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runSupervise(input: SuperviseInput): Promise<number>;
|
|
26
|
+
//# sourceMappingURL=supervise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervise.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/supervise.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,KAAK,IAAI,EAA0B,MAAM,WAAW,CAAC;AAc9D,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC,CAAC;AAUF;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgFzE"}
|