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
package/src/blockdraft.js
CHANGED
|
@@ -33,10 +33,12 @@ export function isBuildFault(red, builtLines) {
|
|
|
33
33
|
/**
|
|
34
34
|
* 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.
|
|
35
35
|
* 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".
|
|
36
|
-
* @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
|
|
36
|
+
* @param {{leaveOut?: {line: number, rule: number}[], sheetLines?: number[], texts: Record<string, string>, jobLines: any[], look: {facts: any[], dropped: any[]}, kept: {picks: any[], left: any[], askRules: any[]}, fresh: {picks: any[], left: {line: number, rule: number}[]}, asks: boolean, countScope: (t: string) => boolean}} o
|
|
37
37
|
*/
|
|
38
|
-
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope, leaveOut = [] }) {
|
|
38
|
+
export function setUpBlock({ texts, jobLines, look, kept, fresh, asks, countScope, leaveOut = [], sheetLines = [] }) {
|
|
39
39
|
const block = newJobBlock({ texts, jobLines, asks, countScope });
|
|
40
|
+
// M19 S3: the lines that read a sheet are known before the first reconcile: their rules are the sheet's to decide (no pick, no question)
|
|
41
|
+
block.setSheetLines(sheetLines);
|
|
40
42
|
// M16 item 4: a Tickets job's own guardrails (the signed ticketFilter / ticketWatch) are not rows of the list; the rule numbers of the other rules stay as written
|
|
41
43
|
if (leaveOut.length) block.rows = block.rows.filter((r) => !(r.kind === 'rule' && leaveOut.some((x) => x.line === r.line && x.rule === r.rule)));
|
|
42
44
|
// a rule the person left is the block's own `left` row (carry, below); the look's person-left drop would say it twice
|
package/src/blockpick.js
CHANGED
|
@@ -173,3 +173,13 @@ export function partOfPick(check, text, rules) {
|
|
|
173
173
|
return { text, class: 'countable', check: rule, ...fields, rules };
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
|
|
177
|
+
// borrowed-from: bareloop src/checkpick.js@v0.61.0 (fc56e1f3)
|
|
178
|
+
/** the numbers a text says as "under / fewer than / less than / below N" (the one reader of that wording: a list-items rule and a shape field's bound both use it) @param {string} text @returns {number[]} */
|
|
179
|
+
export function underNumbers(text) {
|
|
180
|
+
return [...String(text).matchAll(/(?<!\b(?:no|not)\s)\b(?:(?:fewer|less)\s+than|under|below)\s+(\d+)\b/gi)].map((m) => Number(m[1]));
|
|
181
|
+
}
|
|
182
|
+
/** the numbers a text says as "at most / up to / no more than / not more than N" @param {string} text @returns {number[]} */
|
|
183
|
+
export function atMostNumbers(text) {
|
|
184
|
+
return [...String(text).matchAll(/\b(?:at\s+most|up\s+to|no\s+more\s+than|not\s+more\s+than)\s+(\d+)\b/gi)].map((m) => Number(m[1]));
|
|
185
|
+
}
|
package/src/canrun.js
CHANGED
|
@@ -93,7 +93,8 @@ export function findUnbuildableCheckStep(declaration) {
|
|
|
93
93
|
for (const step of declaration.steps) {
|
|
94
94
|
// M10b piece 5 (item 8, hamr's ruling): a green step with neither close.sheet nor close.cited is the old cell cite, which no longer runs. A job signed that
|
|
95
95
|
// way is kept for reference (it still reads and displays) and is refused here, at $0, before any spend.
|
|
96
|
-
|
|
96
|
+
// M19 am11 item 5: a line whose green check holds `itemShape` is not the cell cite; `closeOne` runs it (`closeItemShape`), and a bad part was refused at sign
|
|
97
|
+
if (step.close?.class === 'green' && !step.close.cited && !Array.isArray(step.close.sheet) && !(step.close.itemShape && typeof step.close.itemShape === 'object')) {
|
|
97
98
|
return { step, why: 'a green step with no close.sheet or close.cited is the retired cell cite', say: `This flow will not run: Line ${step.fromLine}'s check cannot cite cells any more. Draft it again to run it.` };
|
|
98
99
|
}
|
|
99
100
|
if (step.close?.class !== 'softgreen') continue;
|
package/src/cardlist.js
CHANGED
|
@@ -3,17 +3,40 @@
|
|
|
3
3
|
// and kept in the draft's log.json as `checkCard`. The page only draws it (bareloop src/panel/jobplan.js@v0.56.0 reads the same two readers); it never decides a check.
|
|
4
4
|
// What this throws away: the rows' proofs (`can`, `pick`, parts). Only the words, the tag, the reason and whether a Drop is offered survive.
|
|
5
5
|
import { renderCard } from './checkblock.js';
|
|
6
|
+
import { kindOfCheck } from './checklook.js';
|
|
7
|
+
import { planCard } from './checkrows.js';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* @param {import('./checkblock.js').CheckBlock} block
|
|
9
|
-
* @returns {{rows: {key: string, line: number, by: string, state: string,
|
|
11
|
+
* @returns {{rows: {key: string, line: number, by: string, state: string, reason: string|null, drop: boolean, kind: 'truth'|'shape'|'file'}[], suggested: {key: string, line: number, text: string, dropped?: boolean}[], restorable?: {key: string, line: number, text: string}[]}}
|
|
10
12
|
*/
|
|
11
13
|
export function cardOfBlock(block) {
|
|
12
|
-
|
|
14
|
+
// borrowed-from: bareloop src/panel/index.html@v0.61.0 (checkRow: a shape row has a Drop unless it is code's own) (M19 S9, section 3.7): every shape row has a Drop but code's own `$` one, the person's own `~` rule that took a field too (`droppable`, as the tag's page draws it: Drop unless `c.by` is "default"); a non-shape row is offered as before
|
|
15
|
+
const dropOffered = new Set(block.rows.filter((r) => r.state === 'built' && (block.isBang(r) || ((r.kind === 'shape' || r.kind === 'rule') && block.droppable(r)))).map((r) => r.key));
|
|
13
16
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
// M19 S3: the rows of a sheet line are drawn by src/sheetrows.js (`withSheetCard`), from the close the block's sheet part made; a dropped sheet check is the block's own suggested row
|
|
18
|
+
// M19 S6 (section 3.3, 3.7): each row carries its kind word (`kindOfCheck`: a field of a list of items is `shape`, a line's output-file floor is `file`); the floor row of each line is drawn, `[default]` `file`, in fwd's words
|
|
19
|
+
rows: [
|
|
20
|
+
...renderCard(block.rows.filter((r) => !block.isSheetLine(r.line))).map((r) => {
|
|
21
|
+
const own = block.rows.find((x) => x.key === r.key);
|
|
22
|
+
return { key: r.key, line: r.line, by: r.by, state: r.state, reason: r.reason ?? null, drop: dropOffered.has(r.key), kind: kindOfCheck({ key: r.key, ...(own?.kind === 'shape' || own?.can?.how === 'shape' ? { shape: /** @type {true} */ (true) } : {}) }) };
|
|
23
|
+
}),
|
|
24
|
+
...block.rows.filter((r) => r.kind === 'floor' && r.state === 'built' && !block.isSheetLine(r.line)).map((r) => ({
|
|
25
|
+
key: r.key, line: r.line, by: r.by, state: r.state, reason: null, drop: false, kind: kindOfCheck({ key: r.key }),
|
|
26
|
+
})),
|
|
27
|
+
].sort((a, b) => a.line - b.line),
|
|
17
28
|
suggested: block.suggestedView(),
|
|
29
|
+
// borrowed-from: bareloop src/panel/jobplan.js@v0.61.0 (`restorable`: the `[you]` rules the person dropped, Not checked "You dropped it."; the card gives each an Add back button) (M19 S9); only when a rule is dropped, so the saved card of every other job is byte for byte what it was
|
|
30
|
+
...(block.droppedRulesView().length ? { restorable: block.droppedRulesView() } : {}),
|
|
18
31
|
};
|
|
19
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* M19 am6 to am9: the card a draft saves and the panel draws. The block's own card gives the suggestions, the restorable rows and the Drop flags; the rows come from the signed plan through the one reader (src/checkrows.js `planCard`),
|
|
36
|
+
* with the Not checked rows as a list of their own. `kept` = the picks and rules a Revise carried (the block's `keptFromLast` rows).
|
|
37
|
+
* @param {import('./checkblock.js').CheckBlock} block @param {any} withSheetAndTickets the block's card with the sheet and Tickets rows (src/sheetrows.js `withSheetCard`) @param {{declaration: any, lines: any[], csvRoles?: string[], log?: unknown}} plan
|
|
38
|
+
*/
|
|
39
|
+
export function cardOfPlanBlock(block, withSheetAndTickets, plan) {
|
|
40
|
+
const kept = block.rows.filter((r) => r.keptFromLast === true && Number.isInteger(r.line) && Number.isInteger(r.rule)).map((r) => ({ line: r.line, rule: r.rule, ...(r.pick ? { check: r.pick } : {}) }));
|
|
41
|
+
return planCard(withSheetAndTickets, { ...plan, kept });
|
|
42
|
+
}
|