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/interviewrun.js
CHANGED
|
@@ -101,10 +101,10 @@ import {
|
|
|
101
101
|
PLAIN_FOLDER_DEFERRED_FIELDS,
|
|
102
102
|
} from './authorjob.js';
|
|
103
103
|
import {
|
|
104
|
-
INPUTS_FIELD, JOB_BLOCK_HELP, destinationFieldFor, labelsFor,
|
|
104
|
+
INPUTS_FIELD, JOB_BLOCK_HELP, destinationFieldFor, labelsFor,
|
|
105
105
|
} from './authorflow.js';
|
|
106
106
|
import {
|
|
107
|
-
parseJobBlock, parseInputs, renderJobLines,
|
|
107
|
+
parseJobBlock, parseInputs, renderJobLines, signedJobLines, REPO_RUBRIC_WORDS,
|
|
108
108
|
} from './jobblock.js';
|
|
109
109
|
import { validateJob, validateBaseUrl, PROVIDERS } from './job.js';
|
|
110
110
|
import { resolveProvider, probeWarningLines, apiKeyProblem } from './providers.js';
|
|
@@ -391,6 +391,14 @@ export async function main(argv, deps = {}) {
|
|
|
391
391
|
// 'repo'), the same authoritative outcome `prepareSource`'s own walk
|
|
392
392
|
// produces for it — reported, never fought, below.
|
|
393
393
|
const IS_REPO = looksLikeRepoSource(SOURCE);
|
|
394
|
+
// hamr 2026-11-14: this door always takes a repo on line 1, and a repo job is Deterministic (a rubric on a repo is for a Tickets job, a panel flow).
|
|
395
|
+
// Refused before a single class question is asked.
|
|
396
|
+
if (VERDICT === 'soft-green' && IS_REPO) {
|
|
397
|
+
say('');
|
|
398
|
+
say(REPO_RUBRIC_WORDS);
|
|
399
|
+
say('Nothing was asked and nothing was written.');
|
|
400
|
+
throw new ExitSignal(1);
|
|
401
|
+
}
|
|
394
402
|
|
|
395
403
|
// ── LANGUAGE, DETECTED — never asked (PRD item 33 M3, ruling 3) ──────────────
|
|
396
404
|
// $0, no provider: reads the repo's own manifest, nearest wins, walking up to
|
|
@@ -577,13 +585,13 @@ export async function main(argv, deps = {}) {
|
|
|
577
585
|
|
|
578
586
|
// ── 3. the class's own frozen questions, one at a time ───────────────────────
|
|
579
587
|
// P7: "The job" is ONE multi-line answer — numbered lines with their `~` rules, parsed by `parseJobBlock` (the same
|
|
580
|
-
// parser the panel uses) and filed under key 1 as the numbered text the drafter reads. A
|
|
581
|
-
//
|
|
588
|
+
// parser the panel uses) and filed under key 1 as the numbered text the drafter reads. A `~ PASS:`/`~ FAIL:` line
|
|
589
|
+
// is refused by that parser (2026-11-14); the judge examples are gone.
|
|
582
590
|
/** @type {Record<string, string>} */
|
|
583
591
|
const answers = {};
|
|
584
592
|
/** @type {import('./jobblock.js').JobLine[]} */
|
|
585
593
|
let JOB_LINES = [];
|
|
586
|
-
const ASKED = REQUIRED
|
|
594
|
+
const ASKED = REQUIRED;
|
|
587
595
|
let asked = 0;
|
|
588
596
|
for (const n of ASKED) {
|
|
589
597
|
asked += 1;
|
|
@@ -600,14 +608,11 @@ export async function main(argv, deps = {}) {
|
|
|
600
608
|
'that one is required — every question in this class\'s set has to be answered before a close can be authored from it. Again:');
|
|
601
609
|
const parsed = parseJobBlock(raw);
|
|
602
610
|
if (!parsed.ok) { say(` ${parsed.error}`); continue; }
|
|
603
|
-
const misfit = jobBlockFitsCheck(parsed.lines, VERDICT === 'soft-green');
|
|
604
|
-
if (misfit) { say(` ${misfit}`); continue; }
|
|
605
611
|
JOB_LINES = parsed.lines;
|
|
606
612
|
answers[n] = renderJobLines(parsed.lines);
|
|
607
613
|
break;
|
|
608
614
|
}
|
|
609
615
|
}
|
|
610
|
-
if (VERDICT === 'soft-green') answers[SOFTGREEN_JUDGE_EXAMPLES_KEY] = renderExamples(JOB_LINES);
|
|
611
616
|
|
|
612
617
|
// ── 4. the OPERATOR's half of the spec — the part nothing authors for you ────
|
|
613
618
|
say('');
|
package/src/job.js
CHANGED
|
@@ -248,6 +248,25 @@ export function flowTypeOf(spec) {
|
|
|
248
248
|
return spec?.mcp ? 'tickets' : 'plain';
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
/** 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. */
|
|
252
|
+
export const OLD_JOB_WORDS = 'This job was made with PASS/FAIL examples or the old judge, which are gone. Draft it fresh.';
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* 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)?
|
|
256
|
+
* ONE reader for every door that takes a signed spec back in (Reuse, a scheduled fire, an exported bundle).
|
|
257
|
+
* @param {Record<string, any>} spec @returns {string|null} the plain refusal, or null when the spec is not an old job
|
|
258
|
+
*/
|
|
259
|
+
export function oldJobWords(spec) {
|
|
260
|
+
/** @type {any[]} */
|
|
261
|
+
const stages = Array.isArray(spec?.closeDecl?.stages) ? spec.closeDecl.stages : [];
|
|
262
|
+
if (stages.some((st) => st && st.kind === 'judged-floor')) return OLD_JOB_WORDS;
|
|
263
|
+
/** @type {any[]} */
|
|
264
|
+
const lines = Array.isArray(spec?.jobLines) ? spec.jobLines : [];
|
|
265
|
+
const isExample = (/** @type {unknown} */ r) => typeof r === 'string' && /^(PASS|FAIL):/i.test(r.trim());
|
|
266
|
+
if (lines.some((l) => l && ((Array.isArray(l.rules) && l.rules.some(isExample)) || isExample(l.rule)))) return OLD_JOB_WORDS;
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
|
|
251
270
|
/** the shape of an MCP server or tool name in a job (the bridge names a tool `<server>_<tool>`) */
|
|
252
271
|
const MCP_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
253
272
|
|
|
@@ -905,7 +924,7 @@ function validatePlanShape(spec, red, reds) {
|
|
|
905
924
|
// class the user picked (PRD v1.57 §2), so the gate cannot check D5 without
|
|
906
925
|
// it. An unknown or locked class is refused there, on its own axis, beside
|
|
907
926
|
// the counted `request-red` above.
|
|
908
|
-
const cd = validateCloseDecl(spec.closeDecl, { at: 'closeDecl', deferListing: true, verdictType: spec.verdictType,
|
|
927
|
+
const cd = validateCloseDecl(spec.closeDecl, { at: 'closeDecl', deferListing: true, verdictType: spec.verdictType, jobLines: Array.isArray(spec.jobLines) ? spec.jobLines : null, inputLabels: inputLabelsOf(spec.inputs) });
|
|
909
928
|
for (const r of cd.reds) reds.push(r);
|
|
910
929
|
if (demanded !== undefined && !CLASS_BY_CLOSE.declared.includes(demanded)) {
|
|
911
930
|
// the same laundering guard as the close-type hierarchy, one level up: a
|
package/src/jobblock.js
CHANGED
|
@@ -4,18 +4,22 @@
|
|
|
4
4
|
//
|
|
5
5
|
// Both are pure and $0: a malformed block is a named red `{ok: false, error}`, never a throw and never a guess.
|
|
6
6
|
|
|
7
|
-
/** @typedef {{
|
|
8
|
-
/** @typedef {{n: number, text: string, rule: string, rules: string[], examples: JobExample[]}} JobLine one numbered job line; `rule` = its `~` lines joined with '; ' ('' when none), `rules` = those same `~` lines one by one (so an example's own '; ' survives) */
|
|
7
|
+
/** @typedef {{n: number, text: string, rule: string, rules: string[]}} JobLine one numbered job line; `rule` = its `~` lines joined with '; ' ('' when none), `rules` = those same `~` lines one by one */
|
|
9
8
|
/** @typedef {{n: number, label: string, value: string}} JobInput one numbered `label: value` input line */
|
|
10
9
|
|
|
10
|
+
/** hamr 2026-11-14: Rubric on a repo is allowed ONLY for a Tickets job; any other repo + rubric start is refused at $0 in these words */
|
|
11
|
+
export const REPO_RUBRIC_WORDS = 'A repo job uses a Deterministic check.';
|
|
12
|
+
|
|
11
13
|
/** the joiner for consecutive `~` lines (fwd's joinGuardrails) */
|
|
12
14
|
export const RULE_JOINER = '; ';
|
|
13
15
|
|
|
16
|
+
/** hamr 2026-11-14: a `~ PASS:` / `~ FAIL:` line is refused at $0; the check list (`~` rules, Drop and Add) covers what the examples did */
|
|
17
|
+
export const PASS_FAIL_GONE_WORDS = 'PASS/FAIL examples are gone \u2014 write what you want as a ~ rule.';
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* Parse "The job" box. A plain line is a numbered job line (1, 2, 3...). A line starting `~` has no number and belongs
|
|
16
21
|
* to the numbered line above; consecutive `~` lines become ONE rule joined with `'; '`. A `~` line starting `PASS:` or
|
|
17
|
-
* `FAIL:` is
|
|
18
|
-
* ignored. A `~` before line 1 is a red.
|
|
22
|
+
* `FAIL:` is a red ({@link PASS_FAIL_GONE_WORDS}). Empty lines are ignored. A `~` before line 1 is a red.
|
|
19
23
|
* @param {unknown} text the box's raw text
|
|
20
24
|
* @returns {{ok: true, lines: JobLine[]}|{ok: false, error: string}}
|
|
21
25
|
*/
|
|
@@ -35,16 +39,12 @@ export function parseJobBlock(text) {
|
|
|
35
39
|
if (lines.length === 0) return { ok: false, error: `The job, line ${row}: a "~" line belongs to the numbered line above it, and there is none yet` };
|
|
36
40
|
const body = t.slice(1).trim();
|
|
37
41
|
if (body === '') continue;
|
|
42
|
+
if (/^(PASS|FAIL):/i.test(body)) return { ok: false, error: PASS_FAIL_GONE_WORDS };
|
|
38
43
|
rule.push(body);
|
|
39
|
-
const m = /^(PASS|FAIL):\s*(.*)$/i.exec(body);
|
|
40
|
-
if (m) {
|
|
41
|
-
if (m[2].trim() === '') return { ok: false, error: `The job, line ${row}: "${m[1].toUpperCase()}:" needs an example after it` };
|
|
42
|
-
lines[lines.length - 1].examples.push({ verdict: /** @type {'PASS'|'FAIL'} */ (m[1].toUpperCase()), text: m[2].trim() });
|
|
43
|
-
}
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
46
|
flush();
|
|
47
|
-
lines.push({ n: lines.length + 1, text: t, rule: '', rules: []
|
|
47
|
+
lines.push({ n: lines.length + 1, text: t, rule: '', rules: [] });
|
|
48
48
|
}
|
|
49
49
|
flush();
|
|
50
50
|
if (lines.length === 0) return { ok: false, error: 'The job is required' };
|
|
@@ -99,16 +99,6 @@ export function jobBoxText(lines) {
|
|
|
99
99
|
return lines.map((l) => [l.text, ...l.rules.map((r) => `~ ${r}`)].join('\n')).join('\n');
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/**
|
|
103
|
-
* The PASS:/FAIL: examples the person wrote, each kept with its line number (answer 2 of a rubric interview — what the
|
|
104
|
-
* calibration compile reads). Empty string when there are none.
|
|
105
|
-
* @param {JobLine[]} lines
|
|
106
|
-
* @returns {string}
|
|
107
|
-
*/
|
|
108
|
-
export function renderExamples(lines) {
|
|
109
|
-
return lines.flatMap((l) => l.examples.map((e) => `line ${l.n} ${e.verdict}: ${e.text}`)).join('\n');
|
|
110
|
-
}
|
|
111
|
-
|
|
112
102
|
/**
|
|
113
103
|
* The inputs as the drafter is told about them: "the person pointed at these inputs: N label path".
|
|
114
104
|
* @param {JobInput[]} inputs
|
|
@@ -119,32 +109,7 @@ export function renderInputs(inputs) {
|
|
|
119
109
|
}
|
|
120
110
|
|
|
121
111
|
/**
|
|
122
|
-
* The
|
|
123
|
-
* `FAIL:` example (the calibration compile reads them); a DETERMINISTIC job has no judge, so an example line would be
|
|
124
|
-
* silently dropped — a red instead.
|
|
125
|
-
* PART 1a (hamr's ruling P1=B, docs/product/ITEM33-BUILD.md "Addendum 2026-10-12"): the examples are required of a rubric
|
|
126
|
-
* job ONLY when it holds a judged part. A rubric job on the person's own local files holds none in this build (its
|
|
127
|
-
* parts are counted or checked against a quote), so the caller says `judged: false` and a block without examples fits.
|
|
128
|
-
* Examples written anyway are never a red there — they simply have no judge to read them yet.
|
|
129
|
-
* @param {JobLine[]} lines
|
|
130
|
-
* @param {boolean} rubric
|
|
131
|
-
* @param {{judged?: boolean}} [o] `judged` (default true): does this job hold a judged part, so that it needs examples?
|
|
132
|
-
* @returns {string|null} the plain red, or null when the block fits the Check type
|
|
133
|
-
*/
|
|
134
|
-
export function jobBlockFitsCheck(lines, rubric, { judged = true } = {}) {
|
|
135
|
-
const all = lines.flatMap((l) => l.examples.map((e) => ({ n: l.n, ...e })));
|
|
136
|
-
if (!rubric) {
|
|
137
|
-
return all.length ? `The job, line ${all[0].n}: PASS:/FAIL: examples are for a Rubric check — a Deterministic job has no judge to read them` : null;
|
|
138
|
-
}
|
|
139
|
-
if (judged && (!all.some((e) => e.verdict === 'PASS') || !all.some((e) => e.verdict === 'FAIL'))) {
|
|
140
|
-
return 'The job: a Rubric check needs at least one "~ PASS:" line and one "~ FAIL:" line under a job line';
|
|
141
|
-
}
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* The signed `jobLines` field from parsed lines: the person's own words, `{n, text, rule, rules}` (examples stay inside the
|
|
147
|
-
* rule text, where the person wrote them). `rules` is the same `~` lines as an array, BESIDE the joined `rule` (never
|
|
112
|
+
* The signed `jobLines` field from parsed lines: the person's own words, `{n, text, rule, rules}`. `rules` is the same `~` lines as an array, BESIDE the joined `rule` (never
|
|
148
113
|
* replacing it); it is omitted on a line with no `~` line, and an older spec lacks it entirely.
|
|
149
114
|
* @param {JobLine[]} lines
|
|
150
115
|
* @returns {{n: number, text: string, rule: string, rules?: string[]}[]}
|