fwdloop 0.33.0 → 0.35.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 +14 -0
- package/bin/fwdloop +18 -2
- package/package.json +1 -1
- package/src/action-line.js +100 -0
- package/src/action-stop.js +44 -0
- package/src/ask.js +9 -2
- package/src/auditchecks.js +6 -4
- package/src/authoring.js +28 -14
- package/src/blockasks.js +3 -2
- package/src/blockassemble.js +40 -21
- package/src/blockdraft.js +8 -13
- package/src/blockpick.js +11 -1
- package/src/checkblock.js +102 -58
- package/src/checked.js +7 -2
- package/src/checklist.js +1 -3
- package/src/checklistsign.js +1 -1
- package/src/checkpick.js +7 -73
- package/src/declaration.js +20 -35
- package/src/drafter.js +281 -208
- package/src/jobkey.js +2 -3
- package/src/noteask.js +62 -0
- package/src/pageask.js +24 -69
- package/src/pagedry.js +27 -4
- package/src/pagemap.js +8 -2
- package/src/pagerules.js +19 -3
- package/src/panel/author.js +63 -36
- package/src/panel/authorcard.js +36 -20
- package/src/panel/data.js +5 -1
- package/src/panel/index.html +66 -37
- package/src/pickrecord.js +42 -54
- package/src/planrebuild.js +16 -6
- package/src/rowedit.js +35 -5
- package/src/rubricstep.js +9 -1
- package/src/runner.js +87 -41
- package/src/runvalues.js +9 -1
- package/src/setup.js +3 -1
- package/src/sheetblock.js +17 -7
- package/src/sheetbuild.js +148 -0
- package/src/sheetchecks.js +3 -2
- package/src/sheetfind.js +4 -4
- package/src/sheetlook.js +15 -4
- package/src/sheetoffer.js +50 -5
- package/src/sheetrows.js +18 -2
- package/src/signed-text.js +1 -5
- package/src/ticket-draft.js +4 -21
- package/src/ticketrows.js +100 -0
- package/src/whole-job.js +27 -11
- package/types/action-line.d.ts +71 -0
- package/types/action-stop.d.ts +36 -0
- package/types/ask.d.ts +3 -2
- package/types/auditchecks.d.ts +2 -1
- package/types/authoring.d.ts +8 -3
- package/types/blockasks.d.ts +1 -2
- package/types/blockassemble.d.ts +20 -3
- package/types/blockdraft.d.ts +4 -12
- package/types/blockpick.d.ts +5 -0
- package/types/checkblock.d.ts +33 -17
- package/types/checked.d.ts +2 -0
- package/types/checklist.d.ts +3 -5
- package/types/checkpick.d.ts +4 -34
- package/types/declaration.d.ts +7 -0
- package/types/drafter.d.ts +23 -356
- package/types/noteask.d.ts +52 -0
- package/types/pageask.d.ts +12 -36
- package/types/pagedry.d.ts +13 -0
- package/types/pagerules.d.ts +7 -0
- package/types/panel/author.d.ts +1 -1
- package/types/panel/authorcard.d.ts +13 -8
- package/types/panel/authorflows.d.ts +4 -4
- package/types/panel/data.d.ts +2 -2
- package/types/panel/jobgrid.d.ts +1 -1
- package/types/pickrecord.d.ts +47 -13
- package/types/rowedit.d.ts +16 -1
- package/types/rubricstep.d.ts +3 -0
- package/types/sheetblock.d.ts +11 -4
- package/types/sheetbuild.d.ts +82 -0
- package/types/sheetchecks.d.ts +2 -1
- package/types/sheetfind.d.ts +2 -2
- package/types/sheetoffer.d.ts +26 -1
- package/types/sheetrows.d.ts +8 -0
- package/types/ticket-draft.d.ts +3 -49
- package/types/ticketrows.d.ts +61 -0
- package/types/whole-job.d.ts +3 -3
- package/src/added-end.js +0 -60
- package/src/repairs.js +0 -38
- package/types/added-end.d.ts +0 -62
- package/types/repairs.d.ts +0 -13
package/types/blockassemble.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ export function pickedOf(part: Record<string, any>): {
|
|
|
11
11
|
rule: any;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* @param {{declaration: Record<string, any>, block: import('./checkblock.js').CheckBlock, lines: {n: number, guardrail?: string|null}[], lineSet: Set<number>}} o
|
|
15
|
-
* `lineSet` = the lines the block was given; `lines` = the signed lines (a guardrail decides the class)
|
|
14
|
+
* @param {{declaration: Record<string, any>, block: import('./checkblock.js').CheckBlock, lines: {n: number, guardrail?: string|null}[], lineSet: Set<number>, askLines?: Set<number>}} o
|
|
15
|
+
* `lineSet` = the lines the block was given; `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)
|
|
16
16
|
* @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
17
|
*/
|
|
18
|
-
export function assembleFromBlock({ declaration, block, lines, lineSet }: {
|
|
18
|
+
export function assembleFromBlock({ declaration, block, lines, lineSet, askLines }: {
|
|
19
19
|
declaration: Record<string, any>;
|
|
20
20
|
block: import("./checkblock.js").CheckBlock;
|
|
21
21
|
lines: {
|
|
@@ -23,11 +23,28 @@ export function assembleFromBlock({ declaration, block, lines, lineSet }: {
|
|
|
23
23
|
guardrail?: string | null;
|
|
24
24
|
}[];
|
|
25
25
|
lineSet: Set<number>;
|
|
26
|
+
askLines?: Set<number>;
|
|
26
27
|
}): {
|
|
27
28
|
declaration: Record<string, any>;
|
|
28
29
|
notChecked: string[];
|
|
29
30
|
notCheckedBy: Record<string, "you" | "agent" | "default">;
|
|
30
31
|
built: Set<number>;
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* M17 am5 / P5: a green sheet step the builder (src/sheetbuild.js) reported as holding no built check has nothing to check it: its close becomes `hitl` (the class is decided here, never in the sheet files),
|
|
35
|
+
* the class on its line follows, and its rules are the Not-checked lines the builder gave. A plan signed before M17 is never passed through here.
|
|
36
|
+
* @param {Record<string, any>} declaration @param {{line: number, lost: string[]}[]} unbuilt
|
|
37
|
+
* @returns {{declaration: Record<string, any>, lines: number[], lost: string[]}}
|
|
38
|
+
*/
|
|
39
|
+
export function closeUnbuiltSheetSteps(declaration: Record<string, any>, unbuilt: {
|
|
40
|
+
line: number;
|
|
41
|
+
lost: string[];
|
|
42
|
+
}[]): {
|
|
43
|
+
declaration: Record<string, any>;
|
|
44
|
+
lines: number[];
|
|
45
|
+
lost: string[];
|
|
46
|
+
};
|
|
47
|
+
/** M17 am5 item 2 (D3): the reason a `~` rule on a signed Ask line is Not checked, the signed words */
|
|
48
|
+
export const ASK_LINE_REASON: "you judge it at the Ask";
|
|
32
49
|
/** what a row says when its check cannot ride a line that has no guardrail of its own (the class of a line comes from its guardrail) */
|
|
33
50
|
export const NO_GUARDRAIL_WORDS: "This line has no guardrail of yours, so a check on it cannot be signed; you judge it at the Ask.";
|
package/types/blockdraft.d.ts
CHANGED
|
@@ -9,10 +9,9 @@ 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
|
-
*
|
|
13
|
-
* @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, scoped?: {line: number, rule: number}[]}} o
|
|
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
|
|
14
13
|
*/
|
|
15
|
-
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope,
|
|
14
|
+
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope, leaveOut }: {
|
|
16
15
|
leaveOut?: {
|
|
17
16
|
line: number;
|
|
18
17
|
rule: number;
|
|
@@ -37,25 +36,18 @@ export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScop
|
|
|
37
36
|
};
|
|
38
37
|
asks: boolean;
|
|
39
38
|
countScope: (t: string) => boolean;
|
|
40
|
-
scoped?: {
|
|
41
|
-
line: number;
|
|
42
|
-
rule: number;
|
|
43
|
-
}[];
|
|
44
39
|
}): import("./checkblock.js").CheckBlock;
|
|
45
40
|
/** the `add` pre-edits of the ledger-suggest call (bareloop authorjob.js@v0.56.0: a count or a phrase; anything else is not an edit) @param {any[]} extra */
|
|
46
41
|
export function ledgerEdits(extra: any[]): any[];
|
|
47
42
|
/**
|
|
48
43
|
* M16 item 4 ("Tickets `ticketFilter` and `ticketWatch` stay as they are"): the rules of a Tickets job that are not the block's. Before M16 only a count guardrail of such a job (it signs a
|
|
49
44
|
* ticket page input, which routes its guardrails: src/checkpick.js codeScope) was picked or asked; every other rule ("priority P1 only", "run a ticket again when its state changes") was the
|
|
50
|
-
* declaration's own typed ticketFilter / ticketWatch, never asked and never listed as Not checked.
|
|
51
|
-
* @param {string} flowType @param {{n: number, rules?: string[]}[]} jobLines @
|
|
45
|
+
* declaration's own typed ticketFilter / ticketWatch, never asked and never listed as Not checked. Since M17 am6 these rules are ticket rows (src/ticketrows.js), so one the look tied to a fact is left out of the block too: it shows once, as the ticket row.
|
|
46
|
+
* @param {string} flowType @param {{n: number, rules?: string[]}[]} jobLines @returns {{line: number, rule: number}[]}
|
|
52
47
|
*/
|
|
53
48
|
export function ticketLeaveOut(flowType: string, jobLines: {
|
|
54
49
|
n: number;
|
|
55
50
|
rules?: string[];
|
|
56
|
-
}[], facts: {
|
|
57
|
-
line: number;
|
|
58
|
-
forRule?: number;
|
|
59
51
|
}[]): {
|
|
60
52
|
line: number;
|
|
61
53
|
rule: number;
|
package/types/blockpick.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export function keepOrDrop(guardrail: string, sug: any): {
|
|
|
21
21
|
kept: false;
|
|
22
22
|
why: string;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* The check a counting rule's own words already ARE ("exactly 3 list items" -> listItems 3), or null. No obvious asks (hamr 2026-11-14): such a rule is settled as written, never proposed back to the person.
|
|
26
|
+
* @param {string} text @returns {Record<string, any>|null}
|
|
27
|
+
*/
|
|
28
|
+
export function obviousCheck(text: string): Record<string, any> | null;
|
|
24
29
|
/**
|
|
25
30
|
* The check CODE proposes for a count rule when the call yields none (R10, ours; fwd has no such fallback): a bullets / list-items / points count -> listItems N (exact; "at most / up to / no more than / fewer than / under / below" -> maxListItems, "at least / minimum / no fewer than / more than" -> minListItems, F315), a lines count ->
|
|
26
31
|
* maxLines N, ONE word number -> minWords N when the rule says "at least / minimum / more than", else maxWords N. A section count names no sections, so none is built; a rule naming two different counts ("3 bullets under 80 words") is not built either; a rule with
|
package/types/checkblock.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export function renderCard(rows: Row[]): {
|
|
|
14
14
|
*/
|
|
15
15
|
/** the card's fixed words, one spelling (the renderer reads them; a test reads them too) */
|
|
16
16
|
export const CARD_T: Readonly<{
|
|
17
|
-
agreed: "you agreed:";
|
|
18
17
|
count: "result count";
|
|
19
18
|
cited: "every claim is backed by a quote copied from";
|
|
20
19
|
theInput: "the input";
|
|
@@ -35,6 +34,7 @@ export const REASON: Readonly<{
|
|
|
35
34
|
manyInputs: "the job has more than one input and code cannot pick which one the claims quote";
|
|
36
35
|
oneSidedTime: "a time limit the AI proposes must be a range, so you judge it at Accept.";
|
|
37
36
|
countNeedsFact: "a result count needs a fact to count; this line has none";
|
|
37
|
+
countNeedsSuggested: "a result count needs a fact to count; add the suggested fact on this line to count its results";
|
|
38
38
|
lookNoWords: "the page does not hold the words of the look's fact for this rule";
|
|
39
39
|
afterLast: "no more tries: Start over (rows are never changed by the AI after the last try)";
|
|
40
40
|
noPick: "No check was picked for it, so you judge it at Accept.";
|
|
@@ -86,10 +86,14 @@ export class CheckBlock {
|
|
|
86
86
|
deltaLog: any[];
|
|
87
87
|
/** @type {any} */
|
|
88
88
|
closeCache: any;
|
|
89
|
+
/** @type {Map<number, 'yes'|'no'|'failed'>} the note question's answer per facts-only line (src/noteask.js; code decides what it means) */
|
|
90
|
+
notes: Map<number, "yes" | "no" | "failed">;
|
|
89
91
|
textOf(source: string | undefined): string;
|
|
90
92
|
/** @param {number} line @param {string} [kind] */
|
|
91
93
|
rowsOn(line: number, kind?: string): Row[];
|
|
92
94
|
ruleRows(line: number): Row[];
|
|
95
|
+
/** does a `~` rule's own row say it is Not checked? Then its row is the ONE place the rule is said (its reason: the look's sentence, or the person's Drop) @param {number} line @param {number} rule */
|
|
96
|
+
saysRule(line: number, rule: number): boolean;
|
|
93
97
|
/** every word the person wrote on a line: the line and its `~` rules */
|
|
94
98
|
said(line: number): string;
|
|
95
99
|
/** @param {Row} r @returns {Row} the row as stored (a repeated key gets `#2`) */
|
|
@@ -115,8 +119,6 @@ export class CheckBlock {
|
|
|
115
119
|
takeJobWord(r: Row): void;
|
|
116
120
|
/** 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 */
|
|
117
121
|
inJob(r: Row): any;
|
|
118
|
-
/** a `~` line an agreed answer wrote (or a carried pair partner) is checked by the rule it was agreed from: one check, both numbers */
|
|
119
|
-
matchFollow(r: Row): void;
|
|
120
122
|
/** a `!` count row is built unless a `~` rule on its line already names the number */
|
|
121
123
|
matchCount(r: Row): void;
|
|
122
124
|
matchRule(r: Row): void;
|
|
@@ -132,8 +134,6 @@ export class CheckBlock {
|
|
|
132
134
|
n: number;
|
|
133
135
|
text: string;
|
|
134
136
|
}, lineParts: any[], lineRows: string[][], factLines: Set<number>): void;
|
|
135
|
-
/** the follow rows of a row (its agreed or carried `~` lines) */
|
|
136
|
-
followsOf(r: Row): Row[];
|
|
137
137
|
/**
|
|
138
138
|
* The fact(s) a fact-like row builds, checked alone through the bareguard shapes and against the facts already on the line.
|
|
139
139
|
* @param {Row} r @param {any[]} onLine the facts already built on this line @returns {{fresh: any[], src: string, names: string[]} | {why: string}}
|
|
@@ -149,6 +149,20 @@ export class CheckBlock {
|
|
|
149
149
|
buildDefaults(l: {
|
|
150
150
|
n: number;
|
|
151
151
|
}, lineParts: any[], lineRows: string[][], factLines: Set<number>): void;
|
|
152
|
+
/**
|
|
153
|
+
* The `$` note row of a facts-only line: the one note question said yes -> a countable nonEmpty text part sits beside the facts (the existing keep-both shape), so the brief
|
|
154
|
+
* is FACTS AND TEXT and text-present is floored; no -> nothing; the call failed -> a Not checked row in plain words. One owner of the row and its part.
|
|
155
|
+
*/
|
|
156
|
+
buildNote(l: {
|
|
157
|
+
n: number;
|
|
158
|
+
}, lineParts: any[], lineRows: string[][]): void;
|
|
159
|
+
/** the job lines that ended up facts-only (a fact part and no text beside it): the lines the note question is about. Reconciles first. @returns {number[]} */
|
|
160
|
+
factOnlyLines(): number[];
|
|
161
|
+
/** the note question's answers, `{line, answer: 'yes'|'no'|'failed'}`; the whole list is reconciled again @param {{line: number, answer: 'yes'|'no'|'failed'}[]} answers */
|
|
162
|
+
setNotes(answers: {
|
|
163
|
+
line: number;
|
|
164
|
+
answer: "yes" | "no" | "failed";
|
|
165
|
+
}[]): void;
|
|
152
166
|
ask(): any[];
|
|
153
167
|
hasOpenQuestions(): boolean;
|
|
154
168
|
hasPendingDelta(): boolean;
|
|
@@ -159,31 +173,33 @@ export class CheckBlock {
|
|
|
159
173
|
ok: false;
|
|
160
174
|
why: string;
|
|
161
175
|
};
|
|
162
|
-
/** the `~` row `partner` is checked by `source` (one check, both rule numbers) */
|
|
163
|
-
follow(source: Row, partner: Row): void;
|
|
164
176
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
|
|
168
|
-
|
|
177
|
+
* The job lines as the list now holds them: every line's `~` rules are the rule rows' own words, in rule order (a replaced rule keeps its place and number). ONE owner of the job text after an answer.
|
|
178
|
+
* @template {{n: number, text: string}} L @param {L[]} jobLines @returns {(L & {rule: string, rules: string[]})[]}
|
|
179
|
+
*/
|
|
180
|
+
jobLinesView<L extends {
|
|
181
|
+
n: number;
|
|
182
|
+
text: string;
|
|
183
|
+
}>(jobLines: L[]): (L & {
|
|
184
|
+
rule: string;
|
|
185
|
+
rules: string[];
|
|
186
|
+
})[];
|
|
187
|
+
/**
|
|
188
|
+
* Revise keeps the picks of the last draft (am17/am18, `src/pickrecord.js` `matchRecord`): a kept pick settles its rule (its words are the final rule's words) and a kept left rule is left.
|
|
189
|
+
* @param {{picks?: {line: number, rule: number, check: any, own?: boolean}[], left?: {line: number, rule: number}[]}} kept
|
|
169
190
|
*/
|
|
170
191
|
carry({ picks, left }: {
|
|
171
192
|
picks?: {
|
|
172
193
|
line: number;
|
|
173
194
|
rule: number;
|
|
174
195
|
check: any;
|
|
175
|
-
added?: string;
|
|
176
196
|
own?: boolean;
|
|
177
197
|
}[];
|
|
178
198
|
left?: {
|
|
179
199
|
line: number;
|
|
180
200
|
rule: number;
|
|
181
201
|
}[];
|
|
182
|
-
}
|
|
183
|
-
line: number;
|
|
184
|
-
rule: number;
|
|
185
|
-
pairRule?: number;
|
|
186
|
-
}[]): void;
|
|
202
|
+
}): void;
|
|
187
203
|
/** @param {{label?: string, pre?: boolean, edits?: any[]}} delta `pre` = a reply that is not a drafter try (the suggest call): it does not count against the tries */
|
|
188
204
|
applyDelta(delta: {
|
|
189
205
|
label?: string;
|
package/types/checked.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** The words for a step with no machine check of its content: the ONE owner (the card and the draft readout both call it). @param {boolean} hasAsk the job has a signed ask @param {boolean} afterLastAsk the step comes after the last ask */
|
|
2
|
+
export function hitlWords(hasAsk: boolean, afterLastAsk: boolean): "No machine check of the content; you check it after you accept." | "No machine check of the content: you check it at the ask." | "No machine check of the content; the machine checks only that the step happened.";
|
|
1
3
|
/**
|
|
2
4
|
* One entry per step, in plan order: the plain sentences for what its typed close checks.
|
|
3
5
|
* M10b piece 4: with `lines` (the signed job lines) a step that reads a sheet also carries `sheet`, its line's block (src/sheetblock.js `sheetLineBlocks`: guardrails,
|
package/types/checklist.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export function ledgerUserText(jobLines: {
|
|
|
20
20
|
export const MAX_BANG: 3;
|
|
21
21
|
/** the reason a check on a version or a date goes under Not checked: it is true only for the input as it is today */
|
|
22
22
|
export const WEEK_ONLY_WORDS: "It names a version or a date from the input, true only for the input as it is today, so you judge it at Accept.";
|
|
23
|
-
/** the label of the list call, as the drafting book and the draft log see it */
|
|
24
|
-
export const LEDGER_LABEL: "ledger-suggest";
|
|
25
23
|
export const LEDGER_TOOL: "suggest_extra_checks";
|
|
26
24
|
/** the reason the empty list is logged with */
|
|
27
25
|
export const EMPTY_LIST_WORDS: "empty list: nothing to check";
|
|
@@ -29,11 +27,11 @@ export function isEmptyList(rows: Row[]): boolean;
|
|
|
29
27
|
export function ledgerRecord(rows: Row[]): ({
|
|
30
28
|
key: string;
|
|
31
29
|
line: number;
|
|
32
|
-
rowKind: "
|
|
30
|
+
rowKind: "rule" | "numbers" | "fact" | "phrase" | "cited" | "count" | "floor" | "note";
|
|
33
31
|
from: "default" | "agent" | "rule" | "look" | "pick";
|
|
34
32
|
by: "default" | "agent" | "you";
|
|
35
33
|
words: string[];
|
|
36
|
-
state: "dropped" | "built" | "
|
|
34
|
+
state: "dropped" | "built" | "not-checked" | "listed";
|
|
37
35
|
reason: string | null;
|
|
38
36
|
} | {
|
|
39
37
|
key: string;
|
|
@@ -92,7 +90,7 @@ export const LEDGER_SCHEMA: Readonly<{
|
|
|
92
90
|
export type Row = {
|
|
93
91
|
key: string;
|
|
94
92
|
line: number;
|
|
95
|
-
kind: "rule" | "fact" | "cited" | "count" | "phrase" | "numbers" | "floor";
|
|
93
|
+
kind: "rule" | "fact" | "cited" | "count" | "phrase" | "numbers" | "note" | "floor";
|
|
96
94
|
from: "rule" | "pick" | "look" | "agent" | "default";
|
|
97
95
|
by: "you" | "agent" | "default";
|
|
98
96
|
words: string[];
|
package/types/checkpick.d.ts
CHANGED
|
@@ -73,10 +73,9 @@ export function countCheck(text: string): Record<string, any> | null;
|
|
|
73
73
|
* The asks for the rows: `Line n, guardrail "<…>": I propose <check in plain words>.` for a kept check, `Line n, guardrail "<…>": I can't check this. Your own words, or
|
|
74
74
|
* Not checked?` when nothing was kept. A proposal is not counted toward am1's cap; a can't-check ask is (am16 (5)).
|
|
75
75
|
* @param {ReturnType<typeof rowsFromAnswer>} rows
|
|
76
|
-
* @returns {{
|
|
76
|
+
* @returns {{line: number, rule: number, source: 'look', ask: 'check'|'no-check', ruleText: string, question: string, reading?: string, check?: Record<string, any>, counted: boolean}[]}
|
|
77
77
|
*/
|
|
78
78
|
export function checkAsks(rows: ReturnType<typeof rowsFromAnswer>): {
|
|
79
|
-
pairRule?: number;
|
|
80
79
|
line: number;
|
|
81
80
|
rule: number;
|
|
82
81
|
source: "look";
|
|
@@ -88,37 +87,9 @@ export function checkAsks(rows: ReturnType<typeof rowsFromAnswer>): {
|
|
|
88
87
|
counted: boolean;
|
|
89
88
|
}[];
|
|
90
89
|
/**
|
|
91
|
-
* @typedef {{line: number, rule: number, check: Record<string, any>|null,
|
|
92
|
-
* `check` = the check the person agreed to (null for their own words); `
|
|
90
|
+
* @typedef {{line: number, rule: number, check: Record<string, any>|null, own?: boolean}} Pick
|
|
91
|
+
* `check` = the check the person agreed to (null for their own words); `own` = their own words
|
|
93
92
|
*/
|
|
94
|
-
/**
|
|
95
|
-
* Settle every scoped rule against the person's answers: a rule with a picked check is checked; the `~` line an agree wrote is covered by that pick; every other
|
|
96
|
-
* rule is Not checked, with the reason (`person-left` = they chose it, `own-words` = they gave their own words, `no-pick` = nothing was picked).
|
|
97
|
-
* @param {ReturnType<typeof scopedRules>} rules @param {Pick[]} picks @param {{line: number, rule: number}[]} left
|
|
98
|
-
* @returns {{checks: Map<number, Record<string, any>[]>, notes: {line: number, rule: number, text: string, reason: 'person-left'|'own-words'|'no-pick'}[]}}
|
|
99
|
-
*/
|
|
100
|
-
export function settleRules(rules: ReturnType<typeof scopedRules>, picks: Pick[], left: {
|
|
101
|
-
line: number;
|
|
102
|
-
rule: number;
|
|
103
|
-
}[]): {
|
|
104
|
-
checks: Map<number, Record<string, any>[]>;
|
|
105
|
-
notes: {
|
|
106
|
-
line: number;
|
|
107
|
-
rule: number;
|
|
108
|
-
text: string;
|
|
109
|
-
reason: "person-left" | "own-words" | "no-pick";
|
|
110
|
-
}[];
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Overwrite the drafter's check on every step of a line this call settles (a green step, which another signed part settles, is left alone): a line with picked checks
|
|
114
|
-
* is softgreen and carries exactly those checks; a line with none is hitl. Whatever `close.shape` the drafter wrote is gone. Pure: returns a new declaration.
|
|
115
|
-
* @param {any} declaration @param {ReturnType<typeof scopedRules>} rules @param {ReturnType<typeof settleRules>} settled
|
|
116
|
-
* @param {(note: {line: number, reason: 'person-left'|'own-words'|'no-pick'}) => string} sentence the one table's words for a reason
|
|
117
|
-
*/
|
|
118
|
-
export function applyPicks(declaration: any, rules: ReturnType<typeof scopedRules>, settled: ReturnType<typeof settleRules>, sentence: (note: {
|
|
119
|
-
line: number;
|
|
120
|
-
reason: "person-left" | "own-words" | "no-pick";
|
|
121
|
-
}) => string): any;
|
|
122
93
|
/**
|
|
123
94
|
* M10 am27 (4) RETENTION record of one draft (record only, counts, no words). Per job line: `aiParts` = the cited facts the drafter wrote on that line (a `cited` close counts once per
|
|
124
95
|
* fact, at least 1), `kept` = how many are still in the final declaration, `dropped` = what code removed, `picks` = the line has the person's picks; `classAsked` / `classFinal`
|
|
@@ -170,13 +141,12 @@ export const SUGGEST_SCHEMA: Readonly<{
|
|
|
170
141
|
export const CANT_CHECK_WORDS: "I can't check this. Your own words, or Not checked?";
|
|
171
142
|
export function HOW_TO_ANSWER(line: number, agree: boolean): string;
|
|
172
143
|
/**
|
|
173
|
-
* `check` = the check the person agreed to (null for their own words); `
|
|
144
|
+
* `check` = the check the person agreed to (null for their own words); `own` = their own words
|
|
174
145
|
*/
|
|
175
146
|
export type Pick = {
|
|
176
147
|
line: number;
|
|
177
148
|
rule: number;
|
|
178
149
|
check: Record<string, any> | null;
|
|
179
|
-
added?: string;
|
|
180
150
|
own?: boolean;
|
|
181
151
|
};
|
|
182
152
|
import { plainWords } from './checkwords.js';
|
package/types/declaration.d.ts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* @param {Record<string, any>} declaration @returns {'plain'|'mcp'|'tickets'}
|
|
5
5
|
*/
|
|
6
6
|
export function flowTypeOf(declaration: Record<string, any>): "plain" | "mcp" | "tickets";
|
|
7
|
+
/** M12 piece 3 (item 4): the signed label filter, `ticketFilter: {priority?: ['P0'..'P3'], labels?: [names]}`; optional, and only on a job that lists MCP tools.
|
|
8
|
+
* Pure data: code decides at run (src/ticket-labels.js); the drafter may only suggest it and a human signs it.
|
|
9
|
+
* @param {Record<string, any>} declaration @param {string[]} reds */
|
|
10
|
+
export function checkTicketFilter(declaration: Record<string, any>, reds: string[]): void;
|
|
11
|
+
/** M12 piece 3 (signed item 7): the ticket fields a schedule may watch, `ticketWatch: ['state'|'labels']`; optional, only on a job that lists MCP tools, typed values only.
|
|
12
|
+
* The scheduler compares (src/trigger-tickets.js); the drafter may suggest, a human signs. @param {Record<string, any>} declaration @param {string[]} reds */
|
|
13
|
+
export function checkTicketWatch(declaration: Record<string, any>, reds: string[]): void;
|
|
7
14
|
/**
|
|
8
15
|
* A small, pure walker over `declaration.steps` for callers that only want
|
|
9
16
|
* the shape-key verdict (e.g. poc/m1/slot-batch.mjs's `shape` column) —
|