fwdloop 0.36.0 → 0.37.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 +1 -1
- package/bin/fwdloop +5 -2
- package/package.json +3 -3
- package/src/action-stop.js +1 -1
- package/src/auditchecks.js +41 -9
- package/src/authoring.js +74 -16
- package/src/blockasks.js +10 -12
- package/src/blockassemble.js +49 -43
- 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 +610 -64
- package/src/checked.js +28 -33
- package/src/checklistsign.js +2 -1
- 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 +26 -4
- package/src/drafter.js +85 -61
- package/src/factwords.js +7 -4
- package/src/globprefix.js +26 -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 +9 -3
- package/src/panel/data.js +3 -2
- package/src/panel/index.html +143 -33
- 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 -3
- 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/sheetbuild.js +41 -29
- package/src/sheetclaims.js +1 -1
- package/src/sheetrows.js +10 -64
- package/src/ticketrows.js +1 -1
- 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 +20 -2
- package/types/blockasks.d.ts +6 -10
- package/types/blockassemble.d.ts +13 -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 +278 -28
- 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 +8 -4
- package/types/globprefix.d.ts +5 -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/sheetclaims.d.ts +1 -0
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does the bareguard this package runs carry `itemShape`? Read from the vocabulary at call time (true from bareguard 0.37); the shape look and everything after it is OFF where it is false.
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/
|
|
5
|
+
export function shapeAvailable(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The name rules of a signed field, all bareguard's own: the characters, the length and its reserved reason words (a field named `wrong-value` would read as a gap).
|
|
8
|
+
* @returns {{max: number, forbidden: string[], reserved: string[]}}
|
|
9
|
+
*/
|
|
10
|
+
export function shapeNameRules(): {
|
|
11
|
+
max: number;
|
|
12
|
+
forbidden: string[];
|
|
13
|
+
reserved: string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Is `name` a legal signed field name? Null when it is, else the plain reason.
|
|
17
|
+
* @param {unknown} name @param {{max: number, forbidden: string[], reserved: string[]|null}} [rules]
|
|
18
|
+
* @returns {string|null}
|
|
19
|
+
*/
|
|
20
|
+
export function nameWhy(name: unknown, rules?: {
|
|
21
|
+
max: number;
|
|
22
|
+
forbidden: string[];
|
|
23
|
+
reserved: string[] | null;
|
|
24
|
+
}): string | null;
|
|
25
|
+
/** kind -> the options (bounds and modifiers) the kind accepts, as bareguard lists them (`object` is not offered). `of` and `minEntries`/`maxEntries`/`unique` are the list's; `equals` is the boolean's. @type {Readonly<Record<string, readonly string[]>>} */
|
|
26
|
+
export const SHAPE_KINDS: Readonly<Record<string, readonly string[]>>;
|
|
27
|
+
/** the options whose value must be one of a closed list, as bareguard lists them (`money.currency` is a SIGN: "$", "€", "£"; `decimal`, `date.lang`): `kind` -> option -> the allowed values @type {Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>} */
|
|
28
|
+
export const SHAPE_OPTION_VALUES: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
|
|
29
|
+
/** the kinds a list entry (`of`) may be: every scalar kind (never `list`, never `object`) */
|
|
30
|
+
export const ENTRY_KINDS: readonly string[];
|
|
31
|
+
/** the options that are BOUNDS: each must appear in the person's own words (the same law as `groundedLiterals`, src/sheetbuild.js). The other options only say how a value is read (currency, unit, of, fromText ...). `equals` has its own rule (R5). */
|
|
32
|
+
export const GROUNDED_BOUNDS: readonly string[];
|
|
33
|
+
/** the upper bounds: "under 60 words" may sign 59, and "under 450" 449.99, so the number the person wrote, one more and its ceiling are the candidates */
|
|
34
|
+
export const UPPER_BOUNDS: readonly string[];
|
|
35
|
+
/** the bounds that count characters, words or entries: whole numbers, 0 or more */
|
|
36
|
+
export const COUNT_BOUNDS: readonly string[];
|
|
37
|
+
/** a field name is at most this long (bareguard's `nameMaxLength`) */
|
|
38
|
+
export const NAME_MAX_CHARS: number;
|
|
39
|
+
/** a field name holds none of these (they separate the path in a red item: bareguard's `nameForbiddenChars`) */
|
|
40
|
+
export const NAME_FORBIDDEN: any;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One item red in the Result tab's words: `item 3: status is "done", not one of: in progress, closed, finished`.
|
|
3
|
+
* @param {string} red `#<i>:<path>:<reason>` @param {Record<string, any>|null} field the signed field `{name, spec, rule?}` or null @param {unknown} value the worker's value @param {string} said the person's rule for the field
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function shapeViewRed(red: string, field: Record<string, any> | null, value: unknown, said: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The model of a shape line's answer.
|
|
9
|
+
* @param {{part: any, results: unknown, reds?: string[], rules?: string[]}} o `part` the signed shape part; `results` the answer's `results` list; `reds` the item reds the close recorded (`#<i>:<path>:<reason>`, none for a green run); `rules` the line's `~` rules
|
|
10
|
+
* @returns {{columns: {name: string}[], rows: {name: string, cells: {mark: 'g'|'r', text: string, why?: string}[]}[], total: number, passed: number, failed: number, errors: string[], notChecked: string, head: string}}
|
|
11
|
+
*/
|
|
12
|
+
export function shapeResultModel({ part, results, reds, rules }: {
|
|
13
|
+
part: any;
|
|
14
|
+
results: unknown;
|
|
15
|
+
reds?: string[];
|
|
16
|
+
rules?: string[];
|
|
17
|
+
}): {
|
|
18
|
+
columns: {
|
|
19
|
+
name: string;
|
|
20
|
+
}[];
|
|
21
|
+
rows: {
|
|
22
|
+
name: string;
|
|
23
|
+
cells: {
|
|
24
|
+
mark: "g" | "r";
|
|
25
|
+
text: string;
|
|
26
|
+
why?: string;
|
|
27
|
+
}[];
|
|
28
|
+
}[];
|
|
29
|
+
total: number;
|
|
30
|
+
passed: number;
|
|
31
|
+
failed: number;
|
|
32
|
+
errors: string[];
|
|
33
|
+
notChecked: string;
|
|
34
|
+
head: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The shape section of the .md report (the signed mock D): the shape-checks line, a table (items as rows, fields as columns, a mark and the short value in each cell), the Not checked line and, when any item failed, a Failed list.
|
|
38
|
+
* @param {ReturnType<typeof shapeResultModel>} m @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
export function shapeMarkdown(m: ReturnType<typeof shapeResultModel>): string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** the words of the `[default]` row of a shape line, drawn only when the person's words gave an item count (hamr 2026-11-18: the card's `$` row is the Not checked line): `exactly 2 items` @param {{min?: number, max?: number}|null} [count] @returns {string|null} */
|
|
2
|
+
export function shapeDefaultWords(count?: {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
} | null): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* M19 am11 item 1: the item count a `~` rule's own words ARE ("exactly 4 list items" -> 4 to 4, "at least 3" -> at least 3, "at most 5" -> at most 5), or null. "at most 0" is no item count (bareguard's `maxItems` is at least 1): it stays a pick over the text.
|
|
8
|
+
* @param {string} text @returns {{min?: number, max?: number}|null}
|
|
9
|
+
*/
|
|
10
|
+
export function itemCountOf(text: string): {
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
} | null;
|
|
14
|
+
/**
|
|
15
|
+
* M19 am11: the words of the rule row that holds a signed item count (the `[default]` row's words, `the answer lists exactly N items`, for an exact count; `at least N items` / `at most N items` beside it). Pure.
|
|
16
|
+
* @param {{minItems?: number, maxItems?: number}} part @returns {string|null}
|
|
17
|
+
*/
|
|
18
|
+
export function shapeCountWords(part: {
|
|
19
|
+
minItems?: number;
|
|
20
|
+
maxItems?: number;
|
|
21
|
+
}): string | null;
|
|
22
|
+
/** an upper bound `n` as the person's own form: "under N unit" when their words say under/fewer than/less than/below N+1 (so the signed N is "under N+1"), else "at most N unit" @param {number} n @param {string} unit @param {string} said */
|
|
23
|
+
export function upper(n: number, unit: string, said: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* A field spec as one plain sentence, written by code from the signed fields, in the person's own form where their words show it ("under 200 characters", not "at most 199"). Pure.
|
|
26
|
+
* @param {Record<string, any>} spec `{kind, required?, ...bounds}` @param {string} [said] the person's own rule for the field @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function shapeFieldSentence(spec: Record<string, any>, said?: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* The signed part of ONE shape line, from the fields that stand (the `[you]` rule fields and the `[agent]` fields the person has not dropped or left Suggested).
|
|
31
|
+
* @param {{text: string, fields: {name: string, spec: Record<string, any>, rule?: number|null, by?: 'you'|'agent'}[], itemCount?: {n?: number, min?: number, max?: number}|null, countRules?: number[]}} o `countRules` = the `~` rules whose words are the item count
|
|
32
|
+
* @returns {Record<string, any>}
|
|
33
|
+
*/
|
|
34
|
+
export function buildShapePart({ text, fields, itemCount, countRules }: {
|
|
35
|
+
text: string;
|
|
36
|
+
fields: {
|
|
37
|
+
name: string;
|
|
38
|
+
spec: Record<string, any>;
|
|
39
|
+
rule?: number | null;
|
|
40
|
+
by?: "you" | "agent";
|
|
41
|
+
}[];
|
|
42
|
+
itemCount?: {
|
|
43
|
+
n?: number;
|
|
44
|
+
min?: number;
|
|
45
|
+
max?: number;
|
|
46
|
+
} | null;
|
|
47
|
+
countRules?: number[];
|
|
48
|
+
}): Record<string, any>;
|
|
49
|
+
/** the signed shape part of job line `n` in a close, or null @param {any} closeDecl @param {number} n */
|
|
50
|
+
export function shapePartOfLine(closeDecl: any, n: number): any;
|
|
51
|
+
/** the words of one signed field row: `name \u00B7 sentence` (the rule it comes from is the `~ [you]` tag's, the card's heading says what is checked) @param {any} f @param {string[]} rules the line's `~` rules @returns {string} */
|
|
52
|
+
export function shapeFieldText(f: any, rules: string[]): string;
|
|
53
|
+
/**
|
|
54
|
+
* The shape rows of a signed close, read from its shape parts: one per field (a `[you]` rule row's, an `[agent]` row's), then the line's `[default]` row. A close with no shape part has none.
|
|
55
|
+
* `rule` is the rule a `[you]` row is. Text is code's (never a model's).
|
|
56
|
+
* @param {any} closeDecl @param {any[]|null} [jobLines] the person's numbered lines
|
|
57
|
+
* @returns {{line: number, key: string, by: 'you'|'agent'|'default', text: string, name?: string, rule?: number}[]}
|
|
58
|
+
*/
|
|
59
|
+
export function shapeRowsOf(closeDecl: any, jobLines?: any[] | null): {
|
|
60
|
+
line: number;
|
|
61
|
+
key: string;
|
|
62
|
+
by: "you" | "agent" | "default";
|
|
63
|
+
text: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
rule?: number;
|
|
66
|
+
}[];
|
|
67
|
+
/**
|
|
68
|
+
* The bareguard `itemShape` check of a signed shape part (clause 6, `buildStepSpec`): the answer field `results`, the item count the person's words gave, and one field spec per signed field.
|
|
69
|
+
* @param {any} part a `shape` part @param {string} id @param {any} [factPart] the step's fact part, when the line is facts+shape @returns {Record<string, any>}
|
|
70
|
+
*/
|
|
71
|
+
export function shapeItemCheck(part: any, id: string, factPart?: any): Record<string, any>;
|
|
72
|
+
/**
|
|
73
|
+
* The SHAPE of a `shape` part (clause 5, called by `rubricStepShapeReds`): its fields are named legally and once, each spec has a kind on the menu, the count is whole numbers, a rule number is a whole number, and bareguard itself
|
|
74
|
+
* accepts the check (`createRubric`, which refuses an impossible bound or a field spec it does not know, naming the path). Pure, never throws.
|
|
75
|
+
* @param {any} part @param {string} w the path of the part @param {(code: string, path: string, detail: string) => void} red
|
|
76
|
+
*/
|
|
77
|
+
export function shapeShapeReds(part: any, w: string, red: (code: string, path: string, detail: string) => void, factPart?: null): void;
|
|
78
|
+
/**
|
|
79
|
+
* One worked example item of a shape, written by code from the signed fields (never by a model): a value of each field's kind that the field's own bounds accept.
|
|
80
|
+
* @param {{name: string, spec: Record<string, any>}[]} fields @returns {Record<string, any>}
|
|
81
|
+
*/
|
|
82
|
+
export function shapeExampleItem(fields: {
|
|
83
|
+
name: string;
|
|
84
|
+
spec: Record<string, any>;
|
|
85
|
+
}[]): Record<string, any>;
|
|
86
|
+
export function shapeRowKey(line: number, name: string): string;
|
|
87
|
+
export function shapeDefaultKey(line: number): string;
|
|
88
|
+
/** why the truth of a shape line's items is not checked: the person judges it at Accept (the Not checked row of every shape line) */
|
|
89
|
+
export const SHAPE_TRUTH_PARTS: readonly string[];
|
|
90
|
+
export const SHAPE_TRUTH_WORDS: string;
|
|
91
|
+
/** the words of a shape card's heading, once above a shape line's rows (code's, never the model's) */
|
|
92
|
+
export const SHAPE_HEAD_PARTS: readonly string[];
|
|
93
|
+
export const SHAPE_HEAD: string;
|
|
94
|
+
export function shapePartOf(params: any): any;
|
|
95
|
+
export function shapeFieldBody(f: {
|
|
96
|
+
name: string;
|
|
97
|
+
kind: string;
|
|
98
|
+
required?: boolean;
|
|
99
|
+
bounds?: Record<string, any>;
|
|
100
|
+
}): Record<string, any>;
|
|
101
|
+
/** the answer field the `itemShape` check reads: the shape answer's one list (the step file is `{"results": [...]}`) */
|
|
102
|
+
export const SHAPE_FIELD: "results";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** the measured value of a `not-a-list` gap in a person's words, or `something else` when none came @param {unknown} measured @returns {string} */
|
|
2
|
+
export function measuredWords(measured: unknown): string;
|
|
3
|
+
/**
|
|
4
|
+
* Split one item red into its item (0-based), its field path (null when the red is about the item as a whole) and its reason. Null when the text is not an item red.
|
|
5
|
+
* @param {unknown} item @returns {{i: number, path: string|null, reason: string}|null}
|
|
6
|
+
*/
|
|
7
|
+
export function parseShapeItem(item: unknown): {
|
|
8
|
+
i: number;
|
|
9
|
+
path: string | null;
|
|
10
|
+
reason: string;
|
|
11
|
+
} | null;
|
|
12
|
+
/** the field a red names, as the signed spec names it: the first name of the path, a list entry's `[j]` and a nested `.name` left off @param {unknown} item @returns {string|null} */
|
|
13
|
+
export function itemFieldOf(item: unknown): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* One item red as a plain sentence: `item 2: "summary" is too long (201 characters, at most 200)`.
|
|
16
|
+
* @param {unknown} item `#<i>:<path>:<reason>` @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
export function plainShapeItem(item: unknown): string;
|
|
19
|
+
/**
|
|
20
|
+
* One bareguard `itemShape` gap as plain lines (one per item red, or one for a whole-field gap).
|
|
21
|
+
* @param {{at: string, file: string, field?: string}} where `at` = `line N`, `file` = the step file's path, `field` = the answer field holding the items (default `results`)
|
|
22
|
+
* @param {any} g the gap @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function plainShapeGap({ at, file, field }: {
|
|
25
|
+
at: string;
|
|
26
|
+
file: string;
|
|
27
|
+
field?: string;
|
|
28
|
+
}, g: any): string;
|
|
29
|
+
/**
|
|
30
|
+
* The inverse of {@link plainShapeItem}: the item red (`#<i>:<path>:<reason>`) a plain sentence of ours says, or null when the text is none of ours. A red run records only the close's plain gap lines (the per-row record
|
|
31
|
+
* is the final close's), so the Result tab's grid reads them back through this; a test walks every reason through both directions.
|
|
32
|
+
* @param {string} text `item 3: "status" is not one of the allowed values` @returns {string|null}
|
|
33
|
+
*/
|
|
34
|
+
export function shapeItemOfPlain(text: string): string | null;
|
|
35
|
+
/** the words of a `not-a-list` gap's measured value (bareguard's `type:<kind>`); any other measured value is printed as it came */
|
|
36
|
+
export const MEASURED_WORDS: Readonly<{
|
|
37
|
+
'type:string': "plain text";
|
|
38
|
+
'type:number': "a number";
|
|
39
|
+
'type:boolean': "true or false";
|
|
40
|
+
'type:object': "an object";
|
|
41
|
+
'type:null': "empty";
|
|
42
|
+
}>;
|
|
43
|
+
export function shapeGapCount(g: any): number;
|
package/types/sheetbuild.d.ts
CHANGED
|
@@ -35,14 +35,13 @@ export function buildSheetLine({ line, tables, suggestions }: {
|
|
|
35
35
|
}[];
|
|
36
36
|
}>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param {{
|
|
41
|
-
* @returns {Promise<{
|
|
42
|
-
*
|
|
38
|
+
* Build the checks of every sheet line from the reply's suggestions, each routed to its job line by its own `line`. Every sheet line in `lines` gets a result, a line with no suggestion included (its rules are
|
|
39
|
+
* then Not checked with the no-pick sentence, never silently nothing). A suggestion that names no sheet line, or is not an object, is refused and listed with its helper.
|
|
40
|
+
* @param {{lines: {n: number, text?: string, rules?: string[], guardrail?: string, rule?: string}[], tables: Record<string, {header: string[], rows: any[]}>, suggestions: any[]}} o
|
|
41
|
+
* @returns {Promise<{built: Record<number, Awaited<ReturnType<typeof buildSheetLine>>>, checks: any[], notChecked: Record<string, string>, refused: {line: number|null, helper: string, why: string}[]}>}
|
|
42
|
+
* `notChecked`: `line N: "rule"` -> the refusal that named it (or `NO_VALUE_WHY`), for each rule of a sheet line that no check holds
|
|
43
43
|
*/
|
|
44
|
-
export function buildSheetChecks({
|
|
45
|
-
declaration: any;
|
|
44
|
+
export function buildSheetChecks({ lines, tables, suggestions }: {
|
|
46
45
|
lines: {
|
|
47
46
|
n: number;
|
|
48
47
|
text?: string;
|
|
@@ -54,19 +53,38 @@ export function buildSheetChecks({ declaration, lines, tables }: {
|
|
|
54
53
|
header: string[];
|
|
55
54
|
rows: any[];
|
|
56
55
|
}>;
|
|
56
|
+
suggestions: any[];
|
|
57
57
|
}): Promise<{
|
|
58
|
-
|
|
58
|
+
built: Record<number, Awaited<ReturnType<typeof buildSheetLine>>>;
|
|
59
|
+
checks: any[];
|
|
59
60
|
notChecked: Record<string, string>;
|
|
60
61
|
refused: {
|
|
61
|
-
line: number;
|
|
62
|
+
line: number | null;
|
|
62
63
|
helper: string;
|
|
63
64
|
why: string;
|
|
64
65
|
}[];
|
|
65
|
-
unbuilt: {
|
|
66
|
-
line: number;
|
|
67
|
-
lost: string[];
|
|
68
|
-
}[];
|
|
69
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* M17 am5 / P5 (fwd's own, kept from the declaration-rewriting builder): the green steps that read a sheet and hold no check after the build (no suggestion, or none code could build), each with its rules as Not-checked lines
|
|
69
|
+
* and the refusal that named each (else the no-pick sentence). What class such a step gets is the caller's to decide (src/blockassemble.js closeUnbuiltSheetSteps); this file writes no class.
|
|
70
|
+
* @param {{declaration: any, lines: {n: number, text?: string, rules?: string[], guardrail?: string, rule?: string}[], roles: string[], notChecked: Record<string, string>}} o
|
|
71
|
+
* @returns {{line: number, lost: string[]}[]}
|
|
72
|
+
*/
|
|
73
|
+
export function unbuiltSheetLines({ declaration, lines, roles, notChecked }: {
|
|
74
|
+
declaration: any;
|
|
75
|
+
lines: {
|
|
76
|
+
n: number;
|
|
77
|
+
text?: string;
|
|
78
|
+
rules?: string[];
|
|
79
|
+
guardrail?: string;
|
|
80
|
+
rule?: string;
|
|
81
|
+
}[];
|
|
82
|
+
roles: string[];
|
|
83
|
+
notChecked: Record<string, string>;
|
|
84
|
+
}): {
|
|
85
|
+
line: number;
|
|
86
|
+
lost: string[];
|
|
87
|
+
}[];
|
|
70
88
|
/** the fields of a suggestion code does not read: it names every check itself */
|
|
71
89
|
export const SUGGESTION_DROPPED: readonly string[];
|
|
72
90
|
export type Placed = {
|
package/types/sheetclaims.d.ts
CHANGED
package/types/sheetrows.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** the fields that say what a check IS: all but the names code gives it (id, claim), the rules it covers and its row tag. Two drafts name checks differently, so "the very same check" is read on these @param {any} c @returns {Record<string, any>} */
|
|
2
|
+
export function sheetCheckBody(c: any): Record<string, any>;
|
|
1
3
|
/**
|
|
2
4
|
* The sheet rows of a declaration, read from its steps' `close.sheet`: the signed rows (for `declaration.checkList`) and the card rows (words, tag, whether a Drop is offered).
|
|
3
5
|
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o
|
|
@@ -20,50 +22,18 @@ export function sheetRowsOf({ declaration, lines, csvRoles }: {
|
|
|
20
22
|
}[];
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
|
-
* The plan's card with the sheet rows on it: the sheet rows after the block's rows
|
|
24
|
-
* @param {{rows: any[], suggested: any[]}} card the block's card (src/cardlist.js) @param {{card: any[]}} sheet `sheetRowsOf`
|
|
25
|
+
* The plan's card with the sheet rows on it: the sheet rows after the block's rows. A dropped sheet check is among the block's own suggestions (Add), like any dropped `!` row (src/cardlist.js).
|
|
26
|
+
* @param {{rows: any[], suggested: any[]}} card the block's card (src/cardlist.js) @param {{card: any[]}} sheet `sheetRowsOf`
|
|
25
27
|
*/
|
|
26
28
|
export function withSheetCard(card: {
|
|
27
29
|
rows: any[];
|
|
28
30
|
suggested: any[];
|
|
29
31
|
}, sheet: {
|
|
30
32
|
card: any[];
|
|
31
|
-
}
|
|
32
|
-
key: string;
|
|
33
|
-
line: number;
|
|
34
|
-
text: string;
|
|
35
|
-
}[]): {
|
|
33
|
+
}): {
|
|
36
34
|
rows: any[];
|
|
37
35
|
suggested: any[];
|
|
38
36
|
};
|
|
39
|
-
/**
|
|
40
|
-
* M17 am3: the key of the check of the line that IS a dropped one (same typed fields; code names every check, so an id says nothing across drafts), or null. A Revise keeps a Drop only for the very same check.
|
|
41
|
-
* @param {any} declaration @param {{line: number, check: any}} d a record of `droppedSheetOf` @returns {string|null}
|
|
42
|
-
*/
|
|
43
|
-
export function keyOfSameCheck(declaration: any, d: {
|
|
44
|
-
line: number;
|
|
45
|
-
check: any;
|
|
46
|
-
}): string | null;
|
|
47
|
-
/**
|
|
48
|
-
* The person's Drop or Add on a sheet row, applied to the declaration (a copy). Same words as the block's own refusals (src/checkblock.js `rowChoice`).
|
|
49
|
-
* @param {{declaration: any, lines: any[], csvRoles: string[], op: 'drop'|'add', key: string, dropped: any[]}} o
|
|
50
|
-
* @returns {{ok: true, declaration: any, dropped: any[]}|{ok: false, why: string}}
|
|
51
|
-
*/
|
|
52
|
-
export function sheetChoice({ declaration, lines, csvRoles, op, key, dropped }: {
|
|
53
|
-
declaration: any;
|
|
54
|
-
lines: any[];
|
|
55
|
-
csvRoles: string[];
|
|
56
|
-
op: "drop" | "add";
|
|
57
|
-
key: string;
|
|
58
|
-
dropped: any[];
|
|
59
|
-
}): {
|
|
60
|
-
ok: true;
|
|
61
|
-
declaration: any;
|
|
62
|
-
dropped: any[];
|
|
63
|
-
} | {
|
|
64
|
-
ok: false;
|
|
65
|
-
why: string;
|
|
66
|
-
};
|
|
67
37
|
/**
|
|
68
38
|
* The list of a declaration with its sheet rows: the block's rows first, then the sheet rows. A declaration with no sheet check keeps the list exactly as it was.
|
|
69
39
|
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o @returns {{declaration: any, sheet: ReturnType<typeof sheetRowsOf>}}
|
|
@@ -78,4 +48,3 @@ export function withSheetRows({ declaration, lines, csvRoles }: {
|
|
|
78
48
|
};
|
|
79
49
|
export function sheetRowKey(line: number, id: string): string;
|
|
80
50
|
export function isSheetKey(key: unknown): boolean;
|
|
81
|
-
export function droppedSheetOf(record: any): any[];
|
package/types/ticketrows.d.ts
CHANGED
|
@@ -57,5 +57,5 @@ export function ticketListReds(declaration: any): string[];
|
|
|
57
57
|
/** @type {readonly ('ticketFilter'|'ticketWatch')[]} */
|
|
58
58
|
export const TICKET_FIELDS: readonly ("ticketFilter" | "ticketWatch")[];
|
|
59
59
|
/** the Not-checked reason of a ticket rule no legal value was suggested for (the block's own noPick sentence is used by the caller's words) */
|
|
60
|
-
export const NO_VALUE_WHY: "No check was picked for it, so you judge it at
|
|
60
|
+
export const NO_VALUE_WHY: "No check was picked for it, so you judge it at Accept.";
|
|
61
61
|
export function ticketRowKey(line: number, rule: number, field: string): string;
|
package/types/try-checks.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export function outputRecord(step: {
|
|
|
33
33
|
* #3 and up: the close's own checks. A softgreen close carries each of its checks; a green close is one check over all its cited fields; a close that
|
|
34
34
|
* judged nothing (`unparseable`, `crash`) is one check that could not run, with that third outcome as its result.
|
|
35
35
|
* @param {any} step @param {any} artifact @param {{verdict: string, red?: string|null, checks?: Array<{text:string, ok:boolean, result:string|null}>}} closed @param {any[]} [checkList] the signed list (M16): a line on it tags its checks
|
|
36
|
+
* @param {any[]} [jobLines] the signed job lines (M19 am11: the words of a list line's field rows read the person's rule)
|
|
36
37
|
*/
|
|
37
38
|
export function closeRecords(step: any, artifact: any, closed: {
|
|
38
39
|
verdict: string;
|
|
@@ -42,7 +43,7 @@ export function closeRecords(step: any, artifact: any, closed: {
|
|
|
42
43
|
ok: boolean;
|
|
43
44
|
result: string | null;
|
|
44
45
|
}>;
|
|
45
|
-
}, checkList?: any[]): any[];
|
|
46
|
+
}, checkList?: any[], jobLines?: any[]): any[];
|
|
46
47
|
export const EVERY_STEP: "every step";
|
|
47
48
|
/** the words of the two checks every step has (#1 and #2 below): the Audit's "Always checked" rows, the plan card's and the Job tab's "Always checked" fold */
|
|
48
49
|
export const EVERY_STEP_TEXTS: readonly string[];
|
package/types/types.d.ts
CHANGED
|
@@ -291,6 +291,10 @@ export type CloseVerdict = {
|
|
|
291
291
|
check: any;
|
|
292
292
|
results?: unknown;
|
|
293
293
|
} | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* a line with an itemShape close (M19 S5): bareguard's own gaps of the items check (names, counts and bounds, never a value)
|
|
296
|
+
*/
|
|
297
|
+
shapeGaps?: any[] | undefined;
|
|
294
298
|
/**
|
|
295
299
|
* a sheet close (M10b piece 2): what the run's sheet-check record keeps
|
|
296
300
|
*/
|
package/types/whole-job.d.ts
CHANGED
|
@@ -44,10 +44,10 @@ export function reportContextOf({ runDir, steps, jobLines, checkList }: {
|
|
|
44
44
|
/**
|
|
45
45
|
* @param {{ steps: { fromLine: number, goal: string, emits?: string, close?: any }[], askLines: Map<number, any>, lastAskIndex: number,
|
|
46
46
|
* readResult: (id: string) => ({ ok: true, value: any } | { ok: false, missing: true } | { ok: false, missing: false, red: string }),
|
|
47
|
-
* context: ReturnType<typeof reportContextOf
|
|
47
|
+
* context: ReturnType<typeof reportContextOf>, redPrefix?: string }} p `redPrefix` is `ask: ` (an Ask job's words, unchanged); M15 am4 gives a job with no Ask `send: `
|
|
48
48
|
* @returns {{ ok: true, value: { text: string } } | { ok: false, red: string }}
|
|
49
49
|
*/
|
|
50
|
-
export function wholeJobText({ steps, askLines, lastAskIndex, readResult, context }: {
|
|
50
|
+
export function wholeJobText({ steps, askLines, lastAskIndex, readResult, context, redPrefix }: {
|
|
51
51
|
steps: {
|
|
52
52
|
fromLine: number;
|
|
53
53
|
goal: string;
|
|
@@ -68,6 +68,7 @@ export function wholeJobText({ steps, askLines, lastAskIndex, readResult, contex
|
|
|
68
68
|
red: string;
|
|
69
69
|
});
|
|
70
70
|
context: ReturnType<typeof reportContextOf>;
|
|
71
|
+
redPrefix?: string;
|
|
71
72
|
}): {
|
|
72
73
|
ok: true;
|
|
73
74
|
value: {
|
|
@@ -80,16 +81,30 @@ export function wholeJobText({ steps, askLines, lastAskIndex, readResult, contex
|
|
|
80
81
|
/**
|
|
81
82
|
* M15 am3 item 6: the body the send writes. A plan whose last Ask shows the whole job (`wholeIdx` >= 0) was accepted AS that text: the body is `{text}` exactly, never rebuilt. A plan signed before
|
|
82
83
|
* M13 am9 (or a job with no Ask) sends the one step right before the send: its section is written from the accepted artifact, the line being that step's own (or, past an Ask, the step the Ask read).
|
|
83
|
-
*
|
|
84
|
+
* M15 am4: a job with no signed Ask (`askLines.size === 0`, no whole-job Ask) writes every work line before the send, in line order: the whole-job text over the steps before the send, the step right before it
|
|
85
|
+
* read from `content` (what the person accepted), the earlier ones from the run's saved outputs (`readResult`). A missing or unreadable earlier output refuses by name, in `send: ` words (never `ask: `).
|
|
86
|
+
* @param {{ content: any, wholeIdx: number, steps: any[], sendIndex: number, askLines: Map<number, any>, context: ReturnType<typeof reportContextOf>,
|
|
87
|
+
* readResult?: (id: string) => ({ ok: true, value: any } | { ok: false, missing: true } | { ok: false, missing: false, red: string }) }} p
|
|
84
88
|
* @returns {{ ok: true, body: string } | { ok: false, red: string }}
|
|
85
89
|
*/
|
|
86
|
-
export function sendBodyOf({ content, wholeIdx, steps, sendIndex, askLines, context }: {
|
|
90
|
+
export function sendBodyOf({ content, wholeIdx, steps, sendIndex, askLines, context, readResult }: {
|
|
87
91
|
content: any;
|
|
88
92
|
wholeIdx: number;
|
|
89
93
|
steps: any[];
|
|
90
94
|
sendIndex: number;
|
|
91
95
|
askLines: Map<number, any>;
|
|
92
96
|
context: ReturnType<typeof reportContextOf>;
|
|
97
|
+
readResult?: (id: string) => ({
|
|
98
|
+
ok: true;
|
|
99
|
+
value: any;
|
|
100
|
+
} | {
|
|
101
|
+
ok: false;
|
|
102
|
+
missing: true;
|
|
103
|
+
} | {
|
|
104
|
+
ok: false;
|
|
105
|
+
missing: false;
|
|
106
|
+
red: string;
|
|
107
|
+
});
|
|
93
108
|
}): {
|
|
94
109
|
ok: true;
|
|
95
110
|
body: string;
|
|
@@ -118,3 +133,4 @@ export function readEveryStep<S extends {
|
|
|
118
133
|
line: number;
|
|
119
134
|
}[];
|
|
120
135
|
}): S[];
|
|
136
|
+
export function lineRulesOf(jl: any): string[];
|