bareloop 0.57.0 → 0.58.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/CHANGELOG.md +45 -0
- package/bareloop.context.md +11 -8
- package/package.json +1 -1
- package/src/authorflow.js +50 -62
- package/src/authorjob.js +100 -30
- package/src/authorreadout.js +88 -0
- package/src/authorrun.js +63 -24
- package/src/authorscout.js +9 -1
- package/src/blockasks.js +11 -16
- package/src/checkblock.js +227 -31
- package/src/checkpick.js +0 -5
- package/src/declaredclose.js +38 -6
- package/src/draftspend.js +20 -4
- package/src/fencepointcall.js +76 -0
- package/src/guarddescriptions.js +14 -0
- package/src/kinds.js +5 -1
- package/src/pagemap.js +7 -29
- package/src/panel/authorroutes.js +6 -1
- package/src/panel/authorsession.js +108 -32
- package/src/panel/index.html +38 -13
- package/src/panel/jobplan.js +49 -16
- package/src/panel/server.js +66 -6
- package/src/planrun.js +2 -0
- package/src/promptregisters.js +5 -0
- package/src/questionbox.js +32 -20
- package/src/reviewdoor.js +1 -1
- package/src/rowresults.js +69 -0
- package/src/rubricstep.js +110 -22
- package/src/stagewords.js +24 -0
- package/types/authorflow.d.ts +42 -79
- package/types/authorjob.d.ts +3 -2
- package/types/authorreadout.d.ts +44 -0
- package/types/authorrun.d.ts +20 -0
- package/types/blockasks.d.ts +5 -10
- package/types/checkblock.d.ts +115 -11
- package/types/checkpick.d.ts +0 -3
- package/types/declaredclose.d.ts +3 -1
- package/types/draftspend.d.ts +16 -2
- package/types/fencepointcall.d.ts +68 -0
- package/types/guarddescriptions.d.ts +7 -0
- package/types/kinds.d.ts +1 -0
- package/types/pagemap.d.ts +2 -5
- package/types/panel/authorsession.d.ts +3 -2
- package/types/panel/jobplan.d.ts +13 -1
- package/types/panel/server.d.ts +41 -16
- package/types/questionbox.d.ts +20 -6
- package/types/rowresults.d.ts +23 -0
- package/types/rubricstep.d.ts +34 -7
- package/types/stagewords.d.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,51 @@ All notable changes to bareloop are documented here. Format:
|
|
|
5
5
|
[SemVer](https://semver.org/spec/v2.0.0.html). Pre-1.0: **minor** = a ladder rung or
|
|
6
6
|
feature lands, **patch** = docs, fixes, scaffolding.
|
|
7
7
|
|
|
8
|
+
## [0.58.0] - 2026-11-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Draft the plan button.** The plan menu's first button reads "Draft the plan" (it only starts drafting, never signs); its footer and the CLI Confirm line say the same.
|
|
13
|
+
- **YOUR ANSWERS in the draft readout and the Audit drafting rows say what was decided** ("agreed", "you wrote", "dropped"), never the question that quotes a replaced rule's old words (found by the full test gate; walked live 2026-11-16). One owner, `decidedWords` in `src/draftspend.js`; older logs with no words keep "you were asked / you said".
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **The author CLI's "SIGNING PREPARED" block prints the same draft readout (hamr 2026-11-15).** `buildReadout` from the signed spec, the metered call count and cost, and the spec hash; the text the panel Chat shows. Pinned from source (the runner is reachable only after paid calls); not run end to end.
|
|
18
|
+
- **The panel Chat shows the draft readout above the signed-ready plan card (hamr 2026-11-15, copied from fwdloop v0.34.0).** The final plan message carries `readout: {text, heads}` built by `buildReadout` from the signed spec, the draft log and the session's figures (rounds = draft-log calls, cost with "at least" when a call is unpriced, hash, your answers), redrawn on Drop with the new hash (never twice); the page draws it as wrapped text with bold heads. Rubric and repo jobs. Display only, not in the hash, no new store. Rendered check: see the commit notes.
|
|
19
|
+
- **The draft readout's one owner (`buildReadout`, `READOUT_HEADS`, `readoutHeadIndexes` in `src/authorreadout.js`; hamr 2026-11-15, copied from fwdloop v0.34.0).** Pure plain text of what the person is about to sign, built from the signed spec through the card's own readers (`cardOfClose` rows and `[you]/[agent]/[default]` tags, `fenceRowText`, `refusedOf`), masked by `redactSecrets`; display only, never signed or stored.
|
|
20
|
+
- **Regression test for Add/Drop on a Suggested phrase through the panel's `rowEdit` (test only).** `tests/checklist-door.test.js`: before Add the phrase is Suggested with the cited default and the count Not checked (true reason); Add on the phrase gives a facts line and offers the count; Add on the count builds it; Drop returns to the first state.
|
|
21
|
+
- **A result count's Not-checked reason is true when its fact is only Suggested (live run `mwi76vh8`).** The Audit said "a result count needs a fact to count; this line has none" while the line's fact sat under Suggested. With a Suggested fact on the line the reason now reads "a result count needs a fact to count; add the suggested fact on this line to count its results" (`REASON.countNeedsSuggested`, picked by code); a line with no fact keeps the old words.
|
|
22
|
+
- **The Audit Checks header's word "checks" matches the row result words (hamr 2026-11-15).** It now uses the `.st-word` look at the same 12px as the "passed" below it. Display only.
|
|
23
|
+
- **The confirm card lists a look-dropped fact once (live run `mwi76vh8`).** A dropped place fact with no `~` rule ("Boston place") showed twice before Draft the plan: the look's own line and the check block's `! [agent]` row ("boston place"). The look's line is now left out when the block already has the row. Display only.
|
|
24
|
+
- **A look's phrase the person's own `~` rule does not name is no check of that rule (rubric jobs; hamr 2026-11-15, live run `mwi76vh8`).** The look tied the page phrase "Select flight" to the rule "be friendly" and it was signed as a `~ [you]` phrase check. A phrase or place whose words the rule's own words do not contain (case-blind) is now an ordinary `! [agent]` row, placed (job-derived with Drop, or Suggested with Add) by the existing split rule, and the `~` rule is Not checked. A phrase the rule names keeps its link on the rule's row; a version or a date keeps the place-rule path; money, time, number and date links are unchanged. A name the AI gives a phrase or place fact is no proof either: such a fact is job-derived (built, Drop) only when its own words are in the job line or a `~` rule, else it is Suggested (Add).
|
|
25
|
+
- **A READING question keeps a text box (hamr 2026-11-15 ruling).** It offers Agree, Drop it and "Or type the right reading:". Drop it leaves the rule Not checked with `REASON.left`. A typed correction REPLACES the rule (one in, one out) and code proves it as it proves any rule; words that carry no provable bound go to Not checked with `REASON.noRule`, never a second question. A proposed-check question stays Agree / Drop it with no box, a rule nothing can check stays unasked, and typing stays retired for everything else.
|
|
26
|
+
- **A check question is buttons only (rubric and repo jobs; hamr 2026-11-15).** The question box for a look's reading or a proposed check has Agree (and Drop it on a proposed check) and no text box to add a comment or own words; the chat's typing box ("answer here when the draft asks you") is no longer drawn while nothing asks to be typed (no ask, the plan menu, the final card, beside a question box), and still appears for the asks that need typing (language, goal). The typed own-words answer is retired: the check block's `rule` choice, the `or type your own words` / `or type how to check it` wording of the questions, `stripAgreeLead` and `HOW_TO_ANSWER` are gone; `send` refuses typed words for a check question. A rule is now changed only by Revise. The drafter's own try-3 questions, the Destination question and the CLI keep their typed answers (they have no buttons).
|
|
27
|
+
- **A rule no check can prove is not asked: it is Not checked at once (rubric and repo jobs; hamr 2026-11-15, option A).** Before, the person was asked "I can't check this. Drop it?" with Drop it as the only answer. Now the check block marks such a rule Not checked with the code reason `REASON.noRule` ("No rule can check this, so you judge it at Accept."), and the draft goes on. Questions that offer Agree (a look's reading, a proposed count check) stay. Unasked rules do not count toward the 3-question stop (`MAX_QUESTIONS`): only asked questions are counted. The `cant-check` / `no-check` asks, `REASON.cantCheck` / `cantCheckRepo` and `CANT_CHECK_WORDS` are gone.
|
|
28
|
+
- **Revise shows on the final card (rubric and repo jobs).** The button was hidden once the draft reached the signed-ready card (phase `prepared`, no pending ask), because `reviseShownFor` looked only for a pending plan menu; to change the job the person had to clear everything and start over. It now shows there too, with the same 2-revises-then-Start-over count. Seen live 2026-11-15 (run `mwhvvvap`).
|
|
29
|
+
- **The pointing call is shown the folders that hold outside files (`test/`) beside the files.** The live draft `smwi20ir86wxj` showed only files, so a rule "don't edit test/" could not be pointed at its folder. The proof is unchanged.
|
|
30
|
+
- **The pointing call's reply and each edit's accept or refusal reason are in the draft log** (`kind: "fence-point"`: `edits`, `results`, `reason`, secret-masked). Before, the live draft `smwi20ir86wxj` showed only that the call ran.
|
|
31
|
+
- **A drafter line refusal is ignored when a stage or a guard's `guardLines` covers the line** (the rubric's rule: only a line no check could be built for is refused). The live draft `smwi20ir86wxj` showed an extra `No rule can check this` row on a line with three `!` stage checks.
|
|
32
|
+
- **A repo `~` rule is kept by the write fence only when the AI points at it and code proves it (the rubric's order: point, code proves, asks, draft).** One small call BEFORE the asks (`src/fencepointcall.js`, thinking off, one retry, no JSON repair, booked in the draft log) shows the AI each `~` rule's own words and the repo paths outside the write scope, and gets row edits back in the rubric's shape (`{"edits":[{"op":"fence","line","rule","path"}]}`); they go through `CheckBlock.applyDelta` like every rubric edit. Code proves each (the path is on the listing, the rule's own words name it, it lies outside the write scope). Not pointed, or the proof fails: the same question as a rubric rule. Code alone never keeps a rule (so "the tests in test/ must pass" is asked). Called only when the job has `~` rules and the listing holds paths outside the fence; a failed call never stops the draft. The drafter's declaration carries no pointing field.
|
|
33
|
+
- **A line the drafter refused is Not checked with code's reason.** The drafter's refusal is only the signal that a line has no check; the reason on the signed row and in `closeDecl.refused` is `REASON.noRule` (the one table), so the drafter's free text is no second reason owner.
|
|
34
|
+
- **The repo-only row builder is gone.** `src/repolist.js` (`buildRepoRows`, `proveFenceClaim`, `NO_CHECK_WORDS`, its "AI said" reason strings) is deleted: the repo job's rows, reasons (`REASON` in `src/checkblock.js`, the one table) and proofs are the check block's. The view readers keep reading the signed rows of both check types (`!` stage rows and fence-kept `~` rows), so no view changed.
|
|
35
|
+
- **A repo `! [agent]` work stage is a droppable row of the check block, and a Drop is carried by Revise.** In the block a stage row can be Dropped and Added back (never the last check on a line it serves, never the last work stage); the signed list signs it `dropped` and the close runs without it. A Drop made on the final card (`dropStage`) is written to the same record a rubric Drop writes (`choiceEntries`, `src/checkblock.js`), so Revise keeps it; code still judges it on the new draft.
|
|
36
|
+
- **The repo drafter no longer writes `fenceKept` or a rule-level `refused`.** Both are gone from the declaration schema (a `refused` item is a whole job line: `{line, reason}`), from the drafter prompt (the fence-claim paragraph and its legal example), from the draft validator and from `closeDecl` (`fenceKept` leaves `CLOSE_DECL_FIELDS`; it was unreleased). Code decides what the write fence keeps and builds `refused` from the rows. A drafter that still writes either is ignored. An older signed spec that carries `fenceKept` still validates, displays and Reuses (only its shape is read).
|
|
37
|
+
- **A repo job runs through the SAME check block as a rubric job (hamr 2026-11-15: "same flow as rubric, no exceptions; only the TYPE of checks varies").** Its `~` rules, its `!` work stages and its `$` rows are rows of one `CheckBlock` (`src/checkblock.js`, `repo` option); `signedRows`, `closeView`, `setGuards`, the ask rounds (`askRounds` in `src/authorjob.js`) and the Drop / Revise-carry doors are the rubric's own. A `~` rule is kept by the write fence ONLY when code finds a repo path (file, or a folder written `folder/`) in the person's own rule words that lies outside the write scope; the drafter's `fenceKept` claim is no longer read (the live run `mwhvvvap` kept `no new dependencies at all` via package.json and `keep the comment at the top of src/sum.js` via a tracked `.bareloop/` copy). Any other rule becomes a question in the question box (Agree is not offered; Drop it leaves it Not checked, own words replace the rule and are proved again), and a repo question never says "on the page". `refused` is built from the rows in code, so a rule is no longer shown both kept and Not checked.
|
|
38
|
+
- **The files listing the drafter and code's proofs read no longer lists bareloop's own stores.** A patient that tracks `.bareloop/`, `.smoke/` or `.litectx/` files (the live patient tracks 26) no longer offers them as repo files, so a leftover `.bareloop/wt/.../src/sum.js` cannot "keep" a rule. Root prefixes only; `src/.smoke/x` stays the person's own path (`src/authorscout.js` `seedFileList`).
|
|
39
|
+
- **The `$ [default]` guard and fence rows read a short plain question, not a raw guard name plus a long sentence.** `did the run change a file?`, `no checker silenced (@ts-ignore, eslint-disable, # type: ignore)?`, `only files in src/ changed?` (the fence's words are built from the signed fence). One owner, `src/stagewords.js` (`guardQuestionText`, `fenceQuestionText`); the plan card, Job tab, Audit, Result tab and the CLI plan print all read it. An older close with no list keeps its old guard lines.
|
|
40
|
+
- **One list for every rubric check (hamr 2026-11-14, Addendum (c); docs/product/ITEM33-BUILD.md).** Every check a person sees on a rubric job is a row of the one list (`~ [you]`, `! [agent]`, `$ [default]`), code decides, and a view shows nothing that is not a row. Built in six pieces:
|
|
41
|
+
- piece 1: the `$` floor row (the line's file must exist, be complete JSON, and carry text) is drawn on every line on the card, the Job tab and the Audit; a facts-only line says its floor has no text check. The separate "line N file" note of the protections folds into it (an older close with no floor row keeps the note).
|
|
42
|
+
- piece 2: the mandatory guards (`changed-from-seed`, and `no-suppressions` where a class has it) are `$ [default]` rows of the signed list, ONCE for the whole job (`closeDecl.list`, row `kind: 'guard'`, line 0, key `J.$guard.<name>`); the close validator admits them, `listMatchesClose` checks each names a guard stage the close runs, and "Always checked" keeps only the write fence for a job that signs them. `GUARD_DESCRIPTIONS` moved to `src/guarddescriptions.js` (still exported from `authorflow.js`).
|
|
43
|
+
- piece 3: every check item the card and the Job tab draw carries the key of its built list row (a pick, the cited default, the numbers tie and the note too). The CLI plan print (`confirmPlanLines`) draws each check with its line and row tag. A close that carries the list with its guard rows draws no model free-text `notes`, and its Job `success` / `guardrails` fields are the rows and the write fence.
|
|
44
|
+
- piece 4: each row gets its OWN pass or fail. `gradeStep` hands out bareguard's raw gaps; `src/rowresults.js` maps each gap to the one row that owns the check it names; `runDeclaredStages` (given the signed list by `planrun` and the review door) records `rows` and `unclaimed` on each stage entry of the close; the Audit and the Result tab show a mark per row and the reason of a failed one. A gap that names no single row (a quote-level gap of a fact part, a part with no results) is never spread over rows: it is shown as its own failed item of the line.
|
|
45
|
+
- piece 5: the try-3 question replaces. The drafter tags each question with `rule` (a `~` rule the line really has) or `new`; `normalizeQuestions` drops a rule the line does not have, a question with no tag and one with both, with the reason. An answer about a rule REPLACES that rule (one in, one out), `new` adds one; the ask shows "This replaces: <old words>" or "This adds a new rule to line N"; each answered question is logged as draft-log kind `try3-question`.
|
|
46
|
+
- prose row (hamr's ruling Q2): a line that writes text gets a signed `prose` row (`kind: 'prose'`, Not checked, `$ [default]`, "what the text says — you judge it at Accept"), built by the check block; every view draws the line from that row, and the stage-derived `proseNotCheckedItems` feeds nothing for a list-built close. It is never a check (`hasBuiltCheck` skips it).
|
|
47
|
+
- fence row (hamr 2026-11-15): the write fence is a `$ [default]` row of the list, once for the whole job (`kind: 'fence'`, line 0, key `J.$fence`, signed like the guard rows; its words come from the fence the close signs), drawn under "other checks" on the confirm card, the signed card, the Job tab and the Audit (where it reads the gate's own record: held · N writes blocked) and in the CLI print. "Always checked" is gone for a job that signs it; an older close keeps it. The fence is not a check (`hasBuiltCheck` never counted it: it is not a row of the block).
|
|
48
|
+
- a `$` default that does not apply to a line kind is not a Not checked item: a facts line's cited default ("this line finds facts, so it has no text to quote") is no longer drawn (the floor row says the line has no text check); it stays in the list, and stays drawn on a text line that cannot quote (several inputs).
|
|
49
|
+
- tags (hamr 2026-11-15): every row label reads `~ [you]`, `! [agent]`, `$ [default]` on the page (`byTagOf`) and in the CLI print.
|
|
50
|
+
- A signed spec or old run is never repaired: a close with no list, or a list with no guard row, keeps today's display and the same verdicts.
|
|
51
|
+
- **Repo jobs join the one list (hamr 2026-11-15, Addendum (d); docs/product/ITEM33-BUILD.md).** A repo job signs `closeDecl.list`: `~ [you]` one row per rule, `! [agent]` one row per AI work stage, `$ [default]` the guards and the write fence once. hamr's law: a rule shows as kept only when code proves it; everything else is Not checked. Every view reads the rows; an old signed repo spec keeps today's display. (The rows are now built by the one check block, see above.)
|
|
52
|
+
|
|
8
53
|
## [0.57.0] - 2026-11-14
|
|
9
54
|
|
|
10
55
|
### Removed
|
package/bareloop.context.md
CHANGED
|
@@ -66,7 +66,10 @@ A rubric or plain-folder job whose signed spec carries `mcp` (and flow type `tic
|
|
|
66
66
|
- **R7b: no Ticket box, a Destination that must exist, a visible refused look.** The New job card no longer has a Ticket box (the page never sends `ticket`; the server still reads `card.ticket` from a scheduled fire and "Run it anyway", which become `run-u --ticket N`). A by-hand Tickets run takes the newest unrun ticket, looked up by `execute` (`ctx.pickNewest`) before the run's row is built; a refused look (token, unreadable list, nothing new) lists the run and settles it at $0 as `refused before start` with the words `The newest ticket could not be looked up. The reason: <cause> Fix that, then start the job again. The run did not start. Nothing spent.` A repo job's Destination (`startDestinationProblem`, the one check) must name a folder, file or a glob under a real folder of the repo's committed tree (`destinationMissingInRepo`, `src/source.js`), else `Destination `<piece>` is not a folder or file in this repo. Type the folder that holds the files the job should change, like src/.`
|
|
67
67
|
- **R7b: the drafter points at a file outside Destination (`src/destpoint.js`, `runDestPoint`/`decideDestPoint`, wired in `src/panel/authorsession.js` before the composer; `deps.destFn` is the test seam).** A repo job only. The model sees the numbered job lines and the Destination, never the file list; code keeps a point only when the path is written in that line, is in `repoTrackedFiles`, the folder is its parent and `destinationCovers` says the file is outside. One `answer` ask with `source: 'dest-point'`; `yes` sets `writeScope`, `draft.writeScope` and `state.card.destination` (the caller's card object is not mutated), `no` changes nothing. Draft-log rows: `dest-point`, `dest-answer`.
|
|
68
68
|
- **R7b rulings: the Start-time ticket check, the skip, the Job tab.** `startSession` (non-headless, Tickets flow incl. Reuse) calls `newestUnrunTicket` (`opts.newestUnrunTicket` is the test seam) before `createSession`: a failure is a 400 whose `error` is the reader's `say` + ` Nothing spent.`; the reader's nothing-new result is `{ok:false, nothingNew:true, say:'No new ticket since #N. Nothing to run.'}`. In `run-u` the same result at run start settles the listed row as `reason:'skipped'` (`words` = say + ` Nothing spent.`, exit 0); any other look failure stays `reason:'refused before start'`. `getRunJob` reads `resolved-spec.json` from the session folder the row's spine path names even when the spine file does not exist.
|
|
69
|
-
- **One check block per rubric job (`src/checkblock.js`, `CheckBlock`; made by `authorCloseForJob` and driven by `authorClose({block, editGenerate})`; it replaced the Phase A/B list's own readers).** Pure (no I/O, no clock, no model): ONE store, `rows`, of three kinds: `~` (the person's rule, `by: you`), `!` (the agent's: a look fact, or an AI edit, `by: agent`) and `$` (code's defaults: the cited rule on a text line of a one-input job, the numbers tie after a fact line, the mechanical floor which never counts; `by: default`). Code matches every row against the saved page and builds every check through the bareguard shapes; a row it cannot build keeps its place with a plain reason. Every row ends `built`, `not-checked` (with a reason), `suggested` or `dropped`. The AI's whole part is a list of row EDITS (`add`, `reading`, `pick`, `not-checkable`; `src/rowedit.js`, tool `submit_edits`), each judged alone by code (a refused edit costs the rest nothing; at most `MAX_BANG` = 3 adds per reply); `editGenerate` is its model boundary and `ledgerGenerate` the `ledger-suggest` call that seeds the `!` rows (absent = the block is built from the look and the defaults). A `~` wins over a `!`; a check needing exact words that hold a version or a date is refused as week-only unless a place rule fits it (below); a `~` rule that carries a negation (`NEGATING_RE`) builds no phrase check. With `split` (the product path) code splits the `!` rows: words (or the count number) found in the job line or its `~` rules = JOB-DERIVED (built, the person may Drop it); anything else is SUGGESTED (held out of the close, offered only when code has proved it builds, switched on by Add). A rubric job's confirm turn plans the goal only (`confirmSystemFor`, `RUBRIC_CONFIRM_NOTE`; `accepted.goalOnly` is `true`). Progress: `onPhase('draft-ledger-try', {label, kept, refused})` per try, `onPhase('ledger-built', {rows})` once when the block is made and `onPhase('draft-ledger', {rows})` / `onPhase('draft-retention', {lines})` at the end; the panel writes `draft-log.jsonl` lines `kind: 'ledger'` (per row, `phase: 'built'` or `'final'`, with `key`, `line`, `rowKind`, `from`, `by`, `words`, `state`, `reason`), `kind: 'ledger-try'`, `kind: 'draft-notbuilt'` (suggested checks code could not build, one plain sentence each) and `kind: 'row-edit'`; the CLI emits the same phases to the author spine as `author-phase`. `authorClose` returns the signed form of the final rows as `ledger` (`signedRows`) and `authorCloseForJob` returns the unbuilt suggestions as `notBuilt` and carries the rows as `closeDecl.list` (fields `SIGNED_ROW_FIELDS`: line, key, from, by, kind, state, rule, part `{line, part}`, reason; never words), admitted by `CLOSE_DECL_FIELDS` and shape-checked by `validateCloseDecl`. Readers: `refusedOf`/`ruleNotChecked` (Not checked), `retentionOfList`, `listMatchesClose` (called by the panel's `signRun`), `cardOfClose` (the card after drafting, from the close alone). The confirm card's Drop / Add are `POST /api/author/<session>/row-edit` `{op: 'drop'|'add', key}`: $0, instant, no model call, answered 400 `bad-row` / `bad-choice` / `no-plan` in plain words. While a question is open, `POST /api/author/<session>/send` with no typed `choice` is refused 400 `bad-choice` (an out-of-date page): nothing is logged and the question stays open. The Audit's `Checks` fold lists the card's sections (Checks, Not checked, Always checked) with each row's recorded result.
|
|
69
|
+
- **One check block per rubric job (`src/checkblock.js`, `CheckBlock`; made by `authorCloseForJob` and driven by `authorClose({block, editGenerate})`; it replaced the Phase A/B list's own readers).** Pure (no I/O, no clock, no model): ONE store, `rows`, of three kinds: `~` (the person's rule, `by: you`), `!` (the agent's: a look fact, or an AI edit, `by: agent`) and `$` (code's defaults: the cited rule on a text line of a one-input job, the numbers tie after a fact line, the mechanical floor which never counts; `by: default`). Code matches every row against the saved page and builds every check through the bareguard shapes; a row it cannot build keeps its place with a plain reason. Every row ends `built`, `not-checked` (with a reason), `suggested` or `dropped`. The AI's whole part is a list of row EDITS (`add`, `reading`, `pick`, `not-checkable`; `src/rowedit.js`, tool `submit_edits`; a repo job's pointing call adds one more op, `fence`, see the repo bullet below), each judged alone by code (a refused edit costs the rest nothing; at most `MAX_BANG` = 3 adds per reply); `editGenerate` is its model boundary and `ledgerGenerate` the `ledger-suggest` call that seeds the `!` rows (absent = the block is built from the look and the defaults). A `~` wins over a `!`; a check needing exact words that hold a version or a date is refused as week-only unless a place rule fits it (below); a `~` rule that carries a negation (`NEGATING_RE`) builds no phrase check. With `split` (the product path) code splits the `!` rows: words (or the count number) found in the job line or its `~` rules = JOB-DERIVED (built, the person may Drop it); anything else is SUGGESTED (held out of the close, offered only when code has proved it builds, switched on by Add). A rubric job's confirm turn plans the goal only (`confirmSystemFor`, `RUBRIC_CONFIRM_NOTE`; `accepted.goalOnly` is `true`). Progress: `onPhase('draft-ledger-try', {label, kept, refused})` per try, `onPhase('ledger-built', {rows})` once when the block is made and `onPhase('draft-ledger', {rows})` / `onPhase('draft-retention', {lines})` at the end; the panel writes `draft-log.jsonl` lines `kind: 'ledger'` (per row, `phase: 'built'` or `'final'`, with `key`, `line`, `rowKind`, `from`, `by`, `words`, `state`, `reason`), `kind: 'ledger-try'`, `kind: 'draft-notbuilt'` (suggested checks code could not build, one plain sentence each) and `kind: 'row-edit'`; the CLI emits the same phases to the author spine as `author-phase`. `authorClose` returns the signed form of the final rows as `ledger` (`signedRows`) and `authorCloseForJob` returns the unbuilt suggestions as `notBuilt` and carries the rows as `closeDecl.list` (fields `SIGNED_ROW_FIELDS`: line, key, from, by, kind, state, rule, part `{line, part}`, reason, facts, fence; never words), admitted by `CLOSE_DECL_FIELDS` and shape-checked by `validateCloseDecl`. Readers: `refusedOf`/`ruleNotChecked` (Not checked), `retentionOfList`, `listMatchesClose` (called by the panel's `signRun`), `cardOfClose` (the card after drafting, from the close alone). The confirm card's Drop / Add are `POST /api/author/<session>/row-edit` `{op: 'drop'|'add', key}`: $0, instant, no model call, answered 400 `bad-row` / `bad-choice` / `no-plan` in plain words. While a question is open, `POST /api/author/<session>/send` with no typed `choice` is refused 400 `bad-choice` (an out-of-date page): nothing is logged and the question stays open. The Audit's `Checks` fold lists the card's sections (Checks, Not checked, Always checked) with each row's recorded result. ONE block serves every job (hamr 2026-11-15, "same flow as rubric, no exceptions"): a repo job builds it with the `repo` option and only the TYPE of its checks varies (the next two bullets).
|
|
70
|
+
- **The one list in full (Addendum 2026-11-14 (c); `src/checkblock.js`, `src/rubricstep.js`, `src/rowresults.js`).** Every check a rubric job shows is a row of `closeDecl.list`, tagged `~ [you]`, `! [agent]` or `$ [default]`, and a view (plan card, Job tab, Result tab, Audit, the CLI print) shows nothing that is not a row. The `$` rows: the per-line `floor` (the line's file must exist, be complete JSON, and carry text only when the close has a text check on it: `floorText`), the per-line cited/numbers/note defaults, the per-line `prose` row of a text line (Not checked, "what the text says — you judge it at Accept", never a check), the job-level write fence row (`kind: 'fence'`, line 0, key `J.$fence`, once; "Always checked" is gone for a job that signs it), and the job-level `guard` rows (`kind: 'guard'`, line 0, key `J.$guard.<name>`, once for the whole job; the block's `setGuards`, signed by `signedRows()`, checked by `listMatchesClose` against the guard stage of that name). "Always checked" keeps only the write fence for a job whose list carries its guard rows. `checksOfClose` gives every item the key of its built row. Each row also has its OWN result: the close (`runDeclaredStages`, given `list`) records `rows: [{key, result: 'passed'|'failed'|'unread', why?}]` and `unclaimed: [words]` on each stage entry of its records (`outer-close`, `close-verdict`); `rowResultsOf` maps bareguard's gaps to the one row that owns the check, never spreading a gap over several (a gap no row owns is `unclaimed`; a line whose file could not be read marks its other rows `unread`). The Audit and the Result tab read those rows (`rowResultsFromRecords`); a close recorded before rows existed keeps the stage verdict. A facts line's cited default ("this line finds facts, so it has no text to quote") is in the list but is not drawn as Not checked. Row labels read `~ [you]`, `! [agent]`, `$ [default]` everywhere. An older close (no list, or a list with no guard row) is drawn as it always was.
|
|
71
|
+
- **Repo jobs on the SAME check block (Addendum 2026-11-15 (d), (e), (f); `src/checkblock.js` with the `repo` option, `src/fencepointcall.js`; `src/repolist.js` is deleted).** A repo job signs `closeDecl.list` too, built by the one `CheckBlock` (`new CheckBlock({repo: {files, writeScope}})`): `~ [you]` one row per rule (key `L<line>.~<rule>`, kind `rule`), `! [agent]` one row per AI work stage (key `S.<stage name>`, kind `stage`, on the stage's first `fromLine`; no stage-to-rule tie exists, ever), `$ [default]` the guard rows and the fence row once. A `~` rule is kept by the write fence in ONE case, in the rubric's order (point, code proves, then the draft): ONE small call before the asks (`runFencePoint`, `src/fencepointcall.js`, tool `submit_edits`, the drafter's thinking setting, label `fence-point`; the draft log carries `kind: 'fence-point'` with the reply and each edit's accept or refusal reason) shows the AI each `~` rule's own words and the repo paths (and folders, written `folder/`) outside the write scope, and it answers row edits `{op: 'fence', line, rule, path}`. Each goes through `applyDelta` like every row edit and code proves it (`provesFence`): `path` is on the listing, the rule's OWN words name it as a whole token, and neither it nor any other path those words name holds a place the run may change. The row is then built with `fence: <path>` (signed row field `fence`) and reads kept by the write fence, its result the gate's record. The proof checks that the path is named and outside the fence, never what the rule SAYS about it. A failed call never stops the draft. Every other `~` rule is Not checked at once with `REASON.noRule` ("no check code can prove keeps this rule — you judge it at Accept"; a repo rule is never asked). The seed listing hides bareloop's own stores (`.bareloop/`, `.smoke/`, `.litectx/`). The drafter writes no rule-level `refused` and no `fenceKept`: `closeDecl.refused` is built from the rows in code. `closeDecl.fenceKept` is only still READ (shape-checked in `CLOSE_DECL_FIELDS`) so an old signed repo spec loads, displays and Reuses; a new draft never writes it, and `guardLines` is no longer offered to new drafts (the validator still reads it). A line refused with no rule is a `!` Not checked row. The repo confirm turn is goal-only (`REPO_CONFIRM_NOTE`; `accepted.goalOnly`); the confirm card draws the `$` guard and fence rows, the signed card, Job tab, Audit, success line and `planMatchesClose(shown, closeDecl, jobLines)` read the rows. `listMatchesClose` checks an `!` row names a stage the close runs. On the final (signed-ready) card a `! [agent]` stage row can be Dropped (`POST /api/author/<session>/row-edit` `{op:'drop', key}` in phase `prepared` runs `session.dropStage`: the stage and its row leave a COPY of the spec, the $0 signing gates run again and the hash is recomputed; a refusing gate or the last check on a line refuses in plain words and changes nothing), and the Drop is kept by a Revise. An old signed repo spec (no list) is drawn as it always was.
|
|
72
|
+
- **The draft readout (hamr 2026-11-15, from fwdloop v0.34.0; `buildReadout`, `READOUT_HEADS`, `READOUT_HEADER_PREFIX`, `readoutHeadIndexes` in `src/authorreadout.js`).** Plain text of the draft the person is about to sign: header (name, drafting model, rounds, cost with `at least` when a call was unpriced, the signed caps, an absent time cap reads "no time cap set"), INPUTS, STEPS (each line, its step file, its check rows), WRITE FENCE, REFUSED / NOT CHECKED, JOB LINES, the plan hash and YOUR ANSWERS (what was decided: `decidedWords` in `src/draftspend.js`, "agreed — …", "you wrote — …", "dropped — Not checked", never the question that quotes a replaced rule's old words; a log row with no `choice` keeps `question — answer`). DISPLAY ONLY: pure, built from the signed resolved spec through the card's own readers (`cardOfClose`, `fenceOfClose`), never signed, stored or part of the hash; the whole text passes `redactSecrets`. The panel Chat draws it above the signed-ready card (`message.readout = {text, heads}`; the server names the heading lines and the page draws them bold, redrawn once on a Drop); the CLI prints it under `SIGNING PREPARED` (test-proven by reading the source, never seen live). The Audit's drafting rows read the same `decidedWords`.
|
|
70
73
|
- **Place rules (`src/placerule.js`; hamr go 2026-11-11).** A phrase fact whose words hold a version or a date is true only while the input stays as it is. At drafting, CODE fits a place rule (`{kind: 'headingBetween'|'headingDateAfter', prefix, end, shape, skip}`; `fitPlacePhrase`) to the input's own newest release heading and the signed fact carries it as `fact.place`; the value itself is never signed. At run start, before any provider call, code re-reads the run's own frozen copy of the input with each rule (`readPlaceRules`): the values found are bound as those facts' phrases on the run's in-memory copy AFTER the approval check and the `job-start` record (`bindPlaceValues`, so the signed spec and its hash never change), and the run records one `place-rules` spine event (rows `{key, kind, found, value, was, reason}`) right after `job-start`. A rule that finds no value stops the run at $0 with every rule listed in plain words (`stopWords`). A resume or a door Accept/Rerun rebinds the values from that run's own `place-rules` record (`placeValuesOfEvents`), and a door with no record refuses (`NO_PLACE_RECORD_WORDS`); `runJob` takes them as `opts.placeValues` / `opts.placeRead`.
|
|
71
74
|
|
|
72
75
|
## Public API` → "THE REVIEW DOOR" below. `green` and
|
|
@@ -661,9 +664,9 @@ every job line counts), while a try cut off once but finished by a later attempt
|
|
|
661
664
|
on to try 3 after an all-cut-off try 2 only when that gate can open, i.e. try 1 failed too);
|
|
662
665
|
the machine keeps at most
|
|
663
666
|
`MAX_QUESTIONS` (3) — each on a job line the previous try's reds named — and logs the rest in `iterations[].droppedQuestions`;
|
|
664
|
-
the drafter is never told a number. It then stops `questions-open` (`questions: [{line, question}]`, nothing validated).
|
|
665
|
-
`authorCloseForJob({ answerQuestions })` is the seam that asks the person (required answer, no skip), takes back the job lines
|
|
666
|
-
with each answer added word for word as a `~` rule, and runs the draft once more over the same survey, listing and confirmed
|
|
667
|
+
the drafter is never told a number. Each question carries a TAG (Addendum 2026-11-14 (c) piece 5): `rule` (a `~` rule number the line really has) or `new: true`; `normalizeQuestions(raw, failedLines, jobLines)` keeps a named rule that exists or a `new`, and drops, with the reason, a rule the line does not have, a question with no tag and one with both. It then stops `questions-open` (`questions: [{line, question, rule | new}]`, nothing validated).
|
|
668
|
+
`authorCloseForJob({ answerQuestions })` is the seam that asks the person (required answer, no skip; the ask says "This replaces: <old words>" or "This adds a new rule to line N"), takes back the job lines
|
|
669
|
+
with each answer REPLACING the rule it names (one in, one out) or, for `new`, added word for word as a `~` rule (each is logged as draft-log kind `try3-question`), and runs the draft once more over the same survey, listing and confirmed
|
|
667
670
|
plan with the first leg's spend carried as prior spend and `offerQuestions: false`. The confirm turn's own `questions` (the
|
|
668
671
|
plan's open questions) are a separate, unchanged mechanism: they are asked before drafting, about the plan; try-3 questions
|
|
669
672
|
are asked after two failed drafts, about a job line.
|
|
@@ -995,7 +998,7 @@ for `protections`: the confirm tool's schema dropped the field. What the menu di
|
|
|
995
998
|
what lands in `accepted.protections`/`confirmedBlock` is rendered by `confirmProtections`
|
|
996
999
|
(`src/authorflow.js`) from the SAME guards `classGuards` (`src/authoring.js`) will actually
|
|
997
1000
|
compose, each through a frozen plain-English line in `GUARD_DESCRIPTIONS` — beside
|
|
998
|
-
`CONFIRM_MENU` — plus the write fence when one is set; a guard with no line there throws
|
|
1001
|
+
`CONFIRM_MENU` — plus the write fence when one is set (a rubric job whose signed list holds the guard rows says them there, as `$ [default]` rows, so only the fence stays here); a guard with no line there throws
|
|
999
1002
|
rather than showing a blank description. The model instead returns `notChecked`: anything
|
|
1000
1003
|
the person asked for that no listed check can verify, in the person's own words, never
|
|
1001
1004
|
silently dropped. It is shown under its own heading in the menu (`src/authorrun.js`, lifted
|
|
@@ -3508,7 +3511,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3508
3511
|
:id/send {text}` answers whatever the confirm turn is currently asking (the `language` pick or a plan's
|
|
3509
3512
|
own follow-up question — the old `worseThanBefore` ask is retired, 2026-09-28) — refused outright when the pending ask is the
|
|
3510
3513
|
plan MENU itself (`{ok:false}`, no route from chat text to a plan decision, ever). There is no
|
|
3511
|
-
typed-revise route (2026-10-09): the panel's **Revise** button, shown
|
|
3514
|
+
typed-revise route (2026-10-09): the panel's **Revise** button, shown while a plan waits for the OK AND on the final signed-ready card (phase `prepared`, Addendum 2026-11-15 (f); the plan menu's first button reads **Draft the plan**: it only starts drafting the checks, it never signs),
|
|
3512
3515
|
abandons the draft (`/abandon`; spend already booked stays booked) and reopens the New job card with the same
|
|
3513
3516
|
values in every box, editable, for a fresh Start drafting; no change request is ever sent to the model. `POST /api/author/:id/sign-prepare` is the menu's
|
|
3514
3517
|
own `confirm` pick — it runs gates 1–4 and reaches `phase:'prepared'` with a `specHash`; it
|
|
@@ -4397,7 +4400,7 @@ For a rubric job (a text file input; `RUBRIC_LANG`) the **drafter writes no word
|
|
|
4397
4400
|
- **The call.** After the look and its asks, before the confirm turn, ONE call (`runCheckSuggest`, over `askStructured`: the ceiling is read first, one retry, the scrubbed answer and its price land in `draft-log.jsonl` as `call` label `check-suggest`) suggests, per in-scope `~` rule, one check or `none`. The tool is `suggest_checks` with a per-rule `anyOf` answer form. An unusable answer reads "I can't check this" for every rule (never a guess). Needs `pickGenerate` (the panel wires it from the draft's provider; absent = no pick path, nothing asked).
|
|
4398
4401
|
- **Scope (`scopedRules`).** A rubric job's `~` rules, minus a rule a kept look fact carries (`forRule`) or the look put under Not checked, and minus (fwd's `codeScope`) a rule of a job with a web-page input that names no whole-output word number. `guardLines` cover whole lines and never settle one word-count rule, so they do not remove a rule from scope. D5 mandatory guards are never offered or replaced.
|
|
4399
4402
|
- **Keep-or-drop (`keepOrDrop`).** A suggestion is kept only if its rule is on bareguard's list AND offered, it carries only that rule's own fields, every number is one the rule names (`maxWords 79` for "under 80 words" is dropped) and every word is a word of the rule; a section count must match the rule's.
|
|
4400
|
-
- **The asks** are the look's own ask path (`source: 'look'`, `ask: '
|
|
4403
|
+
- **The asks** are the look's own ask path (`source: 'look'`, `ask: 'reading' | 'check'`), BUTTONS ONLY (Addendum 2026-11-15 (f)): `Line n, guardrail "<rule>": I propose <plain words>.` answered Agree or Drop it. A rule no check can prove (no proposal to Agree to) is NOT asked: it is Not checked at once with `REASON.noRule` (option A; the `I can't check this` ask and `no-check` are retired). **The cap:** a proposal never counts; only the asked reading questions count toward `MAX_QUESTIONS` (3), else the draft stops at $0 (`look-asks-too-many`) and lists them. `agree` REPLACES the asked rule with the plain words and picks the check (one rule in, one rule out; the check list is the one owner and the job text is rebuilt from it); `drop it` leaves it Not checked. While a check question is open, `POST /api/author/<session>/send` with typed words and no `choice` is refused 400 `bad-choice`; a typed choice `rule` is refused for a check question (`refuseChoice`). The drafter's own try-3 questions, the Destination question and the CLI keep typed answers.
|
|
4401
4404
|
- **What the plan carries** (`applyPicks`, before validation): on each stage of a line this call settles, the drafter's own shape parts are gone, a part per pick is added with `rules: [the rule]` (an answer replaced that rule, so there is no second line), and every other settled rule is a `refused` entry with a reason from `NOTE_WORDS` (`You chose to leave it Not checked...`, `Your own words are on the line...`, `No check was picked for it...`). The drafter and the confirm turn are told which rules code settles (`settled`). The plan card draws a `You picked` row per pick (chat plan card; the Job tab shows the check rows and the Not checked rows of the signed close, not the label).
|
|
4402
4405
|
- **Revise, Start over (am17, am18, am20).** `picks-record.json` in the draft's session folder holds one entry per pick keyed by the job line's WORDS (plus its order among equal lines) and the rule's exact words, never a number. The card sends `carryFrom` (the id of the draft it follows); the next draft keeps every pick whose line and rule words still match (not sent to the call, not asked, not counted, marked `kept from last draft`), asks only what is new or changed, and a deleted rule takes its pick. Revise reopens the boxes holding the server's card (the `~` rules as the answers left them) and names the draft it follows (`carryFrom`, with `carryKind` = `revise` or `startover`); it does not draft. Each draft has 2 revises (fwdloop M4e am14 item 3): the plan menu shows "2 revises left" / "1 revise left" beside **Revise**, and after the second the same button reads **Start over** (there is no separate Start over button; it also reopens the boxes, and its draft has 2 new revises). A revise is a new session, so the count rides the link: `revises.json` (`{used}`) in each draft's folder, a Revise draft has the followed draft's `used` + 1, a Start over or a first draft 0, and the session state carries `revisesUsed` / `revisesLeft` (a refresh brings it back). `POST /api/author/:id/abandon` with `{kind:'revise'}`, and a start whose `carryKind` is `revise`, are refused (409, plain words, nothing ended, no model call) when that would be the third. The draft log carries `{kind:'draft-label', label}` for a Revise or Start over draft (`src/revises.js` `draftLabelOf` owns the words; none for a first draft); the drafting part (`draftingPartFor`) exposes it as `draftLabel`, shown as the Audit Draft group's first row.
|
|
4403
4406
|
- **One rule in, one rule out (2026-11-14; replaces the earlier am21 "editing an agreed line" pairing).** An answer replaces the asked `~` rule (same line, same rule number), so there is never an agreed line beside its source and no follower row; a Revise that edits the replaced rule simply makes it a new rule, asked again. A counting rule whose own words already are the check ("exactly 3 list items", `obviousCheck`) is settled as written, with no question.
|
|
@@ -4462,5 +4465,5 @@ For an integrating agent reading a run's record:
|
|
|
4462
4465
|
- **`draft-log.jsonl` `human` rows** `{no, source: confirm | look | try-3, question, answer, line?, at}`; the answer is secret-masked before it is written and the row exists only when the question was answered.
|
|
4463
4466
|
- **Money line** `moneyWithDraft(spendCore, draftUsd, budgetUsd, draftComplete, runUsd)`: `$run run + $draft drafting = $total of $cap`; without `runUsd` the sum is omitted. The panel's own spelling is `panelMoney2` (`src/panelmoney.js`, one Node owner; `src/panel/index.html` carries a pinned browser copy): 2 decimals from a cent up, 4 decimals for a real amount under a cent (`$0.0054`), `<$0.0001` below that, exact zero `$0.00`, null `unknown`; the CLI's `money()` keeps its own 4 decimals.
|
|
4464
4467
|
- Not built from the signed spec (see the Part 5 commits): the early ask about a number the AI made (T1), because the data it needs does not exist at that point; T1 is replaced by Part 5b below. The "fetching the page…" state (Q2) was built after the run-start refetch moved to after the run is listed: the sign progress list shows the step (`settleFetchingStep`, `src/panel/authorroutes.js`) and a listed run with no log yet reads "fetching the page… the run has not started yet" (`startingStub`, `webFetchState`), both read from `source.json`'s `refrozenAt`.
|
|
4465
|
-
- **The look reads, code asks (PRD v1.107 Part 5b; `src/pagemap.js`).** A map fact on a `time` or `money` shape may carry an optional `reading: {op, value | lo, hi}` (the signed-rule `op` set; a time bound is a string, a money bound a number); any other `reading` makes the whole map answer malformed (no repair). `askableFromLook(look, jobLines)` sorts every `~` rule: a kept page word carries it (no ask); a `reading` whose bound is NOT in the person's own words (`boundInWords`, the same test as `rubric-fact-unmarked`; it reads the words by kind, F242: a number bound is said only as a bare number or an amount's number, a time bound only as a time token with the hour's leading zero ignored, a date bound only as a date token, never a piece of a token) asks `Your line N says "<rule>". I read it as: <fact> <ruleWords>. Agree?`; a rule no kept fact carries
|
|
4468
|
+
- **The look reads, code asks (PRD v1.107 Part 5b; `src/pagemap.js`).** A map fact on a `time` or `money` shape may carry an optional `reading: {op, value | lo, hi}` (the signed-rule `op` set; a time bound is a string, a money bound a number); any other `reading` makes the whole map answer malformed (no repair). `askableFromLook(look, jobLines)` sorts every `~` rule: a kept page word carries it (no ask); a `reading` whose bound is NOT in the person's own words (`boundInWords`, the same test as `rubric-fact-unmarked`; it reads the words by kind, F242: a number bound is said only as a bare number or an amount's number, a time bound only as a time token with the hour's leading zero ignored, a date bound only as a date token, never a piece of a token) asks `Your line N says "<rule>". I read it as: <fact> <ruleWords>. Agree?`; a rule no kept fact carries is NOT asked (Addendum 2026-11-15 (f), option A: it is Not checked at once with `REASON.noRule`). A reading question offers three answers (Addendum (f) ruling): Agree, Drop it and a box "Or type the right reading:". `agree` writes the reading as a `~` rule in plain words, so the bound is the person's own and the fact signs plain; a typed correction REPLACES the asked rule (one in, one out) and code proves it as it proves any rule, and words code cannot prove are Not checked with `REASON.noRule`, never a second question; `drop it` leaves the rule Not checked with `REASON.left`. A leading agree word is no longer stripped (`stripAgreeLead` is removed with the typed answer; `isAgree` stays only so the Result tab reads an old typed "yes" as `(you confirmed)`). A phrase or place link counts only when the person's own `~` rule words contain it, and an AI-written fact name is no proof that a phrase or place is job-derived (a phrase not in the job text is Suggested, Add). `MAX_QUESTIONS` is 3: more asks than that stops the draft before the confirm turn (stop `look-asks-too-many`, no extra spend) with `tooManyAsksText`, a code-written list of every ask and its reading. Asks carry `ask: 'reading' | 'check'` (and `reading` for the agree text) through `normalizeQuestions`.
|
|
4466
4469
|
- **The fit check is removed** (2026-11-14; was F243, `src/fitcheck.js`): no paid call before the look, no Go on / Stop question, no `fit-stopped` stop, no `fit-check` draft-log row. One place for all checks: the check list. "A run needs at least one check" stays.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bareloop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"description": "Workflows that earn their own design, with receipts — agent-authored workflows for repeated, long, verifiable jobs that improve across runs under an un-gameable gate.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/authorflow.js
CHANGED
|
@@ -89,7 +89,8 @@ import { redactSecrets } from './validate.js';
|
|
|
89
89
|
import { ledgerRecord } from './checklist.js';
|
|
90
90
|
import { ROW_EDIT_REVISE, rowEditUserText, rowEditChannel, editsOf } from './rowedit.js';
|
|
91
91
|
import { REASON, CheckBlock } from './checkblock.js';
|
|
92
|
-
import {
|
|
92
|
+
import { GUARD_DESCRIPTIONS } from './guarddescriptions.js';
|
|
93
|
+
import { stepFileContract, inputLabelsOf, stepFileRel, readFrozenInputs, lineRules, lineCarriesText, guardNameOfKey } from './rubricstep.js';
|
|
93
94
|
import { dropRows, dropLine } from './pagedropwords.js';
|
|
94
95
|
import { renderLookReport } from './inputlook.js';
|
|
95
96
|
import { checkDeclarationWords, labelListsFor } from './factwords.js';
|
|
@@ -129,8 +130,10 @@ export const MAX_QUESTIONS = 3;
|
|
|
129
130
|
* word anywhere in it (a test greps this): the machine, not the prompt, bounds the count.
|
|
130
131
|
*/
|
|
131
132
|
export const QUESTIONS_DESCRIPTION = 'Optional. Add a question only if a refusal in the measured results names a job line that cannot be drafted '
|
|
132
|
-
+ 'without the person\'s answer (an undefined size, format, destination, or what "done" means). Each question is {line, question}: '
|
|
133
|
-
+ '"line" is the number of the job line it is about
|
|
133
|
+
+ 'without the person\'s answer (an undefined size, format, destination, or what "done" means). Each question is {line, question} plus the tag that says what the answer does: '
|
|
134
|
+
+ '"line" is the number of the job line it is about; "rule" is the number of that line\'s own rule the question is about (the answer then replaces that rule) '
|
|
135
|
+
+ 'or "new": true when it is about nothing the line already says (the answer is added as a new rule). Name a rule only if the line really has it, and tag each question with a rule or with new, never with a mix. '
|
|
136
|
+
+ 'If the refusals can be fixed without asking, fix them and leave this out. '
|
|
134
137
|
+ 'Never ask about a budget, a cap or a time limit (the person signs those). Still deliver the complete corrected declaration.';
|
|
135
138
|
|
|
136
139
|
/**
|
|
@@ -161,13 +164,14 @@ export function linesNamedByReds(reds, declaration, lineNums) {
|
|
|
161
164
|
}
|
|
162
165
|
|
|
163
166
|
/**
|
|
164
|
-
* The machine's keep-or-drop of the try-3 questions. Kept only when its line is one the previous try's reds named and its
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @
|
|
167
|
+
* The machine's keep-or-drop of the try-3 questions. Kept only when its line is one the previous try's reds named, its text is non-blank, at most {@link MAX_QUESTIONS}, and its TAG is sound
|
|
168
|
+
* (Addendum 2026-11-14 (c) piece 5): the drafter names the `rule` the question is about (a `~` rule number the line really has: the answer REPLACES it) or says `new` (the answer is added as a new rule).
|
|
169
|
+
* A rule the line does not have, a question with neither tag and one with both are dropped; code never guesses which the drafter meant. Every drop comes back with its reason, for the draft's log.
|
|
170
|
+
* @param {any} raw @param {number[]} failedLines @param {{n: number, rules?: string[], rule?: string}[]|null} [jobLines] the person's numbered lines (their rules are what a tag may name)
|
|
171
|
+
* @returns {{kept: {line: number, question: string, rule?: number, new?: true, source?: string, ask?: 'reading'|'cant-check', reading?: string}[], dropped: {reason: string, raw: any}[]}}
|
|
168
172
|
*/
|
|
169
|
-
export function normalizeQuestions(raw, failedLines) {
|
|
170
|
-
/** @type {{line: number, question: string, rule?: number, source?: string, ask?: 'reading'|'cant-check', reading?: string}[]} */
|
|
173
|
+
export function normalizeQuestions(raw, failedLines, jobLines = null) {
|
|
174
|
+
/** @type {{line: number, question: string, rule?: number, new?: true, source?: string, ask?: 'reading'|'cant-check', reading?: string}[]} */
|
|
171
175
|
const kept = [];
|
|
172
176
|
/** @type {{reason: string, raw: any}[]} */
|
|
173
177
|
const dropped = [];
|
|
@@ -177,11 +181,15 @@ export function normalizeQuestions(raw, failedLines) {
|
|
|
177
181
|
if (!q || typeof q !== 'object' || !Number.isInteger(q.line)) { dropped.push({ reason: 'no line', raw: q }); continue; }
|
|
178
182
|
if (!failedLines.includes(q.line)) { dropped.push({ reason: `line ${q.line} is not a line the previous try's checks failed on`, raw: q }); continue; }
|
|
179
183
|
if (typeof q.question !== 'string' || q.question.trim() === '') { dropped.push({ reason: 'blank question', raw: q }); continue; }
|
|
184
|
+
const named = Number.isInteger(q.rule);
|
|
185
|
+
if (named && q.new === true) { dropped.push({ reason: `line ${q.line}: the question names both a rule and new`, raw: q }); continue; }
|
|
186
|
+
if (!named && q.new !== true) { dropped.push({ reason: `line ${q.line}: the question names neither a rule nor new`, raw: q }); continue; }
|
|
187
|
+
if (named && !(q.rule >= 1 && q.rule <= lineRules((jobLines ?? []).find((/** @type {any} */ l) => l?.n === q.line)).length)) { dropped.push({ reason: `line ${q.line} has no rule ${q.rule}`, raw: q }); continue; }
|
|
180
188
|
if (kept.length >= MAX_QUESTIONS) { dropped.push({ reason: 'beyond the machine\'s limit', raw: q }); continue; }
|
|
181
189
|
kept.push({
|
|
182
190
|
line: q.line, question: redactSecrets(q.question.trim()),
|
|
183
191
|
// PRD v1.106 Part 5 Q3: a code-forced question (the early look ask) names the `~` rule it is about and says so; a model's question has neither
|
|
184
|
-
...(
|
|
192
|
+
...(named ? { rule: q.rule } : { new: /** @type {const} */ (true) }), ...(typeof q.source === 'string' ? { source: q.source } : {}),
|
|
185
193
|
// PRD v1.107 Part 5b: the kind of a code-forced ask, and (reading asks) the plain words `agree` writes as the `~` rule
|
|
186
194
|
...(q.ask === 'reading' || q.ask === 'cant-check' ? { ask: q.ask } : {}), ...(q.ask === 'reading' && typeof q.reading === 'string' ? { reading: redactSecrets(q.reading) } : {}),
|
|
187
195
|
});
|
|
@@ -589,27 +597,13 @@ export const ANSWER_QUESTION_FIELD = Object.freeze({
|
|
|
589
597
|
* @type {Record<'confirm'|'fix'|'type-goal'|'start-over', string>}
|
|
590
598
|
*/
|
|
591
599
|
export const CONFIRM_MENU = Object.freeze({
|
|
592
|
-
confirm: 'Confirm —
|
|
600
|
+
confirm: 'Confirm — draft the checks for this plan and goal as shown',
|
|
593
601
|
fix: 'Fix — describe what to change',
|
|
594
602
|
'type-goal': 'Type the goal sentence yourself',
|
|
595
603
|
'start-over': 'Start over — rerun the interview from the beginning',
|
|
596
604
|
});
|
|
597
605
|
|
|
598
|
-
|
|
599
|
-
* PLAIN-ENGLISH lines for the guards `classGuards` can compose, keyed by
|
|
600
|
-
* guard NAME — frozen beside {@link CONFIRM_MENU} because both are constants
|
|
601
|
-
* the confirm turn shows a person verbatim. One entry per guard that exists
|
|
602
|
-
* in `MECHANICAL_GUARDS` (`src/authoring.js`); {@link confirmProtections}
|
|
603
|
-
* throws if a guard `classGuards` hands back has no line here, so a battery
|
|
604
|
-
* that grows a guard fails loudly instead of showing a blank description.
|
|
605
|
-
* @type {Record<string, string>}
|
|
606
|
-
*/
|
|
607
|
-
export const GUARD_DESCRIPTIONS = Object.freeze({
|
|
608
|
-
'changed-from-seed': 'the run must actually change at least one file in scope — a close that reports done '
|
|
609
|
-
+ 'without touching anything is refused',
|
|
610
|
-
'no-suppressions': 'the run may not silence a checker instead of fixing what it flags (things like @ts-ignore, '
|
|
611
|
-
+ 'eslint-disable, or # type: ignore) — none of those may appear in the diff',
|
|
612
|
-
});
|
|
606
|
+
export { GUARD_DESCRIPTIONS };
|
|
613
607
|
|
|
614
608
|
/**
|
|
615
609
|
* THE REAL PROTECTIONS a person is shown, and what {@link runConfirmTurn}
|
|
@@ -629,7 +623,9 @@ export const GUARD_DESCRIPTIONS = Object.freeze({
|
|
|
629
623
|
* @returns {string[]}
|
|
630
624
|
*/
|
|
631
625
|
export function confirmProtections({ verdictType, lang, writeScope = null, jobLines = null, closeDecl = null }) {
|
|
632
|
-
|
|
626
|
+
// (one list, Addendum 2026-11-14 (c) piece 2: a guard the signed list already holds as a `$` row is said THERE, once for the job; an older close with no guard row keeps its line here)
|
|
627
|
+
const rowed = Array.isArray(closeDecl?.list) ? closeDecl.list.filter((/** @type {any} */ r) => r && r.kind === 'guard' && r.state === 'built').map((/** @type {any} */ r) => guardNameOfKey(r.key)) : [];
|
|
628
|
+
const guards = classGuards({ verdictType, lang }).filter((g) => !rowed.includes(g.name));
|
|
633
629
|
const lines = guards.map((g) => {
|
|
634
630
|
const desc = GUARD_DESCRIPTIONS[g.name];
|
|
635
631
|
if (!desc) {
|
|
@@ -638,13 +634,16 @@ export function confirmProtections({ verdictType, lang, writeScope = null, jobLi
|
|
|
638
634
|
}
|
|
639
635
|
return `${g.name} — ${desc}`;
|
|
640
636
|
});
|
|
641
|
-
|
|
637
|
+
// (a close whose signed list holds the fence row says it THERE, as a `$` row; only an older close keeps this line)
|
|
638
|
+
if (Array.isArray(writeScope) && writeScope.length > 0 && !(Array.isArray(closeDecl?.list) && closeDecl.list.some((/** @type {any} */ r) => r && r.kind === 'fence'))) {
|
|
642
639
|
lines.push(`write fence — the run may only change files matching: ${writeScope.join(', ')}`);
|
|
643
640
|
}
|
|
644
641
|
// PART 1a: a rubric job on local files always checks, for EVERY numbered line, that the line's file exists, is complete
|
|
645
642
|
// JSON and has text — a fact of the close's shape (`rubric-step`), not a plan of the model's, so it is listed from code
|
|
643
|
+
// (one list, Addendum 2026-11-14 (c) piece 1: a close whose signed list already holds a line's `$` floor row says it THERE, once; only an older close with no floor row keeps this note)
|
|
646
644
|
if (lang === RUBRIC_LANG && Array.isArray(jobLines)) {
|
|
647
|
-
|
|
645
|
+
const floors = Array.isArray(closeDecl?.list) ? closeDecl.list.filter((/** @type {any} */ r) => r && r.kind === 'floor' && r.state === 'built').map((/** @type {any} */ r) => r.line) : [];
|
|
646
|
+
for (const l of jobLines) if (!floors.includes(l.n)) lines.push(`line ${l.n} file — ${stepFileRel(l.n)} must exist, be complete JSON${lineCarriesText(closeDecl, l.n) ? ', and carry text' : ''}`);
|
|
648
647
|
}
|
|
649
648
|
return lines;
|
|
650
649
|
}
|
|
@@ -939,26 +938,14 @@ export function declarationSchema(catalogue = KIND_CATALOGUE, { verdictType = nu
|
|
|
939
938
|
type: 'object',
|
|
940
939
|
properties: {
|
|
941
940
|
line: { type: 'integer', minimum: 1, description: 'the number of a job line no stage checks' },
|
|
942
|
-
rule
|
|
941
|
+
// a `~` rule is never a repo drafter's to refuse (code decides what keeps it and asks about the rest); only the rubric class keeps the rule number (its rows are code-assembled)
|
|
942
|
+
...(Array.isArray(kinds) && kinds.includes('rubric-step') ? { rule: { type: 'integer', minimum: 1, description: 'optional: the number of ONE ~ rule of that line that nothing checks (the line itself still has a stage)' } } : {}),
|
|
943
943
|
reason: { type: 'string', minLength: 1, description: 'why, in plain words the person can read' },
|
|
944
944
|
},
|
|
945
945
|
required: ['line', 'reason'],
|
|
946
946
|
additionalProperties: false,
|
|
947
947
|
},
|
|
948
|
-
description: 'job lines
|
|
949
|
-
},
|
|
950
|
-
guardLines: {
|
|
951
|
-
type: 'array',
|
|
952
|
-
items: {
|
|
953
|
-
type: 'object',
|
|
954
|
-
properties: {
|
|
955
|
-
guard: { type: 'string', minLength: 1, description: 'the name of a mandatory guard stage' },
|
|
956
|
-
lines: { type: 'array', minItems: 1, uniqueItems: true, items: { type: 'integer', minimum: 1 }, description: 'the number(s) of the job line(s) that guard already checks' },
|
|
957
|
-
},
|
|
958
|
-
required: ['guard', 'lines'],
|
|
959
|
-
additionalProperties: false,
|
|
960
|
-
},
|
|
961
|
-
description: 'optional: which job lines the always-on guards already cover (a line whose every ask a mandatory guard checks needs no stage of its own)',
|
|
948
|
+
description: 'job lines you could not turn into a check, each with a reason in the person\'s words — a note does not cover a line. A ~ rule is never listed here: code decides what keeps it and asks the person about the rest',
|
|
962
949
|
},
|
|
963
950
|
...(ticket ? {
|
|
964
951
|
ticketFilter: {
|
|
@@ -976,7 +963,7 @@ export function declarationSchema(catalogue = KIND_CATALOGUE, { verdictType = nu
|
|
|
976
963
|
type: 'array',
|
|
977
964
|
items: {
|
|
978
965
|
type: 'object',
|
|
979
|
-
properties: { line: { type: 'integer', minimum: 1 }, question: { type: 'string', minLength: 1 } },
|
|
966
|
+
properties: { line: { type: 'integer', minimum: 1 }, question: { type: 'string', minLength: 1 }, rule: { type: 'integer', minimum: 1 }, new: { type: 'boolean' } },
|
|
980
967
|
required: ['line', 'question'],
|
|
981
968
|
},
|
|
982
969
|
description: QUESTIONS_DESCRIPTION,
|
|
@@ -1224,7 +1211,7 @@ export function confirmedBlock(confirmed) {
|
|
|
1224
1211
|
* names the ONE numbered job line it serves, or the line is refused with a reason; the mandatory guards serve no line.
|
|
1225
1212
|
* The $0 validator (validateDeclaration, `jobLines`) enforces it and the revise loop feeds a miss back.
|
|
1226
1213
|
* @param {number} count how many numbered job lines the person wrote
|
|
1227
|
-
* @param {string[]} [guardNames] the mandatory guards' names; present = the block also tells
|
|
1214
|
+
* @param {string[]} [guardNames] the mandatory guards' names; present = the block also tells that a rule needs no stage and no refusal (code decides what keeps a rule)
|
|
1228
1215
|
*/
|
|
1229
1216
|
export function jobLineTagBlock(count, guardNames = []) {
|
|
1230
1217
|
return 'EVERY STAGE SERVES ONE JOB LINE\n\n'
|
|
@@ -1234,17 +1221,10 @@ export function jobLineTagBlock(count, guardNames = []) {
|
|
|
1234
1221
|
+ 'words the person can read. Every numbered line needs at least one stage or one refusal — a note in "notes" does '
|
|
1235
1222
|
+ 'NOT cover a line. The mandatory guards serve no job line and carry NO "fromLine".'
|
|
1236
1223
|
+ (guardNames.length
|
|
1237
|
-
? '\n\
|
|
1238
|
-
+ 'name the guard(s) that do it in "guardLines", beside "stages" — for example {"guardLines": [{"guard": "' + guardNames[0] + '", "lines": [N]}]}. '
|
|
1239
|
-
+ 'Never write a second stage that repeats a guard, and keep "refused" for a line nothing can check.'
|
|
1240
|
-
+ '\n\nTHE ALWAYS-ON CHECKS ALREADY EXIST in this close, in plain words: ' + guardNames.map((n) => n + ' (' + (GUARD_DESCRIPTIONS[n] ?? n) + ')').join('; ')
|
|
1224
|
+
? '\n\nTHE ALWAYS-ON CHECKS ALREADY EXIST in this close, in plain words: ' + guardNames.map((n) => n + ' (' + (GUARD_DESCRIPTIONS[n] ?? n) + ')').join('; ')
|
|
1241
1225
|
+ '; and the write fence (changes stay inside the write scope). They are already among the guard stages you were given — keep those exactly as given, and NEVER declare any of them again as a stage of your own — '
|
|
1242
|
-
+ 'no second files-changed or scope stage, and no stage that adds scope or params to the suppression guard. A job line they already
|
|
1243
|
-
+ '
|
|
1244
|
-
+ 'not given a stage and not refused. Legal example for a two-line job whose line 1 is a test run and whose line 2 is covered by the guards: '
|
|
1245
|
-
+ '{"stages": [{"name": "suite-green", "kind": "command-exit", "fromLine": [1], "params": {"cmd": "npm", "args": ["test"], "expectExit": 0}}], '
|
|
1246
|
-
+ '"guardLines": [{"guard": "' + guardNames[0] + '", "lines": [2]}' + (guardNames[1] ? ', {"guard": "' + guardNames[1] + '", "lines": [2]}' : '') + ']} — '
|
|
1247
|
-
+ 'line 2 has no stage of its own and is not refused.'
|
|
1226
|
+
+ 'no second files-changed or scope stage, and no stage that adds scope or params to the suppression guard. A job line whose every ask they already do needs no stage of its own: list it in "refused" with a reason, never a stage that repeats them.'
|
|
1227
|
+
+ '\n\nA "~" rule needs no stage and no refusal, and you never list one in "refused". Write a stage only for what a kind in the catalogue really measures; never write one to stand in for a rule nothing can check — code decides which rules the write fence keeps (from the person\'s own words) and asks the person about the rest.'
|
|
1248
1228
|
: '');
|
|
1249
1229
|
}
|
|
1250
1230
|
|
|
@@ -2041,6 +2021,10 @@ export const RUBRIC_CONFIRM_NOTE = 'THIS JOB HAS NO REPOSITORY. Its inputs are t
|
|
|
2041
2021
|
+ 'The checks of this job are made elsewhere: plan none. Send an empty checks list, an empty notChecked list and an empty questions list, '
|
|
2042
2022
|
+ 'and write ONE sentence saying what the job does, from the numbered job lines.';
|
|
2043
2023
|
|
|
2024
|
+
/** What the confirm turn tells the model about a REPO job (model-facing, registered; Addendum 2026-11-15 (d)): the turn plans the goal only, the job's checks are the one list's rows, built by code after the draft. */
|
|
2025
|
+
export const REPO_CONFIRM_NOTE = 'The checks of this job are made elsewhere: plan none. Send an empty checks list, an empty notChecked list and an empty questions list, '
|
|
2026
|
+
+ 'and write ONE sentence saying what the job does, from the numbered job lines.';
|
|
2027
|
+
|
|
2044
2028
|
export const CONFIRM_SYSTEM = 'You read what a NON-ENGINEER answered, plus a read-only survey or listing of their '
|
|
2045
2029
|
+ 'own repository, and draft a PLAN for a job\'s definition of done: the checks you plan to compose and one '
|
|
2046
2030
|
+ 'signed goal sentence. You never propose a check the numbered job lines (and the ~ rules written under them) did not ask for '
|
|
@@ -2103,6 +2087,7 @@ export function confirmPrompt({ answers, questions, labels = {}, facts = null, l
|
|
|
2103
2087
|
// PART 1a: a rubric job on the person's own text files. The model is told what a check CAN be here, so that anything
|
|
2104
2088
|
// needing judgement lands in `notChecked` instead of being promised as a check
|
|
2105
2089
|
if (lang === RUBRIC_LANG) lines.push('', RUBRIC_CONFIRM_NOTE);
|
|
2090
|
+
else if (isRepo === true) lines.push('', REPO_CONFIRM_NOTE);
|
|
2106
2091
|
// R10: the `~` rules code settles from the person's own picks are not yours to plan: a check for them is code's, a gap is code's Not checked row
|
|
2107
2092
|
// MCP + tickets R5 (F285): a Tickets job's confirm turn is told the ticket is picked per run and a priority/label line is code's, so it never asks the person which ticket
|
|
2108
2093
|
if (ticket) lines.push('', ticketPerRunFacts());
|
|
@@ -2159,7 +2144,7 @@ async function askConfirmPlan({ convo, generate, mode, book, label }) {
|
|
|
2159
2144
|
* ask: (step: {kind: string, [k: string]: any}) => Promise<string|null>,
|
|
2160
2145
|
* onPhase?: (phase: string, data?: any) => void, mode?: 'tool'|'text',
|
|
2161
2146
|
* worseThanBefore?: string, inputs?: {n: number, label: string, value: string}[]|null,
|
|
2162
|
-
* jobLines?: {n: number}[]|null, ticket?: boolean, card?: {checkItems: {text: string, fromLine: number[], by: 'agent'|'you'|'default', key?: string}[], notChecked: string[], notCheckedBy?: Record<string, string
|
|
2147
|
+
* jobLines?: {n: number}[]|null, ticket?: boolean, card?: {checkItems: {text: string, fromLine: number[], by: 'agent'|'you'|'default', key?: string}[], notChecked: string[], notCheckedBy?: Record<string, string>, closeDecl?: any}|null, block?: CheckBlock|null, cardOf?: (() => any)|null}} o retired field (hamr's ruling 2026-09-28):
|
|
2163
2148
|
* `worseThanBefore` is never asked any more and defaults to `''` — a
|
|
2164
2149
|
* caller may still pass a string through (kept for a future, non-ask
|
|
2165
2150
|
* source of the same constraint), it just never comes from an ask() step.
|
|
@@ -2190,8 +2175,8 @@ export async function runConfirmTurn({
|
|
|
2190
2175
|
// the live check block of a rubric job and the reader that draws its rows (`() => cardOfClose(...)`): the confirm card's Drop and Add are instant row edits ($0, no AI) through the block, and the card is redrawn from its rows
|
|
2191
2176
|
block = null, cardOf = null,
|
|
2192
2177
|
}) {
|
|
2193
|
-
/** a rubric job's confirm turn plans the goal only (its checks are the list's) */
|
|
2194
|
-
const goalOnly = lang === RUBRIC_LANG;
|
|
2178
|
+
/** a rubric or a repo job's confirm turn plans the goal only (its checks are the list's rows) */
|
|
2179
|
+
const goalOnly = lang === RUBRIC_LANG || isRepo === true;
|
|
2195
2180
|
/** @typedef {null|'cap-halt'|'pricing-red'|'provider-red'|'artifact-red'|'confirm-abandoned'|'confirm-restart'} ConfirmStop */
|
|
2196
2181
|
/** @returns {{ok: boolean, stop: ConfirmStop, rounds: number, accepted: null, reds: Red[], cost: any}} */
|
|
2197
2182
|
const base = () => ({ ok: false, stop: null, rounds: 0, accepted: null, reds: [], cost: book.report() });
|
|
@@ -2216,7 +2201,7 @@ export async function runConfirmTurn({
|
|
|
2216
2201
|
// the prompt below so the model can check `notChecked` against it, and
|
|
2217
2202
|
// reused (never recomputed) after the call so the shown, prompted, and
|
|
2218
2203
|
// recorded protections are always the exact same list.
|
|
2219
|
-
const protections = confirmProtections({ verdictType, lang: resolvedLang, writeScope, jobLines, closeDecl: block !== null ? block.closeView() : null });
|
|
2204
|
+
const protections = confirmProtections({ verdictType, lang: resolvedLang, writeScope, jobLines, closeDecl: block !== null ? block.closeView() : (card?.closeDecl ?? null) });
|
|
2220
2205
|
|
|
2221
2206
|
// ── up to 2 paid rounds (ruling 5) ─────────────────────────────────────────
|
|
2222
2207
|
/** @type {string|null} */
|
|
@@ -2305,7 +2290,8 @@ export async function runConfirmTurn({
|
|
|
2305
2290
|
for (const { text } of lookRows) if (!notChecked.includes(text)) notChecked.push(text);
|
|
2306
2291
|
// ONE row per `~` rule on the CARD (hamr 2026-11-14, run mwgsl7zx): a rule the check list says Not checked is said by its row alone (its reason is the look's sentence, or the person's kept Drop, which wins),
|
|
2307
2292
|
// so the look's own line for that rule is not drawn beside it. `accepted.notChecked` below stays the full list the drafter is told.
|
|
2308
|
-
|
|
2293
|
+
// live run mwi76vh8 (session smwi75mbqjjbs): a drop with no `~` rule (a place fact) is the block's own `!` row too ("boston place"), so its look line is not drawn beside it either
|
|
2294
|
+
const shownNotChecked = () => notChecked.filter((t) => !lookRows.some((l) => l.text === t && block !== null && (l.row.rule !== undefined ? block.saysRule(l.row.line, l.row.rule) : block.rows.some((r) => r.key === `L${l.row.line}.fact.${String(l.row.fact).toLowerCase().replace(/\s+/g, ' ').trim()}`))));
|
|
2309
2295
|
const checkItems = normalizeChecks(r.plan.checks);
|
|
2310
2296
|
r.plan = { ...r.plan, checks: checkItems.map((c) => c.text), checkItems };
|
|
2311
2297
|
// the rows of the check block, drawn by the same readers as the signed card (hamr 2026-11-12: the confirm card showed no row the block had built); shown only, never accepted
|
|
@@ -2663,6 +2649,8 @@ export async function authorClose({
|
|
|
2663
2649
|
block.addLook(Array.isArray(facts?.look?.facts) ? facts.look.facts : [], Array.isArray(facts?.look?.dropped) ? facts.look.dropped : []);
|
|
2664
2650
|
block.reconcile();
|
|
2665
2651
|
}
|
|
2652
|
+
// the mandatory guards are job-level `$` rows of the signed list (piece 2): the block that signs knows their names, whoever built it
|
|
2653
|
+
if (block !== null && lang === RUBRIC_LANG) block.setGuards(guards.map((/** @type {any} */ g) => g.name), Array.isArray(writeScope) && writeScope.length ? writeScope : ['output/']);
|
|
2666
2654
|
/** the row-edit turn replaces the drafter's declaration for a rubric job: the model boundary and the declaration code assembles from the block's rows */
|
|
2667
2655
|
const rowEdits = block !== null && lang === RUBRIC_LANG;
|
|
2668
2656
|
const draftGenerate = rowEdits && editGenerate ? editGenerate : generate;
|
|
@@ -2801,7 +2789,7 @@ export async function authorClose({
|
|
|
2801
2789
|
// `questions` is never part of the declaration: stripped before validation, kept only through the machine's filter
|
|
2802
2790
|
const { questions: rawQuestions, ...rest } = ask.declaration;
|
|
2803
2791
|
ask.declaration = rest;
|
|
2804
|
-
const nq = normalizeQuestions(rawQuestions, /** @type {number[]} */ (questionLines));
|
|
2792
|
+
const nq = normalizeQuestions(rawQuestions, /** @type {number[]} */ (questionLines), jobLines);
|
|
2805
2793
|
askedQuestions = nq.kept;
|
|
2806
2794
|
droppedQuestions = nq.dropped;
|
|
2807
2795
|
}
|