bareloop 0.56.0 → 0.58.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.
- package/CHANGELOG.md +80 -0
- package/README.md +3 -3
- package/bareloop.context.md +75 -214
- package/package.json +2 -2
- package/src/authorflow.js +71 -136
- package/src/authoring.js +5 -124
- package/src/authorjob.js +125 -417
- package/src/authorreadout.js +105 -355
- package/src/authorrun.js +70 -234
- package/src/authorscout.js +9 -1
- package/src/blockasks.js +12 -17
- package/src/bundlerun.js +4 -1
- package/src/checkblock.js +297 -75
- package/src/checklist.js +1 -1
- package/src/checkpick.js +9 -5
- package/src/cli.js +3 -3
- package/src/declaredclose.js +45 -112
- package/src/destpoint.js +1 -1
- package/src/draftspend.js +20 -4
- package/src/fencepointcall.js +76 -0
- package/src/guarddescriptions.js +14 -0
- package/src/index.js +3 -43
- package/src/interviewrun.js +13 -8
- package/src/job.js +20 -1
- package/src/jobblock.js +11 -46
- package/src/judged.js +13 -1229
- package/src/kinds.js +10 -348
- package/src/noteask.js +124 -0
- package/src/pagedry.js +27 -5
- package/src/pagemap.js +7 -29
- package/src/pagerules.js +18 -3
- package/src/panel/authorroutes.js +15 -4
- package/src/panel/authorsession.js +201 -167
- package/src/panel/importrun.js +0 -1
- package/src/panel/index.html +43 -18
- package/src/panel/jobplan.js +54 -19
- package/src/panel/server.js +90 -69
- package/src/panel/status.js +3 -0
- package/src/pickrecord.js +15 -54
- package/src/planrun.js +4 -48
- package/src/promptregisters.js +7 -17
- package/src/providerrows.js +0 -36
- package/src/providers.js +4 -25
- package/src/questionbox.js +34 -30
- package/src/reviewdoor.js +1 -1
- package/src/rowresults.js +69 -0
- package/src/rubricstep.js +136 -28
- package/src/run.js +2 -15
- package/src/stagewords.js +24 -0
- package/src/userrun.js +14 -111
- package/types/authorflow.d.ts +51 -137
- package/types/authoring.d.ts +1 -14
- package/types/authorjob.d.ts +14 -55
- package/types/authorreadout.d.ts +52 -80
- package/types/authorrun.d.ts +20 -0
- package/types/blockasks.d.ts +5 -11
- package/types/checkblock.d.ts +147 -28
- package/types/checklist.d.ts +2 -2
- package/types/checkpick.d.ts +5 -3
- package/types/cli.d.ts +1 -3
- package/types/declaredclose.d.ts +5 -33
- package/types/draftspend.d.ts +16 -2
- package/types/fencepointcall.d.ts +68 -0
- package/types/guarddescriptions.d.ts +7 -0
- package/types/index.d.ts +2 -4
- package/types/job.d.ts +8 -0
- package/types/jobblock.d.ts +8 -38
- package/types/judged.d.ts +7 -357
- package/types/kinds.d.ts +4 -104
- package/types/noteask.d.ts +76 -0
- package/types/pagedry.d.ts +13 -0
- package/types/pagemap.d.ts +2 -5
- package/types/pagerules.d.ts +7 -0
- package/types/panel/authorsession.d.ts +37 -5
- package/types/panel/jobplan.d.ts +15 -3
- package/types/panel/server.d.ts +46 -13
- package/types/panel/status.d.ts +5 -0
- package/types/pickrecord.d.ts +8 -13
- package/types/planrun.d.ts +1 -22
- package/types/providerrows.d.ts +0 -31
- package/types/providers.d.ts +3 -19
- package/types/questionbox.d.ts +20 -6
- package/types/rowresults.d.ts +23 -0
- package/types/rubricstep.d.ts +43 -7
- package/types/run.d.ts +1 -20
- package/types/stagewords.d.ts +11 -0
- package/types/userrun.d.ts +0 -1
- package/src/calibrate.js +0 -702
- package/src/cardauthor.js +0 -502
- package/src/fitcheck.js +0 -168
- package/types/calibrate.d.ts +0 -201
- package/types/cardauthor.d.ts +0 -358
- package/types/fitcheck.d.ts +0 -119
package/src/checklist.js
CHANGED
|
@@ -42,7 +42,7 @@ export function weekTokens(t) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* @typedef {{key: string, line: number, kind: 'rule'|'fact'|'cited'|'count'|'phrase'|'numbers'|'floor', from: 'rule'|'pick'|'look'|'agent'|'default', by: 'you'|'agent'|'default',
|
|
45
|
+
* @typedef {{key: string, line: number, kind: 'rule'|'fact'|'cited'|'count'|'phrase'|'numbers'|'note'|'floor', from: 'rule'|'pick'|'look'|'agent'|'default', by: 'you'|'agent'|'default',
|
|
46
46
|
* words: string[], text?: string, rule?: number, part?: {line: number, part: number}, source?: string, name?: string, min?: number, max?: number, pick?: string, after?: number[],
|
|
47
47
|
* state: 'listed'|'built'|'not-checked'|'dropped', reason: string|null, forRule?: number, reading?: import('./pagerules.js').Reading}} Row
|
|
48
48
|
*/
|
package/src/checkpick.js
CHANGED
|
@@ -263,6 +263,15 @@ export function countCheck(text) {
|
|
|
263
263
|
return res.kept ? res.check : null;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* 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.
|
|
268
|
+
* @param {string} text @returns {Record<string, any>|null}
|
|
269
|
+
*/
|
|
270
|
+
export function obviousCheck(text) {
|
|
271
|
+
const c = countCheck(text);
|
|
272
|
+
return c !== null && c !== undefined && sameRuleWords(text, plainWords(/** @type {any} */ (c))) ? c : null;
|
|
273
|
+
}
|
|
274
|
+
|
|
266
275
|
/**
|
|
267
276
|
* 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
|
|
268
277
|
* entry for a rule that was not sent is ignored.
|
|
@@ -282,11 +291,6 @@ export function rowsFromAnswer(scoped, args) {
|
|
|
282
291
|
}
|
|
283
292
|
|
|
284
293
|
// ---- the asks (words are item 4's) -------------------------------------------------------------------------------------------------------
|
|
285
|
-
/** the can't-check ask, as the signed words say it */
|
|
286
|
-
export const CANT_CHECK_WORDS = "I can't check this. Your own words, or Not checked?";
|
|
287
|
-
/** how every answer is told, once (fwd am2 item 2's words) */
|
|
288
|
-
export const HOW_TO_ANSWER = (/** @type {number} */ line, /** @type {boolean} */ agree) => `${agree ? 'Answer "agree" to use it, or type your own words' : 'Type your own words'} (your answer is added as a new ~ rule on line ${line}), or answer "drop it" to leave it Not checked.`;
|
|
289
|
-
|
|
290
294
|
/** a part of a rubric-step stage, from a pick: the check's own fields, the rule's words, and the `~` rule numbers it carries out @param {Record<string, any>} check @param {string} text @param {number[]} rules */
|
|
291
295
|
export function partOfPick(check, text, rules) {
|
|
292
296
|
const { rule, ...fields } = check;
|
package/src/cli.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// `bareloop run <bundle>` is a thin door (`src/bundlerun.js`) to the same engine `bareloop
|
|
7
7
|
// run-u` drives (`src/userrun.js`): providers, keys (the keys file / env, any provider the
|
|
8
8
|
// bundle's spec names), judge, monthly limit and readout are that engine's. The test seam is
|
|
9
|
-
// the engine's too: `deps.provider` (and `providerFor
|
|
9
|
+
// the engine's too: `deps.provider` (and `providerFor`) supplies a scripted
|
|
10
10
|
// provider and skips the real-key check (same as `tests/planrun-*.test.js`'s pattern).
|
|
11
11
|
//
|
|
12
12
|
// Money/arbiter rules the bundle door keeps: `--budget`/`--wall` only TIGHTEN a bundle's
|
|
@@ -305,7 +305,7 @@ async function runLauncher(cmd, rest, deps, io, home) {
|
|
|
305
305
|
* code, so `bin/bareloop.mjs` can set `process.exitCode` and let node flush
|
|
306
306
|
* queued stdout on its own (F-something: `process.exit()` can discard it).
|
|
307
307
|
* @param {string[]} argv
|
|
308
|
-
* @param {{ env?: Record<string,string|undefined>, stdout?: any, stderr?: any, cwd?: string, provider?: any, providerFor?: any,
|
|
308
|
+
* @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
|
|
309
309
|
* @returns {Promise<number>}
|
|
310
310
|
*/
|
|
311
311
|
export async function main(argv, deps = {}) {
|
|
@@ -353,7 +353,7 @@ async function mainInner(argv, deps, holder) {
|
|
|
353
353
|
// (`--job`/`--spec`/`--resume`/`--door`/`--decide`/`--text`/
|
|
354
354
|
// `--review-door`/`--approve`/`--registry`/`--workflow`/`--model`/
|
|
355
355
|
// `--read-shim`/`--scout`/`--ticket`/`--anyway`). `deps` is spread first so an injected test
|
|
356
|
-
// seam (`deps.provider`/`providerFor
|
|
356
|
+
// seam (`deps.provider`/`providerFor`) still reaches it,
|
|
357
357
|
// then `env`/`out`/`err` are overridden to the SAME resolved values every
|
|
358
358
|
// other command here prints through, so `run-u`'s output lands on the
|
|
359
359
|
// `stdout`/`stderr` a caller of `main` actually passed.
|
package/src/declaredclose.js
CHANGED
|
@@ -68,14 +68,12 @@
|
|
|
68
68
|
// once instead of once-per-invocation, but `runPlan` has a dozen return paths and
|
|
69
69
|
// a leaked worktree outlives the process that made it.
|
|
70
70
|
|
|
71
|
-
import { runStage, makeSeedTrees, STOP_FAULTS, EXIT_RED
|
|
71
|
+
import { runStage, makeSeedTrees, STOP_FAULTS, EXIT_RED } from './kinds.js';
|
|
72
|
+
import { guardKeyOf } from './rubricstep.js';
|
|
72
73
|
import {
|
|
73
74
|
validateDeclaration, classGuards, genreOwnedEnvNames, ungroundedGenreEnv, DECLARABLE_LANGUAGES, TYPES_GENRE, catalogueForLang, KIND_CATALOGUE, TEXT_GENRE, genreForLang,
|
|
74
75
|
VERDICT_CLASSES, LIVE_CLASSES, NEVER_OFFERED_KINDS,
|
|
75
76
|
} from './authoring.js';
|
|
76
|
-
// the calibration set's own gate lives beside the rulebook it is graded against
|
|
77
|
-
// (src/judged.js) — one opinion about what a judged floor's signed artifacts are
|
|
78
|
-
import { validateCalibrationSet } from './judged.js';
|
|
79
77
|
import { stageGap } from './ralph.js';
|
|
80
78
|
import { isObj, isNonEmptyString } from './validate.js';
|
|
81
79
|
|
|
@@ -102,22 +100,15 @@ export const DECLARED_GENRES = Object.freeze([TYPES_GENRE.name, TEXT_GENRE]);
|
|
|
102
100
|
* constrained to the names the genre OWNS, so it can never become an environment
|
|
103
101
|
* channel of its own.
|
|
104
102
|
*/
|
|
105
|
-
export const CLOSE_DECL_FIELDS = Object.freeze(['genre', 'lang', 'stages', 'notes', 'refused', 'guardLines', '
|
|
103
|
+
export const CLOSE_DECL_FIELDS = Object.freeze(['genre', 'lang', 'stages', 'notes', 'refused', 'guardLines', 'fenceKept', 'picks', 'list', 'genreEnv']);
|
|
106
104
|
|
|
107
105
|
/** the fields of a row of the one check list that the signed close carries (`closeDecl.list`); the row's own words are never signed */
|
|
108
|
-
export const SIGNED_ROW_FIELDS = Object.freeze(['line', 'key', 'from', 'by', 'kind', 'state', 'rule', 'part', 'reason', 'facts']);
|
|
106
|
+
export const SIGNED_ROW_FIELDS = Object.freeze(['line', 'key', 'from', 'by', 'kind', 'state', 'rule', 'part', 'reason', 'facts', 'fence']);
|
|
109
107
|
/** the states a signed row may end in */
|
|
110
108
|
export const SIGNED_STATES = Object.freeze(['built', 'not-checked', 'dropped']);
|
|
111
109
|
const SIGNED_FROM = Object.freeze(['rule', 'pick', 'look', 'agent', 'default']);
|
|
112
110
|
const SIGNED_BY = Object.freeze(['you', 'agent', 'default']);
|
|
113
|
-
const SIGNED_KINDS = Object.freeze(['rule', 'fact', 'cited', 'count', 'phrase', 'numbers', 'floor']);
|
|
114
|
-
|
|
115
|
-
/** what a stored calibration set carries, ENUMERATED: the frozen cases and the judge
|
|
116
|
-
* tier that graded them. Both are inside the spec, so `jobSpecHash` covers both — which
|
|
117
|
-
* is the whole mechanism behind "a judge-model bump forces a full recalibration"
|
|
118
|
-
* (src/judged.js, `resolveJudge`): the field moves, the hash moves, the signature dies,
|
|
119
|
-
* and the re-sign re-runs the gate. Anything else in there is a field nobody reads. */
|
|
120
|
-
export const CALIBRATION_FIELDS = Object.freeze(['cases', 'judgeModel']);
|
|
111
|
+
const SIGNED_KINDS = Object.freeze(['rule', 'fact', 'cited', 'count', 'phrase', 'numbers', 'note', 'floor', 'guard', 'prose', 'fence', 'stage']);
|
|
121
112
|
|
|
122
113
|
/**
|
|
123
114
|
* The prefix M1 puts on EVERY gap line of a declared stage (its `ctx.gapKeep`).
|
|
@@ -184,8 +175,7 @@ export const HUMAN_CHECKPOINTS = Object.freeze([HITL_PAUSE]);
|
|
|
184
175
|
*
|
|
185
176
|
* `hard` is by CONSTRUCTION: every mechanical kind is a command whose measurement
|
|
186
177
|
* is the truth. `hitl` joined it at N4 slice 1, and `soft` at softgreen module 3
|
|
187
|
-
* — each only because its kind is genuinely LIVE (`human-confirms
|
|
188
|
-
* `judged-floor`): the widening and the kind go in one commit, or this table
|
|
178
|
+
* — each only because its kind is genuinely LIVE (`human-confirms`): the widening and the kind go in one commit, or this table
|
|
189
179
|
* admits a class the executor cannot render.
|
|
190
180
|
*
|
|
191
181
|
* `hitl` STAYS despite the class's retirement (PRD v1.71: the human stage moved
|
|
@@ -212,23 +202,11 @@ export function isDeclaredClose(job) {
|
|
|
212
202
|
* `offer` and `needs` pass through untouched when a declaration carries them
|
|
213
203
|
* (v1's schema does not let one), so `checkMenu`'s derivation is unchanged.
|
|
214
204
|
*
|
|
215
|
-
* THE JUDGE TIER RIDES ALONG, and it rides as a STAMP for the same reason `offer`
|
|
216
|
-
* does. The tier that graded this close's calibration set is a CLOSE-level fact
|
|
217
|
-
* (`calibration.judgeModel`), and the stage that would buy a judge call is a STAGE;
|
|
218
|
-
* `runStage` is handed stages and never the declaration they came out of. Rather than
|
|
219
|
-
* plumb a second close-level channel down through every executor seam, the one place
|
|
220
|
-
* that already turns a declaration into stages carries it across — and it carries it
|
|
221
|
-
* from the SIGNED bytes, so a stage can never name a tier the signature does not.
|
|
222
|
-
* `runJudgedFloor` refuses a mismatch; the absence of a stamp is the SPEC gate's
|
|
223
|
-
* business (`validateCloseDecl` reds a set with no model), never a runtime fall-back.
|
|
224
205
|
* @param {any} closeDecl
|
|
225
206
|
* @returns {any[]|null} null when this is not a declaration
|
|
226
207
|
*/
|
|
227
208
|
export function declaredStages(closeDecl) {
|
|
228
209
|
if (!isObj(closeDecl) || !Array.isArray(closeDecl.stages)) return null;
|
|
229
|
-
const calibrationJudgeModel = isObj(closeDecl.calibration) && isNonEmptyString(closeDecl.calibration.judgeModel)
|
|
230
|
-
? closeDecl.calibration.judgeModel
|
|
231
|
-
: null;
|
|
232
210
|
return closeDecl.stages.map((s) => (isObj(s)
|
|
233
211
|
// RULING 5, stamped by the ARBITER rather than trusted from the artefact:
|
|
234
212
|
// a judged or human stage is `offer: false` BY LAW, so `checkMenu` can never
|
|
@@ -240,7 +218,6 @@ export function declaredStages(closeDecl) {
|
|
|
240
218
|
...s,
|
|
241
219
|
gapKeep: DECLARED_GAP_KEEP,
|
|
242
220
|
...(NEVER_OFFERED_KINDS.includes(s.kind) ? { offer: false } : {}),
|
|
243
|
-
...(s.kind === JUDGED_FLOOR_KIND && calibrationJudgeModel !== null ? { calibrationJudgeModel } : {}),
|
|
244
221
|
}
|
|
245
222
|
: s));
|
|
246
223
|
}
|
|
@@ -280,14 +257,14 @@ export function declaredStages(closeDecl) {
|
|
|
280
257
|
*
|
|
281
258
|
* @param {any} closeDecl
|
|
282
259
|
* @param {{at?: string, listing?: string[]|null, deferListing?: boolean,
|
|
283
|
-
* catalogue?: Record<string, any>, verdictType?: string|null,
|
|
260
|
+
* catalogue?: Record<string, any>, verdictType?: string|null, jobLines?: {n: number}[]|null,
|
|
284
261
|
* inputLabels?: string[]|null}} [opts]
|
|
285
262
|
* @returns {{ok: boolean, reds: Red[], closeDecl: any, grounded: boolean,
|
|
286
263
|
* scoped: {scoped: boolean, via: string|null},
|
|
287
264
|
* ceiling: {class: string, kind: string, stage: string|null, locked: boolean}|null}}
|
|
288
265
|
*/
|
|
289
266
|
export function validateCloseDecl(closeDecl, opts = {}) {
|
|
290
|
-
const { at = 'closeDecl', listing = null, catalogue, verdictType = null,
|
|
267
|
+
const { at = 'closeDecl', listing = null, catalogue, verdictType = null, jobLines = null, inputLabels = null } = opts;
|
|
291
268
|
const deferListing = opts.deferListing === true;
|
|
292
269
|
/** @type {Red[]} */
|
|
293
270
|
const reds = [];
|
|
@@ -337,7 +314,9 @@ export function validateCloseDecl(closeDecl, opts = {}) {
|
|
|
337
314
|
const w = `${at}.list[${i}]`;
|
|
338
315
|
if (!isObj(row)) { red('invalid-value', w, 'a row: { line, key, from, by, kind, state, rule?, part?, reason? }'); return; }
|
|
339
316
|
for (const k of Object.keys(row)) if (!SIGNED_ROW_FIELDS.includes(k)) red('unknown-field', `${w}.${k}`, `not a signed row field (the row's own words are never signed); fields: ${SIGNED_ROW_FIELDS.join(', ')}`);
|
|
340
|
-
|
|
317
|
+
// a `guard` or `fence` row is the job's (line 0, once for the whole job); every other row names its job line
|
|
318
|
+
const jobWide = row.kind === 'guard' || row.kind === 'fence';
|
|
319
|
+
if (!Number.isInteger(row.line) || row.line < (jobWide ? 0 : 1) || (jobWide && row.line !== 0)) red('invalid-value', `${w}.line`, jobWide ? 'a guard or fence row belongs to the whole job: line 0' : 'the job line number');
|
|
341
320
|
if (!isNonEmptyString(row.key)) red('invalid-value', `${w}.key`, 'the row key, a non-empty string');
|
|
342
321
|
if (!SIGNED_FROM.includes(row.from)) red('invalid-value', `${w}.from`, `menu: ${SIGNED_FROM.join('|')}`);
|
|
343
322
|
if (!SIGNED_BY.includes(row.by)) red('invalid-value', `${w}.by`, `menu: ${SIGNED_BY.join('|')}`);
|
|
@@ -346,10 +325,17 @@ export function validateCloseDecl(closeDecl, opts = {}) {
|
|
|
346
325
|
if (row.rule !== undefined && !Number.isInteger(row.rule)) red('invalid-value', `${w}.rule`, 'the ~ rule number');
|
|
347
326
|
if (row.part !== undefined && !(isObj(row.part) && Number.isInteger(row.part.line) && Number.isInteger(row.part.part))) red('invalid-value', `${w}.part`, '{ line, part }: the job line and the index of the part that carries the row');
|
|
348
327
|
if (row.reason !== undefined && typeof row.reason !== 'string') red('invalid-value', `${w}.reason`, 'plain words');
|
|
328
|
+
if (row.fence !== undefined && !isNonEmptyString(row.fence)) red('invalid-value', `${w}.fence`, 'the path the write fence keeps, a non-empty string (a repo job\'s ~ rule row the fence keeps)');
|
|
349
329
|
if (row.facts !== undefined && !(Array.isArray(row.facts) && row.facts.every((/** @type {unknown} */ x) => typeof x === 'string'))) red('invalid-value', `${w}.facts`, 'the names of the facts the row built, an array of strings');
|
|
350
330
|
});
|
|
351
331
|
}
|
|
352
332
|
}
|
|
333
|
+
// an OLD signed repo spec may carry the drafter's fence claim (`fenceKept`, unreleased dev sessions): it still loads and Reuses; only its SHAPE is read, nothing reads its words, and a new draft never writes it
|
|
334
|
+
if (closeDecl.fenceKept !== undefined) {
|
|
335
|
+
if (!Array.isArray(closeDecl.fenceKept) || !closeDecl.fenceKept.every((/** @type {any} */ c) => isObj(c) && Number.isInteger(c.line) && c.line >= 1 && Number.isInteger(c.rule) && c.rule >= 1 && isNonEmptyString(c.path))) {
|
|
336
|
+
red('invalid-value', `${at}.fenceKept`, '{line, rule, path} entries (an older signed spec\'s fence claim)');
|
|
337
|
+
}
|
|
338
|
+
}
|
|
353
339
|
// PART 1a: a genre is bound to its language — code languages are TYPES, the rubric-files language is TEXT, and neither may
|
|
354
340
|
// wear the other's label (`lang` is checked just below; an unknown lang reds there)
|
|
355
341
|
if (!DECLARED_GENRES.includes(closeDecl.genre) || closeDecl.genre !== genreForLang(closeDecl.lang)) {
|
|
@@ -435,7 +421,6 @@ export function validateCloseDecl(closeDecl, opts = {}) {
|
|
|
435
421
|
...(deferListing ? { deferListing: true } : {}),
|
|
436
422
|
guards: classGuards({ verdictType: picked, lang: closeDecl.lang }),
|
|
437
423
|
verdictType: picked,
|
|
438
|
-
writeScope,
|
|
439
424
|
jobLines,
|
|
440
425
|
inputLabels,
|
|
441
426
|
envOwned: owned,
|
|
@@ -446,55 +431,6 @@ export function validateCloseDecl(closeDecl, opts = {}) {
|
|
|
446
431
|
});
|
|
447
432
|
for (const r of v.reds) reds.push({ ...r, path: r.path ? `${at}.${r.path}` : at });
|
|
448
433
|
|
|
449
|
-
// ── THE FROZEN CALIBRATION SET (softgreen module 4, design §4.4). It rides
|
|
450
|
-
// the closeDecl rather than a stage's params because it calibrates the RULER,
|
|
451
|
-
// not one stage's parameters — and because it is read BEFORE any stage runs.
|
|
452
|
-
//
|
|
453
|
-
// WHAT IS CHECKED HERE is that a stored set is LEGAL: exactly the signed size,
|
|
454
|
-
// both polarities present, itemized reds naming lines THIS close's card
|
|
455
|
-
// actually carries. WHAT IS NOT is whether the pipe grades it correctly — that
|
|
456
|
-
// is module 5's gate, it costs paid calls, and a validator cannot buy them.
|
|
457
|
-
//
|
|
458
|
-
// A set with NO judged stage to calibrate is its own red: the card lives on
|
|
459
|
-
// the stage, so an orphan set is graded against nothing and would validate
|
|
460
|
-
// clean forever. The reverse (a judged stage with no set) is deliberately NOT
|
|
461
|
-
// redded here — making the set MANDATORY is the signing gate's call, and
|
|
462
|
-
// module 5 owns it.
|
|
463
|
-
if (closeDecl.calibration !== undefined) {
|
|
464
|
-
const judged = judgedStages(closeDecl);
|
|
465
|
-
if (!isObj(closeDecl.calibration)) {
|
|
466
|
-
red('invalid-value', `${at}.calibration`, 'the frozen calibration set, as an object carrying `cases`');
|
|
467
|
-
} else if (judged.length !== 1) {
|
|
468
|
-
red('calibration-orphan', `${at}.calibration`, `this close carries a calibration set and ${judged.length} `
|
|
469
|
-
+ 'judged-floor stage(s). The set calibrates ONE judged ruler against ONE card — with no judged stage it is '
|
|
470
|
-
+ 'graded against nothing and would read clean forever, and with two there is no one card it belongs to',
|
|
471
|
-
{ judgedStages: judged.length });
|
|
472
|
-
} else {
|
|
473
|
-
for (const key of Object.keys(closeDecl.calibration)) {
|
|
474
|
-
if (!CALIBRATION_FIELDS.includes(key)) red('invalid-value', `${at}.calibration.${key}`, `a calibration set carries ${CALIBRATION_FIELDS.map((f) => `\`${f}\``).join(' and ')} and nothing else`);
|
|
475
|
-
}
|
|
476
|
-
// WHICH TIER GRADED THIS SET, and it is REQUIRED rather than optional. A
|
|
477
|
-
// stored set is only worth the judge that graded it (§4.2's safety argument
|
|
478
|
-
// is BA-20's haiku-4.5 injection evidence and nothing else), so a set with
|
|
479
|
-
// no model beside it is a set nobody can attribute — and the `CALIBRATION_FIELDS`
|
|
480
|
-
// docstring's promise that a bump forces recalibration has nothing to fire
|
|
481
|
-
// on. Required HERE and not at the stage, for the same reason the SET's own
|
|
482
|
-
// presence is the signing gate's call and not this validator's: this gate
|
|
483
|
-
// reads a stored artifact and says whether it is legal. The RUNTIME half —
|
|
484
|
-
// refusing to grade when the stored tier is not the tier this run would buy
|
|
485
|
-
// — is the judged stage's (`runJudgedFloor`), reached through the stamp
|
|
486
|
-
// `declaredStages` puts on the stage.
|
|
487
|
-
if (closeDecl.calibration.judgeModel === undefined) {
|
|
488
|
-
red('missing-required', `${at}.calibration.judgeModel`, 'the judge tier this set was GRADED by — a calibration '
|
|
489
|
-
+ 'nobody can attribute to a model is a floor nobody can tell apart from a bumped one');
|
|
490
|
-
} else if (!isNonEmptyString(closeDecl.calibration.judgeModel)) {
|
|
491
|
-
red('invalid-value', `${at}.calibration.judgeModel`, 'the judge tier this set was graded by, as a non-empty string');
|
|
492
|
-
}
|
|
493
|
-
const cv = validateCalibrationSet(closeDecl.calibration.cases, { card: judged[0]?.params?.card ?? null });
|
|
494
|
-
for (const r of cv.reds) reds.push({ ...r, path: r.path ? `${at}.${r.path}` : `${at}.calibration` });
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
434
|
const ok = reds.length === 0;
|
|
499
435
|
return {
|
|
500
436
|
ok,
|
|
@@ -602,17 +538,14 @@ function translate(r, redact) {
|
|
|
602
538
|
* @param {{timeoutMs?: number, cwd?: string, seedRef?: string,
|
|
603
539
|
* seedTrees?: any, gapCap?: number, maxBuffer?: number, baselineMode?: 'auto'|'worktree',
|
|
604
540
|
* humanRuling?: {decision: string, text?: string|null}|null,
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
* onJudgeCost?: ((c: any) => void)|null,
|
|
608
|
-
* onRubricEvidence?: ((e: any) => void)|null,
|
|
609
|
-
* callBounds?: (() => {timeoutMs?: number, deadlineMs?: number})|null}} [opts]
|
|
541
|
+
* onRubricEvidence?: ((e: any) => void)|null, list?: any[]|null}} [opts]
|
|
542
|
+
* `list` = the signed one check list (`closeDecl.list`): given, each stage entry records a RESULT PER ROW (`rows`, plus `unclaimed` words for a gap no row owns), report-only (Addendum 2026-11-14 (c) piece 4)
|
|
610
543
|
* @returns {Promise<any>}
|
|
611
544
|
*/
|
|
612
545
|
export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
613
546
|
const {
|
|
614
547
|
timeoutMs, cwd, seedRef, seedTrees: shared, gapCap, maxBuffer, baselineMode, humanRuling = null,
|
|
615
|
-
|
|
548
|
+
onRubricEvidence = null, list = null,
|
|
616
549
|
} = opts;
|
|
617
550
|
if (!isNonEmptyString(cwd) || !isNonEmptyString(seedRef)) {
|
|
618
551
|
// Refuse rather than guess. A declared close measures against a SEED; a
|
|
@@ -643,29 +576,9 @@ export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
|
643
576
|
// human stage reads the absence as "nobody has answered yet", which is the
|
|
644
577
|
// whole of what a pause means.
|
|
645
578
|
humanRuling,
|
|
646
|
-
// THE PAID SEAM, THE IDENTITY and THE METER, all operator territory and all
|
|
647
|
-
// absent on every mechanical close. A judged stage with no seam STOPS as a
|
|
648
|
-
// wiring gap rather than falling back to some other model (M1 owns no
|
|
649
|
-
// provider), and `judgeModel` is the seam's OTHER half (PRD item 32.1) —
|
|
650
|
-
// WHICH model the seam drives, resolved by the caller (`resolveJudge`,
|
|
651
|
-
// src/judged.js) and passed through untouched here, exactly as `judgeLoop`
|
|
652
|
-
// is. `runStage` checks the identity before the seam, so a judged stage with
|
|
653
|
-
// neither wired reports the identity gap, and one with only the seam missing
|
|
654
|
-
// still names the judge it would have graded with. Every locate call the
|
|
655
|
-
// seam buys is reported OUT through the meter so the run's ONE ledger can
|
|
656
|
-
// see it — a close has cost $0 until this kind, and a budget must fund the
|
|
657
|
-
// attempt PLUS its close.
|
|
658
|
-
judgeLoop,
|
|
659
|
-
judgeModel,
|
|
660
|
-
onJudgeCost,
|
|
661
|
-
// F152/PRD 30.4 — the SAME per-call time bounds every worker round already
|
|
662
|
-
// carries (`callBounds()`, src/planrun.js:1518), so the judged stage's own
|
|
663
|
-
// locate call cannot hang the process on a live silent endpoint. `null` is
|
|
664
|
-
// the honest absence (an adopter/test that wires no clock through), never a
|
|
665
|
-
// defaulted number invented here.
|
|
666
|
-
callBounds,
|
|
667
579
|
// REPORT-ONLY seam: what a rubric-step stage's cited checks read (bareguard `full.evidence`); the runner records it, nothing here reads it
|
|
668
580
|
onRubricEvidence,
|
|
581
|
+
...(Array.isArray(list) ? { list } : {}),
|
|
669
582
|
seedTrees,
|
|
670
583
|
};
|
|
671
584
|
try {
|
|
@@ -690,6 +603,8 @@ export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
|
690
603
|
// an earlier green's announcement would otherwise be lost behind the
|
|
691
604
|
// stage that decided.
|
|
692
605
|
...(t.notes !== undefined ? { notes: t.notes } : {}),
|
|
606
|
+
// a RESULT PER ROW of the signed list (report-only): a rubric step's rows come from its own graded gaps; a guard stage is its own job-level row. Masked at this boundary like every recorded string
|
|
607
|
+
...rowsRecordOf(list, st, r, t, redact),
|
|
693
608
|
});
|
|
694
609
|
last = t;
|
|
695
610
|
if (t.verdict !== 'satisfied') {
|
|
@@ -713,6 +628,24 @@ export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
|
713
628
|
}
|
|
714
629
|
}
|
|
715
630
|
|
|
631
|
+
/**
|
|
632
|
+
* The per-row results one stage entry records (Addendum 2026-11-14 (c) piece 4): `{rows, unclaimed?}` or nothing. A rubric step's come from its detail (the runner graded them against the signed list);
|
|
633
|
+
* a guard stage with a signed `guard` row is that row, passed when the stage was satisfied. The stage's own verdict is never changed by any of this.
|
|
634
|
+
* @param {any[]|null} list @param {any} st the declared stage @param {any} r the stage result @param {any} t its translation @param {(s: string) => string} redact
|
|
635
|
+
* @returns {{rows?: any[], unclaimed?: string[]}}
|
|
636
|
+
*/
|
|
637
|
+
function rowsRecordOf(list, st, r, t, redact) {
|
|
638
|
+
if (!Array.isArray(list)) return {};
|
|
639
|
+
if (st?.kind === 'rubric-step' && Array.isArray(r?.detail?.rows)) {
|
|
640
|
+
return {
|
|
641
|
+
rows: r.detail.rows.map((/** @type {any} */ x) => ({ key: x.key, result: x.result, ...(typeof x.why === 'string' ? { why: redact(x.why) } : {}) })),
|
|
642
|
+
...(Array.isArray(r.detail.unclaimed) && r.detail.unclaimed.length ? { unclaimed: r.detail.unclaimed.map((/** @type {string} */ u) => redact(String(u))) } : {}),
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
const guard = list.find((/** @type {any} */ x) => x && x.kind === 'guard' && x.key === guardKeyOf(String(st?.name)));
|
|
646
|
+
return guard ? { rows: [{ key: guard.key, result: t.verdict === 'satisfied' ? 'passed' : 'failed' }] } : {};
|
|
647
|
+
}
|
|
648
|
+
|
|
716
649
|
/**
|
|
717
650
|
* The ONE number the trend reader may compare, and the omissions are the point.
|
|
718
651
|
* `trend.js` reads improvement as `value < best`, so:
|
|
@@ -723,7 +656,7 @@ export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
|
723
656
|
* recommend a top-up on a dying run — the one direction trend.js names as
|
|
724
657
|
* dangerous. F6's answer applies: unknown, never a number that means the
|
|
725
658
|
* opposite of what it says.
|
|
726
|
-
* - a
|
|
659
|
+
* - a rubric-step (no measurement) donates its distinct red COUNT, always 'down';
|
|
727
660
|
* - any other stage with no measurement at all donates nothing, for the same reason.
|
|
728
661
|
* The stage POSITION still travels either way, so "the run got further than it
|
|
729
662
|
* ever had" is readable on every declared close.
|
|
@@ -732,8 +665,8 @@ export async function runDeclaredStages(stages, redact = (s) => s, opts = {}) {
|
|
|
732
665
|
*/
|
|
733
666
|
function trendValueOf(stage, r) {
|
|
734
667
|
if (typeof r?.value !== 'number' || !Number.isFinite(r.value)) {
|
|
735
|
-
// a
|
|
736
|
-
// (
|
|
668
|
+
// a rubric-step has no measurement: its number is how many DISTINCT reds it itemizes
|
|
669
|
+
// (src/rubricstep.js `detail.redCount`), lower-is-better, compared to its best-so-far like any deterministic count
|
|
737
670
|
return Number.isInteger(r?.detail?.redCount) ? r.detail.redCount : null;
|
|
738
671
|
}
|
|
739
672
|
return stage?.params?.direction === 'lower-is-better' ? r.value : null;
|
package/src/destpoint.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// names a file to change, the line, the file (copied from that line) and the folder that holds it. Plain code then checks every claim (the line is a job line, the path
|
|
3
3
|
// stands in that line's own words, the file is in the repo's committed tree, the folder is a real parent of it) and that the file lies OUTSIDE the Destination. Only then is
|
|
4
4
|
// there ONE question, worded by code, answered yes or no like the fit check's "go on". A made-up file, a path the line does not hold or a malformed reply is no question.
|
|
5
|
-
// Failure is OPEN (a wrong question is the costly mistake): a call that does not finish asks nothing and drafting goes on. The call/book/retry pattern is src/
|
|
5
|
+
// Failure is OPEN (a wrong question is the costly mistake): a call that does not finish asks nothing and drafting goes on. The call/book/retry pattern is src/pagemap.js's `runPageMap`.
|
|
6
6
|
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import { priceOf, scrubRaw, tallyCalls, capStop, callCasualty } from './text.js';
|
package/src/draftspend.js
CHANGED
|
@@ -182,16 +182,32 @@ export function sessionDirForRow(row, opts = {}) {
|
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
/**
|
|
186
|
+
* What an answered look question DECIDED, in one spelling for every view (the draft readout and the Audit drafting table): agreed / you wrote / dropped.
|
|
187
|
+
* `null` for any other answer, and for an old log row with no `words` (those keep the question-and-answer form).
|
|
188
|
+
* @param {{choice?: string, words?: string}} h
|
|
189
|
+
* @returns {string|null}
|
|
190
|
+
*/
|
|
191
|
+
export function decidedWords(h) {
|
|
192
|
+
if (h.choice === 'agree' && typeof h.words === 'string') return `agreed \u2014 ${h.words}`;
|
|
193
|
+
if (h.choice === 'rule' && typeof h.words === 'string') return `you wrote \u2014 ${h.words}`;
|
|
194
|
+
if (h.choice === 'drop') return 'dropped \u2014 Not checked';
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
|
|
185
198
|
/**
|
|
186
199
|
* PRD v1.106 Part 5 Q1: one answered question as the two lines the Audit's drafting table shows under its step. ONE place owns the words.
|
|
187
|
-
* @param {{question: string, answer: string, source?: string, line?: number, at?: string}} h
|
|
188
|
-
* @returns {{question: string, answer: string, source: string, line?: number, at?: string, askedText: string, saidText: string}}
|
|
200
|
+
* @param {{question: string, answer: string, source?: string, line?: number, at?: string, choice?: string, words?: string}} h
|
|
201
|
+
* @returns {{question: string, answer: string, source: string, line?: number, at?: string, choice?: string, words?: string, askedText: string, saidText: string}}
|
|
189
202
|
*/
|
|
190
203
|
export function humanRowWords(h) {
|
|
204
|
+
const decided = decidedWords(h);
|
|
191
205
|
return {
|
|
192
206
|
question: h.question, answer: h.answer, source: typeof h.source === 'string' ? h.source : 'confirm',
|
|
193
207
|
...(Number.isInteger(h.line) ? { line: h.line } : {}), ...(h.at ? { at: h.at } : {}),
|
|
194
|
-
|
|
208
|
+
...(typeof h.choice === 'string' ? { choice: h.choice } : {}), ...(typeof h.words === 'string' ? { words: h.words } : {}),
|
|
209
|
+
// a rule the answer replaced is shown by what was decided, never by the question that quotes its old words
|
|
210
|
+
askedText: decided ?? `you were asked: ${h.question}`, saidText: decided === null ? `you said: ${h.answer}` : '',
|
|
195
211
|
};
|
|
196
212
|
}
|
|
197
213
|
|
|
@@ -228,7 +244,7 @@ export function readDraftSteps(dir) {
|
|
|
228
244
|
x.status = 'running';
|
|
229
245
|
x.endedAt = null;
|
|
230
246
|
} else if (ev.kind === 'human' && byNo.has(ev.no) && typeof ev.question === 'string' && typeof ev.answer === 'string') {
|
|
231
|
-
byNo.get(ev.no).humans.push(humanRowWords({ question: ev.question, answer: ev.answer, source: ev.source, ...(Number.isInteger(ev.line) ? { line: ev.line } : {}), at: ev.at }));
|
|
247
|
+
byNo.get(ev.no).humans.push(humanRowWords({ question: ev.question, answer: ev.answer, source: ev.source, ...(typeof ev.choice === 'string' ? { choice: ev.choice } : {}), ...(typeof ev.words === 'string' ? { words: ev.words } : {}), ...(Number.isInteger(ev.line) ? { line: ev.line } : {}), at: ev.at }));
|
|
232
248
|
} else if (ev.kind === 'call') {
|
|
233
249
|
const c = { label: String(ev.label), model: typeof ev.model === 'string' ? ev.model : null, costUsd: typeof ev.costUsd === 'number' ? ev.costUsd : null, unpricedRounds: Number(ev.unpricedRounds) || 0, at: String(ev.at) };
|
|
234
250
|
byNo.get(ev.no)?.calls.push(c);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// THE REPO JOB'S POINTING CALL (hamr 2026-11-15: "same as rubric"). A rubric job's `~` rules take the AI's pointing through row edits that code then judges; a repo job does the same. BEFORE the asks, ONE small call
|
|
2
|
+
// shows the AI each `~` rule's own words and the repo paths outside the write scope; it answers in the row-edit shape `{"edits": [...]}` with the one op `fence` {line, rule, path}. The edits go through
|
|
3
|
+
// `CheckBlock.applyDelta` like every rubric edit; code proves each (the path is on the listing, the rule's own words name it, it lies outside the write scope). The AI points; code decides.
|
|
4
|
+
// A rule nobody pointed at, or whose point fails the proof, is asked about like any rule code cannot settle. A failed call never stops the draft: its rules go to the questions.
|
|
5
|
+
import { askStructured, makeCostBook } from './authorflow.js';
|
|
6
|
+
import { lineRules } from './rubricstep.js';
|
|
7
|
+
|
|
8
|
+
/** the label of the call, as the drafting book and the draft log see it */
|
|
9
|
+
export const FENCE_POINT_LABEL = 'fence-point';
|
|
10
|
+
export const FENCE_POINT_TOOL = 'submit_edits';
|
|
11
|
+
/** at most this many outside paths are shown to the call */
|
|
12
|
+
export const FENCE_POINT_MAX_PATHS = 300;
|
|
13
|
+
|
|
14
|
+
/** the call's own system text (model-facing; a prompt register: src/promptregisters.js) */
|
|
15
|
+
export const FENCE_POINT_SYSTEM = `You read the "~" rules of a job and point at the files a rule asks to leave as they are, by sending EDITS to a list of checks that code keeps. Code checks every edit you send against the rule's own words and the file list; an edit it cannot prove is dropped.
|
|
16
|
+
Call ${FENCE_POINT_TOOL} once with an "edits" list, or with an empty list.
|
|
17
|
+
The one edit: {"op":"fence","line":N,"rule":n,"path":"<a path copied from the list of paths>"} - the rule asks that this file or folder stay as it is. The path is one of the listed paths, or a folder that holds some of them, and the rule's own words name it.
|
|
18
|
+
Send an edit only for a rule whose own words say a listed file or folder stays as it is. A rule that says anything else gets no edit. An empty list is a good answer.`;
|
|
19
|
+
|
|
20
|
+
export const FENCE_POINT_SCHEMA = Object.freeze({
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
edits: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
op: { enum: ['fence'] },
|
|
29
|
+
line: { type: 'integer', minimum: 1, description: 'the job line number' },
|
|
30
|
+
rule: { type: 'integer', minimum: 1, description: 'the number of the ~ rule on that line' },
|
|
31
|
+
path: { type: 'string', minLength: 1, description: 'a path from the list that the rule asks to leave as it is' },
|
|
32
|
+
},
|
|
33
|
+
required: ['op', 'line', 'rule', 'path'],
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['edits'],
|
|
39
|
+
additionalProperties: false,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const channel = () => ({
|
|
43
|
+
name: FENCE_POINT_TOOL,
|
|
44
|
+
instruction: `Your reply did not deliver exactly one ${FENCE_POINT_TOOL} call. Call ${FENCE_POINT_TOOL} exactly once. Do not write the answer as text.`,
|
|
45
|
+
textPath: 'edits',
|
|
46
|
+
tool: (/** @type {{calls: any[]}} */ box) => ({
|
|
47
|
+
name: FENCE_POINT_TOOL,
|
|
48
|
+
description: 'Deliver the fence edits (or an empty list). Call this exactly once.',
|
|
49
|
+
parameters: FENCE_POINT_SCHEMA,
|
|
50
|
+
execute: async (/** @type {any} */ args) => { box.calls.push(args); return 'received'; },
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/** @param {{n: number, rules?: string[], rule?: string}[]} jobLines @param {string[]} outside the repo paths outside the write scope @param {string[]|null} writeScope @returns {string} */
|
|
55
|
+
export function fencePointUserText(jobLines, outside, writeScope) {
|
|
56
|
+
const out = ["THE RULES (the person's own words)"];
|
|
57
|
+
for (const l of jobLines) lineRules(l).forEach((r, i) => out.push(`line ${l.n} rule ${i + 1}: ${r}`));
|
|
58
|
+
out.push('', `PATHS OUTSIDE THE WRITE SCOPE${Array.isArray(writeScope) && writeScope.length ? ` (${writeScope.join(', ')})` : ''}:`, ...outside.slice(0, FENCE_POINT_MAX_PATHS).map((p) => `- ${p}`));
|
|
59
|
+
return out.join('\n');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The one paid call; its spend is booked like the look's. An unusable answer is NOT a guessed list: it yields no edits and says why (the rules then go to the questions).
|
|
64
|
+
* @param {{jobLines: any[], outside: string[], writeScope?: string[]|null, generate: Function, ceilingUsd?: number|null, onCall?: (c: any) => void, priorCalls?: any[], priorRaws?: any[]}} o
|
|
65
|
+
* @returns {Promise<{edits: any[], reason: string|null, calls: any[], raws: any[]}>}
|
|
66
|
+
*/
|
|
67
|
+
export async function runFencePoint({ jobLines, outside, writeScope = null, generate, ceilingUsd = null, onCall = () => {}, priorCalls = [], priorRaws = [] }) {
|
|
68
|
+
const book = makeCostBook({ ceilingUsd, onCall });
|
|
69
|
+
book.absorb(priorCalls, priorRaws);
|
|
70
|
+
const before = book.report().calls.length;
|
|
71
|
+
const beforeRaws = book.raws().length;
|
|
72
|
+
const r = await askStructured({ messages: [{ role: 'user', content: fencePointUserText(jobLines, outside, writeScope) }], generate, mode: 'tool', retries: 1, label: FENCE_POINT_LABEL, book, channel: channel() });
|
|
73
|
+
const edits = r.artifact && Array.isArray(r.artifact.edits) ? r.artifact.edits : [];
|
|
74
|
+
const reason = r.artifact ? null : (r.budget ? 'the spend ceiling was reached' : (r.providerError ?? r.red?.detail ?? 'the answer could not be read'));
|
|
75
|
+
return { edits, reason, calls: book.report().calls.slice(before), raws: book.raws().slice(beforeRaws) };
|
|
76
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The plain-English line of each mandatory guard, ONE owner (a leaf module: the confirm turn, the signed card and the one check list's `$` guard rows all read it).
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PLAIN-ENGLISH lines for the guards `classGuards` can compose, keyed by guard NAME — frozen beside CONFIRM_MENU (`src/authorflow.js`) because both are constants the confirm turn shows a person
|
|
5
|
+
* verbatim. One entry per guard that exists in `MECHANICAL_GUARDS` (`src/authoring.js`); `confirmProtections` throws if a guard `classGuards` hands back has no line here, so a battery that grows a
|
|
6
|
+
* guard fails loudly instead of showing a blank description.
|
|
7
|
+
* @type {Record<string, string>}
|
|
8
|
+
*/
|
|
9
|
+
export const GUARD_DESCRIPTIONS = Object.freeze({
|
|
10
|
+
'changed-from-seed': 'the run must actually change at least one file in scope — a close that reports done '
|
|
11
|
+
+ 'without touching anything is refused',
|
|
12
|
+
'no-suppressions': 'the run may not silence a checker instead of fixing what it flags (things like @ts-ignore, '
|
|
13
|
+
+ 'eslint-disable, or # type: ignore) — none of those may appear in the diff',
|
|
14
|
+
});
|
package/src/index.js
CHANGED
|
@@ -129,10 +129,6 @@ export {
|
|
|
129
129
|
// gate that reads a signer's answer (and refuses an empty one), and the seed
|
|
130
130
|
// exemption ruling 8 states.
|
|
131
131
|
HUMAN_DECISIONS, SEED_EXEMPT_KINDS, normalizeHumanRuling, resolveHumanRuling,
|
|
132
|
-
// SOFTGREEN module 2 — the judged stage's own arbiter-owned bounds. An adopter
|
|
133
|
-
// wiring `judgeProvider` needs both numbers to reason about what a judged close
|
|
134
|
-
// can cost: one paid call per artifact, at most one retry each.
|
|
135
|
-
JUDGE_ATTEMPTS, MAX_JUDGED_PATHS,
|
|
136
132
|
// SOFTGREEN module 8 — the REVIEW DOOR's vocabulary: the record type a run
|
|
137
133
|
// writes when it ends at the door, which terminals open one, which classes open
|
|
138
134
|
// one unasked, and the mechanical-only rule an `accept` re-proves against.
|
|
@@ -145,45 +141,9 @@ export {
|
|
|
145
141
|
// module 6's registry half, and refuses an expired door under the same 60-day TTL a
|
|
146
142
|
// hitl checkpoint keeps. It never returns, writes or implies a verdict.
|
|
147
143
|
export { answerReviewDoor } from './reviewdoor.js';
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
// model, and no library fall-back; the old pinned-model constant is gone), the rulebook a card SELECTS from,
|
|
152
|
-
// the card gate, and the two halves themselves so a calibration harness can
|
|
153
|
-
// grade the whole pipe without running a close.
|
|
154
|
-
// `defaultJudgeLoop` (src/judged.js) is the one spelling of how this repo drives a
|
|
155
|
-
// judge; the runner reaches it through `runPlan`'s `judgeProvider`. It is internal:
|
|
156
|
-
// the package root does not export it.
|
|
157
|
-
export {
|
|
158
|
-
resolveJudge, JUDGE_RULES, JUDGE_RULE_IDS,
|
|
159
|
-
runLocate, decide,
|
|
160
|
-
// SOFTGREEN module 4 — what a legal SIGNED calibration set is. The SIZE is
|
|
161
|
-
// hamr's own ruling and a size change is a spec-level threshold change;
|
|
162
|
-
// `expectedOf` is the ONE reduction of a `decide()` result to the shape a case
|
|
163
|
-
// stores, so a calibration harness compares one shape rather than two.
|
|
164
|
-
CALIBRATION_SIZE, validateCalibrationSet, expectedOf,
|
|
165
|
-
} from './judged.js';
|
|
166
|
-
// SOFTGREEN module 4 — the COMPILE. Q6 becomes the rubric card and Q7 becomes the
|
|
167
|
-
// frozen calibration set, both on the D5 shown-and-fixed path: the LLM proposes
|
|
168
|
-
// through `proposeJudgedArtifacts`, an integrating UI shows the proposal, the
|
|
169
|
-
// SIGNER's fix goes through `signJudgedArtifacts`, and `foldJudgedArtifacts`
|
|
170
|
-
// enumerates both into the closeDecl — where the spec hash covers them, so a card
|
|
171
|
-
// line or a case is a re-sign like every other spec edit.
|
|
172
|
-
export {
|
|
173
|
-
proposeJudgedArtifacts, signJudgedArtifacts, foldJudgedArtifacts,
|
|
174
|
-
} from './cardauthor.js';
|
|
175
|
-
// SOFTGREEN module 5 — THE CALIBRATION GATE. `runCalibration` grades the whole
|
|
176
|
-
// pipe (locate + decide) over the signed ten and the five arbiter-owned injection
|
|
177
|
-
// artifacts; `prepareSigning` runs it and refuses on anything short of all of
|
|
178
|
-
// them. Exported because an integrating UI has to be able to RUN and RENDER the
|
|
179
|
-
// gate — the graded rows are what a signer reads before giving a signature — and
|
|
180
|
-
// because the battery is evidence a reader may want to inspect rather than take
|
|
181
|
-
// on trust. `INJECTION_LOCATE_BATTERY` and `INJECTION_CARD` are ARBITER-OWNED
|
|
182
|
-
// constants: no signer authors them and nothing stores them in a spec.
|
|
183
|
-
export {
|
|
184
|
-
runCalibration,
|
|
185
|
-
INJECTION_LOCATE_BATTERY, CASUALTY_AXES,
|
|
186
|
-
} from './calibrate.js';
|
|
144
|
+
// WHICH model a job's judge names (PRD item 32.1: the spec's signed `judge` override, else the job's own worker model; no library fall-back). The old
|
|
145
|
+
// judge's engine (the locate call, the rulebook, `decide`, the calibration shape) is gone (hamr 2026-11-14).
|
|
146
|
+
export { resolveJudge } from './judged.js';
|
|
187
147
|
// M2 — what a declaration may SAY, and whether one said it legally. The
|
|
188
148
|
// catalogue and the genre are DATA an integrating UI renders (the kind menu, the
|
|
189
149
|
// guard batteries it must show the user under D5 and cannot let them remove).
|