bareloop 0.56.0 → 0.57.0

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 (78) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +3 -3
  3. package/bareloop.context.md +65 -207
  4. package/package.json +2 -2
  5. package/src/authorflow.js +25 -78
  6. package/src/authoring.js +5 -124
  7. package/src/authorjob.js +33 -395
  8. package/src/authorreadout.js +17 -355
  9. package/src/authorrun.js +8 -211
  10. package/src/blockasks.js +2 -2
  11. package/src/bundlerun.js +4 -1
  12. package/src/checkblock.js +76 -50
  13. package/src/checklist.js +1 -1
  14. package/src/checkpick.js +10 -1
  15. package/src/cli.js +3 -3
  16. package/src/declaredclose.js +11 -110
  17. package/src/destpoint.js +1 -1
  18. package/src/index.js +3 -43
  19. package/src/interviewrun.js +13 -8
  20. package/src/job.js +20 -1
  21. package/src/jobblock.js +11 -46
  22. package/src/judged.js +13 -1229
  23. package/src/kinds.js +5 -347
  24. package/src/noteask.js +124 -0
  25. package/src/pagedry.js +27 -5
  26. package/src/pagemap.js +2 -2
  27. package/src/pagerules.js +18 -3
  28. package/src/panel/authorroutes.js +9 -3
  29. package/src/panel/authorsession.js +99 -141
  30. package/src/panel/importrun.js +0 -1
  31. package/src/panel/index.html +6 -6
  32. package/src/panel/jobplan.js +7 -5
  33. package/src/panel/server.js +25 -64
  34. package/src/panel/status.js +3 -0
  35. package/src/pickrecord.js +15 -54
  36. package/src/planrun.js +2 -48
  37. package/src/promptregisters.js +2 -17
  38. package/src/providerrows.js +0 -36
  39. package/src/providers.js +4 -25
  40. package/src/questionbox.js +4 -12
  41. package/src/rubricstep.js +26 -6
  42. package/src/run.js +2 -15
  43. package/src/userrun.js +14 -111
  44. package/types/authorflow.d.ts +9 -58
  45. package/types/authoring.d.ts +1 -14
  46. package/types/authorjob.d.ts +13 -55
  47. package/types/authorreadout.d.ts +8 -80
  48. package/types/blockasks.d.ts +1 -2
  49. package/types/checkblock.d.ts +32 -17
  50. package/types/checklist.d.ts +2 -2
  51. package/types/checkpick.d.ts +5 -0
  52. package/types/cli.d.ts +1 -3
  53. package/types/declaredclose.d.ts +3 -33
  54. package/types/index.d.ts +2 -4
  55. package/types/job.d.ts +8 -0
  56. package/types/jobblock.d.ts +8 -38
  57. package/types/judged.d.ts +7 -357
  58. package/types/kinds.d.ts +3 -104
  59. package/types/noteask.d.ts +76 -0
  60. package/types/pagedry.d.ts +13 -0
  61. package/types/pagerules.d.ts +7 -0
  62. package/types/panel/authorsession.d.ts +35 -4
  63. package/types/panel/jobplan.d.ts +3 -3
  64. package/types/panel/server.d.ts +13 -5
  65. package/types/panel/status.d.ts +5 -0
  66. package/types/pickrecord.d.ts +8 -13
  67. package/types/planrun.d.ts +1 -22
  68. package/types/providerrows.d.ts +0 -31
  69. package/types/providers.d.ts +3 -19
  70. package/types/rubricstep.d.ts +9 -0
  71. package/types/run.d.ts +1 -20
  72. package/types/userrun.d.ts +0 -1
  73. package/src/calibrate.js +0 -702
  74. package/src/cardauthor.js +0 -502
  75. package/src/fitcheck.js +0 -168
  76. package/types/calibrate.d.ts +0 -201
  77. package/types/cardauthor.d.ts +0 -358
  78. package/types/fitcheck.d.ts +0 -119
@@ -80,34 +80,34 @@ export function refuseLockedKind(kind: string): Refusal;
80
80
  * one-genre-at-a-time law is untouched.
81
81
  *
82
82
  * @param {{answers: Record<string|number, any>, repoPath?: string|null, lang: string,
83
- * jobLines?: {n: number, text: string}[]|null, inputs?: {n: number, label: string, value: string}[]|null,
83
+ * jobLines?: {n: number, text: string, rule?: string, rules?: string[]}[]|null, inputs?: {n: number, label: string, value: string}[]|null,
84
84
  * verdictType?: string|null,
85
85
  * questions?: Record<string|number, string>|null, generate?: Function, provider?: any,
86
- * seedRef?: string|null, scout?: any, listing?: any, ceilingUsd?: number|null, judgeModel?: string|null,
86
+ * seedRef?: string|null, scout?: any, listing?: any, ceilingUsd?: number|null,
87
87
  * rates?: {in: number, out: number}|null, draftThinking?: 'on'|'off',
88
88
  * onPhase?: (phase: string, data?: any) => void,
89
89
  * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string}) => void,
90
- * seedFn?: Function, scoutFn?: Function, listingFn?: Function, lookFn?: Function|null, fitFn?: Function|null,
91
- * fitAsk?: ((question: string) => Promise<string|null>)|null, onFit?: (fit: {state: string, asks: any[], notFound: any[]}) => void,
90
+ * seedFn?: Function, scoutFn?: Function, listingFn?: Function, lookFn?: Function|null,
92
91
  * authorFn?: Function, authorOpts?: object, writeScope?: string[]|null,
93
- * signerFix?: Function|any, proposeFn?: Function, compileOpts?: object,
94
92
  * ask?: ((step: {kind: string, [k: string]: any}) => Promise<string|null>)|null,
95
93
  * answerQuestions?: ((o: {questions: {line: number, question: string, rule?: number, source?: string, ask?: string, reading?: string, key?: string}[], dropped: {reason: string, raw: any}[], confirmed: any}) =>
96
94
  * Promise<{jobLines: {n: number, text: string, rule?: string}[], answers: Record<string|number, any>, left?: {line: number, rule: number}[], picks?: any[], choices?: {key: string, choice: string, text?: string}[]}|null>)|null,
97
- * pickGenerate?: Function|null, ledgerGenerate?: Function|null, editGenerate?: Function|null, carriedPicks?: any[]|null, carriedChoices?: any[]|null, onChoices?: (rec: any[]) => void, onPicks?: (o: {entries: any[], kept: {line: number, rule: number, entry: any}[]}) => void,
95
+ * pickGenerate?: Function|null, ledgerGenerate?: Function|null, noteFn?: Function|null, onJobLines?: ((jobLines: any[]) => void)|null, editGenerate?: Function|null, carriedPicks?: any[]|null, carriedChoices?: any[]|null, onChoices?: (rec: any[]) => void, onPicks?: (o: {entries: any[], kept: {line: number, rule: number, entry: any}[]}) => void,
98
96
  * confirmGenerate?: Function|null, isRepo?: boolean,
99
97
  * langResult?: {kind: string, candidates?: string[], [k: string]: any}|null}} o
100
98
  * @returns {Promise<{ok: boolean, refusal: Refusal|null, verdictType: string|null,
101
- * closeDecl: any, seedRef: string|null, authoring: any, judged: any, reds: Red[],
99
+ * closeDecl: any, seedRef: string|null, authoring: any, reds: Red[],
102
100
  * stop: string|null, cost: any, interview: any, confirmed: any, picked?: {line: number, text: string}[], hasBuiltCheck?: boolean, notBuilt?: {line: number, text: string}[]}>}
103
101
  */
104
- export function authorCloseForJob({ answers, repoPath, lang, verdictType, questions, jobLines, inputs, generate, provider, seedRef, scout, listing, ceilingUsd, rates, draftThinking, writeScope, judgeModel, onPhase, onCall, seedFn, scoutFn, listingFn, lookFn, fitFn, fitAsk, onFit, authorFn, authorOpts, pickGenerate, ledgerGenerate, editGenerate, carriedPicks, onPicks, carriedChoices, onChoices, signerFix, proposeFn, compileOpts, ask, confirmGenerate, isRepo, langResult, answerQuestions, }: {
102
+ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questions, jobLines, inputs, generate, provider, seedRef, scout, listing, ceilingUsd, rates, draftThinking, writeScope, onPhase, onCall, seedFn, scoutFn, listingFn, lookFn, authorFn, authorOpts, pickGenerate, ledgerGenerate, noteFn, onJobLines, editGenerate, carriedPicks, onPicks, carriedChoices, onChoices, ask, confirmGenerate, isRepo, langResult, answerQuestions, }: {
105
103
  answers: Record<string | number, any>;
106
104
  repoPath?: string | null;
107
105
  lang: string;
108
106
  jobLines?: {
109
107
  n: number;
110
108
  text: string;
109
+ rule?: string;
110
+ rules?: string[];
111
111
  }[] | null;
112
112
  inputs?: {
113
113
  n: number;
@@ -122,7 +122,6 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
122
122
  scout?: any;
123
123
  listing?: any;
124
124
  ceilingUsd?: number | null;
125
- judgeModel?: string | null;
126
125
  rates?: {
127
126
  in: number;
128
127
  out: number;
@@ -139,19 +138,9 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
139
138
  scoutFn?: Function;
140
139
  listingFn?: Function;
141
140
  lookFn?: Function | null;
142
- fitFn?: Function | null;
143
- fitAsk?: ((question: string) => Promise<string | null>) | null;
144
- onFit?: (fit: {
145
- state: string;
146
- asks: any[];
147
- notFound: any[];
148
- }) => void;
149
141
  authorFn?: Function;
150
142
  authorOpts?: object;
151
143
  writeScope?: string[] | null;
152
- signerFix?: Function | any;
153
- proposeFn?: Function;
154
- compileOpts?: object;
155
144
  ask?: ((step: {
156
145
  kind: string;
157
146
  [k: string]: any;
@@ -191,6 +180,8 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
191
180
  } | null>) | null;
192
181
  pickGenerate?: Function | null;
193
182
  ledgerGenerate?: Function | null;
183
+ noteFn?: Function | null;
184
+ onJobLines?: ((jobLines: any[]) => void) | null;
194
185
  editGenerate?: Function | null;
195
186
  carriedPicks?: any[] | null;
196
187
  carriedChoices?: any[] | null;
@@ -217,7 +208,6 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
217
208
  closeDecl: any;
218
209
  seedRef: string | null;
219
210
  authoring: any;
220
- judged: any;
221
211
  reds: Red[];
222
212
  stop: string | null;
223
213
  cost: any;
@@ -266,14 +256,6 @@ export function assembleSpec(specDraft: any, { closeDecl, verdictType }: {
266
256
  closeDecl: any;
267
257
  verdictType: string;
268
258
  }): any;
269
- /**
270
- * THE one spelling of "a passed calibration gate stands in for the seed red": the
271
- * close carries a judged stage AND the gate ran and passed. A failed or missing
272
- * calibration never satisfies it, and a close with no judged stage never reaches it.
273
- * @param {any[]} judged `judgedStages(closeDecl)` @param {any} calibration `gates.calibration`
274
- * @returns {boolean}
275
- */
276
- export function seedProofIsCalibration(judged: any[], calibration: any): boolean;
277
259
  /**
278
260
  * D9, in code: *nothing JUDGES the close; three mechanical gates plus a
279
261
  * signature.* No LLM validates another LLM's close, here or anywhere.
@@ -287,23 +269,7 @@ export function seedProofIsCalibration(judged: any[], calibration: any): boolean
287
269
  * A close with NO work stage red at seed has nothing to do and is refused
288
270
  * decision-ready — gate-2 round 2's arm B died exactly there, on a mypy that
289
271
  * scanned nothing and therefore read clean.
290
- * 4. THE CALIBRATION GATE (softgreen module 5) — for a close carrying a
291
- * `judged-floor` stage ONLY. The whole judged pipe runs over the signed ten
292
- * and the five arbiter-owned injection artifacts, and anything short of
293
- * 10/10 with itemized reds and 5/5 resisted is an unsignable close. It is
294
- * the ONE gate here that spends money, so it runs LAST — every free refusal
295
- * has already had its chance, and nobody pays to discover a broken
296
- * declaration.
297
- *
298
- * D9.3 AND THE JUDGED CLOSE (2026-08-18 second addendum, ruling 3; hamr: *"fix it now,
299
- * we are delivering softgreen, isn't that the whole point?"*; widened 2026-10-09 to mixed
300
- * closes, hamr: *"a rubric job should check if judge can judge (calibration) and judge
301
- * rules can apply properly to pass ... we can't close everything upfront"*). Gate 3
302
- * protects against a close that cannot fail. A judged stage SKIPS the seed read by ruling
303
- * 8, so it can never show red there. For ANY close carrying a judged stage (pure or
304
- * mixed with mechanical stages), a PASSED calibration gate plays the seed-red role
305
- * (`seedProofIsCalibration`). A close with NO judged stage is UNCHANGED: some work stage
306
- * must be red at the seed. A failed or missing calibration never satisfies it.
272
+ * (There was a fourth, paid gate, the calibration gate of the old judge; it is gone with the old judge, 2026-11-14.)
307
273
  *
308
274
  * Gates 2 and 3 share ONE execution, and that is stated rather than hidden: at
309
275
  * job creation the tree IS the seed, so "does every stage run against the real
@@ -316,13 +282,11 @@ export function seedProofIsCalibration(judged: any[], calibration: any): boolean
316
282
  * comes back is the resolved spec, its hash, and the evidence to sign against.
317
283
  *
318
284
  * @param {{spec: any, workdir: string, seedRef?: string|null, shellCapUsd?: number,
319
- * timeoutMs?: number, seedFn?: Function, listingFn?: Function, seedReadFn?: Function,
320
- * judgeLoop?: Function|null, judgeModel?: string|null, onJudgeCost?: ((c: any) => void)|null,
321
- * calibrateFn?: Function, ceilingUsd?: number|null, priorCalls?: any[]}} o
285
+ * timeoutMs?: number, seedFn?: Function, listingFn?: Function, seedReadFn?: Function}} o
322
286
  * @returns {Promise<{ok: boolean, specHash: string|null, seedRef: string|null,
323
287
  * gates: any, work: any[], guards: any[], stops: any[], reds: Red[], refusal: Refusal|null}>}
324
288
  */
325
- export function prepareSigning({ spec, workdir, seedRef, shellCapUsd, timeoutMs, seedFn, listingFn, seedReadFn, judgeLoop, judgeModel, onJudgeCost, calibrateFn, ceilingUsd, priorCalls, }: {
289
+ export function prepareSigning({ spec, workdir, seedRef, shellCapUsd, timeoutMs, seedFn, listingFn, seedReadFn, }: {
326
290
  spec: any;
327
291
  workdir: string;
328
292
  seedRef?: string | null;
@@ -331,12 +295,6 @@ export function prepareSigning({ spec, workdir, seedRef, shellCapUsd, timeoutMs,
331
295
  seedFn?: Function;
332
296
  listingFn?: Function;
333
297
  seedReadFn?: Function;
334
- judgeLoop?: Function | null;
335
- judgeModel?: string | null;
336
- onJudgeCost?: ((c: any) => void) | null;
337
- calibrateFn?: Function;
338
- ceilingUsd?: number | null;
339
- priorCalls?: any[];
340
298
  }): Promise<{
341
299
  ok: boolean;
342
300
  specHash: string | null;
@@ -26,25 +26,6 @@ export function fellBackLines(authoring: {
26
26
  brokenStages: string[];
27
27
  } | null;
28
28
  } | null): string[];
29
- /**
30
- * THE TWO SIGNED JUDGED ARTIFACTS, as a person reads them before signing
31
- * (softgreen modules 4+5). Absent on a close that judges nothing, which is why
32
- * this returns an EMPTY list rather than a "no card" line: a green close has no
33
- * rubric and saying so every run is noise, not information.
34
- *
35
- * The CARD is printed in full — it is short, it is the whole standard the judge
36
- * will hold the work to, and it is the signer's own words. The CASES are printed
37
- * as a ROSTER (id, verdict, itemized reds) rather than in full: ten real source
38
- * artifacts is a page of code the terminal cannot usefully show, and what a
39
- * signer checks at this surface is that both polarities are there and that each
40
- * red names something they recognise. The artifacts themselves are in the spec
41
- * file, which is named right above this block.
42
- * @param {{closeDecl?: any}} spec the RESOLVED spec
43
- * @returns {string[]}
44
- */
45
- export function rubricLines({ closeDecl }: {
46
- closeDecl?: any;
47
- }): string[];
48
29
  /**
49
30
  * THE CONFIRM TURN'S OPEN QUESTIONS (PRD item 33 M3 piece 4, ruling 5's D3
50
31
  * addendum) — shown at the SIGNING readout, from `authored.json`'s own
@@ -75,32 +56,6 @@ export function openQuestionLines(confirmed: {
75
56
  export function answeredQuestionLines(confirmed: {
76
57
  answeredQuestions?: string[];
77
58
  } | null): string[];
78
- /**
79
- * THE CALIBRATION GATE'S OWN READOUT — the one gate that spends money, and the
80
- * one whose rows a signer has to read case by case.
81
- *
82
- * ITEMIZED, never an aggregate percentage: "9/10" tells a person nothing about
83
- * which line of their own rubric is wrong, and the fix for a miss is a card line
84
- * or a corrected case (§4.3's ceiling). A CASUALTY prints under its own name and
85
- * says so, because a dead judge is not a failed set.
86
- * @param {any} calibration `signing.gates.calibration`
87
- * @returns {string[]}
88
- */
89
- export function calibrationLines(calibration: any): string[];
90
- /**
91
- * The calibration gate's real result as one line a person reads next to the step (hamr, 2026-10-09: the panel
92
- * showed `calibrating ✓` over a gate that graded 8 of 10 and let 2 attack styles leak). PASS IS THE GATE'S OWN:
93
- * `ok` is `calibration.ok` as `runCalibration` decided it (every case right as a SET of reds, every style
94
- * resisted), never recomputed here, so there is no second spelling of the floor. The counts are read from the
95
- * record (`graded[].ok` is `compareExpectation`, which compares reds as sets); the denominators are the live
96
- * constants (CALIBRATION_SIZE, the battery length), so a gate that stopped part-way reads "x of 10", not "x of x".
97
- * @param {any} calibration `signing.gates.calibration`
98
- * @returns {{ok: boolean, note: string}|null} null when the gate was not reached
99
- */
100
- export function calibrationSummary(calibration: any): {
101
- ok: boolean;
102
- note: string;
103
- } | null;
104
59
  /**
105
60
  * THE AUTHORING CEILING, parsed from `--budget`. Housed here for the same reason
106
61
  * the readout above is: the runner is a script, and a rule no test can reach is a
@@ -193,12 +148,9 @@ export function plainKinds(): string[];
193
148
  * An unknown code is NEVER dropped: it becomes a generic sentence that still
194
149
  * quotes the code and path, under the kind `unmapped`.
195
150
  * @param {PlainRed[]} reds
196
- * @param {{cases?: any}} [o] the proposed cases, to name a case by its own id
197
151
  * @returns {PlainReason[]}
198
152
  */
199
- export function plainReasons(reds: PlainRed[], { cases }?: {
200
- cases?: any;
201
- }): PlainReason[];
153
+ export function plainReasons(reds: PlainRed[]): PlainReason[];
202
154
  /**
203
155
  * WHY one drafting try was refused, in the code's own words: the unique `detail` of each red it raised (the same sentences
204
156
  * `draftStopText` quotes at a stop), else the plain `reason` the loop gave (a seed-read failure raises no red). Scrubbed,
@@ -222,23 +174,6 @@ export function declarationRecord(declaration: unknown): {
222
174
  declarationText: string;
223
175
  declarationCut: true;
224
176
  } | {};
225
- /**
226
- * THE MESSAGE a person reads when the rubric proposal was refused. Both doors
227
- * (the panel's failed step and the CLI) print exactly this.
228
- * @param {{stop: string, reds: PlainRed[], cases?: any, spend?: {knownUsd?: number|null, spendComplete?: boolean|null}|null,
229
- * source?: 'proposal'|'signer'}} o
230
- * @returns {string}
231
- */
232
- export function proposalStopText({ stop, reds, cases, spend, source }: {
233
- stop: string;
234
- reds: PlainRed[];
235
- cases?: any;
236
- spend?: {
237
- knownUsd?: number | null;
238
- spendComplete?: boolean | null;
239
- } | null;
240
- source?: "proposal" | "signer";
241
- }): string;
242
177
  /**
243
178
  * @param {{stop: string, reds?: PlainRed[]|null, refusal?: {detail?: string}|null,
244
179
  * spend?: {knownUsd?: number|null, spendComplete?: boolean|null}|null, wholeJob?: boolean}} o `wholeJob` - a rubric job on the person's
@@ -258,14 +193,11 @@ export function draftStopText({ stop, reds, refusal, spend, wholeJob }: {
258
193
  wholeJob?: boolean;
259
194
  }): string;
260
195
  /**
261
- * Plain sentences for the reds of a refused signing, one or more per red. Card and practice-case reds reuse the
262
- * proposal table; an unknown code is a generic sentence that quotes the code.
263
- * @param {PlainRed[]} reds @param {{cases?: any}} [o]
196
+ * Plain sentences for the reds of a refused signing, one or more per red. An unknown code is a generic sentence that quotes the code.
197
+ * @param {PlainRed[]} reds
264
198
  * @returns {{kind: string, sentence: string, todo: string, red: PlainRed}[]}
265
199
  */
266
- export function signingReasons(reds: PlainRed[], { cases }?: {
267
- cases?: any;
268
- }): {
200
+ export function signingReasons(reds: PlainRed[]): {
269
201
  kind: string;
270
202
  sentence: string;
271
203
  todo: string;
@@ -276,16 +208,15 @@ export function signingReasons(reds: PlainRed[], { cases }?: {
276
208
  export function signingKinds(): string[];
277
209
  /**
278
210
  * THE MESSAGE a person reads when the signing gates refuse. The panel's failed step and the CLI print exactly this.
279
- * @param {{reds: PlainRed[], refusal?: {detail?: string}|null, cases?: any, noCheck?: boolean,
211
+ * @param {{reds: PlainRed[], refusal?: {detail?: string}|null, noCheck?: boolean,
280
212
  * spend?: {knownUsd?: number|null, spendComplete?: boolean|null}|null}} o `noCheck` = the check block has no built check (block.hasBuiltCheck() is false): the stop is the end check's own words
281
213
  * @returns {string}
282
214
  */
283
- export function signingStopText({ reds, refusal, cases, spend, noCheck }: {
215
+ export function signingStopText({ reds, refusal, spend, noCheck }: {
284
216
  reds: PlainRed[];
285
217
  refusal?: {
286
218
  detail?: string;
287
219
  } | null;
288
- cases?: any;
289
220
  noCheck?: boolean;
290
221
  spend?: {
291
222
  knownUsd?: number | null;
@@ -295,15 +226,12 @@ export function signingStopText({ reds, refusal, cases, spend, noCheck }: {
295
226
  /**
296
227
  * The reds as the drafting log keeps them: every structured field, the plain
297
228
  * sentence beside it, every string secret-scrubbed and bounded, the list capped.
298
- * @param {PlainRed[]} reds @param {{cases?: any, signing?: boolean}} [o] `signing`: the reds are the signing gates', worded by signingReasons
229
+ * @param {PlainRed[]} reds @param {{signing?: boolean}} [o] `signing`: the reds are the signing gates', worded by signingReasons
299
230
  * @returns {Record<string, any>[]}
300
231
  */
301
- export function redsRecord(reds: PlainRed[], { cases, signing }?: {
302
- cases?: any;
232
+ export function redsRecord(reds: PlainRed[], { signing }?: {
303
233
  signing?: boolean;
304
234
  }): Record<string, any>[];
305
- /** the stops this module explains in plain words */
306
- export const PLAIN_PROPOSAL_STOPS: readonly string[];
307
235
  /**
308
236
  * ONE owner of the plain sentence for every drafting stop code (hamr 2026-10-09: "a user should get a reason they can
309
237
  * understand and do something about"). What happened; `STOP_TODO` below overrides the default "draft again" where that is wrong.
@@ -1,4 +1,4 @@
1
- /** @typedef {{key: string, rowKey: string, line: number, rule: number, source: 'look', ask: 'reading'|'cant-check'|'no-check'|'check', ruleText: string, question: string, counted: boolean, reading?: string, check?: Record<string, any>, pairRule?: number}} BlockAsk */
1
+ /** @typedef {{key: string, rowKey: string, line: number, rule: number, source: 'look', ask: 'reading'|'cant-check'|'no-check'|'check', ruleText: string, question: string, counted: boolean, reading?: string, check?: Record<string, any>}} BlockAsk */
2
2
  /**
3
3
  * The questions the block has open, in the order the person meets them: the look's readings, then the look's can't-checks, then the pick path's asks (a proposal or a can't-check about a rule the pick path owns) in rule order (a proposal is not counted toward the 3-ask cap).
4
4
  * A can't-check about a rule the PICK path owns (`scoped`: src/checkpick.js scopedRules, every `~` rule of a file job) is the pick path's own ask, `no-check`, in fwd's words (a "Line N, guardrail ...: I can't check this" ask
@@ -33,5 +33,4 @@ export type BlockAsk = {
33
33
  counted: boolean;
34
34
  reading?: string;
35
35
  check?: Record<string, any>;
36
- pairRule?: number;
37
36
  };
@@ -14,7 +14,6 @@ export function renderCard(rows: Row[]): {
14
14
  */
15
15
  /** the card's fixed words, one spelling (the renderer reads them; a test reads them too) */
16
16
  export const CARD_T: Readonly<{
17
- agreed: "you agreed:";
18
17
  count: "result count";
19
18
  cited: "every claim is backed by a quote copied from";
20
19
  theInput: "the input";
@@ -84,10 +83,14 @@ export class CheckBlock {
84
83
  deltaLog: any[];
85
84
  /** @type {any} */
86
85
  closeCache: any;
86
+ /** @type {Map<number, 'yes'|'no'|'failed'>} the note question's answer per facts-only line (src/noteask.js; code decides what it means) */
87
+ notes: Map<number, "yes" | "no" | "failed">;
87
88
  textOf(source: string | undefined): string;
88
89
  /** @param {number} line @param {string} [kind] */
89
90
  rowsOn(line: number, kind?: string): Row[];
90
91
  ruleRows(line: number): Row[];
92
+ /** does a `~` rule's own row say it is Not checked? Then its row is the ONE place the rule is said (its reason: the look's sentence, or the person's Drop) @param {number} line @param {number} rule */
93
+ saysRule(line: number, rule: number): boolean;
91
94
  /** every word the person wrote on a line: the line and its `~` rules */
92
95
  said(line: number): string;
93
96
  /** @param {Row} r @returns {Row} the row as stored (a repeated key gets `#2`) */
@@ -113,8 +116,6 @@ export class CheckBlock {
113
116
  takeJobWord(r: Row): void;
114
117
  /** are the row's words (or its count number, or the name it asks for a fact by) in the job line or its `~` rules? Normalised, case-insensitive */
115
118
  inJob(r: Row): any;
116
- /** a `~` line an agreed answer wrote (or a carried pair partner) is checked by the rule it was agreed from: one check, both numbers */
117
- matchFollow(r: Row): void;
118
119
  /** a `!` count row is built unless a `~` rule on its line already names the number */
119
120
  matchCount(r: Row): void;
120
121
  matchRule(r: Row): void;
@@ -130,8 +131,6 @@ export class CheckBlock {
130
131
  n: number;
131
132
  text: string;
132
133
  }, lineParts: any[], lineRows: string[][], factLines: Set<number>): void;
133
- /** the follow rows of a row (its agreed or carried `~` lines) */
134
- followsOf(r: Row): Row[];
135
134
  /**
136
135
  * The fact(s) a fact-like row builds, checked alone through the bareguard shapes and against the facts already on the line.
137
136
  * @param {Row} r @param {any[]} onLine the facts already built on this line @returns {{fresh: any[], src: string, names: string[]} | {why: string}}
@@ -147,6 +146,20 @@ export class CheckBlock {
147
146
  buildDefaults(l: {
148
147
  n: number;
149
148
  }, lineParts: any[], lineRows: string[][], factLines: Set<number>): void;
149
+ /**
150
+ * The `$` note row of a facts-only line (build 2026-11-14 (b)): the one note question said yes -> a countable nonEmpty text part sits beside the facts (the existing keep-both shape), so the brief
151
+ * is FACTS AND TEXT and text-present is floored; no -> nothing; the call failed -> a Not checked row in plain words. One owner of the row and its part.
152
+ */
153
+ buildNote(l: {
154
+ n: number;
155
+ }, lineParts: any[], lineRows: string[][]): void;
156
+ /** the job lines that ended up facts-only (a fact part and no text beside it): the lines the note question is about. Reconciles first. @returns {number[]} */
157
+ factOnlyLines(): number[];
158
+ /** the note question's answers, `{line, answer: 'yes'|'no'|'failed'}`; the whole list is reconciled again @param {{line: number, answer: 'yes'|'no'|'failed'}[]} answers */
159
+ setNotes(answers: {
160
+ line: number;
161
+ answer: "yes" | "no" | "failed";
162
+ }[]): void;
150
163
  ask(): any[];
151
164
  hasOpenQuestions(): boolean;
152
165
  hasPendingDelta(): boolean;
@@ -157,31 +170,33 @@ export class CheckBlock {
157
170
  ok: false;
158
171
  why: string;
159
172
  };
160
- /** the `~` row `partner` is checked by `source` (one check, both rule numbers) */
161
- follow(source: Row, partner: Row): void;
162
173
  /**
163
- * Revise keeps the picks of the last draft (am17/am18/am21, `src/pickrecord.js` `matchRecord`): a kept pick settles its rule and its added `~` line follows it; a kept left rule is
164
- * left; an edited added line (`pairRule`) is the row asked and its source follows it.
165
- * @param {{picks?: {line: number, rule: number, check: any, added?: string, own?: boolean}[], left?: {line: number, rule: number}[]}} kept
166
- * @param {{line: number, rule: number, pairRule?: number}[]} [asked] the rules still asked (a `pairRule` marks an edited added line)
174
+ * The job lines as the list now holds them: every line's `~` rules are the rule rows' own words, in rule order (a replaced rule keeps its place and number). ONE owner of the job text after an answer.
175
+ * @template {{n: number, text: string}} L @param {L[]} jobLines @returns {(L & {rule: string, rules: string[]})[]}
176
+ */
177
+ jobLinesView<L extends {
178
+ n: number;
179
+ text: string;
180
+ }>(jobLines: L[]): (L & {
181
+ rule: string;
182
+ rules: string[];
183
+ })[];
184
+ /**
185
+ * Revise keeps the picks of the last draft (am17/am18, `src/pickrecord.js` `matchRecord`): a kept pick settles its rule (its words are the final rule's words) and a kept left rule is left.
186
+ * @param {{picks?: {line: number, rule: number, check: any, own?: boolean}[], left?: {line: number, rule: number}[]}} kept
167
187
  */
168
188
  carry({ picks, left }: {
169
189
  picks?: {
170
190
  line: number;
171
191
  rule: number;
172
192
  check: any;
173
- added?: string;
174
193
  own?: boolean;
175
194
  }[];
176
195
  left?: {
177
196
  line: number;
178
197
  rule: number;
179
198
  }[];
180
- }, asked?: {
181
- line: number;
182
- rule: number;
183
- pairRule?: number;
184
- }[]): void;
199
+ }): void;
185
200
  /** @param {{label?: string, pre?: boolean, edits?: any[]}} delta `pre` = a reply that is not a drafter try (the suggest call): it does not count against the tries */
186
201
  applyDelta(delta: {
187
202
  label?: string;
@@ -48,7 +48,7 @@ export function isEmptyList(rows: Row[]): boolean;
48
48
  export function ledgerRecord(rows: Row[]): ({
49
49
  key: string;
50
50
  line: number;
51
- rowKind: "fact" | "phrase" | "rule" | "count" | "numbers" | "cited" | "floor";
51
+ rowKind: "fact" | "phrase" | "rule" | "count" | "numbers" | "cited" | "note" | "floor";
52
52
  from: "rule" | "agent" | "default" | "pick" | "look";
53
53
  by: "you" | "agent" | "default";
54
54
  words: string[];
@@ -111,7 +111,7 @@ export const LEDGER_SCHEMA: Readonly<{
111
111
  export type Row = {
112
112
  key: string;
113
113
  line: number;
114
- kind: "rule" | "fact" | "cited" | "count" | "phrase" | "numbers" | "floor";
114
+ kind: "rule" | "fact" | "cited" | "count" | "phrase" | "numbers" | "note" | "floor";
115
115
  from: "rule" | "pick" | "look" | "agent" | "default";
116
116
  by: "you" | "agent" | "default";
117
117
  words: string[];
@@ -54,6 +54,11 @@ export function suggestUserText(lines: {
54
54
  * @param {string} text @returns {Record<string, any>|null}
55
55
  */
56
56
  export function countCheck(text: string): Record<string, any> | null;
57
+ /**
58
+ * The check a counting rule's own words already ARE ("exactly 3 list items" -> listItems 3), or null. No obvious asks (hamr 2026-11-14): such a rule is settled as written, never proposed back to the person.
59
+ * @param {string} text @returns {Record<string, any>|null}
60
+ */
61
+ export function obviousCheck(text: string): Record<string, any> | null;
57
62
  /**
58
63
  * What the call's answer comes to, one row per scoped rule: the check kept (or null) and why it was dropped. A rule the answer never mentions is dropped as `no entry`; an
59
64
  * entry for a rule that was not sent is ignored.
package/types/cli.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * code, so `bin/bareloop.mjs` can set `process.exitCode` and let node flush
4
4
  * queued stdout on its own (F-something: `process.exit()` can discard it).
5
5
  * @param {string[]} argv
6
- * @param {{ env?: Record<string,string|undefined>, stdout?: any, stderr?: any, cwd?: string, provider?: any, providerFor?: any, judgeProvider?: any, judgeModel?: string|null, now?: () => number, stdin?: any, interactive?: boolean, runlistHome?: string, keysHome?: string, processEnv?: Record<string,string|undefined> }} deps
6
+ * @param {{ env?: Record<string,string|undefined>, stdout?: any, stderr?: any, cwd?: string, provider?: any, providerFor?: any, now?: () => number, stdin?: any, interactive?: boolean, runlistHome?: string, keysHome?: string, processEnv?: Record<string,string|undefined> }} deps
7
7
  * @returns {Promise<number>}
8
8
  */
9
9
  export function main(argv: string[], deps?: {
@@ -13,8 +13,6 @@ export function main(argv: string[], deps?: {
13
13
  cwd?: string;
14
14
  provider?: any;
15
15
  providerFor?: any;
16
- judgeProvider?: any;
17
- judgeModel?: string | null;
18
16
  now?: () => number;
19
17
  stdin?: any;
20
18
  interactive?: boolean;
@@ -7,15 +7,6 @@ export function isDeclaredClose(job: any): boolean;
7
7
  * `offer` and `needs` pass through untouched when a declaration carries them
8
8
  * (v1's schema does not let one), so `checkMenu`'s derivation is unchanged.
9
9
  *
10
- * THE JUDGE TIER RIDES ALONG, and it rides as a STAMP for the same reason `offer`
11
- * does. The tier that graded this close's calibration set is a CLOSE-level fact
12
- * (`calibration.judgeModel`), and the stage that would buy a judge call is a STAGE;
13
- * `runStage` is handed stages and never the declaration they came out of. Rather than
14
- * plumb a second close-level channel down through every executor seam, the one place
15
- * that already turns a declaration into stages carries it across — and it carries it
16
- * from the SIGNED bytes, so a stage can never name a tier the signature does not.
17
- * `runJudgedFloor` refuses a mismatch; the absence of a stamp is the SPEC gate's
18
- * business (`validateCloseDecl` reds a set with no model), never a runtime fall-back.
19
10
  * @param {any} closeDecl
20
11
  * @returns {any[]|null} null when this is not a declaration
21
12
  */
@@ -53,7 +44,7 @@ export function declaredStages(closeDecl: any): any[] | null;
53
44
  *
54
45
  * @param {any} closeDecl
55
46
  * @param {{at?: string, listing?: string[]|null, deferListing?: boolean,
56
- * catalogue?: Record<string, any>, verdictType?: string|null, writeScope?: string[]|null, jobLines?: {n: number}[]|null,
47
+ * catalogue?: Record<string, any>, verdictType?: string|null, jobLines?: {n: number}[]|null,
57
48
  * inputLabels?: string[]|null}} [opts]
58
49
  * @returns {{ok: boolean, reds: Red[], closeDecl: any, grounded: boolean,
59
50
  * scoped: {scoped: boolean, via: string|null},
@@ -65,7 +56,6 @@ export function validateCloseDecl(closeDecl: any, opts?: {
65
56
  deferListing?: boolean;
66
57
  catalogue?: Record<string, any>;
67
58
  verdictType?: string | null;
68
- writeScope?: string[] | null;
69
59
  jobLines?: {
70
60
  n: number;
71
61
  }[] | null;
@@ -115,11 +105,7 @@ export function guardNames(closeDecl: any, verdictType: string): string[];
115
105
  * @param {{timeoutMs?: number, cwd?: string, seedRef?: string,
116
106
  * seedTrees?: any, gapCap?: number, maxBuffer?: number, baselineMode?: 'auto'|'worktree',
117
107
  * humanRuling?: {decision: string, text?: string|null}|null,
118
- * judgeLoop?: ((o: {system: string}) => any)|null,
119
- * judgeModel?: string|null,
120
- * onJudgeCost?: ((c: any) => void)|null,
121
- * onRubricEvidence?: ((e: any) => void)|null,
122
- * callBounds?: (() => {timeoutMs?: number, deadlineMs?: number})|null}} [opts]
108
+ * onRubricEvidence?: ((e: any) => void)|null}} [opts]
123
109
  * @returns {Promise<any>}
124
110
  */
125
111
  export function runDeclaredStages(stages: any[], redact?: (s: string) => string, opts?: {
@@ -134,16 +120,7 @@ export function runDeclaredStages(stages: any[], redact?: (s: string) => string,
134
120
  decision: string;
135
121
  text?: string | null;
136
122
  } | null;
137
- judgeLoop?: ((o: {
138
- system: string;
139
- }) => any) | null;
140
- judgeModel?: string | null;
141
- onJudgeCost?: ((c: any) => void) | null;
142
123
  onRubricEvidence?: ((e: any) => void) | null;
143
- callBounds?: (() => {
144
- timeoutMs?: number;
145
- deadlineMs?: number;
146
- }) | null;
147
124
  }): Promise<any>;
148
125
  /**
149
126
  * The trend reader's input for ONE close verdict, whichever executor produced
@@ -190,12 +167,6 @@ export const CLOSE_DECL_FIELDS: readonly string[];
190
167
  export const SIGNED_ROW_FIELDS: readonly string[];
191
168
  /** the states a signed row may end in */
192
169
  export const SIGNED_STATES: readonly string[];
193
- /** what a stored calibration set carries, ENUMERATED: the frozen cases and the judge
194
- * tier that graded them. Both are inside the spec, so `jobSpecHash` covers both — which
195
- * is the whole mechanism behind "a judge-model bump forces a full recalibration"
196
- * (src/judged.js, `resolveJudge`): the field moves, the hash moves, the signature dies,
197
- * and the re-sign re-runs the gate. Anything else in there is a field nobody reads. */
198
- export const CALIBRATION_FIELDS: readonly string[];
199
170
  /**
200
171
  * The prefix M1 puts on EVERY gap line of a declared stage (its `ctx.gapKeep`).
201
172
  * A literal, so the anchored pattern below is exact.
@@ -257,8 +228,7 @@ export const HUMAN_CHECKPOINTS: readonly string[];
257
228
  *
258
229
  * `hard` is by CONSTRUCTION: every mechanical kind is a command whose measurement
259
230
  * is the truth. `hitl` joined it at N4 slice 1, and `soft` at softgreen module 3
260
- * — each only because its kind is genuinely LIVE (`human-confirms`, then
261
- * `judged-floor`): the widening and the kind go in one commit, or this table
231
+ * — each only because its kind is genuinely LIVE (`human-confirms`): the widening and the kind go in one commit, or this table
262
232
  * admits a class the executor cannot render.
263
233
  *
264
234
  * `hitl` STAYS despite the class's retirement (PRD v1.71: the human stage moved
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { makeSpine } from "./spine.js";
2
2
  export { runPlan } from "./planrun.js";
3
3
  export { workBranchName } from "./workbranch.js";
4
4
  export { answerReviewDoor } from "./reviewdoor.js";
5
+ export { resolveJudge } from "./judged.js";
5
6
  export { main as cliMain } from "./cli.js";
6
7
  export { ralph, runClose, runStages, CLOSE_FAULTS } from "./ralph.js";
7
8
  export { globToPrefix, scanSecrets } from "./validate.js";
@@ -14,10 +15,7 @@ export { renderListing, selectionPrompt } from "./selection.js";
14
15
  export { validateEnvelope, resolveTrySpec, resolveReuse, reuseSpecHash, selectBridge, runReuse, REUSE_GRADED_RED, readResume, resumeTreeGate, CHECKPOINT_OUTCOMES, PAUSE_TTL_MS, checkpointAgeGate, applyDoorDecision, writeRunGreenRow } from "./reuse.js";
15
16
  export { classifyIncidents, foldLedger, ledgerDeltas, updateLedger, LEDGER_CLASSES, VOUCHED_RATE_SOURCES, rateProvenance, spendProvenance } from "./ledger.js";
16
17
  export { readShimArm, READ_SHIM_CAP, READ_SHIM_STRATEGY, READ_SHIM_DIFF_STRATEGY } from "./readshim.js";
17
- export { runDeclaredClose, runStage, seedRead, seedAtHead, LIVE_KINDS, STOP_FAULTS, JUDGED_MARKER, HUMAN_DECISIONS, SEED_EXEMPT_KINDS, normalizeHumanRuling, resolveHumanRuling, JUDGE_ATTEMPTS, MAX_JUDGED_PATHS, DOOR_OPEN_OUTCOMES, REVIEW_DOOR_CLASSES, doorOpens, mechanicalStages } from "./kinds.js";
18
- export { resolveJudge, JUDGE_RULES, JUDGE_RULE_IDS, runLocate, decide, CALIBRATION_SIZE, validateCalibrationSet, expectedOf } from "./judged.js";
19
- export { proposeJudgedArtifacts, signJudgedArtifacts, foldJudgedArtifacts } from "./cardauthor.js";
20
- export { runCalibration, INJECTION_LOCATE_BATTERY, CASUALTY_AXES } from "./calibrate.js";
18
+ export { runDeclaredClose, runStage, seedRead, seedAtHead, LIVE_KINDS, STOP_FAULTS, JUDGED_MARKER, HUMAN_DECISIONS, SEED_EXEMPT_KINDS, normalizeHumanRuling, resolveHumanRuling, DOOR_OPEN_OUTCOMES, REVIEW_DOOR_CLASSES, doorOpens, mechanicalStages } from "./kinds.js";
21
19
  export { validateDeclaration, KIND_CATALOGUE, LOCKED_KINDS, genreEnv, genreInstruments, LOCKED_CLASSES, CLASS_BATTERIES, classGuards, closeCeiling, NEVER_OFFERED_KINDS } from "./authoring.js";
22
20
  export { runAuthorScout, buildSeedListing, AUTHOR_SCOUT_VERBS, SCOUT_ATTEMPTS, SCOUT_RETRY_CAUSES } from "./authorscout.js";
23
21
  export { scrubRaw, RAW_PERSIST_MAX } from "./text.js";
package/types/job.d.ts CHANGED
@@ -30,6 +30,12 @@ export function validateBaseUrl(value: unknown): string | null;
30
30
  * @param {Record<string, any>} spec @returns {'plain'|'mcp'|'tickets'}
31
31
  */
32
32
  export function flowTypeOf(spec: Record<string, any>): "plain" | "mcp" | "tickets";
33
+ /**
34
+ * Is this signed spec an OLD job: one that carries a `judged-floor` stage (the old judge) or a job line with a `PASS:` / `FAIL:` rule (the old examples)?
35
+ * ONE reader for every door that takes a signed spec back in (Reuse, a scheduled fire, an exported bundle).
36
+ * @param {Record<string, any>} spec @returns {string|null} the plain refusal, or null when the spec is not an old job
37
+ */
38
+ export function oldJobWords(spec: Record<string, any>): string | null;
33
39
  /**
34
40
  * Validate an operator-owned job spec (`schema: "job-v1"`). Never throws on
35
41
  * JSON text or plain parsed data — the ingest contract; a live object with a
@@ -284,6 +290,8 @@ export const FLOW_TYPE_LABELS: Readonly<{
284
290
  mcp: "MCP";
285
291
  tickets: "Tickets MCP";
286
292
  }>;
293
+ /** hamr 2026-11-14 (rubric vs deterministic split, piece 6): the words for a job made with PASS/FAIL examples or the old judge, which are gone. Old runs are not repaired. */
294
+ export const OLD_JOB_WORDS: "This job was made with PASS/FAIL examples or the old judge, which are gone. Draft it fresh.";
287
295
  /**
288
296
  * The fields a "Reuse workflow" run may change: where the work lands (the write fence, `writeScope`, and a
289
297
  * `destination`/`source` where a spec ever carries them), the `inputs` the person pointed at (P7: Inputs is open on a reuse) and the two ceilings. Everything else in a signed spec is