bareloop 0.57.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/bareloop.context.md +11 -8
  3. package/package.json +1 -1
  4. package/src/authorflow.js +50 -62
  5. package/src/authorjob.js +100 -30
  6. package/src/authorreadout.js +88 -0
  7. package/src/authorrun.js +63 -24
  8. package/src/authorscout.js +9 -1
  9. package/src/blockasks.js +11 -16
  10. package/src/checkblock.js +227 -31
  11. package/src/checkpick.js +0 -5
  12. package/src/declaredclose.js +38 -6
  13. package/src/draftspend.js +20 -4
  14. package/src/fencepointcall.js +76 -0
  15. package/src/guarddescriptions.js +14 -0
  16. package/src/kinds.js +5 -1
  17. package/src/pagemap.js +7 -29
  18. package/src/panel/authorroutes.js +6 -1
  19. package/src/panel/authorsession.js +108 -32
  20. package/src/panel/index.html +38 -13
  21. package/src/panel/jobplan.js +49 -16
  22. package/src/panel/server.js +66 -6
  23. package/src/planrun.js +2 -0
  24. package/src/promptregisters.js +5 -0
  25. package/src/questionbox.js +32 -20
  26. package/src/reviewdoor.js +1 -1
  27. package/src/rowresults.js +69 -0
  28. package/src/rubricstep.js +110 -22
  29. package/src/stagewords.js +24 -0
  30. package/types/authorflow.d.ts +42 -79
  31. package/types/authorjob.d.ts +3 -2
  32. package/types/authorreadout.d.ts +44 -0
  33. package/types/authorrun.d.ts +20 -0
  34. package/types/blockasks.d.ts +5 -10
  35. package/types/checkblock.d.ts +115 -11
  36. package/types/checkpick.d.ts +0 -3
  37. package/types/declaredclose.d.ts +3 -1
  38. package/types/draftspend.d.ts +16 -2
  39. package/types/fencepointcall.d.ts +68 -0
  40. package/types/guarddescriptions.d.ts +7 -0
  41. package/types/kinds.d.ts +1 -0
  42. package/types/pagemap.d.ts +2 -5
  43. package/types/panel/authorsession.d.ts +3 -2
  44. package/types/panel/jobplan.d.ts +13 -1
  45. package/types/panel/server.d.ts +41 -16
  46. package/types/questionbox.d.ts +20 -6
  47. package/types/rowresults.d.ts +23 -0
  48. package/types/rubricstep.d.ts +34 -7
  49. package/types/stagewords.d.ts +11 -0
@@ -0,0 +1,68 @@
1
+ /** @param {{n: number, rules?: string[], rule?: string}[]} jobLines @param {string[]} outside the repo paths outside the write scope @param {string[]|null} writeScope @returns {string} */
2
+ export function fencePointUserText(jobLines: {
3
+ n: number;
4
+ rules?: string[];
5
+ rule?: string;
6
+ }[], outside: string[], writeScope: string[] | null): string;
7
+ /**
8
+ * 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).
9
+ * @param {{jobLines: any[], outside: string[], writeScope?: string[]|null, generate: Function, ceilingUsd?: number|null, onCall?: (c: any) => void, priorCalls?: any[], priorRaws?: any[]}} o
10
+ * @returns {Promise<{edits: any[], reason: string|null, calls: any[], raws: any[]}>}
11
+ */
12
+ export function runFencePoint({ jobLines, outside, writeScope, generate, ceilingUsd, onCall, priorCalls, priorRaws }: {
13
+ jobLines: any[];
14
+ outside: string[];
15
+ writeScope?: string[] | null;
16
+ generate: Function;
17
+ ceilingUsd?: number | null;
18
+ onCall?: (c: any) => void;
19
+ priorCalls?: any[];
20
+ priorRaws?: any[];
21
+ }): Promise<{
22
+ edits: any[];
23
+ reason: string | null;
24
+ calls: any[];
25
+ raws: any[];
26
+ }>;
27
+ /** the label of the call, as the drafting book and the draft log see it */
28
+ export const FENCE_POINT_LABEL: "fence-point";
29
+ export const FENCE_POINT_TOOL: "submit_edits";
30
+ /** at most this many outside paths are shown to the call */
31
+ export const FENCE_POINT_MAX_PATHS: 300;
32
+ /** the call's own system text (model-facing; a prompt register: src/promptregisters.js) */
33
+ 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.\nCall submit_edits once with an \"edits\" list, or with an empty list.\nThe 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.\nSend 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.";
34
+ export const FENCE_POINT_SCHEMA: Readonly<{
35
+ type: "object";
36
+ properties: {
37
+ edits: {
38
+ type: string;
39
+ items: {
40
+ type: string;
41
+ properties: {
42
+ op: {
43
+ enum: string[];
44
+ };
45
+ line: {
46
+ type: string;
47
+ minimum: number;
48
+ description: string;
49
+ };
50
+ rule: {
51
+ type: string;
52
+ minimum: number;
53
+ description: string;
54
+ };
55
+ path: {
56
+ type: string;
57
+ minLength: number;
58
+ description: string;
59
+ };
60
+ };
61
+ required: string[];
62
+ additionalProperties: boolean;
63
+ };
64
+ };
65
+ };
66
+ required: string[];
67
+ additionalProperties: false;
68
+ }>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 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
3
+ * 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
4
+ * guard fails loudly instead of showing a blank description.
5
+ * @type {Record<string, string>}
6
+ */
7
+ export const GUARD_DESCRIPTIONS: Record<string, string>;
package/types/kinds.d.ts CHANGED
@@ -549,6 +549,7 @@ export type Ctx = {
549
549
  evidence: any[];
550
550
  evidenceTotal?: number;
551
551
  }) => void;
552
+ list?: any[] | null;
552
553
  onStage?: (row: {
553
554
  stage: string | null;
554
555
  kind: string | null;
@@ -128,7 +128,7 @@ export function askableFromLook(look: {
128
128
  * its reading as the suggestion (no extra paid call). A secret in a rule is masked.
129
129
  * @param {LookAsk[]} asks @returns {string}
130
130
  */
131
- export function tooManyAsksText(asks: LookAsk[]): string;
131
+ export function tooManyAsksText(asks: LookAsk[], where?: string): string;
132
132
  /** the label of the one paid call, as the drafting book and the progress line see it */
133
133
  export const MAP_CALL_LABEL: "page-map";
134
134
  /** the shapes the map may name; a `place` is read by code as a phrase */
@@ -140,11 +140,8 @@ export const MAP_UNREADABLE: "The AI's answer about the page was not readable tw
140
140
  export const DROP_IT: "drop it";
141
141
  export function isDropIt(text: unknown): boolean;
142
142
  export function isAgree(text: unknown): boolean;
143
- export function stripAgreeLead(text: string): string;
144
- export function readingTail(n: number): string;
145
- export function cantCheckTail(n: number): string;
146
143
  export function readingQuestion(n: number, rule: string, reading: string): string;
147
- export function cantCheckQuestion(n: number, rule: string): string;
144
+ export function cantCheckQuestion(n: number, rule: string, where?: string): string;
148
145
  /**
149
146
  * `reading` = the plain words an `agree` writes as a `~` rule (a reading ask only)
150
147
  */
@@ -242,7 +242,7 @@ export function validateJobCard(card: any, opts?: {
242
242
  * `signPrepare()` are the only ways in.
243
243
  * @param {any} card the validated job card (see {@link validateJobCard})
244
244
  * @param {{env?: Record<string,string|undefined>, sessionsRoot?: string, home?: string, timeoutMs?: number,
245
- * scout?: any, generate?: Function, pickGenerate?: Function|null, ledgerGenerate?: Function|null, noteFn?: Function|null, editGenerate?: Function|null, carryFrom?: string, carryKind?: string, confirmGenerate?: Function, authorFn?: Function,
245
+ * scout?: any, generate?: Function, pickGenerate?: Function|null, ledgerGenerate?: Function|null, fenceGenerate?: Function|null, noteFn?: Function|null, editGenerate?: Function|null, carryFrom?: string, carryKind?: string, confirmGenerate?: Function, authorFn?: Function,
246
246
  * prepareSigningFn?: Function, npmCiFn?: Function, lookFn?: Function|null, destFn?: Function|null, newestUnrunTicket?: typeof newestUnrunTicket, readTicketFn?: typeof readTicket, fetchUrl?: (url: string) => Promise<{ok: true, text: string, url: string}|{ok: false, error: string}>, draftThinking?: "on"|"off", reuse?: {spec: any, workflowKey: string}, schedule?: import('../trigger.js').Trigger|null, flow?: {flowType: 'plain'|'mcp'|'tickets', pick: {server: string, tools: string[]}|null}}} [deps] `scout`..`prepareSigningFn` are
247
247
  * TEST SEAMS ONLY — see the note just above where each is read, below. `reuse` (Reuse workflow) is NOT a seam: the
248
248
  * caller (`/api/author/start`) sets it only when the server's own same-job rule held.
@@ -257,6 +257,7 @@ export function createSession(card: any, deps?: {
257
257
  generate?: Function;
258
258
  pickGenerate?: Function | null;
259
259
  ledgerGenerate?: Function | null;
260
+ fenceGenerate?: Function | null;
260
261
  noteFn?: Function | null;
261
262
  editGenerate?: Function | null;
262
263
  carryFrom?: string;
@@ -311,7 +312,7 @@ export const FILE_JOB_STEP_LABELS: Readonly<Record<string, string>>;
311
312
  */
312
313
  export const PHASE_STEP: Readonly<Record<string, keyof typeof STEP_LABELS>>;
313
314
  /** the line under the plan bubble, in plain words (the bubble itself is drawn by the page's one `renderJobPlan`) */
314
- export const PLAN_FOOTER: "Sign & run to confirm this plan, or Revise to edit the boxes and draft again.";
315
+ export const PLAN_FOOTER: "Draft the plan to see its checks, or Revise to edit the boxes.";
315
316
  /** the form's fields, in card order — what `card.json` stores, verbatim (P5 item 3) */
316
317
  export const CARD_FIELDS: readonly string[];
317
318
  /**
@@ -62,10 +62,19 @@ export function planFromConfirm(jobLines: {
62
62
  * (`results`: stage name to passed), never re-derived; a row no verdict was recorded for says so. A Not checked row's result is "not checked" (its reason is in its words).
63
63
  * The write fence is enforced per write by the gate, so its row reads the gate's own record of THIS run (hamr ruling A, 2026-11-13): `blocked` = the write/edit attempts the gate denied
64
64
  * (`held · N writes blocked`), or `null` when the run's gate record is missing (said in plain words, never "held").
65
+ * Each row reads ITS OWN recorded result when the close recorded one (`rowRes`, piece 4: `{results: key -> {result, why?}, unclaimed: line -> words}`), else (a close recorded before rows existed) the verdict of its stage.
66
+ * A gap no row owns is its own failed item of its line, in the gap's words.
65
67
  * @param {JobPlan} plan @param {string[]} guards @param {Map<string, boolean>|null} results @param {number|null} [blocked] @param {boolean} [closeRan] the results are a CLOSE's (the latest), so a declared stage missing from them was not reached (the close stops at its first red); else a stage no verdict was recorded for reads none
68
+ * @param {{results: Map<string, {result: string, why?: string}>, unclaimed: Map<number, string[]>}|null} [rowRes]
66
69
  * @returns {{checks: AuditRow[], notChecked: AuditRow[], always: AuditRow[]}}
67
70
  */
68
- export function auditChecksOf(plan: JobPlan, guards: string[], results: Map<string, boolean> | null, blocked?: number | null, closeRan?: boolean): {
71
+ export function auditChecksOf(plan: JobPlan, guards: string[], results: Map<string, boolean> | null, blocked?: number | null, closeRan?: boolean, rowRes?: {
72
+ results: Map<string, {
73
+ result: string;
74
+ why?: string;
75
+ }>;
76
+ unclaimed: Map<number, string[]>;
77
+ } | null): {
69
78
  checks: AuditRow[];
70
79
  notChecked: AuditRow[];
71
80
  always: AuditRow[];
@@ -77,6 +86,8 @@ export type AuditRow = {
77
86
  by: "agent" | "you" | "default" | null;
78
87
  result: "passed" | "failed" | "none" | "not-reached" | "not-checked" | "held" | "record-missing";
79
88
  word?: string;
89
+ key?: string;
90
+ why?: string;
80
91
  };
81
92
  export type PlanCheck = {
82
93
  name: string;
@@ -84,6 +95,7 @@ export type PlanCheck = {
84
95
  by?: "agent" | "you" | "default" | null;
85
96
  key?: string;
86
97
  stage?: string;
98
+ fence?: true;
87
99
  };
88
100
  export type PlanLine = {
89
101
  n: number;
@@ -345,6 +345,19 @@ export function deliveredOf(records: any[]): {
345
345
  bytes: number | null;
346
346
  sha256: string | null;
347
347
  }[];
348
+ /**
349
+ * The per-row results of the run's FINAL close (Addendum 2026-11-14 (c) piece 4): what its stage entries recorded in `rows` (`{key, result, why?}`) and `unclaimed` (words of a gap no row owns), keyed by
350
+ * the signed list's row key / by job line. A close recorded before rows existed (an older run) yields empty maps: every reader then keeps the stage verdict. Read, never re-derived.
351
+ * @param {any[]} records @param {any} spec
352
+ * @returns {{results: Map<string, {result: string, why?: string}>, unclaimed: Map<number, string[]>}}
353
+ */
354
+ export function rowResultsFromRecords(records: any[], spec: any): {
355
+ results: Map<string, {
356
+ result: string;
357
+ why?: string;
358
+ }>;
359
+ unclaimed: Map<number, string[]>;
360
+ };
348
361
  /**
349
362
  * R8 (piece 10): the ticket grid of the job a run belongs to, or `null` when that job is not a Tickets job (no run of it read a ticket) or the run is unknown. ONE row per run of the job, from
350
363
  * the run list's own entry (`summarizeRow`: status, needs, money, wall, ending words), the ticket from `job-start` ({@link ticketOfStart}), the checks from {@link checksOf} and the steps from
@@ -734,22 +747,7 @@ export function getRunResult(runid: string, opts?: {
734
747
  foldWords: string;
735
748
  scopeLine: string | null;
736
749
  } | null;
737
- checks: {
738
- head: string;
739
- passed: number;
740
- total: number;
741
- allPassed: boolean;
742
- stages: any[];
743
- notes: never[];
744
- } | {
745
- head: string;
746
- passed: any;
747
- total: any;
748
- notReached: number;
749
- allPassed: boolean;
750
- stages: any;
751
- notes: any;
752
- } | null;
750
+ checks: any;
753
751
  work: {
754
752
  branch: string;
755
753
  finalCommit: string;
@@ -983,6 +981,33 @@ export function judgedFileLine(o: {
983
981
  bytes: number | null;
984
982
  sha256: string | null;
985
983
  }): string;
984
+ /**
985
+ * The close's stage names, in declared order — `close[].name` (a hand-authored
986
+ * command close) or `closeDecl.stages[].name` (an authored declaration); the
987
+ * two are mutually exclusive (`validateJob`'s own `close-duplicated` red).
988
+ * `null` when neither carries a named stage (an old/malformed spec) — never a
989
+ * fabricated placeholder.
990
+ * @param {any} spec
991
+ * @returns {string|null}
992
+ */
993
+ export function successFromSpec(spec: any): string | null;
994
+ /**
995
+ * The write fence plus the guard checks a close actually carries — reusing
996
+ * {@link confirmProtections} (`src/authorflow.js`), the SAME function the
997
+ * authoring CLI's confirm turn shows a person, never a second hand-typed list
998
+ * (build spec item 2). Guard names only resolve for a `closeDecl` spec
999
+ * (`classGuards` needs its `lang`+the spec's `verdictType`); an old-shape
1000
+ * `close`-array spec falls back to the write fence alone — its guard stages
1001
+ * (e.g. `no-suppressions`) already show up in {@link successFromSpec}'s own
1002
+ * stage list, and inventing a second detector to relabel them as "guards" here
1003
+ * would be exactly the per-age special-casing the build spec rules out.
1004
+ * `confirmProtections` itself can throw for an unrecognized verdictType/lang
1005
+ * (a spec this panel was never validated against) — caught here so a stale or
1006
+ * hand-edited spec never 500s the Job tab, only shows less than it could.
1007
+ * @param {any} spec
1008
+ * @returns {string|null}
1009
+ */
1010
+ export function guardrailsFromSpec(spec: any): string | null;
986
1011
  /**
987
1012
  * The Signed row of the Job tab: `YYYY-MM-DD HH:MM · <first 6 of specHash>`, the time being the run's FIRST `job-start`
988
1013
  * in local time (hamr, P7). `null` when either part is not on record — never a made-up stamp.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Which buttons a look question offers. Agree only when it carries a proposal (a reading ask with its reading, a check-pick ask with its check); Drop it only where "drop it" leaves
3
- * one of the person's own `~` rules Not checked (a can't-check ask or a check-pick ask about a rule number).
3
+ * one of the person's own `~` rules Not checked (a reading or check-pick ask about a rule number). A rule with nothing to agree to is not asked at all (src/checkblock.js).
4
4
  * @param {{source?: string, ask?: string, reading?: unknown, check?: unknown, rule?: unknown}} q @returns {{agree: boolean, drop: boolean}}
5
5
  */
6
6
  export function offersOf(q: {
@@ -14,8 +14,8 @@ export function offersOf(q: {
14
14
  drop: boolean;
15
15
  };
16
16
  /**
17
- * A look question as the PANEL shows it: the code's own answer words (`Answer "agree"...` / `Answer "drop it"...`) cut off the end, because the buttons and the box say it.
18
- * Only the known tails are cut, matched exactly as a suffix (never a pattern over the prose); a question that ends in none of them is returned whole.
17
+ * A question as the PANEL shows it: the Destination question's own typed-answer words (`DEST_ANSWER`) cut off the end, because its buttons and box say it. A look question carries no answer words
18
+ * (its buttons say it); it is returned whole. Only the known tail is cut, matched exactly as a suffix (never a pattern over the prose).
19
19
  * @param {{question: string, line?: number, source?: string}} q @returns {string}
20
20
  */
21
21
  export function panelQuestionText(q: {
@@ -23,15 +23,26 @@ export function panelQuestionText(q: {
23
23
  line?: number;
24
24
  source?: string;
25
25
  }): string;
26
+ /**
27
+ * What a try-3 answer DOES, in the words the ask shows (Addendum 2026-11-14 (c) piece 5): `replaces` = the old words of the `~` rule the answer replaces; `adds` = the answer is a new rule of the line.
28
+ * Null when the question says neither (a code-forced look question has its own words). ONE owner: the panel's box, its chat line and the CLI print it.
29
+ * @param {{replaces?: unknown, adds?: unknown, line?: unknown}} step @returns {string|null}
30
+ */
31
+ export function answerEffectWords(step: {
32
+ replaces?: unknown;
33
+ adds?: unknown;
34
+ line?: unknown;
35
+ }): string | null;
26
36
  /**
27
37
  * What the panel's question box shows for one pending ask. Only a question the person answers (`kind: 'answer'`) has a box; every other ask (language, menu, install)
28
38
  * keeps the chat input. `sendChoice` = the choice the box's own Send posts.
29
- * @param {{kind: string, source?: string, index?: number, total?: number, question?: string, line?: number, offers?: {agree: boolean, drop: boolean}, folder?: string, current?: string}} step
39
+ * @param {{kind: string, source?: string, ask?: string, index?: number, total?: number, question?: string, line?: number, offers?: {agree: boolean, drop: boolean}, folder?: string, current?: string, replaces?: string, adds?: boolean}} step
30
40
  * @returns {{head: string, line: string, text: string, choices: {choice: string, label: string}[], orLabel: string|null, sendChoice: string}|null}
31
41
  */
32
42
  export function boxFor(step: {
33
43
  kind: string;
34
44
  source?: string;
45
+ ask?: string;
35
46
  index?: number;
36
47
  total?: number;
37
48
  question?: string;
@@ -42,6 +53,8 @@ export function boxFor(step: {
42
53
  };
43
54
  folder?: string;
44
55
  current?: string;
56
+ replaces?: string;
57
+ adds?: boolean;
45
58
  }): {
46
59
  head: string;
47
60
  line: string;
@@ -55,11 +68,12 @@ export function boxFor(step: {
55
68
  } | null;
56
69
  /**
57
70
  * The door's check of a choice sent for the pending ask. Null = accepted; else the refusal words.
58
- * @param {{kind: string, source?: string, rule?: unknown, offers?: {agree: boolean, drop: boolean}}} step @param {unknown} choice @returns {string|null}
71
+ * @param {{kind: string, source?: string, ask?: string, rule?: unknown, offers?: {agree: boolean, drop: boolean}}} step @param {unknown} choice @returns {string|null}
59
72
  */
60
73
  export function refuseChoice(step: {
61
74
  kind: string;
62
75
  source?: string;
76
+ ask?: string;
63
77
  rule?: unknown;
64
78
  offers?: {
65
79
  agree: boolean;
@@ -82,6 +96,6 @@ export const CHOICE_SAYS: Readonly<{
82
96
  bad: "That answer is not one of the choices. Nothing was saved.";
83
97
  notOffered: "That choice is not offered for this question. Nothing was saved.";
84
98
  outOfDate: "This page is out of date. Reload it and answer again. Nothing was saved.";
85
- noRule: "That question is about the job line, not one of your ~ rules, so there is nothing to drop. Agree, or type your own words. Nothing was saved.";
99
+ noRule: "That question is about the job line, not one of your ~ rules, so there is nothing to drop. Nothing was saved.";
86
100
  blank: "An answer is needed here — there is no skip. Type it in the box and press Send.";
87
101
  }>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @typedef {{key: string, result: 'passed'|'failed'|'unread', why?: string}} RowResult
3
+ * @param {any[]|null|undefined} list the signed list (`closeDecl.list`) @param {{step: number, parts: any[]}} params the rubric-step stage's params
4
+ * @param {{verdict?: string, rawGaps?: any[], extraGaps?: string[], detail?: Record<string, any>}} graded `gradeStep`'s answer
5
+ * @returns {{rows: RowResult[], unclaimed: string[]}}
6
+ */
7
+ export function rowResultsOf(list: any[] | null | undefined, params: {
8
+ step: number;
9
+ parts: any[];
10
+ }, graded: {
11
+ verdict?: string;
12
+ rawGaps?: any[];
13
+ extraGaps?: string[];
14
+ detail?: Record<string, any>;
15
+ }): {
16
+ rows: RowResult[];
17
+ unclaimed: string[];
18
+ };
19
+ export type RowResult = {
20
+ key: string;
21
+ result: "passed" | "failed" | "unread";
22
+ why?: string;
23
+ };
@@ -138,7 +138,7 @@ export function plainStepGap(step: number, why: string, g: any, params?: any): s
138
138
  * the manifest's recorded sha via `inputShas`.
139
139
  * @param {Record<string, string>} inputShas the manifest's recorded sha256 per cited label
140
140
  * @returns {Promise<{verdict: 'green'|'red'|'stopped', gapLines: string[], fault: string|null, detail: Record<string, any>,
141
- * evidence?: any[], evidenceTotal?: number}>} `evidence`/`evidenceTotal` are bareguard's `full.evidence` (what each `cited` check read), carried out
141
+ * rawGaps?: any[], extraGaps?: string[], evidence?: any[], evidenceTotal?: number}>} `evidence`/`evidenceTotal` are bareguard's `full.evidence` (what each `cited` check read), carried out
142
142
  * for the report-only `rubric-evidence` spine record; no verdict, gap or count above is derived from them
143
143
  */
144
144
  export function gradeStep({ params, bytes, outputBytes, inputs, factQuotes, factMissing }: {
@@ -156,6 +156,8 @@ export function gradeStep({ params, bytes, outputBytes, inputs, factQuotes, fact
156
156
  gapLines: string[];
157
157
  fault: string | null;
158
158
  detail: Record<string, any>;
159
+ rawGaps?: any[];
160
+ extraGaps?: string[];
159
161
  evidence?: any[];
160
162
  evidenceTotal?: number;
161
163
  }>;
@@ -291,19 +293,32 @@ export function partSentence(part: any): string;
291
293
  * @param {any} closeDecl @param {number} n @returns {boolean}
292
294
  */
293
295
  export function lineCarriesText(closeDecl: any, n: number): boolean;
296
+ /** the fence a close's row names: `closeDecl.fence` (the confirm card's view of it) or the allowed prefixes its own `changed-from-seed` guard stage signs @param {any} closeDecl @returns {string[]|null} */
297
+ export function fenceOfClose(closeDecl: any): string[] | null;
298
+ /**
299
+ * The words of a line's `$` floor row (Addendum 2026-11-14 (c) piece 1), written by code from the signed close: the line's file must exist and be complete JSON, and carry text only when the close
300
+ * really puts a text check on it ({@link lineCarriesText}); a facts-only line says it has none. ONE owner: the card, the Job tab and the Audit read it.
301
+ * @param {any} closeDecl @param {number} n @returns {string}
302
+ */
303
+ export function floorText(closeDecl: any, n: number): string;
304
+ /** the one spelling of the floor row's words (the check block's own card view reads it with the line's `carriesText`) @param {number} n @param {boolean} carriesText @returns {string} */
305
+ export function floorWords(n: number, carriesText: boolean): string;
294
306
  /**
295
307
  * The checks a signed close actually runs, per job line, in plain code-written sentences: one per countable part of every
296
308
  * rubric-step stage. This is the ONE reader both the plan card and the sign-time invariant use.
297
309
  * Each row says who added the check (`by`): `you` = one of the person's picks, as the signed close's own record (`closeDecl.picks`) names it; `agent` = the drafter's;
298
310
  * `default` = code's own (the one list's `$` rows: the cited part written by `defaultCitedText`, and the numbers tie of a text step).
299
- * @param {any} closeDecl
300
- * @returns {{line: number, text: string, by: 'agent'|'you'|'default', key?: string}[]}
311
+ * A repo job's list (Addendum 2026-11-15 (d)) adds its rows here: an `!` row per work stage (the stage's name) and a `~` row the write fence keeps (the rule in the person's words, from `jobLines`; else its number), `fence` holding the path.
312
+ * @param {any} closeDecl @param {any[]|null} [jobLines] the person's numbered lines, so a `~` row reads in their own words
313
+ * @returns {{line: number, text: string, by: 'agent'|'you'|'default', key?: string, pick?: true, fence?: string}[]}
301
314
  */
302
- export function checksOfClose(closeDecl: any): {
315
+ export function checksOfClose(closeDecl: any, jobLines?: any[] | null): {
303
316
  line: number;
304
317
  text: string;
305
318
  by: "agent" | "you" | "default";
306
319
  key?: string;
320
+ pick?: true;
321
+ fence?: string;
307
322
  }[];
308
323
  /**
309
324
  * The names of the facts a signed close checks (every fact part of every rubric-step stage). Pure.
@@ -315,7 +330,7 @@ export function signedFactNames(closeDecl: any): string[];
315
330
  * steps' "you judge it at Accept" lines and the refusals (`ruleNotChecked`, which reads the list's not-checked rows when the close carries the list). Nothing the confirm turn said is merged
316
331
  * in: a rubric confirm turn plans the goal only, so a check can never be shown and then silently dropped (run mv5bk400).
317
332
  * @param {{closeDecl: any, jobLines?: any[]|null, ledger?: {key: string, words: string[]}[]|null}} o `jobLines` the person's numbered lines, so a ~ rule reads in the person's own words; `ledger` the draft log's final list rows, so a phrase row is named by its words
318
- * @returns {{checkItems: {text: string, fromLine: number[], by: 'agent'|'you'|'default', key?: string}[], notChecked: string[], notCheckedBy: Record<string, 'you'|'agent'|'default'>}}
333
+ * @returns {{checkItems: {text: string, fromLine: number[], by: 'agent'|'you'|'default', key?: string, pick?: true}[], notChecked: string[], notCheckedBy: Record<string, 'you'|'agent'|'default'>}}
319
334
  */
320
335
  export function cardOfClose({ closeDecl, jobLines, ledger }: {
321
336
  closeDecl: any;
@@ -330,6 +345,7 @@ export function cardOfClose({ closeDecl, jobLines, ledger }: {
330
345
  fromLine: number[];
331
346
  by: "agent" | "you" | "default";
332
347
  key?: string;
348
+ pick?: true;
333
349
  }[];
334
350
  notChecked: string[];
335
351
  notCheckedBy: Record<string, "you" | "agent" | "default">;
@@ -349,13 +365,13 @@ export function listMatchesClose(closeDecl: any): {
349
365
  /**
350
366
  * The sign-time invariant: the checks the person was shown (`shown`, from the plan card) are exactly the checks the signed
351
367
  * close runs (`checksOfClose`), per line. Pure.
352
- * @param {{text: string, fromLine: number[]|null}[]} shown @param {any} closeDecl
368
+ * @param {{text: string, fromLine: number[]|null}[]} shown @param {any} closeDecl @param {any[]|null} [jobLines] the person's numbered lines (a repo job's `~` row reads the rule in their words)
353
369
  * @returns {{ok: true}|{ok: false, error: string}}
354
370
  */
355
371
  export function planMatchesClose(shown: {
356
372
  text: string;
357
373
  fromLine: number[] | null;
358
- }[], closeDecl: any): {
374
+ }[], closeDecl: any, jobLines?: any[] | null): {
359
375
  ok: true;
360
376
  } | {
361
377
  ok: false;
@@ -402,6 +418,17 @@ export const NEGATING_RE: RegExp;
402
418
  export const WHY_OTHER_CURRENCY: "the amount is in another currency than the page fact";
403
419
  export function defaultCitedText(label: string): string;
404
420
  export function defaultNoteText(n: number): string;
421
+ export function carriesOneList(closeDecl: any): boolean;
422
+ export function guardKeyOf(name: string): string;
423
+ export function guardNameOfKey(key: unknown): string;
424
+ export function stageKeyOf(name: string): string;
425
+ export function stageNameOfKey(key: unknown): string;
426
+ /** the words of a text line's `prose` row: the person judges what the text says at Accept (the same words the stage-derived line always used) */
427
+ export const PROSE_WORDS: "what the text says \u2014 you judge it at Accept";
428
+ /** the key of the job-level write fence row (the one list, hamr 2026-11-15: the fence is a `$` row like every other rule) */
429
+ export const FENCE_KEY: "J.$fence";
430
+ export function fenceRowText(scope: string[]): string;
431
+ export function guardRowText(name: string): string;
405
432
  export type ShapeRed = {
406
433
  code: string;
407
434
  path: string;
@@ -90,6 +90,17 @@ export function stageQuestionText({ kind, params, genre, suiteCmdKeys, }: {
90
90
  * @returns {Map<string, string|null>}
91
91
  */
92
92
  export function stageQuestionsByName(spec: any): Map<string, string | null>;
93
+ /**
94
+ * The plain question of the `$ [default]` write-fence row, built from the signed fence itself: `src/**` reads `src/`; an entry that is a glob this cannot read as a folder or file is quoted as it was signed.
95
+ * @param {string[]} scope @returns {string}
96
+ */
97
+ export function fenceQuestionText(scope: string[]): string;
98
+ /**
99
+ * The plain question of a job-level `$ [default]` guard row (the one list's guard rows, by guard NAME) — the one owner the plan card, Job tab, Audit, Result and the CLI print read, in place of the guard's raw name and its
100
+ * long frozen sentence (GUARD_DESCRIPTIONS stays the older confirm-turn "protections" line). `null` for a guard with no line here: the caller keeps the old words, never an invented question.
101
+ * @param {string} name @returns {string|null}
102
+ */
103
+ export function guardQuestionText(name: string): string | null;
93
104
  /** the genre-owned noun for the count a TYPES-genre typecheck stage measures (see {@link stageQuestionText}) */
94
105
  export const GENRE_WHAT: Readonly<{
95
106
  TYPES: "type errors";