fwdloop 0.36.0 → 0.38.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/README.md +6 -20
- package/bin/fwdloop +35 -12
- package/package.json +3 -3
- package/src/action-stop.js +1 -1
- package/src/auditchecks.js +41 -9
- package/src/authoring.js +78 -20
- package/src/blockasks.js +10 -12
- package/src/blockassemble.js +49 -46
- package/src/blockdraft.js +4 -2
- package/src/blockpick.js +10 -0
- package/src/canrun.js +2 -1
- package/src/cardlist.js +28 -5
- package/src/checkblock.js +598 -61
- package/src/checked.js +27 -33
- package/src/checklistsign.js +3 -3
- package/src/checklook.js +45 -0
- package/src/checkrows.js +202 -0
- package/src/cited-record.js +2 -2
- package/src/citedcheck.js +53 -12
- package/src/citedwords.js +7 -4
- package/src/closers.js +49 -2
- package/src/declaration.js +34 -10
- package/src/drafter.js +99 -74
- package/src/factwords.js +7 -4
- package/src/globprefix.js +26 -0
- package/src/isrec.js +2 -0
- package/src/line-checks.js +1 -2
- package/src/minrule.js +16 -0
- package/src/model-step.js +22 -4
- package/src/pageask.js +0 -3
- package/src/pagedropwords.js +3 -11
- package/src/pagedry.js +75 -1
- package/src/pagefetch.js +11 -6
- package/src/pagelook.js +2 -1
- package/src/pagerules.js +8 -2
- package/src/panel/author.js +33 -8
- package/src/panel/data.js +3 -2
- package/src/panel/index.html +177 -37
- package/src/panel/result.js +34 -1
- package/src/pickrecord.js +14 -0
- package/src/planrebuild.js +55 -19
- package/src/ratelimit.js +117 -0
- package/src/report.js +14 -2
- package/src/rowresults.js +111 -0
- package/src/rubricstep.js +65 -2
- package/src/runner.js +38 -5
- package/src/shapebuild.js +281 -0
- package/src/shapelook.js +91 -0
- package/src/shapemenu.js +64 -0
- package/src/shaperesult.js +104 -0
- package/src/shaperows.js +263 -0
- package/src/shapewords.js +140 -0
- package/src/sheet-record.js +1 -2
- package/src/sheetblock.js +1 -2
- package/src/sheetbuild.js +41 -29
- package/src/sheetchecks.js +1 -2
- package/src/sheetclaims.js +1 -2
- package/src/sheetoffer.js +1 -1
- package/src/sheetrows.js +10 -64
- package/src/sheetrun.js +1 -2
- package/src/ticketrows.js +2 -3
- package/src/try-checks.js +39 -6
- package/src/types.js +1 -0
- package/src/whole-job.js +24 -8
- package/types/action-stop.d.ts +1 -1
- package/types/auditchecks.d.ts +13 -2
- package/types/authoring.d.ts +21 -2
- package/types/blockasks.d.ts +6 -10
- package/types/blockassemble.d.ts +12 -13
- package/types/blockdraft.d.ts +3 -2
- package/types/blockpick.d.ts +4 -0
- package/types/cardlist.d.ts +18 -2
- package/types/checkblock.d.ts +276 -27
- package/types/checked.d.ts +15 -6
- package/types/checklook.d.ts +36 -0
- package/types/checkrows.d.ts +119 -0
- package/types/citedcheck.d.ts +4 -2
- package/types/closers.d.ts +10 -1
- package/types/drafter.d.ts +9 -4
- package/types/globprefix.d.ts +5 -0
- package/types/isrec.d.ts +1 -0
- package/types/minrule.d.ts +6 -0
- package/types/model-step.d.ts +43 -2
- package/types/pageask.d.ts +0 -1
- package/types/pagedropwords.d.ts +0 -1
- package/types/pagedry.d.ts +27 -0
- package/types/pagefetch.d.ts +3 -2
- package/types/pagerules.d.ts +4 -0
- package/types/panel/result.d.ts +16 -1
- package/types/pickrecord.d.ts +10 -0
- package/types/ratelimit.d.ts +59 -0
- package/types/report.d.ts +2 -1
- package/types/rowresults.d.ts +28 -0
- package/types/rubricstep.d.ts +21 -0
- package/types/runner.d.ts +3 -1
- package/types/shapebuild.d.ts +97 -0
- package/types/shapelook.d.ts +76 -0
- package/types/shapemenu.d.ts +40 -0
- package/types/shaperesult.d.ts +40 -0
- package/types/shaperows.d.ts +102 -0
- package/types/shapewords.d.ts +43 -0
- package/types/sheetbuild.d.ts +31 -13
- package/types/sheetrows.d.ts +5 -36
- package/types/ticketrows.d.ts +1 -1
- package/types/try-checks.d.ts +2 -1
- package/types/types.d.ts +4 -0
- package/types/whole-job.d.ts +20 -4
package/types/blockassemble.d.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The words a Not-checked row says. A rule the person left, wrote in their own words, or left with no pick keeps fwd's signed table (M10 am16 (5): src/pagedropwords.js), the words the plan card and the
|
|
3
|
-
* Audit already had; any other reason is the block's own (what code could not build and why).
|
|
4
|
-
* @param {string|null|undefined} reason @param {{cantAsked?: boolean}} [row]
|
|
5
|
-
*/
|
|
6
|
-
export function notCheckedWords(reason: string | null | undefined, row?: {
|
|
7
|
-
cantAsked?: boolean;
|
|
8
|
-
}): string;
|
|
9
1
|
/** a countable part as the picked check the softgreen close runs: its own fields, the rule named `rule` (the inverse of the block's partOfPick) @param {Record<string, any>} part */
|
|
10
2
|
export function pickedOf(part: Record<string, any>): {
|
|
11
3
|
rule: any;
|
|
12
4
|
};
|
|
13
5
|
/**
|
|
14
|
-
* @param {{declaration: Record<string, any>, block: import('./checkblock.js').CheckBlock, lines: {n: number, guardrail?: string|null}[], lineSet: Set<number>, askLines?: Set<number
|
|
15
|
-
* `lineSet` = the lines the block
|
|
6
|
+
* @param {{declaration: Record<string, any>, block: import('./checkblock.js').CheckBlock, lines: {n: number, guardrail?: string|null}[], lineSet: Set<number>, askLines?: Set<number>, sheetRoles?: string[], shapeOnlyClass?: 'green'|null}} o
|
|
7
|
+
* `lineSet` = the lines of the list (the block's step lines that are not sheet lines); `lines` = the signed lines (a guardrail decides the class); `askLines` = the signed Ask lines: each `~` rule on one is a Not-checked line here, never skipped (M17 am5 item 2);
|
|
8
|
+
* `sheetRoles` = the CSV inputs: the block's sheet part of a sheet line is the `close.sheet` of the line's first green step that reads one (M19 S3: the checks the block holds, drops and all)
|
|
16
9
|
* @returns {{declaration: Record<string, any>, notChecked: string[], notCheckedBy: Record<string, 'you'|'agent'|'default'>, built: Set<number>}} `built` = the lines that got a check from the block (a red naming one of them is a fault of the build)
|
|
17
10
|
*/
|
|
18
|
-
export function assembleFromBlock({ declaration, block, lines, lineSet, askLines }: {
|
|
11
|
+
export function assembleFromBlock({ declaration, block, lines, lineSet, askLines, sheetRoles, shapeOnlyClass }: {
|
|
19
12
|
declaration: Record<string, any>;
|
|
20
13
|
block: import("./checkblock.js").CheckBlock;
|
|
21
14
|
lines: {
|
|
@@ -24,6 +17,8 @@ export function assembleFromBlock({ declaration, block, lines, lineSet, askLines
|
|
|
24
17
|
}[];
|
|
25
18
|
lineSet: Set<number>;
|
|
26
19
|
askLines?: Set<number>;
|
|
20
|
+
sheetRoles?: string[];
|
|
21
|
+
shapeOnlyClass?: "green" | null;
|
|
27
22
|
}): {
|
|
28
23
|
declaration: Record<string, any>;
|
|
29
24
|
notChecked: string[];
|
|
@@ -46,5 +41,9 @@ export function closeUnbuiltSheetSteps(declaration: Record<string, any>, unbuilt
|
|
|
46
41
|
};
|
|
47
42
|
/** M17 am5 item 2 (D3): the reason a `~` rule on a signed Ask line is Not checked, the signed words */
|
|
48
43
|
export const ASK_LINE_REASON: "you judge it at the Ask";
|
|
49
|
-
/**
|
|
50
|
-
|
|
44
|
+
/**
|
|
45
|
+
* M19 amendment 1 (signed 2026-11-20): a line that is a list of items and nothing else (no quote) signs class `green` with `itemShape` and no `cited`; the person's own rules on its text still ride beside it. `null` (tests only) signs no
|
|
46
|
+
* list-of-items check and the rows are Not checked (REASON.noRule). A facts+shape line keeps its class (green, `cited` plus `itemShape`, amendment E) whatever this says.
|
|
47
|
+
* @type {'green'|null}
|
|
48
|
+
*/
|
|
49
|
+
export const SHAPE_ONLY_CLASS: "green" | null;
|
package/types/blockdraft.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export function isBuildFault(red: string, builtLines: number[]): boolean;
|
|
|
9
9
|
/**
|
|
10
10
|
* The block of a draft (M16 item 2): the person's `~` rules and `$` defaults, then the look's facts, then the picks the person made (kept from the last draft, and just answered), reconciled once.
|
|
11
11
|
* Fresh answers go through `carry` like the kept ones (the draft is a child process: the answer comes back as a pick or a left rule), and are not marked "kept".
|
|
12
|
-
* @param {{leaveOut?: {line: number, rule: number}[], texts: Record<string, string>, jobLines: any[], look: {facts: any[], dropped: any[]}, kept: {picks: any[], left: any[], askRules: any[]}, fresh: {picks: any[], left: {line: number, rule: number}[]}, asks: boolean, countScope: (t: string) => boolean}} o
|
|
12
|
+
* @param {{leaveOut?: {line: number, rule: number}[], sheetLines?: number[], texts: Record<string, string>, jobLines: any[], look: {facts: any[], dropped: any[]}, kept: {picks: any[], left: any[], askRules: any[]}, fresh: {picks: any[], left: {line: number, rule: number}[]}, asks: boolean, countScope: (t: string) => boolean}} o
|
|
13
13
|
*/
|
|
14
|
-
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope, leaveOut }: {
|
|
14
|
+
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope, leaveOut, sheetLines }: {
|
|
15
15
|
leaveOut?: {
|
|
16
16
|
line: number;
|
|
17
17
|
rule: number;
|
|
18
18
|
}[];
|
|
19
|
+
sheetLines?: number[];
|
|
19
20
|
texts: Record<string, string>;
|
|
20
21
|
jobLines: any[];
|
|
21
22
|
look: {
|
package/types/blockpick.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ export function partOfPick(check: Record<string, any>, text: string, rules: numb
|
|
|
40
40
|
class: string;
|
|
41
41
|
check: any;
|
|
42
42
|
};
|
|
43
|
+
/** the numbers a text says as "under / fewer than / less than / below N" (the one reader of that wording: a list-items rule and a shape field's bound both use it) @param {string} text @returns {number[]} */
|
|
44
|
+
export function underNumbers(text: string): number[];
|
|
45
|
+
/** the numbers a text says as "at most / up to / no more than / not more than N" @param {string} text @returns {number[]} */
|
|
46
|
+
export function atMostNumbers(text: string): number[];
|
|
43
47
|
export { plainWords };
|
|
44
48
|
export function isCountable(g: unknown): boolean;
|
|
45
49
|
export function sameRuleWords(a: unknown, b: unknown): boolean;
|
package/types/cardlist.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {import('./checkblock.js').CheckBlock} block
|
|
3
|
-
* @returns {{rows: {key: string, line: number, by: string, state: string,
|
|
3
|
+
* @returns {{rows: {key: string, line: number, by: string, state: string, reason: string|null, drop: boolean, kind: 'truth'|'shape'|'file'}[], suggested: {key: string, line: number, text: string, dropped?: boolean}[], restorable?: {key: string, line: number, text: string}[]}}
|
|
4
4
|
*/
|
|
5
5
|
export function cardOfBlock(block: import("./checkblock.js").CheckBlock): {
|
|
6
6
|
rows: {
|
|
@@ -8,9 +8,9 @@ export function cardOfBlock(block: import("./checkblock.js").CheckBlock): {
|
|
|
8
8
|
line: number;
|
|
9
9
|
by: string;
|
|
10
10
|
state: string;
|
|
11
|
-
text: string;
|
|
12
11
|
reason: string | null;
|
|
13
12
|
drop: boolean;
|
|
13
|
+
kind: "truth" | "shape" | "file";
|
|
14
14
|
}[];
|
|
15
15
|
suggested: {
|
|
16
16
|
key: string;
|
|
@@ -18,4 +18,20 @@ export function cardOfBlock(block: import("./checkblock.js").CheckBlock): {
|
|
|
18
18
|
text: string;
|
|
19
19
|
dropped?: boolean;
|
|
20
20
|
}[];
|
|
21
|
+
restorable?: {
|
|
22
|
+
key: string;
|
|
23
|
+
line: number;
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
21
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* M19 am6 to am9: the card a draft saves and the panel draws. The block's own card gives the suggestions, the restorable rows and the Drop flags; the rows come from the signed plan through the one reader (src/checkrows.js `planCard`),
|
|
29
|
+
* with the Not checked rows as a list of their own. `kept` = the picks and rules a Revise carried (the block's `keptFromLast` rows).
|
|
30
|
+
* @param {import('./checkblock.js').CheckBlock} block @param {any} withSheetAndTickets the block's card with the sheet and Tickets rows (src/sheetrows.js `withSheetCard`) @param {{declaration: any, lines: any[], csvRoles?: string[], log?: unknown}} plan
|
|
31
|
+
*/
|
|
32
|
+
export function cardOfPlanBlock(block: import("./checkblock.js").CheckBlock, withSheetAndTickets: any, plan: {
|
|
33
|
+
declaration: any;
|
|
34
|
+
lines: any[];
|
|
35
|
+
csvRoles?: string[];
|
|
36
|
+
log?: unknown;
|
|
37
|
+
}): any;
|
package/types/checkblock.d.ts
CHANGED
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
/** the card
|
|
1
|
+
/** the card's rows: which rows show, and their key, line, tag, state and reason. NO words: the words of a row are the plan reader's (src/checkrows.js `planCard`), one writer (M19 am6 item 4). @param {Row[]} rows */
|
|
2
2
|
export function renderCard(rows: Row[]): {
|
|
3
3
|
key: any;
|
|
4
4
|
line: any;
|
|
5
5
|
by: any;
|
|
6
6
|
state: any;
|
|
7
7
|
reason: any;
|
|
8
|
+
}[];
|
|
9
|
+
/**
|
|
10
|
+
* The Drop/Add choices of rows, tied to the line's words (not its number) and the row's own name, so a Revise keeps them. ONE owner for the block's own record and for a Drop made on a signed card.
|
|
11
|
+
* @param {{n: number, text: string}[]} lines @param {{line: number, key: string, choice: string}[]} picks @returns {{lineWords: string, occurrence: number, tail: string, choice: string}[]}
|
|
12
|
+
*/
|
|
13
|
+
export function choiceEntries(lines: {
|
|
14
|
+
n: number;
|
|
8
15
|
text: string;
|
|
16
|
+
}[], picks: {
|
|
17
|
+
line: number;
|
|
18
|
+
key: string;
|
|
19
|
+
choice: string;
|
|
20
|
+
}[]): {
|
|
21
|
+
lineWords: string;
|
|
22
|
+
occurrence: number;
|
|
23
|
+
tail: string;
|
|
24
|
+
choice: string;
|
|
9
25
|
}[];
|
|
10
26
|
/**
|
|
11
27
|
* A row. `kind`: rule, fact, phrase, count, cited, numbers, floor. `by`: you (`~`), agent (`!`), default (`$`). A `~` row may carry `links` (the look's facts tied to it),
|
|
12
28
|
* `pick`, `aiReading`, `left`. `state` is built or not-checked; a not-checked row always has a plain `reason`.
|
|
13
29
|
* @typedef {Record<string, any>} Row
|
|
14
30
|
*/
|
|
15
|
-
/**
|
|
16
|
-
export const CARD_T: Readonly<{
|
|
17
|
-
count: "result count";
|
|
18
|
-
cited: "every claim is backed by a quote copied from";
|
|
19
|
-
theInput: "the input";
|
|
20
|
-
numbers: "every number in the text is in a checked quote of line";
|
|
21
|
-
withWords: "with the words";
|
|
22
|
-
}>;
|
|
31
|
+
/** what `setSheet` is given: code's build of a job's sheet checks, per sheet line @typedef {Awaited<ReturnType<typeof import('./sheetbuild.js').buildSheetChecks>>} SheetBuilt */
|
|
23
32
|
/** the four row edits an AI reply may hold */
|
|
24
33
|
export const EDIT_OPS: readonly string[];
|
|
25
34
|
/** the plain reasons code gives, in one place (the card, the Job tab and the Audit read them from the row) */
|
|
26
35
|
export const REASON: Readonly<{
|
|
27
36
|
left: "You chose to leave it Not checked, so you judge it at Accept.";
|
|
28
37
|
nothingOnPage: "Your own words are on the line; the machine has no check for them, so you judge it at Accept.";
|
|
29
|
-
cantCheck: "I can't check this on the page; waiting for your answer";
|
|
30
38
|
noRule: "No rule can check this, so you judge it at Accept.";
|
|
31
39
|
waitingPick: "waiting for your answer on the proposed check";
|
|
32
40
|
waitingReading: "waiting for your answer on the reading";
|
|
@@ -38,13 +46,17 @@ export const REASON: Readonly<{
|
|
|
38
46
|
lookNoWords: "the page does not hold the words of the look's fact for this rule";
|
|
39
47
|
afterLast: "no more tries: Start over (rows are never changed by the AI after the last try)";
|
|
40
48
|
noPick: "No check was picked for it, so you judge it at Accept.";
|
|
49
|
+
itemCountByRule: "your rule on this line sets the item count";
|
|
41
50
|
negated: "it says what is not needed, so there is nothing to check";
|
|
42
51
|
dropped: "You dropped it.";
|
|
43
52
|
suggested: "Suggested: not in your job, so it is not checked unless you add it.";
|
|
53
|
+
sheetLine: "this line reads a sheet and its rules are checked by the sheet checks, so a row edit about it is not used";
|
|
54
|
+
sheetFacts: "this line reads a sheet, so it is checked by its sheet checks and not by page facts";
|
|
55
|
+
columnRule: "this rule only names a column; the agent's checks on this line use it";
|
|
44
56
|
}>;
|
|
45
57
|
export class CheckBlock {
|
|
46
|
-
/** @param {{texts: Record<string, string>, labels: string[], maxTries?: number, countScope?: (ruleText: string) => boolean, asks?: boolean, split?: boolean, cited?: boolean}} o the frozen input texts, their labels, how many AI replies (tries) may still change a row, whether code scopes a counting `~` rule in (a pick is asked), and whether a person can be asked at all (`asks`: false = a rule code cannot settle is Not checked, a reading code proposes is built as the AI's proposal) */
|
|
47
|
-
constructor({ texts, labels, maxTries, countScope, asks, split, cited }: {
|
|
58
|
+
/** @param {{texts: Record<string, string>, labels: string[], maxTries?: number, countScope?: (ruleText: string) => boolean, asks?: boolean, split?: boolean, cited?: boolean, repo?: {files: string[]|null, writeScope: string[]|null}|null}} o the frozen input texts, their labels, how many AI replies (tries) may still change a row, whether code scopes a counting `~` rule in (a pick is asked), and whether a person can be asked at all (`asks`: false = a rule code cannot settle is Not checked, a reading code proposes is built as the AI's proposal) */
|
|
59
|
+
constructor({ texts, labels, maxTries, countScope, asks, split, cited, repo }: {
|
|
48
60
|
texts: Record<string, string>;
|
|
49
61
|
labels: string[];
|
|
50
62
|
maxTries?: number;
|
|
@@ -52,8 +64,21 @@ export class CheckBlock {
|
|
|
52
64
|
asks?: boolean;
|
|
53
65
|
split?: boolean;
|
|
54
66
|
cited?: boolean;
|
|
67
|
+
repo?: {
|
|
68
|
+
files: string[] | null;
|
|
69
|
+
writeScope: string[] | null;
|
|
70
|
+
} | null;
|
|
55
71
|
});
|
|
56
72
|
cited: boolean;
|
|
73
|
+
/** a repo job's check TYPE (the only thing that varies): `files` = the repo listing at the seed (null until it is read), `writeScope` = the signed write fence. Null = a rubric job @type {{files: string[]|null, writeScope: string[]|null}|null} */
|
|
74
|
+
repo: {
|
|
75
|
+
files: string[] | null;
|
|
76
|
+
writeScope: string[] | null;
|
|
77
|
+
} | null;
|
|
78
|
+
/** @type {any[]} a repo job's drafted stages as the drafter wrote them (guards included); the rows of the work stages are in `rows`, the close's stages are these minus the dropped ones */
|
|
79
|
+
declared: any[];
|
|
80
|
+
/** the job lines a mandatory guard already covers (`guardLines`): a repo stage is never dropped when it is the last thing covering a line @type {Set<number>} */
|
|
81
|
+
guardCover: Set<number>;
|
|
57
82
|
/** the product path sets it: `!` rows split into job-derived and suggested, a suggestion code cannot build is hidden (hamr 2026-11-13). Off, every `!` row is built as before (the older callers and their tests) */
|
|
58
83
|
split: boolean;
|
|
59
84
|
countScope: (ruleText: string) => boolean;
|
|
@@ -88,6 +113,102 @@ export class CheckBlock {
|
|
|
88
113
|
closeCache: any;
|
|
89
114
|
/** @type {Map<number, 'yes'|'no'|'failed'>} the note question's answer per facts-only line (src/noteask.js; code decides what it means) */
|
|
90
115
|
notes: Map<number, "yes" | "no" | "failed">;
|
|
116
|
+
/** @type {string[]} the NAMES of the mandatory guards the close carries (Addendum 2026-11-14 (c) piece 2): each is a job-level `$` row of the signed list, never a row of `rows` (no line, so no check of a line) */
|
|
117
|
+
guards: string[];
|
|
118
|
+
/** @type {string[]|null} the write fence of the job: a job-level `$` row of the signed list (hamr 2026-11-15), never a row of `rows` */
|
|
119
|
+
fence: string[] | null;
|
|
120
|
+
/** S4: the job lines that read a sheet (a CSV input and a `~` rule): every rule of such a line is decided by the sheet checks alone, never by the page path (`src/sheetrows.js` `sheetLineNumbers`) @type {Set<number>} */
|
|
121
|
+
sheetLines: Set<number>;
|
|
122
|
+
/** S4: what code built from the AI's `sheetChecks` (src/sheetbuild.js `buildSheetChecks`), null until the row-edit turn has answered @type {SheetBuilt|null} */
|
|
123
|
+
sheetBuilt: SheetBuilt | null;
|
|
124
|
+
/** shape jobs (clause 4): what code built from the AI's `itemShape` (src/shapebuild.js `buildShapes`), null until the row-edit turn has answered. A line in `built` is a SHAPE line: a line is exactly one class, facts, sheet or shape @type {ReturnType<typeof import('./shapebuild.js').buildShapes>|null} */
|
|
125
|
+
shapeBuilt: ReturnType<typeof import("./shapebuild.js").buildShapes> | null;
|
|
126
|
+
/** shape jobs: the Drops the person made, kept beside the rows (`agent` = `<line>:<field name>`, `rules` = `<line>:<rule number>`) @type {{agent: Set<string>, rules: Set<string>}} */
|
|
127
|
+
shapeDrops: {
|
|
128
|
+
agent: Set<string>;
|
|
129
|
+
rules: Set<string>;
|
|
130
|
+
};
|
|
131
|
+
/** the mandatory guards of this job's class, by name: signedRows() adds one `$` guard row for each, once for the whole job @param {string[]} names @param {string[]|null} [fence] the signed write fence, when the job has one */
|
|
132
|
+
setGuards(names: string[], fence?: string[] | null): void;
|
|
133
|
+
/** S4: the job lines that read a sheet. Their rules are decided by the sheet checks alone (no page path, no pick question, no row edit), from here on @param {number[]} nums */
|
|
134
|
+
setSheetLines(nums: number[]): void;
|
|
135
|
+
/** @param {number} n */
|
|
136
|
+
isSheetLine(n: number): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* S4: the checks code built from the AI's `sheetChecks` become rows of the one list: an `[agent]` row for each check that is no rule row's. A `[you]` row is the `~` rule's own row (its state comes from the sheet,
|
|
139
|
+
* `matchSheetRule`). A Drop the person made on a check is kept for the same check (same typed fields) when the checks are built again; every row is reconciled.
|
|
140
|
+
* fwd keeps: no `[default]` sheet row (the tag adds one per sheet line, bareloop S4); fwd's list has none (M16 am4 (2): "a `[default]` sheet check does not exist").
|
|
141
|
+
* @param {SheetBuilt} built
|
|
142
|
+
*/
|
|
143
|
+
setSheet(built: SheetBuilt): void;
|
|
144
|
+
/** shape jobs, rules first: does job line `n` hold a rule that took its shape field (no truth check could take it)? Only such a line carries shape rows and a shape part @param {number} n */
|
|
145
|
+
isShapeLine(n: number): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Shape jobs, rules first (hamr 2026-11-19): remember the shape code built from the shape look (src/shapebuild.js `buildShapes`). It decides nothing by itself: `matchRule` tries every rule's truth check (fact, cite, count, phrase, pick) FIRST,
|
|
148
|
+
* and a rule that ends with none and no open ask may take its shape field (`takesShape`). A line where no rule did has no shape rows at all (`syncShapeRows`), so a page job's rows stay as they were. A Drop the person made
|
|
149
|
+
* (an `[agent]` field, or a rule's own shape field) is kept for the same field when the shape is built again. Every row is reconciled.
|
|
150
|
+
* @param {ReturnType<typeof import('./shapebuild.js').buildShapes>} built
|
|
151
|
+
*/
|
|
152
|
+
setShape(built: ReturnType<typeof import("./shapebuild.js").buildShapes>): void;
|
|
153
|
+
/** the Drops the shape rows carry now, remembered beside the rows (a row can leave the list and come back) */
|
|
154
|
+
keepShapeDrops(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Rules first: may this rule, which no truth check could take, take the shape field the shape look proposed for it? Its own `[you]` row then carries the field. Null when it may not (no shape, a sheet or repo job, no field for the rule).
|
|
157
|
+
* @param {Row} r @returns {{name: string}|null}
|
|
158
|
+
*/
|
|
159
|
+
takesShape(r: Row): {
|
|
160
|
+
name: string;
|
|
161
|
+
} | null;
|
|
162
|
+
/**
|
|
163
|
+
* The rules that are still Not checked once every truth check, the person's answers and the pending asks are settled, and that may still take a shape field (not a sheet or repo job, not left or negating by the person's words):
|
|
164
|
+
* the ONLY rules the shape look is asked about, and only when there is one. Call after `reconcile`.
|
|
165
|
+
* @returns {{line: number, rule: number}[]}
|
|
166
|
+
*/
|
|
167
|
+
shapeCandidates(): {
|
|
168
|
+
line: number;
|
|
169
|
+
rule: number;
|
|
170
|
+
}[];
|
|
171
|
+
/**
|
|
172
|
+
* Shape rows live only on a line where a rule took its shape field: its `[agent]` extra fields (job-derived on, no-word Suggested) and its `$` count row are added there, and removed from any line where none did.
|
|
173
|
+
* Called after the rules are matched.
|
|
174
|
+
*/
|
|
175
|
+
syncShapeRows(): void;
|
|
176
|
+
/** the dropped shape fields the record keeps, tied to the line's words (not its number): an `[agent]` field by its name, a rule's own shape field by its rule number @returns {{lineWords: string, occurrence: number, name?: string, rule?: number}[]} */
|
|
177
|
+
shapeDroppedRecord(): {
|
|
178
|
+
lineWords: string;
|
|
179
|
+
occurrence: number;
|
|
180
|
+
name?: string;
|
|
181
|
+
rule?: number;
|
|
182
|
+
}[];
|
|
183
|
+
/** a Revise keeps a Drop of the very same field (same line words, same name or rule number); a field this draft did not build is not dropped @param {{lineWords: string, occurrence: number, name?: string, rule?: number}[]} rec */
|
|
184
|
+
carryShapeDropped(rec: {
|
|
185
|
+
lineWords: string;
|
|
186
|
+
occurrence: number;
|
|
187
|
+
name?: string;
|
|
188
|
+
rule?: number;
|
|
189
|
+
}[]): void;
|
|
190
|
+
/**
|
|
191
|
+
* The dropped sheet checks the record keeps, as fwd's picks record has always written them (`{key, line, index, check, text}`, M17 am3): `index` is the check's place among its line's checks, `check` the check as built.
|
|
192
|
+
* fwd keeps this record shape (the tag ties each entry to the line's words instead, `{lineWords, occurrence, check, text}`): the record is a file of the plan folder, and a draft saved before this carries the old shape.
|
|
193
|
+
* @returns {{key: string, line: number, index: number, check: Record<string, any>, text: string}[]}
|
|
194
|
+
*/
|
|
195
|
+
sheetDroppedRecord(): {
|
|
196
|
+
key: string;
|
|
197
|
+
line: number;
|
|
198
|
+
index: number;
|
|
199
|
+
check: Record<string, any>;
|
|
200
|
+
text: string;
|
|
201
|
+
}[];
|
|
202
|
+
/** a Revise keeps a Drop of the very same check: the record's entries, matched on the line and the check's own fields (never its id: code names every check); a check this draft did not build is not dropped @param {{line: number, check: Record<string, any>}[]} rec */
|
|
203
|
+
carrySheetDropped(rec: {
|
|
204
|
+
line: number;
|
|
205
|
+
check: Record<string, any>;
|
|
206
|
+
}[]): void;
|
|
207
|
+
/** each job line's words and its order among equal lines (the key a record ties a choice to) @returns {Map<number, {lineWords: string, occurrence: number}>} */
|
|
208
|
+
lineWordKeys(): Map<number, {
|
|
209
|
+
lineWords: string;
|
|
210
|
+
occurrence: number;
|
|
211
|
+
}>;
|
|
91
212
|
textOf(source: string | undefined): string;
|
|
92
213
|
/** @param {number} line @param {string} [kind] */
|
|
93
214
|
rowsOn(line: number, kind?: string): Row[];
|
|
@@ -109,7 +230,23 @@ export class CheckBlock {
|
|
|
109
230
|
* becomes the `why` of the `~` rule it was tied to, or a Not checked `!` row of its own, so every drop shows under Not checked.
|
|
110
231
|
*/
|
|
111
232
|
addLook(facts: any[], dropped?: any[]): void;
|
|
233
|
+
/**
|
|
234
|
+
* S1 (the sheet look, src/sheetlook.js): a `~` rule whose word is no column of its CSV carries ONE column question. Agree writes `reading` (the rule's own words with the column in place of the word) as the rule's words,
|
|
235
|
+
* through the same one-rule-in, one-rule-out answer as any reading (`applyAnswer`); no line is added. Code builds the question; nothing here reads a model field.
|
|
236
|
+
* A tie (`columns`, `readings`: the rule's words for each tied column) has no single reading: the person picks a column (`applyAnswer` `column`) and the rule is that column's reading.
|
|
237
|
+
* @param {{line: number, rule: number|null, question: string, reading?: string, columns?: string[], readings?: Record<string, string>}[]} asks
|
|
238
|
+
*/
|
|
239
|
+
addSheetAsks(asks: {
|
|
240
|
+
line: number;
|
|
241
|
+
rule: number | null;
|
|
242
|
+
question: string;
|
|
243
|
+
reading?: string;
|
|
244
|
+
columns?: string[];
|
|
245
|
+
readings?: Record<string, string>;
|
|
246
|
+
}[]): void;
|
|
112
247
|
match(): void;
|
|
248
|
+
/** the person's own words of the rules an `[agent]` sheet row shows (its `covers`) @param {Row} r @returns {string[]} */
|
|
249
|
+
coverTexts(r: Row): string[];
|
|
113
250
|
/** a `!` row: the agent's fact, phrase or count (a look fact tied to a rule is a link on that rule's row, never a row of its own) */
|
|
114
251
|
isBang(r: Row): boolean;
|
|
115
252
|
/**
|
|
@@ -119,9 +256,22 @@ export class CheckBlock {
|
|
|
119
256
|
takeJobWord(r: Row): void;
|
|
120
257
|
/** are the row's words (or its count number, or the name it asks for a fact by) in the job line or its `~` rules? Normalised, case-insensitive */
|
|
121
258
|
inJob(r: Row): any;
|
|
259
|
+
/**
|
|
260
|
+
* M19 am11 item 1: on a line with item fields (a shape line), a `~` rule that counts list items is the shape part's own item count, not a count pick over `text`. Run after every rule is matched, so the order of the rules does not matter.
|
|
261
|
+
* The ONE writer of such a row's `can` and of its `from` (it is the person's rule again, not a pick). A text line, a sheet line and a repo line are unchanged. A Drop of the rule is kept (`shapeDrops.rules`).
|
|
262
|
+
*/
|
|
263
|
+
takeItemCounts(): void;
|
|
122
264
|
/** a `!` count row is built unless a `~` rule on its line already names the number */
|
|
123
265
|
matchCount(r: Row): void;
|
|
266
|
+
/** RULES FIRST (hamr 2026-11-19): today's truth check for the rule; only a rule that ends with none and no open ask takes the shape field proposed for it (the strongest check wins, no ask) @param {Row} r */
|
|
124
267
|
matchRule(r: Row): void;
|
|
268
|
+
matchTruthRule(r: Row): void;
|
|
269
|
+
/**
|
|
270
|
+
* S4: a `~` rule of a sheet line. The sheet checks code built decide it, and nothing else does (ONE owner: a rule has never two rows): built = this rule's own `[you]` row carries the check; an `[agent]` row that shows it carries it
|
|
271
|
+
* (and a Drop of that row leaves the rule Not checked); a table check only named it, a refusal, or nothing picked = Not checked with that plain reason. Before the AI's turn has answered, nothing is picked yet.
|
|
272
|
+
* @param {Row} r
|
|
273
|
+
*/
|
|
274
|
+
matchSheetRule(r: Row): void;
|
|
125
275
|
/** a `~` rule that counts words, bullets, lines or sections: a settled pick builds it; else code proposes the check and asks */
|
|
126
276
|
matchCountRule(r: Row): void;
|
|
127
277
|
/** a `!` fact or phrase row: its words must be on the page; a version or a date is true only today, so only a place rule's fit may carry it */
|
|
@@ -134,6 +284,24 @@ export class CheckBlock {
|
|
|
134
284
|
n: number;
|
|
135
285
|
text: string;
|
|
136
286
|
}, lineParts: any[], lineRows: string[][], factLines: Set<number>): void;
|
|
287
|
+
/**
|
|
288
|
+
* S4: ONE sheet part per sheet line, from the checks code built (the `[you]` rule rows' checks, then the `[agent]` checks the person has not dropped). Every row it carries points at it. A part code cannot legally build leaves its rows Not checked
|
|
289
|
+
* in the stage-shape red's own words; a line whose checks were all dropped has no part and no `[default]` row.
|
|
290
|
+
* @param {{n: number}} l @param {Row[]} sheetRows @param {any[]} lineParts @param {string[][]} lineRows
|
|
291
|
+
*/
|
|
292
|
+
buildSheetPartOf(l: {
|
|
293
|
+
n: number;
|
|
294
|
+
}, sheetRows: Row[], lineParts: any[], lineRows: string[][]): void;
|
|
295
|
+
/**
|
|
296
|
+
* Shape jobs: ONE shape part per shape line, from the fields that stand (a `[you]` rule row's field, then the `[agent]` fields the person has not dropped and that are not Suggested) and the item count the person's words gave. Every
|
|
297
|
+
* row it carries points at it. A line left with no field has no part and no `[default]` row.
|
|
298
|
+
* The part is validated by `rubricStepShapeReds` (names, kinds, count, and bareguard's own `createRubric` over the `itemShape` check): a part code cannot legally build leaves its rows Not checked in that red's own words, as `buildSheetPartOf` does.
|
|
299
|
+
* @param {{n: number, text: string}} l @param {Row[]} shapeRows @param {any[]} lineParts @param {string[][]} lineRows
|
|
300
|
+
*/
|
|
301
|
+
buildShapePartOf(l: {
|
|
302
|
+
n: number;
|
|
303
|
+
text: string;
|
|
304
|
+
}, shapeRows: Row[], lineParts: any[], lineRows: string[][]): void;
|
|
137
305
|
/**
|
|
138
306
|
* The fact(s) a fact-like row builds, checked alone through the bareguard shapes and against the facts already on the line.
|
|
139
307
|
* @param {Row} r @param {any[]} onLine the facts already built on this line @returns {{fresh: any[], src: string, names: string[]} | {why: string}}
|
|
@@ -163,10 +331,61 @@ export class CheckBlock {
|
|
|
163
331
|
line: number;
|
|
164
332
|
answer: "yes" | "no" | "failed";
|
|
165
333
|
}[]): void;
|
|
334
|
+
/**
|
|
335
|
+
* The person's job lines as they stand now (a try-3 answer replaced or added a `~` rule): a rule whose words changed is the person's own typed words (its old answer is void), a new rule is a new row, a rule that is gone leaves.
|
|
336
|
+
* @param {{n: number, text: string, rules?: string[]}[]} jobLines
|
|
337
|
+
*/
|
|
338
|
+
syncJob(jobLines: {
|
|
339
|
+
n: number;
|
|
340
|
+
text: string;
|
|
341
|
+
rules?: string[];
|
|
342
|
+
}[]): void;
|
|
343
|
+
/** the repo listing at the seed, once it is read (the rule rows are judged against it) @param {string[]|null} files */
|
|
344
|
+
setListing(files: string[] | null): void;
|
|
345
|
+
/**
|
|
346
|
+
* The drafter's work stages as `!` rows (a mandatory guard is not one), and a Not checked `!` row for each line the drafter refused: the refusal is only the SIGNAL, the reason is code's (`REASON.noRule`, the one table). Idempotent: the stage rows are made again from `stages`.
|
|
347
|
+
* @param {any[]} stages the declaration's stages, guards included @param {{guardNames?: string[], refused?: any[], guardLines?: any[]}} [o]
|
|
348
|
+
*/
|
|
349
|
+
addStages(stages: any[], { guardNames, refused, guardLines }?: {
|
|
350
|
+
guardNames?: string[];
|
|
351
|
+
refused?: any[];
|
|
352
|
+
guardLines?: any[];
|
|
353
|
+
}): void;
|
|
354
|
+
/** the repo paths outside the write scope (the pointing call is shown these); empty when there is no listing or no fence @returns {string[]} */
|
|
355
|
+
outsideScope(): string[];
|
|
356
|
+
/** the folders every file of which lies outside the write scope (a rule may ask such a folder to stay as it is, written `folder/`); the pointing call is shown them beside the files @returns {string[]} */
|
|
357
|
+
outsideFolders(): string[];
|
|
358
|
+
/** is this repo file a place the run may change? @param {string} f */
|
|
359
|
+
inScope(f: string): boolean;
|
|
360
|
+
/** the listing paths (a file, or a folder written `folder/`) a text names as whole tokens @param {string} text @returns {string[]} */
|
|
361
|
+
namedPaths(text: string): string[];
|
|
362
|
+
/**
|
|
363
|
+
* Code's proof of a fence pointer: `path` is on the listing, the rule's own words name it (whole token; a folder as `folder/`), and neither it nor any other path those words name holds a place the run may change.
|
|
364
|
+
* @param {string} text the rule's own words @param {string} path @returns {boolean}
|
|
365
|
+
*/
|
|
366
|
+
provesFence(text: string, path: string): boolean;
|
|
367
|
+
/** the AI's pointer at a repo `~` rule ({op:'fence', line, rule, path}): judged ALONE; code's proof decides, the AI only points @param {any} e */
|
|
368
|
+
editFence(e: any): {
|
|
369
|
+
refusedBecause: string;
|
|
370
|
+
accepted?: undefined;
|
|
371
|
+
landedKey?: undefined;
|
|
372
|
+
} | {
|
|
373
|
+
accepted: boolean;
|
|
374
|
+
landedKey: any;
|
|
375
|
+
refusedBecause?: undefined;
|
|
376
|
+
};
|
|
377
|
+
/** a repo `~` rule: kept by the write fence when the AI pointed at a path and code proves it from the person's words; else the same ask the rubric flow uses (the person's Agree / Drop it / own words), Not checked when nobody can be asked @param {Row} r */
|
|
378
|
+
matchRepoRule(r: Row): void;
|
|
379
|
+
/** a repo job's rows: a rule is built with the path the fence keeps for it or Not checked with its reason; a work stage is built, or dropped when the person dropped it and it is not the last thing on its line */
|
|
380
|
+
buildRepo(): any;
|
|
381
|
+
/** may this repo work-stage row be dropped? Never the last check on a line it serves (another live stage, a guard's `guardLines` or a line refusal still covers it), and never the last work stage of the job @param {Row} r */
|
|
382
|
+
dropOk(r: Row): any;
|
|
383
|
+
/** a row the person can Drop (and Add back): a `!` fact, phrase or count; in a repo job also a work stage the drafter wrote @param {Row} r */
|
|
384
|
+
droppable(r: Row): boolean;
|
|
166
385
|
ask(): any[];
|
|
167
386
|
hasOpenQuestions(): boolean;
|
|
168
387
|
hasPendingDelta(): boolean;
|
|
169
|
-
/** @param {string} qKey @param {string} choice @param {string} [text] @returns {{ok: true} | {ok: false, why: string}} */
|
|
388
|
+
/** @param {string} qKey @param {string} choice @param {string} [text] the person's correction (a reading question only) @returns {{ok: true} | {ok: false, why: string}} */
|
|
170
389
|
applyAnswer(qKey: string, choice: string, text?: string): {
|
|
171
390
|
ok: true;
|
|
172
391
|
} | {
|
|
@@ -213,11 +432,13 @@ export class CheckBlock {
|
|
|
213
432
|
applyEdit(e: any, kept: {
|
|
214
433
|
adds: number;
|
|
215
434
|
}): {
|
|
435
|
+
refusedBecause: string;
|
|
436
|
+
accepted?: undefined;
|
|
437
|
+
landedKey?: undefined;
|
|
438
|
+
} | {
|
|
216
439
|
accepted: boolean;
|
|
217
440
|
landedKey: any;
|
|
218
441
|
refusedBecause?: undefined;
|
|
219
|
-
} | {
|
|
220
|
-
refusedBecause: string;
|
|
221
442
|
};
|
|
222
443
|
editAdd(e: any): {
|
|
223
444
|
refusedBecause: string;
|
|
@@ -278,31 +499,31 @@ export class CheckBlock {
|
|
|
278
499
|
refusedBecause?: undefined;
|
|
279
500
|
};
|
|
280
501
|
reconcile(): any;
|
|
281
|
-
/** the loop: while a question is open or a reply waits, apply it and reconcile the WHOLE list again. `answer(q)` gives {choice, text} or null (a person who did not answer) */
|
|
502
|
+
/** the loop: while a question is open or a reply waits, apply it and reconcile the WHOLE list again. `answer(q)` gives {choice, text?} or null (a person who did not answer) */
|
|
282
503
|
drive({ answer }: {
|
|
283
504
|
answer: any;
|
|
284
505
|
}): this;
|
|
285
|
-
card(): {
|
|
286
|
-
key: any;
|
|
287
|
-
line: any;
|
|
288
|
-
by: any;
|
|
289
|
-
state: any;
|
|
290
|
-
reason: any;
|
|
291
|
-
text: string;
|
|
292
|
-
}[];
|
|
293
506
|
/**
|
|
294
507
|
* The rows as the close shape the card readers (`checksOfClose`, `refusedOf`, `cardOfClose`) already read: the block's stages, the picks code records and the signed list. The confirm card
|
|
295
508
|
* and the signed card read the rows through the SAME readers, so a row shown at confirm is the row signed. Reconciles first (the whole list, every time).
|
|
296
509
|
*/
|
|
297
510
|
closeView(): {
|
|
511
|
+
fence?: string[] | undefined;
|
|
298
512
|
stages: any;
|
|
299
513
|
picks: {
|
|
300
514
|
line: number;
|
|
301
515
|
part: any;
|
|
302
516
|
}[];
|
|
303
|
-
list: {
|
|
517
|
+
list: ({
|
|
304
518
|
[k: string]: any;
|
|
305
|
-
}
|
|
519
|
+
} | {
|
|
520
|
+
line: number;
|
|
521
|
+
key: string;
|
|
522
|
+
from: string;
|
|
523
|
+
by: string;
|
|
524
|
+
kind: string;
|
|
525
|
+
state: string;
|
|
526
|
+
})[];
|
|
306
527
|
};
|
|
307
528
|
/** the picks code records: a countable part carrying the `~` rule numbers it settles @param {{parts: any[], map: {part: number, line: number}[]}} c the build @returns {{line: number, part: any}[]} */
|
|
308
529
|
picksOf(c: {
|
|
@@ -315,14 +536,38 @@ export class CheckBlock {
|
|
|
315
536
|
line: number;
|
|
316
537
|
part: any;
|
|
317
538
|
}[];
|
|
539
|
+
/**
|
|
540
|
+
* The rules and lines the close has no check for, as the signed close's `refused` (one owner: the draft's assembled declaration and a final-card Drop both read it): each `~` rule row that is not built, then each job line no stage serves.
|
|
541
|
+
* @param {{n: number}[]|null|undefined} jobLines @param {any[]} stages the block's stages @returns {{line: number, rule?: number, reason: string}[]}
|
|
542
|
+
*/
|
|
543
|
+
refusedView(jobLines: {
|
|
544
|
+
n: number;
|
|
545
|
+
}[] | null | undefined, stages: any[]): {
|
|
546
|
+
line: number;
|
|
547
|
+
rule?: number;
|
|
548
|
+
reason: string;
|
|
549
|
+
}[];
|
|
318
550
|
/** the standing ruling "a run needs one check": one row that is not the floor is built */
|
|
319
551
|
hasBuiltCheck(): boolean;
|
|
320
552
|
/**
|
|
321
553
|
* The signed list (`closeDecl.list`): the signed fields of every row, never its words. A suggestion not added is signed `dropped` ("suggested, not added"), a suggestion code could not build
|
|
322
554
|
* `dropped` with code's reason (it is on the Audit, never on the card), and a built row carries the names of the facts it made (`facts`), so every reader can tag each fact by its row's kind.
|
|
323
555
|
*/
|
|
324
|
-
signedRows(): {
|
|
556
|
+
signedRows(): ({
|
|
325
557
|
[k: string]: any;
|
|
558
|
+
} | {
|
|
559
|
+
line: number;
|
|
560
|
+
key: string;
|
|
561
|
+
from: string;
|
|
562
|
+
by: string;
|
|
563
|
+
kind: string;
|
|
564
|
+
state: string;
|
|
565
|
+
})[];
|
|
566
|
+
/** the `[you]` rule rows the person dropped (Not checked, "You dropped it."): the card gives each an Add back button @returns {{key: string, line: number, text: string}[]} */
|
|
567
|
+
droppedRulesView(): {
|
|
568
|
+
key: string;
|
|
569
|
+
line: number;
|
|
570
|
+
text: string;
|
|
326
571
|
}[];
|
|
327
572
|
/** the suggestions code has proved it can build, as the card offers them (Add): `{key, line, text}` */
|
|
328
573
|
suggestedView(): {
|
|
@@ -377,3 +622,7 @@ export class CheckBlock {
|
|
|
377
622
|
* `pick`, `aiReading`, `left`. `state` is built or not-checked; a not-checked row always has a plain `reason`.
|
|
378
623
|
*/
|
|
379
624
|
export type Row = Record<string, any>;
|
|
625
|
+
/**
|
|
626
|
+
* what `setSheet` is given: code's build of a job's sheet checks, per sheet line
|
|
627
|
+
*/
|
|
628
|
+
export type SheetBuilt = Awaited<ReturnType<typeof import("./sheetbuild.js").buildSheetChecks>>;
|
package/types/checked.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function hitlWords(hasAsk: boolean, afterLastAsk: boolean): "No machine c
|
|
|
6
6
|
* Checked with `covers`, Not checked), and its sentences are only the lead sentence; the surfaces draw the block. Without `lines` the older one-row-per-check sentences.
|
|
7
7
|
* @param {{ steps?: any[] }} declaration @param {{ hasAsk?: boolean, askLines?: number[], lines?: any[], csvRoles?: string[], keptChecks?: {line: number, check: any}[], keptWords?: string }} [opts] hasAsk = the job has a signed ask line (so "you check it at the ask" is true);
|
|
8
8
|
* askLines = the job lines of the signed asks, which also lets a step after the LAST ask read "you check it after you accept" (am41 item 2, am42: the ONE place for these words)
|
|
9
|
-
* @returns {{ step: number, line: number|null, goal: string, class: string, sentences: string[], sheet?: ReturnType<typeof sheetLineBlocks>[number] }[]}
|
|
9
|
+
* @returns {{ step: number, line: number|null, goal: string, class: string, lead: string|null, sentences: string[], sheet?: ReturnType<typeof sheetLineBlocks>[number] }[]}
|
|
10
10
|
*/
|
|
11
11
|
export function checkedLines(declaration: {
|
|
12
12
|
steps?: any[];
|
|
@@ -25,6 +25,7 @@ export function checkedLines(declaration: {
|
|
|
25
25
|
line: number | null;
|
|
26
26
|
goal: string;
|
|
27
27
|
class: string;
|
|
28
|
+
lead: string | null;
|
|
28
29
|
sentences: string[];
|
|
29
30
|
sheet?: ReturnType<typeof sheetLineBlocks>[number];
|
|
30
31
|
}[];
|
|
@@ -44,15 +45,23 @@ export function notCheckedView(items: unknown, declaration: any): {
|
|
|
44
45
|
readNotes: string[];
|
|
45
46
|
};
|
|
46
47
|
/**
|
|
47
|
-
* The checks of one list line's step as rows `{text, by, part}` in the close's part order (the quote check's facts and count, each picked check, the numbers tie), each with the `by` of the row that built it.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
48
|
+
* The checks of one list line's step as rows `{text, by, part}` in the close's part order (the quote check's facts and count, the field rows of a list of items, each picked check, the numbers tie), each with the `by` of the row that built it.
|
|
49
|
+
* M19 am7 items 1 to 3 and 8: the words are the card's, from the one reader (src/checkrows.js `stepRowsOf`); `part` is the index the signed list's rows point at (src/checklistsign.js), with a list line's shape part counted.
|
|
50
|
+
* ONE reader for the plan card's sentences, the Job tab and the Audit's Checks fold. Pure.
|
|
51
|
+
* @param {any} declaration @param {any} st the step @param {{lines?: any[], kept?: {line: number, check: any}[]}} [o] `lines` = the signed job lines (a field row's words read the person's rule), `kept` = the picks a Revise carried
|
|
52
|
+
* @returns {{text: string, by: 'you'|'agent'|'default', part: number, key: string}[]}
|
|
51
53
|
*/
|
|
52
|
-
export function listPartRows(declaration: any, st: any,
|
|
54
|
+
export function listPartRows(declaration: any, st: any, { lines, kept }?: {
|
|
55
|
+
lines?: any[];
|
|
56
|
+
kept?: {
|
|
57
|
+
line: number;
|
|
58
|
+
check: any;
|
|
59
|
+
}[];
|
|
60
|
+
}): {
|
|
53
61
|
text: string;
|
|
54
62
|
by: "you" | "agent" | "default";
|
|
55
63
|
part: number;
|
|
64
|
+
key: string;
|
|
56
65
|
}[];
|
|
57
66
|
/** The label that always sits with the "Not checked" list (am41 item 3: the ONE place these words live; the Job tab and the Chat card read it off their payloads). */
|
|
58
67
|
export const NOT_CHECKED_LABEL: "not checked (the AI's own reading)";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind word of a check row (hamr 2026-11-19, signed list look): `shape` = code checks the form of the items, `file` = code checks the files (a guard, a line's output-file floor), `truth` = every other check.
|
|
3
|
+
* @param {{key?: string, shape?: true, fence?: true}} c @returns {'truth'|'shape'|'file'}
|
|
4
|
+
*/
|
|
5
|
+
export function kindOfCheck(c: {
|
|
6
|
+
key?: string;
|
|
7
|
+
shape?: true;
|
|
8
|
+
fence?: true;
|
|
9
|
+
}): "truth" | "shape" | "file";
|
|
10
|
+
/**
|
|
11
|
+
* A Not checked text `head — reason` split into the row and the reason behind "why"; the quotes round a rule go; "you judge it at Accept" is the group title's, not a reason.
|
|
12
|
+
* @param {string} raw @returns {{text: string, why?: string}}
|
|
13
|
+
*/
|
|
14
|
+
export function splitNotChecked(raw: string): {
|
|
15
|
+
text: string;
|
|
16
|
+
why?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The Not checked rows of the look: each item split into row and reason, with its tag and the job line that owns it (0 = no one line: the item names no `line N:`).
|
|
20
|
+
* fwd's own items name their line with the code-written prefix `line N: ` (src/blockassemble.js) and a `~` rule with `not checked · ` (the group title says it now).
|
|
21
|
+
* @param {string[]} items @param {Record<string, string>} [by] @returns {{line: number, text: string, why?: string, by?: 'you'|'agent'|'default'}[]}
|
|
22
|
+
*/
|
|
23
|
+
export function ncRowsOf(items: string[], by?: Record<string, string>): {
|
|
24
|
+
line: number;
|
|
25
|
+
text: string;
|
|
26
|
+
why?: string;
|
|
27
|
+
by?: "you" | "agent" | "default";
|
|
28
|
+
}[];
|
|
29
|
+
/** the group titles and the tail of the Not checked one (section 3.7, copied unchanged) */
|
|
30
|
+
export const LOOK: Readonly<{
|
|
31
|
+
checked: "CHECKED";
|
|
32
|
+
notChecked: "NOT CHECKED";
|
|
33
|
+
notCheckedTail: "you judge these at Accept";
|
|
34
|
+
suggested: "SUGGESTED · add if you want it";
|
|
35
|
+
everyLine: "Every line";
|
|
36
|
+
}>;
|