bareloop 0.47.1 → 0.49.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 +56 -0
- package/README.md +16 -9
- package/bareloop.context.md +70 -46
- package/bin/bareloop.mjs +2 -0
- package/package.json +3 -3
- package/src/bundle.js +36 -9
- package/src/bundleref.js +103 -0
- package/src/bundlerun.js +134 -17
- package/src/cli.js +138 -144
- package/src/config.js +1 -1
- package/src/draftspend.js +88 -34
- package/src/facts.js +1 -1
- package/src/interviewrun.js +11 -11
- package/src/invoke.js +3 -2
- package/src/launcher.js +122 -12
- package/src/learn.js +34 -20
- package/src/learnstore.js +30 -14
- package/src/pagedropwords.js +1 -0
- package/src/pagedry.js +77 -6
- package/src/pagemap.js +17 -3
- package/src/pagerules.js +2 -1
- package/src/panel/authorsession.js +7 -13
- package/src/panel/index.html +30 -7
- package/src/panel/runroutes.js +28 -14
- package/src/panel/server.js +69 -118
- package/src/prompts.js +50 -0
- package/src/reuse.js +1 -1
- package/src/runexport.js +162 -0
- package/src/runfiles.js +65 -0
- package/src/runlist.js +72 -0
- package/src/userrun.js +17 -13
- package/types/bundle.d.ts +16 -0
- package/types/bundleref.d.ts +63 -0
- package/types/bundlerun.d.ts +10 -3
- package/types/cli.d.ts +2 -1
- package/types/draftspend.d.ts +7 -23
- package/types/launcher.d.ts +67 -2
- package/types/learn.d.ts +29 -15
- package/types/learnstore.d.ts +31 -10
- package/types/pagedry.d.ts +26 -0
- package/types/pagemap.d.ts +1 -0
- package/types/panel/server.d.ts +7 -3
- package/types/prompts.d.ts +21 -0
- package/types/reuse.d.ts +3 -0
- package/types/runexport.d.ts +58 -0
- package/types/runfiles.d.ts +40 -0
- package/types/runlist.d.ts +55 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,62 @@ 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.49.0] - 2026-10-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **A launcher `6 update` option (and `bareloop update`).** It asks npm for the newest bareloop only when you press it (nothing goes online at start or in the background). Newest: `You have the newest bareloop (X).` A newer one: `bareloop Y is out. You have X.` and `Update now? (y/n)`; `y` runs `npm install -g bareloop@latest` and says to pick 3 restart (from the menu) or to run `bareloop restart` (typed as `bareloop update`), `n` leaves it. The install gives up after 5 minutes: its npm child is ended and the same "The update did not finish" line shows. If npm cannot be reached: `Could not reach npm to check. Try again later.`
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **A page fetch's browser no longer outlives bareloop.** If bareloop is killed or crashes while reading a web address, the browser it started now exits with it (barebrowse 0.24.1; Firefox needs `setpriv`, Chromium needs nothing). Old leftover browser folders in `/tmp` are cleaned on the next fetch.
|
|
17
|
+
- **"yes, " in front of your own reading is no longer signed.** When a question about a `~` rule is answered "yes, check it as departure between 05:00 and 21:59", the rule now reads "check it as departure between 05:00 and 21:59". A leading "yes," or "agree:" (the word, then a comma or colon) is dropped from the signed `~` rule and the rest is kept word for word; any other start is kept whole; a bare "yes" or "agree" still accepts the reading, and a yes in the middle of a sentence is left alone. "yes, drop it" on a rule the page cannot check drops it. (F240)
|
|
18
|
+
- **Two money units that differ only in spaces are one unit.** Page rules now trim and collapse spaces in each listed unit (so "US dollars" and " US dollars" become one), and a spec that still carries such a pair is refused at no cost in bareloop's own words ("the units are not repeated") instead of by bareguard 0.26.
|
|
19
|
+
- **A time label the run cannot read is now Not checked (F236, F237).** A time fact is read against the page by the same checker the run uses before it is signed. If the page never shows a time right after the label (for example "Departure time" on a page that writes "Departure time:"), the fact is left out and shown under Not checked: `the page never shows a time right after "Departure time", so it is not checked.` It only catches a label that can never read; a label that reads a wrong time is kept and left to you at Accept.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Menu numbers.** The panel line gains `6 update`; the job line is now `7 export 8 run 9 resume 10 history`. `5 install` with nothing to do now says `Already set up. This does not update bareloop. Pick 6 update for that.`
|
|
24
|
+
- **barebrowse `^0.21.0` to `^0.24.1`.** No change to how bareloop calls it.
|
|
25
|
+
- **bareguard `^0.25.1` to `^0.26.0`.** Its one break for bareloop is the money-unit rule above; the new table rules (`cells`, `table`, `diff`) are not used here.
|
|
26
|
+
- **Piped input never installs on `bareloop update`.** The rule was "no terminal never installs", but the command always had an asker, so `echo y | bareloop update` (or a pipe into the menu's `6`) ran `npm install -g`. When stdin is not a terminal it now prints `To update: npm install -g bareloop@latest` and exits 0.
|
|
27
|
+
- **"agree with the shown price" is no longer cut to "with the shown price".** The F240 lead-word strip first also took a bare space, then a hyphen or dash, as a separator, so it ate real words ("yes or no questions only" signed as "or no questions only", "yes-no questions only" as "no questions only"). Now only a leading `yes` or `agree` directly followed by a comma or colon is dropped from the signed `~` rule; any other start is kept whole.
|
|
28
|
+
|
|
29
|
+
## [0.48.0] - 2026-10-25
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **`bareloop restart`, and the panel's start time.** `restart` (menu item 3) is the existing stop (same open-drafts warning and ask; `--yes` skips it) then the existing start, on the port the panel had when it is free again, else the first free one; with no panel running it says so and just starts. `GET /api/whoami` now carries `startedAt`, and the header reads `panel running at http://127.0.0.1:4700 · started 10/24 21:40` (local time, the panel's own date style); `bareloop status` prints it too. An older panel that reports none shows nothing extra.
|
|
34
|
+
- **Export a green panel run by its name (hamr's ruling, 2026-10-25).** `bareloop export "my-job (run-3)" --out ./folder` turns a green run from the panel into a bundle: the run's own signed job, plus a record of the run built from what the run itself recorded (cost, time, rounds, saved plan). With no name it lists your green runs, numbered, and you pick one. A number it cannot read from the run is refused in words, never guessed. For now only repo jobs: a judged job, a page-link job and a plain-folder job are refused with "only repo jobs can be exported for now" and the reason. Each export adds one `exported` line to `runs.jsonl`, so `bareloop run "my-job (run-3)"` finds the bundle by name. The older `export <job.json> --registry <dir> --out <dir>` is unchanged. The panel's Run tab for a green repo run now shows the export command to copy beside the `git merge` text.
|
|
35
|
+
- **One menu.** Bare `bareloop` shows `panel: 1 start 2 stop 3 restart 4 status 5 install` and `jobs: 6 export 7 run 8 resume 9 history`. Each job command asks for what it needs (typed flags skip the question): export a numbered list then a folder; run a bundle (number, name or folder), a repo, then the money and time caps; resume a numbered list of stopped runs, then more money or time; history a bundle. An empty Enter on a required question asks once more; a second empty Enter ends that command with a plain line (exit 0).
|
|
36
|
+
- **A cap can be raised with your yes.** `bareloop run` and `run --resume` used to refuse a cap above the bundle's signed one (`envelope-widen`). They now show it back ("This raises the $ cap from $2 to $10.") and proceed only when you type `yes`; with no terminal it needs `--yes`, else it is refused before anything runs. The approval (who, old, new, when) is written to `runs/<runid>/approvals.jsonl` in the bundle and the history row. A resume still folds what the run already spent. Lowering a cap needs nothing.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- **The Run tab's NEXT is one instruction per row.** A green repo run reads `in:` the repo, `keep the work:` `git merge …`, `throw it away:` `git branch -D …`, `reusable bundle:` `bareloop export "job (run-N)" --out <folder>` in two columns (muted labels), so a long command wraps under the command column. The two-step endings use the same shape with the panel's own names: `raise the cap:` Cap $ on the Chat card, `then:` press Resume; `raise the time:` Time cap (min) …; `resume:` press Resume, `or change the job:` press Reuse workflow; `fix the destination:` the Destination, `then:` press Reuse workflow. Single-instruction endings stay one line.
|
|
41
|
+
- **`bareloop run` commits a green.** The bundle runner left a green run's work uncommitted on its branch; it now commits it on the work branch (the same call the panel uses) and prints a `commit` line. The merge stays yours.
|
|
42
|
+
- **The first run of an unblessed bundle, typed at a terminal, is signed with a typed yes.** It shows the bundle hash and asks "Type yes to sign it:"; only `yes` proceeds, and the signing is written to the run's `approvals.jsonl`. With flags only, `--approve <hash>` is still how.
|
|
43
|
+
- **Export lists only runs it can take.** A run that was already green (no saved plan), a judged, page-link or folder job, or one with no signed job file is not listed; a number it cannot read is still refused at export, in words.
|
|
44
|
+
- **No line tells you to run `bareloop author` or `bareloop interview` any more** (they left the CLI). Messages name the panel's drafting or `scripts/run-author.mjs` / `scripts/run-interview.mjs`.
|
|
45
|
+
- **The bundle questions show what they ask about.** `history` and `run` list the last 10 bundles you know (exported ones plus any with `bareloop run` runs), newest first, numbered, each as run name + folder, then ask; older ones are reached by typing their run name or folder. `resume` lists the last 10 stopped runs the same way (older by run id or folder). With nothing to pick from they say so in one line ("No exported bundles yet. Export one with 6.") and end.
|
|
46
|
+
- **`q` leaves a job command.** Typing `q` (any case) at any job question (the number, bundle, folder, repo, model, `$` cap, time cap and the yes-to-sign questions of export, run, resume and history) ends that command with a plain "nothing chosen" line and exit 0, like a second empty Enter. It used to be taken as a bundle name or a wrong answer. A folder literally called `q` is still reachable as `./q`.
|
|
47
|
+
- **`bareloop run` asks for what is missing.** No bundle, repo or model typed: it asks (the model from the ones ticked in Settings, only when the bundle names none). A bundle can be named by the run name it was exported under.
|
|
48
|
+
- **`interview`, `author` and `runs backfill` are no longer commands; `replay` is `node scripts/run-replay.mjs`.** `run-u` still works by name (the panel starts runs with it) but is listed nowhere. `scripts/run-interview.mjs` and `scripts/run-author.mjs` are unchanged, and the interview's "run it now" offer starts the author script. The library functions the panel uses stay.
|
|
49
|
+
- **A bundle's money-halt hint no longer says the ceiling cannot be raised.** The resume line reads `--budget <more than $X, above $Y asks you to type yes>`.
|
|
50
|
+
- **`learningHints` is ON by default (hamr's ruling, 2026-10-24).** It shipped OFF behind a `config.json` setting; an absent setting now means ON, so the planner is handed cross-run learnings at the draft and first replan. `"learningHints": false` still turns it off; an unreadable config still reads OFF. The one owner is `learningHintsOn` in `src/learnstore.js`.
|
|
51
|
+
|
|
52
|
+
- **One record of a session's drafting spend, not two.** Each metered drafting call already wrote a `call` line to `draft-log.jsonl` AND rewrote `draft-spend.json` with the running total. The `call` line now also carries the drafting `provider` and `baseUrl`, `draft-spend.json` is no longer written, and the monthly limit and Money tab fold the log's call lines (same `tallyCalls` reader as the session) for a session that never became a run. A session folder left by the old shape (the file, no call lines) is still read from the file, so old money is not lost; a torn log line makes the figure an "at least". Call lines written before they carried the drafting identity take provider, baseUrl and model from the old file, so old drafting spend stays on its Money row.
|
|
53
|
+
- **One `run.log` per run folder.** Accept, Rerun, Pause and Resume each made a new `accept-<id>-<ms>.log` / `resume-<id>-<ms>.log` file; they now append to the folder's `run.log` (the one the first run already writes) under a header line `== <action> <runid> at <time> ==`. A refusal shows only its own action's lines. The `log` field in the reply is now that path. Folders that already hold the old per-action files are left as they are.
|
|
54
|
+
- **`bareloop start` on a silent taken port tells you how to find what holds it.** The stop line now reads "Port N is taken and not answering. To see what holds it: lsof -i :N. If it is a stuck bareloop, end it: kill <pid>" (the old advice, "stop it first", could not be followed: `bareloop stop` only finds a panel that answers).
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **`bareloop run --yes <bundle>` keeps the bundle, and a pipe is never asked a question.** `--yes` took the next word as its value, so the bundle vanished and the command asked "which bundle?", found none, and exited 0 with nothing run. `--yes` is now a plain switch. And when `bareloop` is run with input that is not a terminal (`</dev/null`, a pipe) and a required word is missing, you get the usage line and exit 1 instead of a question. The menu still reads its choices from a pipe (`echo q | bareloop`).
|
|
59
|
+
- **The Run tab offers "reusable bundle:" only for a run export will take, and the command pastes into a shell.** The row was shown for a run that was already green (no saved plan) and for judged repo jobs, which export then refuses; it now uses the same check export uses. The command ends `--out "./<job>-bundle"` (a real folder name you may change) instead of `--out <folder>`, which a shell reads as a redirect.
|
|
60
|
+
- **A broken learnings file is no longer the same as "no lessons yet" (hamr's ruling, 2026-10-24, copied from fwdloop).** An unreadable or wrong-version ledger made the planner's hint block silently empty and recorded nothing. The planner still gets nothing and the run still goes on, but the run's `learnings` spine record now carries `hintsError` (first line, secrets masked), and the Audit learnings box prints one plain line: "The learnings file could not be read, so no lessons were given: ..." with a red ✗ header mark instead of the green ✓ (✓ stays when lessons were handed). In the ✗ case the title reads "No lessons were given to the planner", and the shown line writes the home folder as `~` (the spine record keeps the full reason). Hints off still reads nothing and records nothing.
|
|
61
|
+
|
|
62
|
+
- **Lessons follow the workflow, not the signed hash (hamr's ruling, 2026-10-24).** Learnings decided "same job version" by the signed hash, which moves with the money cap, time cap, source, destination, inputs and model. A Reuse with a new cap therefore read none of the earlier lessons, and a Resume that raised the cap counted one run twice (a second ledger row). The version is now the workflow key (the rule Reuse already uses). Rows and holds carry a new `workflowKey` beside `specHash`; rows an older version wrote have none and still match any version. Signing, approvals and bridges are unchanged.
|
|
63
|
+
|
|
8
64
|
## [0.47.1] - 2026-10-24
|
|
9
65
|
|
|
10
66
|
### Fixed
|
package/README.md
CHANGED
|
@@ -24,6 +24,10 @@ bareloop finds that path for you. Write your problem in plain language, as steps
|
|
|
24
24
|
|
|
25
25
|
The harness (budget, time, what it may touch) and the judge both sit **outside** the agent loop. The agent can't judge itself. Every run is recorded, so you can audit it and replay it at $0 and see exactly what happened.
|
|
26
26
|
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://raw.githubusercontent.com/hamr0/bareloop/main/docs/media/panel-walkthrough.gif" alt="The bareloop panel: write a job, the runs list, a rubric run waiting for Accept, its Result, Audit and signed Job, then a repo run ready to merge" width="900">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
27
31
|
## Two kinds of jobs
|
|
28
32
|
|
|
29
33
|
**Deterministic (code)**: code decides. Tests pass, the linter is quiet, the build exits clean. If no check exists yet, say what you need and the agent builds that check first.
|
|
@@ -129,18 +133,21 @@ Find it once, keep it, reuse it. It is a seed of something bigger over time.
|
|
|
129
133
|
|
|
130
134
|
### Export a job
|
|
131
135
|
|
|
136
|
+
When a job in the panel has gone green, keep it as a bundle you can run anywhere:
|
|
137
|
+
|
|
132
138
|
```bash
|
|
133
|
-
bareloop export
|
|
134
|
-
|
|
139
|
+
bareloop export "my-job (run-3)" --out ./my-job.bareloop # or just `bareloop export` and pick from the list
|
|
140
|
+
cd ./my-job.bareloop && npm install
|
|
141
|
+
bareloop run "my-job (run-3)" --repo /path/to/checkout --approve <bundleHash printed above>
|
|
135
142
|
```
|
|
136
143
|
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
`bareloop run <bundle> --resume <runid>`. Full
|
|
144
|
+
Bare `bareloop` is one menu: the panel (1 start, 2 stop, 3 restart, 4 status, 5 install, 6 update) and the jobs
|
|
145
|
+
(7 export, 8 run, 9 resume, 10 history), each asking for what it needs. `update` checks npm only when you press it and offers to install the newer version. `export` only ships a run that
|
|
146
|
+
already earned a real green, and only repo jobs for now. The first `run` on a new machine asks you to
|
|
147
|
+
approve the bundle's printed hash; once that run goes green, later runs need no re-approval as long
|
|
148
|
+
as the bundle stays unchanged. Every run works in its own fresh git worktree, commits a green on its
|
|
149
|
+
own branch and leaves the merge to you. A cap above the one signed is shown back and needs your
|
|
150
|
+
typed `yes` (or `--yes`). A halted run continues with `bareloop run <bundle> --resume <runid>`. Full
|
|
144
151
|
contract — flags, approval/blessing rules, exit codes — in
|
|
145
152
|
[`bareloop.context.md`](bareloop.context.md).
|
|
146
153
|
|
package/bareloop.context.md
CHANGED
|
@@ -738,7 +738,7 @@ attempt PLUS its close. Unpriced is never free: a null cost is a `pricing-red` s
|
|
|
738
738
|
never retried, and the ladder is otherwise ONE retry (`JUDGE_ATTEMPTS`) — after that a broken
|
|
739
739
|
judge is an instrument stop, never a red about the tree.
|
|
740
740
|
|
|
741
|
-
**The rulebook, and what each rule can raise** (`JUDGE_RULES` in `src/judged.js`; every rule carries a plain-words `means` the case-proposal prompt renders, so a proposed practice case never expects a red the rule cannot raise). The judge only POINTS (quotes lines verbatim); code does every check; unsure is red; the judge never says pass/fail. Quotes are matched by bareguard's `quoteIn(..., {wholeLines:true})` (`wholeLines` arrived in bareguard 0.21; bareloop now needs `^0.
|
|
741
|
+
**The rulebook, and what each rule can raise** (`JUDGE_RULES` in `src/judged.js`; every rule carries a plain-words `means` the case-proposal prompt renders, so a proposed practice case never expects a red the rule cannot raise). The judge only POINTS (quotes lines verbatim); code does every check; unsure is red; the judge never says pass/fail. Quotes are matched by bareguard's `quoteIn(..., {wholeLines:true})` (`wholeLines` arrived in bareguard 0.21; bareloop now needs `^0.26.0`): a contiguous run of whole artifact lines, so a bare fragment cannot pass by hiding in a longer line, while a dropped leading `* ` of a JSDoc tag line still matches. `has-doc` checks only that a JSDoc block sits directly above the function (read off the artifact by `docBlockAbove`; the judge's quote is a pointer that must lie inside that block), so a documented function never breaks it. **`says-what`** (the doc's description must say more than the function's own name) reds when the described prose, minus a fixed list of function words and the name's own words (camel/snake/kebab, light inflections, and a prefix echo such as `init`/`initialize` when the shorter word is at least 4 letters), leaves nothing; no description, or an unlocatable quote, reds. It catches a pure name echo only ("Returns the total." for `getTotal` passes), and with NO doc block at all it stays silent and leaves the red to `has-doc` (the card is not required to carry both). `params` reds a declared parameter with no tag, an `@param` naming no parameter (each destructured slot absorbs one unmatched root tag), and, when the doc names any field of a simple destructured parameter, a missing field; `@param options` alone for `{ x, y }` passes. `returns` reds a returning function with no `@returns`. A practice case that expects a `has-doc` red on a function that has a block is refused as a legality red before any call (`validateCalibrationSet`).
|
|
742
742
|
|
|
743
743
|
**A judged stage may only judge files inside the job's write fence** (`judgedOutsideFence`, `src/authoring.js`, called from `validateDeclaration`, which every door reaches: the authoring revise loop, `validateCloseDecl` at signing and runner pre-flight, and `validateJob` for hand-written or reused specs). A path outside `writeScope` reds `judged-outside-write-scope` at draft time, because a finding on a file the run is fenced out of can never be fixed. With no fence to compare against (the plain-folder deferral) the rule is not run.
|
|
744
744
|
|
|
@@ -1247,7 +1247,7 @@ must never make an ordinary first run read as a resume. Belted like `priorSpentU
|
|
|
1247
1247
|
non-finite or negative value reads as 0). Rides onto `job-start` as its own field,
|
|
1248
1248
|
`draftSpentUsd`, only when > 0 — never inside `spentUsd`/`engagementSpentUsd`, which stay
|
|
1249
1249
|
run-only. `bareloop run-u --draft-spent-usd <n>` is the CLI door (validated: finite, ≥ 0, else
|
|
1250
|
-
refused); `
|
|
1250
|
+
refused); `scripts/run-author.mjs` prints its own known drafting spend floor and the exact `run-u`
|
|
1251
1251
|
command including the flag; the panel's sign route passes the session's own tracked drafting
|
|
1252
1252
|
spend the same way. `src/replay.js`'s `moneyWithDraft(spendCore, draftSpentUsd, budgetUsd?, draftSpendComplete?)` is
|
|
1253
1253
|
the one shared display formatter: `"$3.71 ($0.81 drafting) of $5.00"`, unchanged
|
|
@@ -1391,7 +1391,7 @@ never greens with no registry row (F207).
|
|
|
1391
1391
|
has no guard against being passed without `--draft-spent-usd` — alone it is inert (nothing is
|
|
1392
1392
|
folded, so no `job-start` field is emitted). Every printed re-invocation tail carries it
|
|
1393
1393
|
alongside `--draft-spent-usd` (only when drafting spend > 0), so a resumed leg never turns the
|
|
1394
|
-
floor back into an exact figure; `
|
|
1394
|
+
floor back into an exact figure; `scripts/run-author.mjs` and the panel's sign route pass it when the
|
|
1395
1395
|
session's drafting spend was incomplete.
|
|
1396
1396
|
|
|
1397
1397
|
**`bareloop run-u --draft-spent-usd <n>`** (hamr's ruling 2026-09-28, "one cap covers drafting +
|
|
@@ -1401,7 +1401,7 @@ enforced ceiling and reading it as `Infinity` would silently narrow it into "no
|
|
|
1401
1401
|
names no drafting spend, so the signed `budgetUsd` is unaffected; this only shrinks THIS leg's
|
|
1402
1402
|
own enforced remainder (`job.budgetUsd - draftSpentUsd - spentUsd`). Every printed
|
|
1403
1403
|
resume/decide/door re-invocation carries `--draft-spent-usd` too, mirroring `--read-shim`'s own
|
|
1404
|
-
tail — a resumed leg that dropped it would silently widen its ceiling back up. `
|
|
1404
|
+
tail — a resumed leg that dropped it would silently widen its ceiling back up. `scripts/run-author.mjs`
|
|
1405
1405
|
prints the exact `run-u` command including this flag, with its own known drafting spend (a floor,
|
|
1406
1406
|
never $0 on an unpriced call — F6). The panel's sign route (`src/panel/authorroutes.js`)
|
|
1407
1407
|
passes the same flag off the authoring session's own tracked spend.
|
|
@@ -3238,6 +3238,7 @@ hash and needs re-approval, exactly like any other semantic edit.
|
|
|
3238
3238
|
| `readBundle(dir)` | `dir` → `{ ok, reds, spec, manifest, bridges, blessing, history }` | never throws; every failure is a typed red. Runs the tamper check (below) whenever both a manifest and a spec parsed |
|
|
3239
3239
|
| `resolveBundleSpec(bundle, bundleDir)` | a `readBundle` result + the bundle dir → `{ spec, approveHash }` | the in-memory `$BARELOOP_BUNDLE` → absolute `bundleDir` substitution; `approveHash` is `jobSpecHash` of the *substituted* spec, never the unresolved one |
|
|
3240
3240
|
| `checkEnvelope(spec, envelope)` | `spec` (already resolved) + `{ budgetUsd?, maxWallMs? }` → `{ ok, reds }` | tighten-only: a given number must be ≤ the spec's own |
|
|
3241
|
+
| `capRaises(spec, envelope)` | `spec` + `{ budgetUsd?, maxWallMs? }` → `[{ field, old, new }]` | the caps an envelope would RAISE above the signed ones; `bareloop run` shows each and needs a typed `yes` / `--yes` (pure) |
|
|
3241
3242
|
| `bless(dir, record)` | `dir` + `{ bundleHash, runid, outcome, host?, blessedAt? }` → the blessing object | writes/overwrites `blessing.json`; there is only ever one, for the bundle's current hash |
|
|
3242
3243
|
| `verifyBlessing(bundle)` | a `readBundle` result → `{ ok, unblessed, reds }` | `unblessed: true` (no red) means never blessed here; a red means blessed-but-stale |
|
|
3243
3244
|
| `appendHistory(dir, row)` | `dir` + a plain object → `void` | atomic append to `history.jsonl` (`appendFileSync`, same convention as `spine.js`/`ledger.js`) |
|
|
@@ -3265,7 +3266,7 @@ hash and needs re-approval, exactly like any other semantic edit.
|
|
|
3265
3266
|
| `manifest-invalid` / `spec-invalid` | `readBundle` | `manifest.json`/`spec.json` could not be read or parsed |
|
|
3266
3267
|
| `bundle-tampered` | `readBundle` | manifest and spec both parsed, but the recomputed `bundleHash` (from what's really on disk) does not match the stored one — **the load-bearing check, N4 below** |
|
|
3267
3268
|
| `bundle-deps-missing` | `checkBundleDeps` (F128) | the bundle's own `close/` directory cannot resolve `require.resolve('bareloop')` — the bundle was installed the WRONG way (as someone else's dependency) instead of `cd <bundleDir> && npm install`. `bareloop run` calls this as literal step 1b, right after the tamper check, before the envelope check, the key, and any worktree |
|
|
3268
|
-
| `envelope-widen` | `checkEnvelope` | a given `budgetUsd`/`maxWallMs` exceeds the bundle's own signed ceiling
|
|
3269
|
+
| `envelope-widen` | `checkEnvelope` | a given `budgetUsd`/`maxWallMs` exceeds the bundle's own signed ceiling and no yes was given (`bareloop run` offers the raise first: type `yes`, or pass `--yes`) |
|
|
3269
3270
|
| `blessing-stale` | `verifyBlessing` | `blessing.json` exists but its `bundleHash` no longer matches the manifest's — the bundle was re-exported/edited since the run that blessed it; re-export and re-approve |
|
|
3270
3271
|
|
|
3271
3272
|
**N4 — why `readBundle`'s tamper check must run before anything else touches the bundle.**
|
|
@@ -3292,8 +3293,8 @@ same seam `tests/planrun-*.test.js` uses. `deps` also accepts `env`, `stdout`, `
|
|
|
3292
3293
|
`now`, `stdin` — omit any of them and the real `process.*` equivalent is used.
|
|
3293
3294
|
|
|
3294
3295
|
Bare `bareloop` (no sub-command) is the **launcher menu** (PANEL-BUILD.md addendum L, `src/launcher.js`): two header lines, then
|
|
3295
|
-
`1 start 2 stop 3
|
|
3296
|
-
`bareloop start | stop | status | install`), from one function:
|
|
3296
|
+
`panel: 1 start 2 stop 3 restart 4 status 5 install 6 update`, `jobs: 7 export 8 run 9 resume 10 history`, `q quit`. The header is printed first by EVERY call (menu and each of
|
|
3297
|
+
`bareloop start | stop | restart | status | install | update`), from one function:
|
|
3297
3298
|
|
|
3298
3299
|
```
|
|
3299
3300
|
bareloop 0.47.0 · installed ✓ · panel running at http://127.0.0.1:4701
|
|
@@ -3304,7 +3305,7 @@ Colour (`src/tty-colour.js`): on only when stdout is a terminal, `NO_COLOR` is e
|
|
|
3304
3305
|
changes them, and a piped or `NO_COLOR` run prints the plain words above (the thin `─` rules around the header appear only with colour).
|
|
3305
3306
|
|
|
3306
3307
|
- `installed ✓` = `~/.config/bareloop/` exists, `config.json` is there and reads with no problem, `.env` exists with mode 600, node >= 22;
|
|
3307
|
-
otherwise `not installed — <first missing thing>, pick
|
|
3308
|
+
otherwise `not installed — <first missing thing>, pick 5 install`. The run counts use the panel's own status words and Needs-you rule over the
|
|
3308
3309
|
run list file ($0, works with the panel stopped).
|
|
3309
3310
|
- **No pid file.** The panel is found by asking `127.0.0.1:4700..4709` for `GET /api/whoami` (2000 ms each, in parallel — a loaded panel answered in 0.8 s; 300 ms missed it); a reply with `app: "bareloop"` is a panel. `start` never opens a second panel next to a silent one: a port that is taken but did not answer is asked again for about 10 s; a late bareloop answer counts as "already running", another kind of reply moves on to the next port, and still silent makes `start` stop with `Port 4700 is taken and not answering. If it's a stuck bareloop, stop it first.` (exit 1, nothing started). `stop` also checks each pid is really gone (signal 0) before it says "Panel stopped."; a pid still alive at the deadline is named (`did not stop`, exit 1) and the ones that did stop are still named.
|
|
3310
3311
|
`GET /api/whoami` → `{ app: "bareloop", version, pid, port, drafts, schedules }` (`version` is the version the panel STARTED with, read once at start, never re-read from package.json — so a panel on old code after a bump still reports the old one and the launcher's stop-and-start note can fire; the page topbar is the same) (open drafting sessions, jobs with a schedule), read-only, same Host guard as every
|
|
@@ -3312,26 +3313,45 @@ changes them, and a piped or `NO_COLOR` run prints the plain words above (the th
|
|
|
3312
3313
|
- **`bareloop start`** → already running: says so, opens the page, starts nothing (if the running panel's version differs from this bareloop's it adds `It is version X; this bareloop is Y. Run bareloop stop, then bareloop start, to use Y.`). Else starts `bareloop panel --port N` DETACHED (`setsid`; log appended to
|
|
3313
3314
|
`~/.config/bareloop/panel.log`) on the first free port from 4700 (a taken port that replies as something else is skipped and named; one that stays silent for ~10 s stops `start` with `Port N is taken and not answering…`, nothing started), waits up to 10 s for it to answer, opens the page with
|
|
3314
3315
|
`xdg-open`/`open` (no opener: prints the URL). `bareloop panel [--port N]` is unchanged (foreground, fixed port).
|
|
3316
|
+
- **`bareloop restart [--yes]`** (menu 3) → no panel running: `Panel not running — starting it.` and starts. Else the `stop` above (same open-drafts warning and y/N; `--yes` skips it), and only if the panel is really gone (a declined stop starts nothing) the `start` above, trying the port the panel had first (free again) and then the normal first-free-port rule. No new process model, no pid file. `GET /api/whoami` also carries `startedAt` (ISO, set once when the panel process starts); the header shows ` · started MM/DD HH:MM` (local, `dateTimeWords`) after the address and `status` ends its line with it; an older panel without it shows nothing extra.
|
|
3315
3317
|
- **`bareloop stop [--yes]`** → SIGTERM to the pid of EVERY panel the probe finds (one panel at a time; no which-one question), waits until each pid is gone (signal 0) and each port is quiet; a pid still alive at the 10 s deadline is named and exits 1, never `Panel stopped.`. Open drafts (in memory, summed over all found panels) are warned about and a y/N is asked;
|
|
3316
3318
|
`--yes` skips it. Not running: `Panel not running.`, exit 0. Several found: all stopped, `N panels stopped.`. Any other option (e.g. `--port`) is refused in plain words. Runs are separate processes and keep going.
|
|
3317
3319
|
- **`bareloop status`** → header plus `pid N · version X · N draft(s) open · N schedule(s) on`. Exit 0 running, 3 not running. A panel whose version differs from the CLI's shows `(version X — stop and start to use Y)` after its URL in the header (yellow on a terminal).
|
|
3318
3320
|
- **`bareloop install`** → creates only what is missing (folder mode 700, `.env` with the keys-file comment lines, mode 600, `config.json`); never reads a key value;
|
|
3319
|
-
`Already
|
|
3321
|
+
`Already set up. This does not update bareloop. Pick 6 update for that.` when there is nothing to add. Needs node >= 22.
|
|
3322
|
+
- **`bareloop update`** (menu 6; `updateCmd` in `src/launcher.js`, one function for both doors; PRD v1.116) → the ONLY launcher command that goes online, and only when pressed: `GET https://registry.npmjs.org/bareloop/latest` (global `fetch`, 5 s deadline; nothing goes online at start, in the panel or in the background). Versions compare numerically (major.minor.patch). Newest: `You have the newest bareloop (X).` Newer: `bareloop Y is out. You have X.` then `Update now? (y/n) ` on the menu's asker; `y`/`yes` runs `npm install -g bareloop@latest` (no shell, output shown; a 300 s deadline ends the npm child with SIGTERM and counts as not finished) and prints `Updated to Y. Then pick 3 restart.` (from the menu) or `Updated to Y. Then run bareloop restart.` (typed as `bareloop update`), or on a non-zero exit / spawn error `The update did not finish. Run it yourself: npm install -g bareloop@latest` (exit 1); `n`/`no`/`q` prints `Not updated. To update later: npm install -g bareloop@latest`; an empty Enter or other text asks once more, a second ends as `n`; with no terminal (piped or redirected stdin, even if the pipe says `y`; `terminal: false` from `src/cli.js`) or no asker it never installs and prints `To update: npm install -g bareloop@latest`. Any registry failure (timeout, offline, non-200, bad JSON, no version): `Could not reach npm to check. Try again later.`, exit 1. Test seams: `deps.launcher.npmFetch`, `npmSpawn`, `npmDeadlineMs`.
|
|
3320
3323
|
|
|
3321
|
-
|
|
3322
|
-
|
|
3324
|
+
**One menu (PRD v1.114, F245).** Bare `bareloop` prints the header, then `panel: 1 start 2 stop 3 restart 4 status 5 install 6 update`, `jobs: 7 export 8 run 9 resume 10 history` and `q quit`. Each job command asks for what it needs
|
|
3325
|
+
(typed flags skip the question): **export** lists the green runs as numbered `job (run-N)` names, then asks the output folder; **run** asks the bundle (the last 10 known bundles are listed newest first, numbered, as run name + folder; a number picks one, a run name or a folder reaches an older one; none known: `No exported bundles yet. Export one with 7.` and it ends), the repo, then
|
|
3326
|
+
the `$` cap and the time cap (Enter keeps the signed ones); **resume** lists the stopped / capped bundle runs the engine would resume, then offers more money / time; **history** asks the bundle and prints what `bareloop history <bundle>` prints.
|
|
3327
|
+
`q` at any question ends the command cleanly (nothing run, exit `0`). A required question answered with an empty Enter is asked once more; a second empty Enter ends that command with a plain line (nothing chosen, nothing run), exit `0`. `interview`, `author`, `replay` and `runs backfill` are no longer commands
|
|
3328
|
+
(`node scripts/run-replay.mjs`, `scripts/run-interview.mjs`, `scripts/run-author.mjs` run from a source checkout; the library functions the panel uses stay). `run-u` is still dispatched by name (`bareloop run-u <flags…>`: the panel spawns it) but is listed nowhere.
|
|
3323
3329
|
|
|
3324
3330
|
When two key rows share one provider and endpoint, a CLI run uses the FIRST row in the keys list, so put the
|
|
3325
3331
|
key you want first (the panel picks the row by the Model menu).
|
|
3326
3332
|
|
|
3333
|
+
- **`bareloop export ["<job> (run-N)"] [--out <dir>]`** (PRD v1.114; `src/runexport.js`) → a bundle from a GREEN panel / run-u run, by the name the panel shows. No name: the green runs are listed numbered and you pick;
|
|
3334
|
+
no `--out`: the folder is asked. The bundle is the run's OWN signed spec (`closeDecl` kept as signed — no close scripts, nothing edited, same `jobSpecHash`) plus a bridge-v1 record minted with `mintBridge` from the run's saved plan
|
|
3335
|
+
(`bridge-<job>-<runid>.json`, beside its spine) and the run's spine: cost (`job-end` `engagementSpentUsd`, else `spentUsd`), `spendComplete`, wall time (`legsWallMs`), rounds (`readTry`), and the run list's `patient`.
|
|
3336
|
+
A value that cannot be read is refused in plain words naming it, never guessed. **Repo jobs only for now:** a rubric (judged) job, a job that reads a page link and a plain-folder job are refused at $0 with `only repo jobs can be exported for now`
|
|
3337
|
+
and the reason. Each export appends ONE `{type:'exported', runid, job, bundle, bundleHash, at}` row to `runs.jsonl` (ignored by every run-list reader) so `bareloop run "<name>"` finds the bundle. Then `cd <bundle> && npm install`.
|
|
3338
|
+
`exportBundle` takes a spec with `closeDecl` and no `close` (both is a red). Exit `0`, `1` on a refusal. The older form below (`--registry`) is unchanged.
|
|
3327
3339
|
- **`bareloop export <jobs/x.json> --registry <dir> --out <dir>`** → resolves the spec's
|
|
3328
3340
|
close-script paths against the spec file's own directory (never the process cwd), calls
|
|
3329
3341
|
`exportBundle`. On success prints `bundleHash:`, the sorted file list, and "this bundle is
|
|
3330
3342
|
unblessed until its first run greens on the importer's machine." Exit `1` on any red or
|
|
3331
3343
|
missing flag, `0` on success.
|
|
3332
3344
|
|
|
3333
|
-
- **`bareloop run <
|
|
3334
|
-
and **`bareloop run <
|
|
3345
|
+
- **`bareloop run <bundle> --repo <path> [--model <id>] [--budget N] [--wall MIN] [--yes] [--approve <bundleHash>]`**
|
|
3346
|
+
and **`bareloop run <bundle> --resume <runid> [--repo <path>] [...]`** — `<bundle>` is a folder OR the run name it was exported under (`job (run-N)`, found through the `exported` rows in `runs.jsonl`;
|
|
3347
|
+
`src/bundleref.js`). **PRD v1.114 changes to the steps below:** (a) a missing bundle, repo or model is ASKED for (when stdin is a terminal or a caller-handed stream; a bare uninjected pipe gets the usage line, as before) —
|
|
3348
|
+
the model from the Settings-ticked lines, only when the bundle's spec names none and no `--model` is given; an empty Enter asks once more, a second ends the command (exit `0`, nothing run). A guided run
|
|
3349
|
+
(anything asked) also offers the optional `$` cap and time cap (Enter keeps the signed ones). (b) **A cap ABOVE the signed one is allowed with your yes**, at `run` and at `run --resume`: it prints
|
|
3350
|
+
`This raises the $ cap from $X to $Y.` (or the time cap, in minutes), then `Type yes to sign it:`; only `yes` proceeds. With no terminal a raise needs `--yes`, else it is refused at $0 (`envelope-widen`,
|
|
3351
|
+
the sentence says how). The approval is appended to `<bundleDir>/runs/<runid>/approvals.jsonl` as `{type:'cap-raise', who, field, old, new, at, bundleHash, approveHash}` once the engine accepts the run, and the
|
|
3352
|
+
history row carries `capsRaised`. Lowering needs no confirm. A resume's ceiling still folds prior spend. (c) **A green run commits its work on its work branch** (`commitWork`, the panel's own call: everything
|
|
3353
|
+
changed except the arbiter's books and `node_modules`; a green with nothing to commit says so), printed as a `commit` line before `branch`/`worktree`/`merge`. The folder is kept; the merge stays yours.
|
|
3354
|
+
(d) The first run of an UNBLESSED bundle typed at a terminal (the menu) shows the `bundleHash` and asks `Type yes to sign it:`; only `yes` proceeds and counts as the approval, recorded as `{type:'bundle-approve', who, bundleHash, at}` in `approvals.jsonl`. Flags only keeps `--approve <bundleHash>` (`--yes` signs caps, not a bundle). Export's list shows only runs it can take (green with a saved plan, a signed spec, a repo job). — a thin door
|
|
3335
3355
|
(`src/bundlerun.js`) to the same engine `bareloop run-u` drives (`src/userrun.js`): one
|
|
3336
3356
|
runner, so providers, keys (any provider the bundle's spec names — the keys file or env), the
|
|
3337
3357
|
judge, the monthly $ limit, the outside watchdog and the readout are that engine's. The door
|
|
@@ -3341,8 +3361,8 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3341
3361
|
`require.resolve('bareloop')`? A red (`bundle-deps-missing`) prints the exact cure line
|
|
3342
3362
|
(`cd <bundleDir> && npm install`) and stops, exit `1`, before the envelope check, the
|
|
3343
3363
|
blessing check, any key, or any worktree.
|
|
3344
|
-
3. `checkEnvelope(spec, { budgetUsd?, maxWallMs? })` — `--wall` is minutes, converted to ms.
|
|
3345
|
-
A red (an invalid number,
|
|
3364
|
+
3. `checkEnvelope(spec, { budgetUsd?, maxWallMs? })` over the LOWERED / equal fields — `--wall` is minutes, converted to ms.
|
|
3365
|
+
A red (an invalid number) stops here, exit `1`. A field above the signed one is a RAISE (`capRaises`): shown back and signed by `yes` / `--yes`, else `envelope-widen`, exit `1` (see the header above).
|
|
3346
3366
|
4. Blessing — BEFORE any key is read. No `blessing.json` yet: print the bundle's `README.md`
|
|
3347
3367
|
(the operator questions), the "first run" notice + the minting-run line (F128-corrected —
|
|
3348
3368
|
see below), the `bundleHash`, and **require** `--approve <bundleHash>` to match exactly, or
|
|
@@ -3364,8 +3384,8 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3364
3384
|
(P5-R): no new id, run dir or worktree. The resume command a halted leg prints carries that leg's own
|
|
3365
3385
|
`--budget`/`--wall`, only if you passed them (a tightened ceiling never silently reverts to the signed
|
|
3366
3386
|
one). After a MONEY halt the line does NOT repeat the exhausted `--budget` (chain spend is folded, so
|
|
3367
|
-
it would halt again at once); it prints `--budget <more than $<spent so far>,
|
|
3368
|
-
budgetUsd
|
|
3387
|
+
it would halt again at once); it prints `--budget <more than $<spent so far>, above $<signed
|
|
3388
|
+
budgetUsd> asks you to type yes>` for you to fill in, and is not runnable until you do. When the run spent the WHOLE signed
|
|
3369
3389
|
ceiling, that range is empty, so no resume line is printed: the block says no room is left under the signed ceiling. A bundle's spec is
|
|
3370
3390
|
manifest-hashed, so its halt hint never asks you to edit `budgetUsd`.
|
|
3371
3391
|
6. `resolveBundleSpec` (the `$BARELOOP_BUNDLE` substitution) → tighten `budgetUsd`/`maxWallMs`
|
|
@@ -3417,7 +3437,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3417
3437
|
writes `JSON.stringify(row)` — `src/bundle.js`), then every bridge's `listingRow(b)` from
|
|
3418
3438
|
`<bundleDir>/bridges`. Always exit `0`; "(no runs yet)" when `history.jsonl` doesn't exist.
|
|
3419
3439
|
|
|
3420
|
-
- **`bareloop replay <spine.jsonl>`** / **`bareloop replay --all <dir>`** (PANEL-BUILD.md
|
|
3440
|
+
- **`bareloop replay …` LEFT THE CLI (PRD v1.114): it is `node scripts/run-replay.mjs <spine.jsonl>` / `--all <dir>` now (same output, same exit codes; the library is unchanged).** Historical entry: **`bareloop replay <spine.jsonl>`** / **`bareloop replay --all <dir>`** (PANEL-BUILD.md
|
|
3421
3441
|
P0, last of the rung's four tasks) → the read side for the panel's History/Run/Audit/Job
|
|
3422
3442
|
tabs: point it at one run's spine (+ its `-gate-audit.jsonl` sidecar, resolved
|
|
3423
3443
|
automatically) and get `formatReplay`'s one-page report; point `--all` at a directory and
|
|
@@ -3435,7 +3455,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3435
3455
|
this command reports, it never grades), `1` on a missing file/directory or a non-spine
|
|
3436
3456
|
file, `1` with a usage line on no args.
|
|
3437
3457
|
|
|
3438
|
-
- **`bareloop runs`** / **`bareloop runs backfill <dir>`** (PANEL-BUILD.md P1, 2026-09-24
|
|
3458
|
+
- **`bareloop runs`** still prints the run list; **`runs backfill` LEFT THE CLI (PRD v1.114)** (the library's `backfillRuns` stays). Historical entry: **`bareloop runs`** / **`bareloop runs backfill <dir>`** (PANEL-BUILD.md P1, 2026-09-24
|
|
3439
3459
|
rulings — "one home for runs", hamr's option B) → the one run list, at `~/.config/bareloop/
|
|
3440
3460
|
runs.jsonl` (the same directory the keys file, PRD §7d, lives in — outside any repo tree,
|
|
3441
3461
|
never moved into one). This is a LIST, not a relocation: patient copies stay exactly where
|
|
@@ -3549,7 +3569,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3549
3569
|
session is still non-terminal — one authoring session at a time) creates a session
|
|
3550
3570
|
(`src/panel/authorsession.js`) that runs `prepareSource`/`detectLanguage`/`validateJob`/
|
|
3551
3571
|
`authorCloseForJob`/`assembleSpec`/`prepareSigning` in-process, exactly the library calls
|
|
3552
|
-
`
|
|
3572
|
+
`scripts/run-interview.mjs`/`scripts/run-author.mjs` already make — never a script's own readline loop,
|
|
3553
3573
|
never a reimplementation of any gate. `GET /api/author/model-check?provider=<KEY>&model=<id>` is the $0 readiness probe the job card runs
|
|
3554
3574
|
before Start (`checkProviderReachable`, `src/providers.js` — a models-list GET only, never a
|
|
3555
3575
|
completion; the page sees the key's NAME and a status word, never the value). `POST
|
|
@@ -3564,7 +3584,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3564
3584
|
`{ok, sessionId, state}` of the ONE live (non-terminal) session, or `{sessionId:null, state:null}`: a refreshed page
|
|
3565
3585
|
re-attaches to it from the server's session map (nothing is stored page-side). A panel restart mints a new token and
|
|
3566
3586
|
loses the in-memory sessions: the page then shows one "reload this page" line and stops the Chat poll (no auto-reload;
|
|
3567
|
-
drafting money already spent stays booked via `draft-
|
|
3587
|
+
drafting money already spent stays booked via the session's `draft-log.jsonl`, below). `GET /api/author/:id` polls the session's state
|
|
3568
3588
|
(phase, chat messages, cost, `specHash` once prepared). `POST /api/author/
|
|
3569
3589
|
:id/send {text}` answers whatever the confirm turn is currently asking (the `language` pick or a plan's
|
|
3570
3590
|
own follow-up question — the old `worseThanBefore` ask is retired, 2026-09-28) — refused outright when the pending ask is the
|
|
@@ -3586,7 +3606,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3586
3606
|
a test can drive the real ask()-channel/hash wiring without a live provider call;
|
|
3587
3607
|
none of them are reachable from `authorroutes.js`'s real construction path. Sessions live
|
|
3588
3608
|
under `~/.config/bareloop/panel-sessions/<id>/` (each one's own `resolved-spec.json` and
|
|
3589
|
-
`signing.json`, the two files `
|
|
3609
|
+
`signing.json`, the two files `scripts/run-author.mjs` itself already writes). Edit/re-sign, the
|
|
3590
3610
|
`~/.config/bareloop/.env` keys-file loader, and Settings have landed (P4a/P4b — see "Settings" below).
|
|
3591
3611
|
|
|
3592
3612
|
- **Panel P5 — the Ended block (`docs/product/PANEL-BUILD.md` Addendum 2026-10-02, item 1)** →
|
|
@@ -3641,7 +3661,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3641
3661
|
started under is never overwritten, and a run resumed under `r<k>` is resumed again under the
|
|
3642
3662
|
spec whose hash its `job-start` carries. The spawn is `setsid --wait systemd-inhibit node
|
|
3643
3663
|
bin/bareloop.mjs run-u --spec <spec> --resume <runid> --approve <hash>` (array argv, detached,
|
|
3644
|
-
log `
|
|
3664
|
+
log appended to the folder's one `run.log` beside the spec, under a header line `== resume <runid> at <ISO> ==` (Accept, Rerun and Pause append there too; a refusal shows only its own action's lines, read from after the header); `--draft-spent-usd`/`--draft-spend-incomplete`
|
|
3645
3665
|
ride along from the run's `job-start`, so the one cap still covers drafting). `--wait` hands back
|
|
3646
3666
|
the engine's own exit code: an exit inside the settle window (6s) is the engine's own refusal and
|
|
3647
3667
|
the log tail is returned as `error` verbatim; otherwise `{ok:true, runid, specHash, capsChanged,
|
|
@@ -3800,11 +3820,12 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3800
3820
|
over this same `src/userrun.js:main`, not rewired to go through `src/cli.js`.
|
|
3801
3821
|
**Printed commands are spelled the way you entered:** every re-invocation these flows print (the approve
|
|
3802
3822
|
line, resume, pause, reopen, the interview's run-author line, the author's run-u line) reads `bareloop
|
|
3803
|
-
run-u …`
|
|
3804
|
-
the source-tree adapters
|
|
3823
|
+
run-u …` when reached through `bareloop`, and `node scripts/run-u.mjs …` only through
|
|
3824
|
+
the source-tree adapters; `interview` and `author` left the CLI (PRD v1.114), so they are always spelled
|
|
3825
|
+
`node scripts/run-interview.mjs` / `node scripts/run-author.mjs` — the tarball ships no `scripts/`. One owner: `commandFor` (`src/invoke.js`),
|
|
3805
3826
|
fed by each flow's `deps.invokedAs`.
|
|
3806
3827
|
|
|
3807
|
-
- **`bareloop interview <flags…>`** (PANEL-BUILD.md P0 task 3/4) → the close-authoring
|
|
3828
|
+
- **`bareloop interview` LEFT THE CLI (PRD v1.114): `node scripts/run-interview.mjs <flags…>` is the door; its "run it now" offer starts `scripts/run-author.mjs`.** Historical entry: **`bareloop interview <flags…>`** (PANEL-BUILD.md P0 task 3/4) → the close-authoring
|
|
3808
3829
|
interview, at the terminal, one question at a time (D10; `docs/wiki/FINDINGS.md`'s
|
|
3809
3830
|
interview surface). `src/cli.js`'s `interview` dispatch hands `rest` straight to
|
|
3810
3831
|
**`src/interviewrun.js`'s own `main(argv, deps)`**, unparsed — the same one-owner shape
|
|
@@ -3823,7 +3844,7 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3823
3844
|
`stderr` (the raw streams, not the wrapped `out`/`err` line-functions every other command
|
|
3824
3845
|
here uses) rather than re-deriving them.
|
|
3825
3846
|
|
|
3826
|
-
- **`bareloop author <flags…>`** (PANEL-BUILD.md P0 task 4/4) → the authoring pipeline: a
|
|
3847
|
+
- **`bareloop author` LEFT THE CLI (PRD v1.114): `node scripts/run-author.mjs <flags…>`.** Historical entry: **`bareloop author <flags…>`** (PANEL-BUILD.md P0 task 4/4) → the authoring pipeline: a
|
|
3827
3848
|
real scout over a real repository, a real model filling the close declaration, D9's three
|
|
3828
3849
|
mechanical gates, stopping at `prepareSigning` (it never signs and never runs the job —
|
|
3829
3850
|
signing and running are `run-u`'s territory). `src/cli.js`'s `author` dispatch hands `rest`
|
|
@@ -3858,9 +3879,10 @@ key you want first (the panel picks the row by the Model menu).
|
|
|
3858
3879
|
(`Cap $ − drafting spent`) as ITS own ceiling. Nothing here is left for a person to
|
|
3859
3880
|
hand-compute or re-type, the same rule F185 set for `--spec`.
|
|
3860
3881
|
|
|
3861
|
-
**
|
|
3862
|
-
bundle's own signed `budgetUsd`/`maxWallMs`
|
|
3863
|
-
|
|
3882
|
+
**Lowering is free; raising needs your yes.** `--budget`/`--wall` on `bareloop run` may lower the
|
|
3883
|
+
bundle's own signed `budgetUsd`/`maxWallMs` freely (`checkEnvelope` stays tighten-only). A number above the signed one is a RAISE
|
|
3884
|
+
(`capRaises`): shown back in words and signed by typing `yes` at a terminal (or `--yes`), recorded as a `cap-raise` line in the run's
|
|
3885
|
+
`approvals.jsonl`; with no terminal and no `--yes` it is refused at `$0` as `envelope-widen`.
|
|
3864
3886
|
|
|
3865
3887
|
**First-run approval, blessing, no-resign.** The bundle's own signed `bundleHash` is what a
|
|
3866
3888
|
human reads and accepts with `--approve` on the run that first blesses it. That first GREEN
|
|
@@ -3905,12 +3927,12 @@ yourself if you want a tarball.
|
|
|
3905
3927
|
|
|
3906
3928
|
No model is called anywhere in learnings (a test walks the import closure). Pure rules in `learn.js`; file IO in `learnstore.js`.
|
|
3907
3929
|
|
|
3908
|
-
- **Setting:** `learningHints` (`true`/`false`) in `config.json`, absent =
|
|
3909
|
-
- **Run end:** `execute` (`src/userrun.js`, shared by the panel, the CLI and the bundle runner) calls `learnAtRunEnd({ home, runid, events, auditFiles, spec, specHash, workdir, trust })` once, right after the claim settles, in its own try/catch: a failure prints one WARNING and never changes the verdict, exit code or spend. It writes nothing when the engine has no config home.
|
|
3930
|
+
- **Setting:** `learningHints` (`true`/`false`) in `config.json`, absent = ON (default ON since 2026-10-24; only an explicit `false` turns it off). OFF still writes the tally at run end; it only means the planner is handed nothing.
|
|
3931
|
+
- **Run end:** `execute` (`src/userrun.js`, shared by the panel, the CLI and the bundle runner) calls `learnAtRunEnd({ home, runid, events, auditFiles, spec, specHash, workflowKey, workdir, trust })` once, right after the claim settles, in its own try/catch: a failure prints one WARNING and never changes the verdict, exit code or spend. It writes nothing when the engine has no config home.
|
|
3910
3932
|
- **Cards:** `buildCards({ runid, events, audit, workdir, spec, model, questions })` → `{ cards, suspect, thin, noise }`. FIXED = a check red then the same check passes later in the run; NEVER FIXED = still red at run end. Excluded and counted: noise runs (provider-red, close-crashed, worker-crash, no close spoke), CHECK-SUSPECT (a no-suppressions hit on a prose comment), TOO-THIN (no error kind and no fix files). Written files come from `attempt-diff` events and the gate audit's allow write/edit rows relative to the tree.
|
|
3911
3933
|
- **Fold:** `cardsMatch` / `foldCards`: same job + check, a shared error kind, Jaccard >= 60% on flagged-text tokens (a fit on known cards, not a proof). Code-less cards (kind `other`) fold on the text rule alone, only when both token sets are non-empty (R1, 2026-10-23: UNTESTED on real data; the 60% was fitted on cards with codes). `kindAgrees` is the one kind test.
|
|
3912
|
-
- **Ledger** `<config home>/learn/ledger.json` (mode 600, atomic, secrets masked): rows `{ id, lesson, count, sample, models, workflow, place, level, trust, runIds, firstSeen, lastSeen, specHash }
|
|
3913
|
-
- **Reading:** `hintsForRun({ home, spec,
|
|
3934
|
+
- **Ledger** `<config home>/learn/ledger.json` (mode 600, atomic, secrets masked): rows `{ id, lesson, count, sample, models, workflow, place, level, trust, runIds, firstSeen, lastSeen, specHash, workflowKey }` (`workflowKey` is the job version; a row without it, written by an older version, matches any version), plus `pending` (holds an older version wrote for rubric runs; new runs write none), `suspect`, `health`. There is no check-wide set-aside (R2, 2026-10-23): a lesson seen in several jobs climbs by the climb rules and is read at its level; all-jobs hints come last. `countLedger` (+1 per run per row), `releasePending` (an OLD hold, written by v0.46.x, counts on the human Accept; `releaseRun` is called from the door's accept path; a rubric run's lessons now count at run end like a deterministic run's, trust `rubric` kept, and `foldRunIntoLedger` returns `held: 0`; reuse/bridge credit still waits for the Accept). A row already holding the run id (a resumed leg, one id) is refreshed from the new card (sample, lesson, key, lastSeen, hash, key, place) but its count, model tally and run ids do not move, `climb` (the level of a lesson, derived at read time by `readableRows` from the rows not decayed at that moment: it can go back down when siblings age past 56 days; the file stores `workflow` only and ignores an older stored level). The ledger keeps EVERY row (nothing is deleted, no `expired` flag is stored; hamr 2026-10-23). Memory is the filter: `readableRows` / `renderHints` skip a row last seen more than 56 days ago (`isDecayed`) and a workflow row of another workflow key (`otherJobVersion`; a cap, time, source, destination, inputs or model change keeps the lessons); a lesson seen again counts +1 on its old row. Old files with `status`/`expiredBy` still load; the fields are ignored and dropped at the next write.
|
|
3935
|
+
- **Reading:** `hintsForRun({ home, spec, workflowKey })` renders once at run start; `runJob(..., { learnHints: { text, ids } })` → `runPlan` hands it to the PLANNER at the draft and the first replan only, and emits a `learnings` spine record with the exact text. An unreadable ledger file hands the planner nothing, never stops the run, and is not silent: `handedHints` returns the reason and the engine emits a `learnings` record `{phase:'draft', hintsError}` (no `text`); the Audit run detail carries `learningsError` (the plain line from `hintsErrorLine`, home folder written `~`; the spine keeps the full reason) and the learnings box prints it under the title "No lessons were given to the planner" (with hints the title stays "What the planner was told from earlier runs"). `renderHints(ledger, { workflow, place, workflowKey, now })` is the one render (this job, then this place, then all-jobs, highest count first, 2,000 characters, a hint whole or not at all; all-jobs hints last); a FIXED hint adds `What changed:` (first 3 `+`/`-` lines of the stored diff, 150 chars each, then `(+N more)`; never on NEVER FIXED) and a repeated path in a hint reads as its basename (R3, R5, 2026-10-23); the spine's recorded text is byte-equal to a fresh `renderHints(...).text` from the ledger as it stood. The Audit run detail carries `learnings` (read-only); its header counts DISTINCT hints (the same ledger row handed at the draft and the first replan counts once).
|
|
3914
3936
|
|
|
3915
3937
|
### Settings — the keys file, `config.json`, the monthly $ limit, the Providers tab (PANEL-BUILD.md P4a, `src/keysfile.js`, `src/config.js`, `src/monthly.js`, `src/providerrows.js`, `src/panel/settingsroutes.js`)
|
|
3916
3938
|
|
|
@@ -3925,7 +3947,7 @@ Two files in `~/.config/bareloop/`, outside any repo:
|
|
|
3925
3947
|
real one). The CLI (`run-u`, `interview`, `author`) and the panel both use it.
|
|
3926
3948
|
- **`config.json` — every setting, never a key value.** `readConfig({ home })` /
|
|
3927
3949
|
`updateConfig(patch, { home })` (atomic tmp + rename, mode 600, unknown fields kept).
|
|
3928
|
-
Fields: `learningHints` (true/false; absent =
|
|
3950
|
+
Fields: `learningHints` (true/false; absent = on; see "Cross-run learnings"), `monthlyLimitUsd` (number above 0; absent or `null` = no limit; any other value present
|
|
3929
3951
|
is a `ConfigError`, refused like an unreadable file), `keys.<ENV NAME>` = `{ shape, baseUrl, legacyMaxTokens }` (the Providers rows' settings: an API shape id, the typed Base URL,
|
|
3930
3952
|
the "old max_tokens" tick), `models.<ENV NAME>` = a list of `{ model, use, inPerM?, outPerM? }` lines (replaced WHOLE on every save; the customer's own price below). Nothing is built
|
|
3931
3953
|
in: a row with nothing saved is shape `openai-api`, no address, no lines. A secret-shaped
|
|
@@ -3956,14 +3978,15 @@ spends; the CLI prints it to stderr, exit 2) and at the panel's Sign & run (`sig
|
|
|
3956
3978
|
same text under `#jf-cap-money` via `GET /api/author/monthly-check?cap=`. "This month" is the local
|
|
3957
3979
|
calendar month; a died or incomplete-spend run makes the total an "at least" figure.
|
|
3958
3980
|
|
|
3959
|
-
*Drafting spend that never became a run* (2026-10-05, F213). A panel authoring session
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3981
|
+
*Drafting spend that never became a run* (2026-10-05, F213). A panel authoring session appends one `call` line
|
|
3982
|
+
(`{ ..., model, provider, baseUrl, costUsd, unpricedRounds, at }`) to `<session dir>/draft-log.jsonl` after every
|
|
3983
|
+
metered call, so an abandoned, refused or restarted session's drafting money is not lost (there is no second
|
|
3984
|
+
total file: `draft-spend.json` is no longer written, and a folder left by the old shape that has the file and no call
|
|
3985
|
+
lines is still read from it). `readLegs` (hence `monthSpend`, `spendSummary`, `checkMonthlyRoom` and the Money
|
|
3986
|
+
tab) folds the call lines with `tallyCalls` for every `<home>/panel-sessions/<id>/` whose folder holds no listed run's `spine` or
|
|
3964
3987
|
`patient` (a signed run already carries its drafting spend via `--draft-spent-usd`; no double count). It lands in
|
|
3965
|
-
the month of
|
|
3966
|
-
unreadable
|
|
3988
|
+
the month of the first call, under the provider row it was drafted on; an unpriced call, a torn log line or an
|
|
3989
|
+
unreadable log makes the figure an "at least". It is not a run: no wall, not in the `runs` count.
|
|
3967
3990
|
|
|
3968
3991
|
*Hold until done.* A run CLAIMS the limit when it starts and holds it until it is done — no lock file,
|
|
3969
3992
|
records only. `claimRun` (`src/monthly.js`) writes the run's row FIRST (it carries its `pid` and
|
|
@@ -4434,16 +4457,17 @@ A **Rubric** job whose first Input is the full path of a FILE (not a repo folder
|
|
|
4434
4457
|
|
|
4435
4458
|
### Required facts — a line that finds, lists or looks something up (Part 1b, `src/facts.js`, `docs/product/ITEM33-BUILD.md` "Addendum 2026-10-13" and "Part 1c", PRD item 33 RF1–RF22)
|
|
4436
4459
|
|
|
4437
|
-
Check what the person asked for, not what the worker chose to write. bareloop needs bareguard `^0.
|
|
4460
|
+
Check what the person asked for, not what the worker chose to write. bareloop needs bareguard `^0.26.0` (`cited` + `decides`, bind-only and `text` decides, word-edge anchors; 0.24 lets money currency/unit be lists, ruling #65; bareloop facts now carry them, see "Currency and unit lists" below; 0.25 returns `full.evidence`, the spans the Result tab marks, see `rubric-evidence`).
|
|
4438
4461
|
|
|
4439
4462
|
- **The part.** A `rubric-step` stage's `params.parts` may hold ONE part of `class: "fact"` (a line that finds, lists or looks up): `{ text, class: "fact", source: <input label>, facts: [{ name, shape, unit? | currency?, phrase?, anchor?, until?, rule?, aiProposal? }], count?: { min?, max? }, rules?: [n], covers?: [n] }`. `shape` is `money | number | date | time | phrase | text`; `rule` is `{ op: lt | lte | gt | gte, value }` or `{ op: "between", lo, hi }` (not on `text` or `phrase`); `money` names at least one of `unit` (the input's own words, e.g. `"US dollars"`) or `currency` (`$ € £`), and may name both, each one value or a list (below); `phrase` carries the fixed `phrase` the quote must contain; `anchor` / `until` are labels copied VERBATIM from the input. A fact name is letters, spaces, `_` or `-` only (it is written into the claim text bareguard scans for numbers). A line with a fact part has no word, section or claim-count parts (a drafting red). Code fills `tested` (the early-test evidence) and `sample` (what the drafter saw of a big input) into the signed part; a model-written one is replaced.
|
|
4440
4463
|
- **The step file.** `output/steps/<n>.json` of a facts line is `{ "results": [ { "quote": "...", "values": { "<fact name>": "<value as the quote writes it>" } } ] }` — no free text, no `cites`. ONE quote per result holds all its facts, so a worker cannot mix a price from one result with a time from another. `buildStepSpec` makes one bareguard `cited` check with `decides` (the fact's index is its `d<j>` key; a phrase fact is a presence decide and takes no value). The claim text is written by CODE from the values (`name: value; ...`); a `count` becomes `min` / `max` on the number of results. Every value is compared by shape and exactly (`8:15 AM` equals `08:15`, `389` equals `389.00`); a red names the result and the fact in plain words (`plainFactItem`). A JSON number in `values` is read as the string it prints as.
|
|
4441
4464
|
- **No record cutting (Part 1c).** A fact part carries no `record`, `tested` or `sample` (a `record` field is an unknown-field red). The worker's brief says "one quote per result, copied from that result's own text" (bareguard's quote cap of 4000 characters stays its own). Drafting does not grade: it only proves each fact CAN be checked (below).
|
|
4442
4465
|
- **Repeat rule (Part 1c M1, M4).** On a fact line asking for N results (`count.min`), `checkFactWords` (`src/factwords.js`, the one owner) refuses at $0 an anchor label the label list counts fewer than N times (`rubric-fact-label-rare`) and a `phrase` fact whose words `countPhrase` finds in the input fewer than N times (`rubric-fact-phrase-rare`); count 1 or none keeps a once-only one legal. `RUBRIC_RULES` states both.
|
|
4443
4466
|
- **The look, then the draft (Part 1c; the default look is now the page-word map, next bullet).** For a rubric job on files, `authorCloseForJob` runs the look (`lookFn`, default `runPageMap`; the older search-and-read `runInputLook` in `src/authorscout.js`, pure parts in `src/inputlook.js`, is unwired from the default path) on the frozen input text BEFORE the confirm turn and the draft, when a `provider` is present (`lookFn: null` = no look; a panel test that replaces `generate` gets none unless it passes `lookFn`). Read-only by construction: tools `search_input` / `read_input` over in-memory text, `LOOK_ROUNDS` 8, a reserved final round whose only tool is the strict answer form `report_look`, spend metered into the drafting book (`calls` absorbed like the repo scout's). Its report (facts with a label picked from the list, prose lines, not-found entries) is verified by code (`verifyLookReport`: a label off the list, an unknown shape/line/input, or a phrase not in the source is moved to not-found, named) and rendered into the drafter's prompt (`renderLookReport`); a failed or reportless look is an ABSENT survey and stops drafting at $0 (`scout-absent`, "the first look at your repo or input did not complete"). Every place, date or name in the job line is a fact too, bound to the label before it (a direction = phrase facts `Leaves <place>` / `arrives at <place>`); prose lines and their `~` limits are not looked up.
|
|
4444
|
-
- **The page-word map (idea A core, `src/pagemap.js`, `src/pagerules.js`, `docs/product/ITEM33-BUILD.md` "Addendum 2026-10-18 — Idea A core").** The default `lookFn` is `runPageMap`: ONE AI call per page input (the job's drafter identity, thinking off, booked per call into `draft-
|
|
4445
|
-
- **Currency and unit lists (idea A core, `src/facts.js`).** A money fact's `unit` and `currency` may each be one string (every spec signed before lists) or a non-empty list: at most 3 currencies (`$ € £` only; a code like `EUR` is a unit) and 10 units, none repeated, a unit at most 100 characters, enforced by our own plain reds before bareguard is asked. A string reads exactly as a one-element list and is never rewritten, so an old signed spec keeps its bytes and hash. The first listed form is the primary one in the plan row and the worker brief; others read "or". `checkFactWords` requires EVERY listed unit and sign to be on the page.
|
|
4467
|
+
- **The page-word map (idea A core, `src/pagemap.js`, `src/pagerules.js`, `docs/product/ITEM33-BUILD.md` "Addendum 2026-10-18 — Idea A core").** The default `lookFn` is `runPageMap`: ONE AI call per page input (the job's drafter identity, thinking off, booked per call into `draft-log.jsonl`, cap checked before each call) maps the job to the page's OWN words as `{"facts":[{name, from, shape: place|money|time|phrase, words, currency?, unit?}]}`; it takes the old look's arguments and returns the same envelope. Plain code then keeps or drops each word (`applyPageRules(text, mapping, jobLines)` -> `{ facts, dropped }`, pure, ported from the frozen POC): found-on-page (count >= 1), N2 (a label written 2+ times inside one page line is unusable), R1 (a second label stays only if it reads the same values as the first), U1 (a label the page writes AFTER the number, "EUR 490 total", becomes a unit; a label with no number either side is dropped), R1L (a unit/currency form stays only if it reads the same numbers as the primary form; units first; before R1L the forms are sorted by code - a sign is a currency, any other form a unit, whichever box the AI used), S1 (a fact name that counts results is refused; two facts may not share shape AND label). After the rules, `dryReadMoney` (`src/pagedry.js`, called by `runPageMap`) grades an honest claim on every result line with the run's own checker; a money fact that reads none is left under Not checked (`reads-no-result`); then `dryReadPhrases` reads each kept phrase fact against those same result lines (the lines the job's kept money facts read) and drops a phrase found in none of them whole as `phrase-no-result` (Not checked: `"Rome" is on the page but in none of its results, so it is not checked.`); with no kept money fact the result lines are unknown and phrase facts pass untouched. The AI never grades; the answer is read strictly (no JSON repair): a malformed or truncated answer is retried ONCE, twice is the plain stop "The AI's answer about the page was not readable twice. Nothing was signed." (an ABSENT survey; a draft is not a run, so no Resume); one retry on a transport error (booked unpriced, so `spendComplete=false`) or a 429 (the vendor's stated wait). The scrubbed raw answer rides each call into `draft-log.jsonl` (`call.raw`), unsigned, so a run can be replayed at $0. A drafted fact may use only words the map KEPT: a signed anchor, closing label, unit or currency that was dropped is the red `rubric-fact-word-dropped` with the drop's reason, and an anchor must be a kept label (`rubric-fact-label-off-list`, now against the kept set).
|
|
4468
|
+
- **Currency and unit lists (idea A core, `src/facts.js`).** A money fact's `unit` and `currency` may each be one string (every spec signed before lists) or a non-empty list: at most 3 currencies (`$ € £` only; a code like `EUR` is a unit) and 10 units, none repeated (two units that differ only in spaces are one unit, bareguard 0.26: the page-rule pool trims and collapses spaces so twins collapse, and the shape check says it in our own words), a unit at most 100 characters, enforced by our own plain reds before bareguard is asked. A string reads exactly as a one-element list and is never rewritten, so an old signed spec keeps its bytes and hash. The first listed form is the primary one in the plan row and the worker brief; others read "or". `checkFactWords` requires EVERY listed unit and sign to be on the page.
|
|
4446
4469
|
- **No silent drop (idea A core, `src/pagedropwords.js`, `withDropNotes` in `src/rubricstep.js`).** Every word, fact or `~` rule the page rules drop is shown as Not checked with a plain sentence from ONE table (no other file writes a drop reason). Before validation `withDropNotes` appends to the declaration: `closeDecl.refused` `{ line, rule, reason }` for a dropped fact whose `~` rule no part carries (never a line-level refusal; a rule the drafter already listed is not listed twice), and one line in `closeDecl.notes` for any other drop, including a word cut from a fact that is still checked. Those word-level lines are not "Not checked": `splitReadNotes` / `isReadNote` (`src/pagedropwords.js`) sort a row whose every sentence only says which written form of a still-checked fact was not used (not on the page, listed twice, not the same values, list limits, and an `s1` copy of a fact that is still signed) into `readNotes`, shown in their own fold "How the page was read · N" right after Not checked (plan card, Job tab, Result tab `readNotes`, CLI confirm menu) and not counted in it; a whole fact left out (`no-label`, `reads-no-result`, `phrase-no-result`, an `s1` copy of an unsigned fact) stays Not checked. The signed fact names come from `signedFactNames(closeDecl)` (older specs too) or the look at the confirm turn (`plan.signedFacts`). The confirm card gets the same lines (`plan.notChecked`) before drafting is paid for, and the drafter's look block says `NOT CHECKED (rule n)` / `LEFT OUT`. Nothing about this changes a signed spec's verdict rules; it is the Not checked list, in the person's words.
|
|
4470
|
+
- **Time facts get the dry read (F236/F237, `dryReadTimes` in `src/pagedry.js`, called by `runPageMap` between the money and phrase dry reads).** For each kept time fact with a label, the candidate lines are every page line holding a label word with a clock time (H:MM or HH:MM, optional AM/PM) somewhere after it; each is graded as an honest claim (quote = the line, value = its first time after the label, fact `{shape:'time', anchor: label}`, no window) by the run's own `gradeStep`. A fact with no green line is dropped whole as `reads-no-time` and stays Not checked: `the page never shows a time right after "<label>", so it is not checked.` (rendered like its neighbours: `line 1: "<the ~ rule>" — the page never shows a time right after "Departure time", so it is not checked.`). It catches an impossible label only; a label that reads a wrong time is kept and left to the person at Accept. Other shapes, and a time fact with no label word, pass through untouched.
|
|
4447
4471
|
- **Labels are picked, never typed (`src/labelscan.js`).** `scanLabels(text)` lists, per shape (money, number, date, time, text), the words right before each value with counts (top 40 per shape; one generic scan, no per-site table; a page reader's `[ref=N]` tags are ignored). `labelOnList(scan, shape, idOrText)` is the one test (id or exact words, white-space blind). The look and the drafter pick labels only from the list shown in the prompt (`renderLabelList`). Fact-line reds are plain sentences; the confirm step and the drafter share one rule text (`RUBRIC_RULES`), and the drafter's per-shape field guide is generated from bareguard's `rubricVocabulary`.
|
|
4448
4472
|
- **Found-once check (`src/factwords.js`, `checkDeclarationWords`, run after validation in `authorClose`).** Every anchor must be on the input's label list for its shape, and every `until`, phrase and unit must be in the source once (white-space blind: U+202F, U+00A0; phrases whole-word, case-blind). A miss is a red naming the word and the input: `rubric-fact-label-off-list`, `rubric-fact-word-missing`, `rubric-fact-unread` (an input that cannot be read is a red, never a skipped check). Nothing is graded; finding and grading are the run's and the close's job.
|
|
4449
4473
|
- **No silently dropped rule (RF16).** When a close holds a fact part or any part with `rules`, every `~` rule of every job line must be carried out by a part (its number in the part's `rules`, 1 = the first `~` rule) or listed in `refused` as `{ line, rule, reason }`, or its whole line refused; a rule that is none is a $0 red (`rubric-rule-dropped`). `refused` entries may now carry `rule`. A number the person did not write (a bound not found in the line's own words) must be marked `aiProposal: true` (the card says "AI's proposal — check it"), and an AI-proposed time limit must be `between`, never one-sided (RF17).
|
|
@@ -4481,5 +4505,5 @@ For an integrating agent reading a run's record:
|
|
|
4481
4505
|
- **`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.
|
|
4482
4506
|
- **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.
|
|
4483
4507
|
- 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`.
|
|
4484
|
-
- **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 asks `... I can't check this on the page. Drop it?`. Readings come first, then can't-check asks. `agree` (or `yes`) writes the reading as a `~` rule in plain words, so the bound is the person's own and the fact signs plain; a typed answer is the `~` rule instead; `drop it` on a can't-check ask adds no rule and leaves it Not checked. `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' | 'cant-check'` (and `reading` for the agree text) through `normalizeQuestions`.
|
|
4508
|
+
- **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 asks `... I can't check this on the page. Drop it?`. Readings come first, then can't-check asks. `agree` (or `yes`) writes the reading as a `~` rule in plain words, so the bound is the person's own and the fact signs plain; a typed answer is the `~` rule instead (F240: a leading agree word directly followed by a comma or colon, as in `yes, check it as ...` or `agree: ...`, is stripped by `stripAgreeLead` in `src/pagemap.js` before the rule is signed; a bare space, a hyphen or any dash after the word is not a separator, so `yes-no questions only` is kept whole); `drop it` on a can't-check ask adds no rule and leaves it Not checked. `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' | 'cant-check'` (and `reading` for the agree text) through `normalizeQuestions`.
|
|
4485
4509
|
- **The fit check (F243, `src/fitcheck.js`; `docs/product/ITEM33-BUILD.md` "Addendum 2026-10-21 — fit check build spec").** Rubric jobs only, once, after the inputs are frozen and the content gate passes and BEFORE the look; it runs only when the caller passes the answer seam `fitAsk` to `authorCloseForJob` (the panel; the CLI door and any test without it never run it; `fitFn: null` = no check). `runFitCheck` makes ONE AI call (the drafter identity, the drafting thinking rule, label `fit-check`, cap checked before the call) that splits each job line (no `~` rules) into asks copied from that line and quotes the page for each; plain code (`decideFit`) decides: an ask is found only if `found` is true AND its quote is on an input (whitespace and case ignored), a found-with-off-page-quote is `madeUp` and counts as not found, a reply with an ask not copied from its line or a line with no ask is malformed (one retry). All found = `fits` (nothing shown); any not found = `ask`: one question through the panel `ask` seam (`I found X of Y of your asks on this page. Not found: <ask> (line N), .... Type go on to keep drafting, or anything else to stop and change the job or the page.`); `go on` continues to the look, anything else stops `fit-stopped` (plain words in `draftStopText`), no answer is `confirm-abandoned`. The answer is not a `~` rule and changes nothing in the job. Failure is OPEN: a cut, two unreadable replies, a failed call or a cap stop is `absent`, chat says "The fit check did not finish; drafting goes on." and drafting goes on. The result is one `fit-check` row in `draft-log.jsonl`.
|
package/bin/bareloop.mjs
CHANGED
|
@@ -19,5 +19,7 @@ const code = await main(process.argv.slice(2), {
|
|
|
19
19
|
stderr: process.stderr,
|
|
20
20
|
cwd: process.cwd(),
|
|
21
21
|
stdin: process.stdin,
|
|
22
|
+
// a pipe or </dev/null is read (the menu takes its choices from it) but never asked a missing argument
|
|
23
|
+
interactive: Boolean(process.stdin.isTTY),
|
|
22
24
|
});
|
|
23
25
|
process.exitCode = code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bareloop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.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",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"bare-agent": "^0.52.0",
|
|
31
|
-
"barebrowse": "^0.
|
|
32
|
-
"bareguard": "^0.
|
|
31
|
+
"barebrowse": "^0.24.1",
|
|
32
|
+
"bareguard": "^0.26.0",
|
|
33
33
|
"litectx": "^0.32.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|