fwdloop 0.32.0 → 0.34.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/bin/fwdloop +20 -2
- package/package.json +2 -2
- package/src/auditchecks.js +55 -0
- package/src/authoring.js +53 -12
- package/src/blockasks.js +45 -0
- package/src/blockassemble.js +159 -0
- package/src/blockdraft.js +86 -0
- package/src/blocklines.js +30 -0
- package/src/blockpick.js +175 -0
- package/src/cardlist.js +19 -0
- package/src/checkblock.js +843 -0
- package/src/checked.js +48 -9
- package/src/checklist.js +99 -0
- package/src/checklistsign.js +93 -0
- package/src/checkpick.js +7 -73
- package/src/checkwords.js +20 -1
- package/src/cited-record.js +21 -1
- package/src/citedcheck.js +162 -7
- package/src/closers.js +41 -3
- package/src/declaration.js +34 -9
- package/src/declaredclose.js +4 -0
- package/src/draft-steps.js +3 -1
- package/src/drafter.js +311 -206
- package/src/factwords.js +112 -0
- package/src/inputlook.js +53 -0
- package/src/labelscan.js +162 -0
- package/src/noteask.js +62 -0
- package/src/pageask.js +9 -69
- package/src/pagedropwords.js +11 -1
- package/src/pagedry.js +27 -4
- package/src/pagerules.js +19 -3
- package/src/panel/author.js +76 -7
- package/src/panel/authorcard.js +43 -17
- package/src/panel/data.js +41 -9
- package/src/panel/index.html +208 -13
- package/src/panel/result.js +4 -3
- package/src/panel/server.js +3 -1
- package/src/pickrecord.js +70 -54
- package/src/placerule.js +398 -0
- package/src/planrebuild.js +216 -0
- package/src/rowedit.js +148 -0
- package/src/rubricstep.js +272 -0
- package/src/runfile.js +4 -2
- package/src/runner.js +67 -10
- package/src/setup.js +11 -5
- package/src/sheetblock.js +22 -8
- package/src/sheetbuild.js +151 -0
- package/src/sheetchecks.js +52 -66
- package/src/sheetclaims.js +12 -32
- package/src/sheetfind.js +4 -4
- package/src/sheetlook.js +14 -3
- package/src/sheetoffer.js +74 -57
- package/src/sheetrows.js +123 -0
- package/src/sheetrun.js +13 -10
- package/src/summary-words.js +3 -3
- package/src/ticket-draft.js +4 -21
- package/src/ticketrows.js +100 -0
- package/src/try-checks.js +31 -12
- package/src/types.js +1 -0
- package/types/auditchecks.d.ts +25 -0
- package/types/authoring.d.ts +21 -2
- package/types/blockasks.d.ts +36 -0
- package/types/blockassemble.d.ts +50 -0
- package/types/blockdraft.d.ts +75 -0
- package/types/blocklines.d.ts +31 -0
- package/types/blockpick.d.ts +46 -0
- package/types/cardlist.d.ts +21 -0
- package/types/checkblock.d.ts +378 -0
- package/types/checked.d.ts +16 -2
- package/types/checklist.d.ts +115 -0
- package/types/checklistsign.d.ts +27 -0
- package/types/checkpick.d.ts +4 -34
- package/types/checkwords.d.ts +5 -0
- package/types/cited-record.d.ts +9 -0
- package/types/citedcheck.d.ts +33 -2
- package/types/closers.d.ts +24 -2
- package/types/declaration.d.ts +7 -0
- package/types/declaredclose.d.ts +2 -0
- package/types/drafter.d.ts +29 -715
- package/types/factwords.d.ts +38 -0
- package/types/inputlook.d.ts +49 -0
- package/types/labelscan.d.ts +35 -0
- package/types/noteask.d.ts +52 -0
- package/types/pageask.d.ts +2 -35
- package/types/pagedry.d.ts +13 -0
- package/types/pagerules.d.ts +7 -0
- package/types/panel/author.d.ts +41 -0
- package/types/panel/authorcard.d.ts +14 -9
- package/types/panel/authorflows.d.ts +4 -4
- package/types/panel/data.d.ts +5 -3
- package/types/panel/jobgrid.d.ts +1 -1
- package/types/pickrecord.d.ts +69 -13
- package/types/placerule.d.ts +208 -0
- package/types/planrebuild.d.ts +52 -0
- package/types/provider.d.ts +1 -1
- package/types/rowedit.d.ts +48 -0
- package/types/rubricstep.d.ts +63 -0
- package/types/runfile.d.ts +5 -2
- package/types/runner.d.ts +45 -1
- package/types/sheetblock.d.ts +12 -4
- package/types/sheetbuild.d.ts +84 -0
- package/types/sheetchecks.d.ts +12 -18
- package/types/sheetclaims.d.ts +2 -1
- package/types/sheetfind.d.ts +2 -2
- package/types/sheetoffer.d.ts +31 -6
- package/types/sheetrows.d.ts +81 -0
- package/types/sheetrun.d.ts +4 -4
- package/types/summary-words.d.ts +2 -1
- package/types/ticket-draft.d.ts +3 -49
- package/types/ticketrows.d.ts +61 -0
- package/types/try-checks.d.ts +4 -2
- package/types/types.d.ts +8 -0
- package/src/repairs.js +0 -38
- package/types/repairs.d.ts +0 -13
package/types/sheetchecks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Every column name one check holds
|
|
3
|
-
*
|
|
2
|
+
* Every column name one check holds, read from bareguard's own vocabulary: each field of the check's rule that carries `columnAt` ("self": a name; "self.column": a cell
|
|
3
|
+
* `{column, row}`; "each.column": a list of `{column}`; "each": a list of names). A row-math `b` of `{const}` is no column. bareguard owns which fields these are.
|
|
4
4
|
* @param {any} check @returns {string[]}
|
|
5
5
|
*/
|
|
6
6
|
export function sheetCheckColumns(check: any): string[];
|
|
@@ -13,7 +13,8 @@ export function sheetCheckSentence(check: any): string;
|
|
|
13
13
|
/**
|
|
14
14
|
* M10b piece 4: a signed check may carry fwdloop's own `covers` (the numbers of the job line's `~` rules the drafter tagged it to; signed, so the person sees it).
|
|
15
15
|
* bareguard does not know it, so the checks are cleaned HERE, the ONE place, on the way into bareguard (`createRubric` at sign time and at run time).
|
|
16
|
-
*
|
|
16
|
+
* M17 am3: `row` (fwdloop's own typed tag of a check code made an `[agent]` row) is cleaned here too.
|
|
17
|
+
* @param {any[]} checks @returns {any[]} a copy without `covers` and `row`
|
|
17
18
|
*/
|
|
18
19
|
export function bareguardChecks(checks: any[]): any[];
|
|
19
20
|
/**
|
|
@@ -28,9 +29,10 @@ export function sheetCoversReds(checks: any[], jobLine: {
|
|
|
28
29
|
/** The rows for a step's `close.sheet`, one per check, in order. @param {unknown} sheet @returns {string[]} */
|
|
29
30
|
export function sheetCheckRows(sheet: unknown): string[];
|
|
30
31
|
/**
|
|
31
|
-
* The $0 sign-time test of one step's sheet checks (M10b item 4): bareguard's `
|
|
32
|
-
*
|
|
33
|
-
* a
|
|
32
|
+
* The $0 sign-time test of one step's sheet checks (M10b item 4): bareguard's `checkTables` is given the checks and the signed fingerprint of each sheet they read
|
|
33
|
+
* (`tableSha` of the drafting copy's table) and returns every problem; each becomes a red that names the job line (and the check) in fwdloop's words. A sheet with no
|
|
34
|
+
* saved copy, a sheet bareguard cannot read as a table, or a column that is no header of its sheet is reported first; a check bareguard refuses only when none of those is.
|
|
35
|
+
* Never throws.
|
|
34
36
|
* @param {any[]} checks the step's `close.sheet` (already known to be a list of objects) @param {number} line the job line the step comes from
|
|
35
37
|
* @param {Record<string, {header: string[], rows: any[]}>} tables the drafting copy's table of each sheet role @returns {string[]} reds, each naming the line
|
|
36
38
|
*/
|
|
@@ -39,10 +41,10 @@ export function sheetCheckReds(checks: any[], line: number, tables: Record<strin
|
|
|
39
41
|
rows: any[];
|
|
40
42
|
}>): string[];
|
|
41
43
|
/**
|
|
42
|
-
* M10b piece 3: a number or a date in a check comes from the job, never from the model.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
44
|
+
* M10b piece 3: a number or a date in a check comes from the job, never from the model. bareguard's `groundedLiterals` judges every number and date the check carries
|
|
45
|
+
* against the person's words on the job line or its `~` rules (one string, `wordsSaidOn`); each literal it reports missing becomes a red in fwdloop's words. A literal of the
|
|
46
|
+
* wrong type or an unreadable condition is not "not in your words": `createRubric` refuses it (sheetCheckReds), so it is no red here.
|
|
47
|
+
* Throws away: a text value (`equals`, `needle`), band bounds, `n`, `tolerance`, `range` are not read (bareguard does not read them either).
|
|
46
48
|
* @param {any[]} checks the step's `close.sheet` @param {{n: number, text?: string, rule?: string, rules?: string[]}} jobLine @returns {string[]} reds, each naming the line
|
|
47
49
|
*/
|
|
48
50
|
export function sheetCheckWordReds(checks: any[], jobLine: {
|
|
@@ -60,11 +62,3 @@ export function sheetNoClaimReds(checks: any[], line: number): string[];
|
|
|
60
62
|
export const SHEET_RULES: readonly string[];
|
|
61
63
|
/** most checks one step may carry */
|
|
62
64
|
export const MAX_SHEET_CHECKS: 20;
|
|
63
|
-
/** the fields of a check that hold a column name as a plain string (the ONE list: {@link sheetCheckColumns} reads it, the drafter's tool schema offers a header enum on each) */
|
|
64
|
-
export const COLUMN_STRING_FIELDS: readonly string[];
|
|
65
|
-
/** the row-math operands: a column name, or (for `b`) `{const}` */
|
|
66
|
-
export const COLUMN_OPERAND_FIELDS: readonly string[];
|
|
67
|
-
/** the date-cell fields: `{column, row}` */
|
|
68
|
-
export const COLUMN_CELL_FIELDS: readonly string[];
|
|
69
|
-
/** the list fields whose entries hold a `column` */
|
|
70
|
-
export const COLUMN_LIST_FIELDS: readonly string[];
|
package/types/sheetclaims.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export function sheetClaims(checks: any[]): Array<{
|
|
|
9
9
|
ops: string[];
|
|
10
10
|
}>;
|
|
11
11
|
/**
|
|
12
|
-
* The `emit_artifact` tool's properties for a step that reads a sheet: one typed box per claim, each required
|
|
12
|
+
* The `emit_artifact` tool's properties for a step that reads a sheet: one typed box per claim, each required, the box's schema bareguard's `claimSchema` of the check
|
|
13
|
+
* (two checks that share a claim name share one box: their keys merge). `covers` is fwdloop's own and is stripped before bareguard reads the check. (`done` is added by the caller.)
|
|
13
14
|
* @param {any[]} checks @returns {{properties: Record<string, any>, required: string[]}}
|
|
14
15
|
*/
|
|
15
16
|
export function sheetAnswerProps(checks: any[]): {
|
package/types/sheetfind.d.ts
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
export function findColumn(csvText: string, word: string): FoundHeader | FoundAsk | FoundTie | FoundNone;
|
|
13
13
|
/** a column fits when a plain number fills at least this share of the rows (F71 (b)) */
|
|
14
14
|
export const FIT_RATIO: 0.9;
|
|
15
|
-
export function columnQuestion(word: string, found: FoundAsk, line: number): string;
|
|
16
|
-
export function columnTail(line: number): string;
|
|
15
|
+
export function columnQuestion(word: string, found: FoundAsk, line: number, tied?: boolean): string;
|
|
16
|
+
export function columnTail(line: number, tied?: boolean): string;
|
|
17
17
|
/**
|
|
18
18
|
* the word IS a column (nothing to ask)
|
|
19
19
|
*/
|
package/types/sheetoffer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The tool schema of `close.sheet`: a list of bareguard cells / table checks.
|
|
3
|
-
*
|
|
4
|
-
* (which `~` rules of the job line the check covers), kept and signed.
|
|
2
|
+
* The tool schema of `close.sheet`: a list of bareguard cells / table checks. The check's schema is bareguard's `checkSchema` (every column-bearing field an enum of the sheet's
|
|
3
|
+
* exact header, `table` an enum of the roles, one `op` enum); fwdloop drops what a check must not carry (the free-text `explanation` fields: a check carries no prose), puts its
|
|
4
|
+
* own words on id / rule / table / claim / op, and adds `covers` (which `~` rules of the job line the check covers), kept and signed.
|
|
5
5
|
* @param {Record<string, {header: string[]}>} tables the drafting copy's table of each CSV input role
|
|
6
6
|
* @returns {Record<string, any>|null} null when there is no sheet with a header to pick from
|
|
7
7
|
*/
|
|
@@ -18,8 +18,33 @@ export function sheetOpsBrief(): string[];
|
|
|
18
18
|
* The rules the validator enforces on `close.sheet`, as lines for the drafter (every one of them is a refusal at $0 in src/declaration.js / src/sheetchecks.js).
|
|
19
19
|
* @param {string[]} roles the CSV input roles @returns {string[]}
|
|
20
20
|
*/
|
|
21
|
-
export function sheetOfferRules(roles: string[]): string[];
|
|
21
|
+
export function sheetOfferRules(roles: string[], lineNums?: number[]): string[];
|
|
22
|
+
/**
|
|
23
|
+
* M17 am2 item 2: the row-edit reply's `sheetChecks` property: bareguard's `checkSchema` items (src/sheetoffer.js `sheetChecksProp`) plus the job line each suggestion is for. Typed suggestions only; code builds or refuses each.
|
|
24
|
+
* @param {Record<string, {header: string[]}>} tables @param {number[]} [lineNums] the job's sheet lines: `line` can only name one of them @returns {Record<string, any>|null}
|
|
25
|
+
*/
|
|
26
|
+
export function sheetSuggestProp(tables: Record<string, {
|
|
27
|
+
header: string[];
|
|
28
|
+
}>, lineNums?: number[]): Record<string, any> | null;
|
|
22
29
|
/** @param {unknown} rule @returns {boolean} true for the `use the column 'X' for 'Y'` rule an agreed column ask writes ({@link columnRuleWords}) */
|
|
23
30
|
export function isColumnChoiceRule(rule: unknown): boolean;
|
|
24
|
-
/**
|
|
25
|
-
|
|
31
|
+
/**
|
|
32
|
+
* M17 ruling 1 (hamr 2026-11-14): the parts of an agreed column rule (`use the column 'Amount' for 'Price'`), read from the words code wrote ({@link columnRuleWords}); null for any other text.
|
|
33
|
+
* @param {unknown} rule @returns {{column: string, word: string}|null}
|
|
34
|
+
*/
|
|
35
|
+
export function columnChoiceParts(rule: unknown): {
|
|
36
|
+
column: string;
|
|
37
|
+
word: string;
|
|
38
|
+
} | null;
|
|
39
|
+
/**
|
|
40
|
+
* M17 ruling 1: the rule's own words with the job's word (case aside, whole word) swapped for the agreed column: "Price over 500" + Amount -> "Amount over 500". Null when the word is not in the rule.
|
|
41
|
+
* @param {string} text @param {string} word @param {string} column @returns {string|null}
|
|
42
|
+
*/
|
|
43
|
+
export function swapColumnWord(text: string, word: string, column: string): string | null;
|
|
44
|
+
/** The comparisons of a `where` condition, as bareguard's vocabulary lists them. */
|
|
45
|
+
export const WHERE_CMPS: readonly any[];
|
|
46
|
+
export function agreedColumnWords(c: {
|
|
47
|
+
line: number;
|
|
48
|
+
word: string;
|
|
49
|
+
column: string;
|
|
50
|
+
}): string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 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
|
+
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o
|
|
4
|
+
* @returns {{signed: Record<string, any>[], card: {key: string, line: number, by: 'you'|'agent', state: 'built', text: string, reason: null, drop: boolean}[]}}
|
|
5
|
+
*/
|
|
6
|
+
export function sheetRowsOf({ declaration, lines, csvRoles }: {
|
|
7
|
+
declaration: any;
|
|
8
|
+
lines: any[];
|
|
9
|
+
csvRoles: string[];
|
|
10
|
+
}): {
|
|
11
|
+
signed: Record<string, any>[];
|
|
12
|
+
card: {
|
|
13
|
+
key: string;
|
|
14
|
+
line: number;
|
|
15
|
+
by: "you" | "agent";
|
|
16
|
+
state: "built";
|
|
17
|
+
text: string;
|
|
18
|
+
reason: null;
|
|
19
|
+
drop: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The plan's card with the sheet rows on it: the sheet rows after the block's rows, a dropped sheet check among the suggestions (Add), as the block's dropped suggestions are.
|
|
24
|
+
* @param {{rows: any[], suggested: any[]}} card the block's card (src/cardlist.js) @param {{card: any[]}} sheet `sheetRowsOf` @param {{key: string, line: number, text: string}[]} [dropped]
|
|
25
|
+
*/
|
|
26
|
+
export function withSheetCard(card: {
|
|
27
|
+
rows: any[];
|
|
28
|
+
suggested: any[];
|
|
29
|
+
}, sheet: {
|
|
30
|
+
card: any[];
|
|
31
|
+
}, dropped?: {
|
|
32
|
+
key: string;
|
|
33
|
+
line: number;
|
|
34
|
+
text: string;
|
|
35
|
+
}[]): {
|
|
36
|
+
rows: any[];
|
|
37
|
+
suggested: any[];
|
|
38
|
+
};
|
|
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
|
+
/**
|
|
68
|
+
* 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
|
+
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o @returns {{declaration: any, sheet: ReturnType<typeof sheetRowsOf>}}
|
|
70
|
+
*/
|
|
71
|
+
export function withSheetRows({ declaration, lines, csvRoles }: {
|
|
72
|
+
declaration: any;
|
|
73
|
+
lines: any[];
|
|
74
|
+
csvRoles: string[];
|
|
75
|
+
}): {
|
|
76
|
+
declaration: any;
|
|
77
|
+
sheet: ReturnType<typeof sheetRowsOf>;
|
|
78
|
+
};
|
|
79
|
+
export function sheetRowKey(line: number, id: string): string;
|
|
80
|
+
export function isSheetKey(key: unknown): boolean;
|
|
81
|
+
export function droppedSheetOf(record: any): any[];
|
package/types/sheetrun.d.ts
CHANGED
|
@@ -34,10 +34,10 @@ export function readRunSheets(runDir: string, checks: any[]): {
|
|
|
34
34
|
*/
|
|
35
35
|
export function closeSheet(checks: any[], artifact: unknown, sheet: ReturnType<typeof readRunSheets> | null | undefined): Promise<import("./types.js").CloseVerdict>;
|
|
36
36
|
/**
|
|
37
|
-
* M10b am5: the `table` checks of a draft that already fail on the sheet the draft was made with. A table check judges the sheet itself, so bareguard's `
|
|
38
|
-
* run's
|
|
39
|
-
* Each check is read by its id
|
|
40
|
-
*
|
|
37
|
+
* M10b am5: the `table` checks of a draft that already fail on the sheet the draft was made with. A table check judges the sheet itself, so bareguard's `runTableChecks`
|
|
38
|
+
* (the same evaluation path as the run's `checkStep`) can run it before anything is spent: $0, no model call, no answer needed. Only `table` checks run; a cells check judges
|
|
39
|
+
* the step's answer and never runs here. Each check is its own rubric, read by its id. Only a `red` verdict is a red here: a `stopped` check (bareguard could not read the
|
|
40
|
+
* sheet) or a rubric bareguard refuses is not reported (the draft's own sheet look and sheetCheckReds have said so).
|
|
41
41
|
* @param {any} declaration the draft @param {Record<string, {header: string[], rows: any[]}>} tables the draft-time table of each CSV input, by role
|
|
42
42
|
* @returns {Promise<string[]>} one red per failing check, in plan order
|
|
43
43
|
*/
|
package/types/summary-words.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export function catchUpWords(rec: any): "This run was a catch-up: it started mor
|
|
|
45
45
|
/**
|
|
46
46
|
* ENDED / NEXT of a finished run. Every outcome the history row can hold has a fixed sentence; an unknown one gets an honest fixed fallback
|
|
47
47
|
* that names the code and guesses nothing. `null` when there is no ending (still running, waiting, or no history row and not died).
|
|
48
|
-
* @param {{outcome: string|null, died?: boolean, line: number|null, destination: string|null, canResume: boolean, home?: string, skipReason?: string}} f
|
|
48
|
+
* @param {{outcome: string|null, died?: boolean, line: number|null, destination: string|null, canResume: boolean, home?: string, skipReason?: string, anywayOffered?: boolean}} f
|
|
49
49
|
* @returns {{reason: string, next: string, rows?: Array<[string, string]>}|null}
|
|
50
50
|
*/
|
|
51
51
|
export function endedWords(f: {
|
|
@@ -56,6 +56,7 @@ export function endedWords(f: {
|
|
|
56
56
|
canResume: boolean;
|
|
57
57
|
home?: string;
|
|
58
58
|
skipReason?: string;
|
|
59
|
+
anywayOffered?: boolean;
|
|
59
60
|
}): {
|
|
60
61
|
reason: string;
|
|
61
62
|
next: string;
|
package/types/ticket-draft.d.ts
CHANGED
|
@@ -9,61 +9,15 @@ export function ticketFactsLines(role: string): string[];
|
|
|
9
9
|
/** the lines for a generic MCP job: the server, its tool names (so the drafter can grant them to steps), and the rule that a step lists a tool only if it calls it live @param {string} server @param {string[]} tools @returns {string[]} */
|
|
10
10
|
export function mcpFactsLines(server: string, tools: string[]): string[];
|
|
11
11
|
/**
|
|
12
|
-
* The schema parts a job with an MCP adds (M13 piece 4): per-step `mcpTools` (an enum of the job's tool names) for MCP (generic) and Tickets, and
|
|
13
|
-
*
|
|
12
|
+
* The schema parts a job with an MCP adds (M13 piece 4): per-step `mcpTools` (an enum of the job's tool names) for MCP (generic) and Tickets, and no top-level `ticketFilter` or `ticketWatch` (M17 am6: they are checks on the list, suggested in the
|
|
13
|
+
* row-edit turn, src/rowedit.js; a draft that carries one is refused). The job's own `mcp` block and `flowType` are NOT offered: code sets them.
|
|
14
14
|
* @param {{flowType: 'mcp'|'tickets', tools: string[]}} o
|
|
15
15
|
*/
|
|
16
16
|
export function ticketSchemaParts({ flowType, tools }: {
|
|
17
17
|
flowType: "mcp" | "tickets";
|
|
18
18
|
tools: string[];
|
|
19
19
|
}): {
|
|
20
|
-
top: {
|
|
21
|
-
ticketFilter?: undefined;
|
|
22
|
-
ticketWatch?: undefined;
|
|
23
|
-
};
|
|
24
|
-
step: {
|
|
25
|
-
mcpTools: {
|
|
26
|
-
type: string;
|
|
27
|
-
items: {
|
|
28
|
-
type: string;
|
|
29
|
-
enum: string[];
|
|
30
|
-
};
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
} | {
|
|
35
|
-
top: {
|
|
36
|
-
ticketFilter: {
|
|
37
|
-
type: string;
|
|
38
|
-
properties: {
|
|
39
|
-
priority: {
|
|
40
|
-
type: string;
|
|
41
|
-
items: {
|
|
42
|
-
type: string;
|
|
43
|
-
enum: string[];
|
|
44
|
-
};
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
labels: {
|
|
48
|
-
type: string;
|
|
49
|
-
items: {
|
|
50
|
-
type: string;
|
|
51
|
-
};
|
|
52
|
-
description: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
additionalProperties: boolean;
|
|
56
|
-
description: string;
|
|
57
|
-
};
|
|
58
|
-
ticketWatch: {
|
|
59
|
-
type: string;
|
|
60
|
-
items: {
|
|
61
|
-
type: string;
|
|
62
|
-
enum: string[];
|
|
63
|
-
};
|
|
64
|
-
description: string;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
20
|
+
top: {};
|
|
67
21
|
step: {
|
|
68
22
|
mcpTools: {
|
|
69
23
|
type: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which signed field a Tickets rule is the check of: `ticketWatch` (a state or labels change), `ticketFilter` (a priority P0 to P3 or a label), or null (a content rule or a count).
|
|
3
|
+
* @param {string} t the rule's words @returns {'ticketFilter'|'ticketWatch'|null}
|
|
4
|
+
*/
|
|
5
|
+
export function ticketRuleField(t: string): "ticketFilter" | "ticketWatch" | null;
|
|
6
|
+
/**
|
|
7
|
+
* The reds of a suggested value, by the declaration's own readers (a stand-in declaration with an `mcp` block so only the value is judged). Empty = legal.
|
|
8
|
+
* @param {'ticketFilter'|'ticketWatch'} field @param {unknown} value @returns {string[]}
|
|
9
|
+
*/
|
|
10
|
+
export function proposalReds(field: "ticketFilter" | "ticketWatch", value: unknown): string[];
|
|
11
|
+
/** the words a value is drawn with: the readout's own (src/authoring.js) @param {'ticketFilter'|'ticketWatch'} field @param {any} v */
|
|
12
|
+
export function ticketWords(field: "ticketFilter" | "ticketWatch", v: any): string;
|
|
13
|
+
/**
|
|
14
|
+
* The ticket rows of a Tickets declaration: one per `~` rule of a filter or watch kind. Built when the declaration holds that field; else Not checked (the person judges it at the Ask).
|
|
15
|
+
* @param {{declaration: any, lines: {n: number, guardrail?: string|null}[]}} o `lines` = the signed lines (a line's `guardrail` is its `; `-joined `~` rules)
|
|
16
|
+
* @returns {{signed: Record<string, any>[], card: {key: string, line: number, by: 'you', state: string, text: string, reason: string|null, drop: false}[], notChecked: {line: number, rule: string, reason: string}[]}}
|
|
17
|
+
*/
|
|
18
|
+
export function ticketRowsOf({ declaration, lines }: {
|
|
19
|
+
declaration: any;
|
|
20
|
+
lines: {
|
|
21
|
+
n: number;
|
|
22
|
+
guardrail?: string | null;
|
|
23
|
+
}[];
|
|
24
|
+
}): {
|
|
25
|
+
signed: Record<string, any>[];
|
|
26
|
+
card: {
|
|
27
|
+
key: string;
|
|
28
|
+
line: number;
|
|
29
|
+
by: "you";
|
|
30
|
+
state: string;
|
|
31
|
+
text: string;
|
|
32
|
+
reason: string | null;
|
|
33
|
+
drop: false;
|
|
34
|
+
}[];
|
|
35
|
+
notChecked: {
|
|
36
|
+
line: number;
|
|
37
|
+
rule: string;
|
|
38
|
+
reason: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The list of a declaration with its ticket rows after the block's rows. A declaration with none keeps its list exactly as it was.
|
|
43
|
+
* @param {{declaration: any, lines: any[]}} o @returns {{declaration: any, tickets: ReturnType<typeof ticketRowsOf>}}
|
|
44
|
+
*/
|
|
45
|
+
export function withTicketRows({ declaration, lines }: {
|
|
46
|
+
declaration: any;
|
|
47
|
+
lines: any[];
|
|
48
|
+
}): {
|
|
49
|
+
declaration: any;
|
|
50
|
+
tickets: ReturnType<typeof ticketRowsOf>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The proof of a plan whose list has ticket rows (a plan with none is not examined): a built ticket row needs the declaration's field, and a field the declaration holds needs a built row for it.
|
|
54
|
+
* @param {any} declaration @returns {string[]}
|
|
55
|
+
*/
|
|
56
|
+
export function ticketListReds(declaration: any): string[];
|
|
57
|
+
/** @type {readonly ('ticketFilter'|'ticketWatch')[]} */
|
|
58
|
+
export const TICKET_FIELDS: readonly ("ticketFilter" | "ticketWatch")[];
|
|
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 the Ask.";
|
|
61
|
+
export function ticketRowKey(line: number, rule: number, field: string): string;
|
package/types/try-checks.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export function outputRecord(step: {
|
|
|
32
32
|
/**
|
|
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
|
-
* @param {any} step @param {any} artifact @param {{verdict: string, red?: string|null, checks?: Array<{text:string, ok:boolean, result:string|null}>}} closed
|
|
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
36
|
*/
|
|
37
37
|
export function closeRecords(step: any, artifact: any, closed: {
|
|
38
38
|
verdict: string;
|
|
@@ -42,8 +42,10 @@ export function closeRecords(step: any, artifact: any, closed: {
|
|
|
42
42
|
ok: boolean;
|
|
43
43
|
result: string | null;
|
|
44
44
|
}>;
|
|
45
|
-
}): any[];
|
|
45
|
+
}, checkList?: any[]): any[];
|
|
46
46
|
export const EVERY_STEP: "every step";
|
|
47
|
+
/** 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
|
+
export const EVERY_STEP_TEXTS: readonly string[];
|
|
47
49
|
export function lineSource(step: {
|
|
48
50
|
fromLine?: unknown;
|
|
49
51
|
}): string;
|
package/types/types.d.ts
CHANGED
|
@@ -275,6 +275,14 @@ export type CloseVerdict = {
|
|
|
275
275
|
ok: boolean;
|
|
276
276
|
result: string | null;
|
|
277
277
|
}[] | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* the numbers tie of a text line (M16 R7): beside the class's own verdict
|
|
280
|
+
*/
|
|
281
|
+
numbersCheck?: {
|
|
282
|
+
text: string;
|
|
283
|
+
ok: boolean;
|
|
284
|
+
result: string | null;
|
|
285
|
+
} | undefined;
|
|
278
286
|
/**
|
|
279
287
|
* a cited green close (M10 piece 4): the fact part and the check's own answer, for the run's cited-check record
|
|
280
288
|
*/
|
package/src/repairs.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// M10 am27 (2): code repairs of the two mechanical plan mistakes F169 found in 13 of 20 F168 drafts. Each repair is returned as a line of text and logged on the draft
|
|
2
|
-
// entry (`repaired`), so it is visible. Neither repair grants a primitive, changes a class, or writes a check.
|
|
3
|
-
// (1) a green step whose `close.cited.source` is a declared source role the step does not read: the role is added to its `reads`.
|
|
4
|
-
// (2) an `unjudgeable` entry for a line whose guardrailClasses says green: the entry is dropped and the line stays green.
|
|
5
|
-
// Throws away: the `unjudgeable` reason text of a dropped entry (kept only inside the `repaired` line).
|
|
6
|
-
/**
|
|
7
|
-
* @param {any} declaration the drafter's declaration (not changed) @param {{sources?: {role?: string, kind?: string}[]}} arbiter
|
|
8
|
-
* @returns {{declaration: any, repaired: string[]}}
|
|
9
|
-
*/
|
|
10
|
-
export function repairDeclaration(declaration, arbiter) {
|
|
11
|
-
const isRec = (/** @type {unknown} */ v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
12
|
-
if (!isRec(declaration)) return { declaration, repaired: [] };
|
|
13
|
-
/** @type {string[]} */
|
|
14
|
-
const repaired = [];
|
|
15
|
-
const roles = new Set((arbiter?.sources ?? []).filter((s) => typeof s?.role === 'string').map((s) => /** @type {string} */ (s.role)));
|
|
16
|
-
let out = declaration;
|
|
17
|
-
if (Array.isArray(declaration.steps)) {
|
|
18
|
-
out = {
|
|
19
|
-
...out,
|
|
20
|
-
steps: declaration.steps.map((/** @type {any} */ st, /** @type {number} */ i) => {
|
|
21
|
-
const src = isRec(st) && isRec(st.close) && st.close.class === 'green' && isRec(st.close.cited) ? st.close.cited.source : undefined;
|
|
22
|
-
if (typeof src !== 'string' || !roles.has(src) || !Array.isArray(st.reads) || st.reads.includes(src)) return st;
|
|
23
|
-
repaired.push(`steps[${i}].reads: added "${src}" (its cited check reads it)`);
|
|
24
|
-
return { ...st, reads: [...st.reads, src] };
|
|
25
|
-
}),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (isRec(declaration.unjudgeable) && isRec(declaration.guardrailClasses)) {
|
|
29
|
-
const un = { ...declaration.unjudgeable };
|
|
30
|
-
for (const key of Object.keys(un)) {
|
|
31
|
-
if (declaration.guardrailClasses[key] !== 'green') continue;
|
|
32
|
-
repaired.push(`unjudgeable: dropped the entry for line ${key} (its class is green; reason was: ${String(un[key]).slice(0, 160)})`);
|
|
33
|
-
delete un[key];
|
|
34
|
-
}
|
|
35
|
-
out = { ...out, unjudgeable: un };
|
|
36
|
-
}
|
|
37
|
-
return { declaration: repaired.length ? out : declaration, repaired };
|
|
38
|
-
}
|
package/types/repairs.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {any} declaration the drafter's declaration (not changed) @param {{sources?: {role?: string, kind?: string}[]}} arbiter
|
|
3
|
-
* @returns {{declaration: any, repaired: string[]}}
|
|
4
|
-
*/
|
|
5
|
-
export function repairDeclaration(declaration: any, arbiter: {
|
|
6
|
-
sources?: {
|
|
7
|
-
role?: string;
|
|
8
|
-
kind?: string;
|
|
9
|
-
}[];
|
|
10
|
-
}): {
|
|
11
|
-
declaration: any;
|
|
12
|
-
repaired: string[];
|
|
13
|
-
};
|