bareloop 0.54.0 → 0.55.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/bareloop.context.md +73 -12
  3. package/package.json +3 -3
  4. package/src/authorflow.js +148 -46
  5. package/src/authoring.js +21 -4
  6. package/src/authorjob.js +82 -3
  7. package/src/authorreadout.js +20 -3
  8. package/src/authorrun.js +1 -1
  9. package/src/authorscout.js +9 -6
  10. package/src/bridges.js +4 -3
  11. package/src/cardschedule.js +42 -0
  12. package/src/carrystore.js +1 -1
  13. package/src/checkpick.js +576 -0
  14. package/src/checksuggest.js +28 -0
  15. package/src/checkwords.js +25 -0
  16. package/src/cli.js +1 -1
  17. package/src/config.js +24 -1
  18. package/src/declaredclose.js +1 -1
  19. package/src/destpoint.js +149 -0
  20. package/src/draftspend.js +39 -0
  21. package/src/factwords.js +14 -1
  22. package/src/job.js +81 -1
  23. package/src/jobblock.js +9 -0
  24. package/src/labelscan.js +11 -0
  25. package/src/launcher.js +10 -6
  26. package/src/learn.js +6 -4
  27. package/src/mcpchecks.js +52 -0
  28. package/src/mcppick.js +36 -0
  29. package/src/mcpsources.js +77 -0
  30. package/src/mcpuse.js +97 -0
  31. package/src/natural.js +23 -0
  32. package/src/pagemap.js +5 -2
  33. package/src/panel/authorroutes.js +90 -15
  34. package/src/panel/authorsession.js +183 -21
  35. package/src/panel/index.html +686 -26
  36. package/src/panel/jobgrid.js +117 -0
  37. package/src/panel/jobplan.js +31 -15
  38. package/src/panel/scheduler.js +80 -13
  39. package/src/panel/schedules.js +189 -28
  40. package/src/panel/schedulestart.js +44 -13
  41. package/src/panel/server.js +438 -33
  42. package/src/panel/settingsroutes.js +133 -3
  43. package/src/panel/status.js +22 -2
  44. package/src/panel/tickets.js +44 -0
  45. package/src/pickrecord.js +145 -0
  46. package/src/plan.js +31 -2
  47. package/src/planrun.js +71 -15
  48. package/src/prcheckout.js +259 -0
  49. package/src/readshim.js +3 -2
  50. package/src/replay.js +6 -0
  51. package/src/reuse.js +3 -3
  52. package/src/revises.js +56 -0
  53. package/src/rubricstep.js +62 -16
  54. package/src/run.js +10 -1
  55. package/src/runexport.js +2 -0
  56. package/src/runlist.js +3 -2
  57. package/src/schedulewords.js +46 -4
  58. package/src/source.js +81 -7
  59. package/src/stepmcp.js +86 -0
  60. package/src/ticket.js +113 -0
  61. package/src/ticketfilter.js +76 -0
  62. package/src/ticketlabels.js +79 -0
  63. package/src/ticketmcp.js +111 -0
  64. package/src/ticketnext.js +35 -0
  65. package/src/ticketrepo.js +98 -0
  66. package/src/ticketschedule.js +32 -0
  67. package/src/ticketshape.js +45 -0
  68. package/src/tools.js +9 -0
  69. package/src/trigger.js +14 -2
  70. package/src/triggerclock.js +7 -3
  71. package/src/triggerfiles.js +19 -11
  72. package/src/triggertickets.js +244 -0
  73. package/src/u-readout.js +2 -2
  74. package/src/userrun.js +146 -10
  75. package/src/validate.js +3 -1
  76. package/src/worktree.js +43 -1
  77. package/types/authorflow.d.ts +128 -28
  78. package/types/authorjob.d.ts +16 -3
  79. package/types/authorreadout.d.ts +9 -2
  80. package/types/authorscout.d.ts +4 -2
  81. package/types/bridges.d.ts +4 -3
  82. package/types/cardschedule.d.ts +24 -0
  83. package/types/checkpick.d.ts +297 -0
  84. package/types/checksuggest.d.ts +30 -0
  85. package/types/checkwords.d.ts +14 -0
  86. package/types/config.d.ts +7 -0
  87. package/types/destpoint.d.ts +87 -0
  88. package/types/draftspend.d.ts +16 -0
  89. package/types/factwords.d.ts +7 -0
  90. package/types/job.d.ts +13 -0
  91. package/types/jobblock.d.ts +9 -0
  92. package/types/labelscan.d.ts +7 -0
  93. package/types/launcher.d.ts +7 -2
  94. package/types/mcpchecks.d.ts +8 -0
  95. package/types/mcppick.d.ts +33 -0
  96. package/types/mcpsources.d.ts +51 -0
  97. package/types/mcpuse.d.ts +15 -0
  98. package/types/natural.d.ts +2 -0
  99. package/types/pagemap.d.ts +2 -1
  100. package/types/panel/authorroutes.d.ts +11 -2
  101. package/types/panel/authorsession.d.ts +58 -3
  102. package/types/panel/jobgrid.d.ts +405 -0
  103. package/types/panel/jobplan.d.ts +10 -4
  104. package/types/panel/scheduler.d.ts +7 -2
  105. package/types/panel/schedules.d.ts +124 -4
  106. package/types/panel/schedulestart.d.ts +21 -3
  107. package/types/panel/server.d.ts +427 -6
  108. package/types/panel/settingsroutes.d.ts +4 -2
  109. package/types/panel/status.d.ts +16 -2
  110. package/types/panel/tickets.d.ts +61 -0
  111. package/types/pickrecord.d.ts +88 -0
  112. package/types/plan.d.ts +1 -0
  113. package/types/prcheckout.d.ts +151 -0
  114. package/types/readshim.d.ts +4 -3
  115. package/types/replay.d.ts +3 -0
  116. package/types/reuse.d.ts +2 -2
  117. package/types/revises.d.ts +23 -0
  118. package/types/rubricstep.d.ts +14 -5
  119. package/types/run.d.ts +18 -1
  120. package/types/runlist.d.ts +6 -3
  121. package/types/schedulewords.d.ts +29 -2
  122. package/types/source.d.ts +40 -4
  123. package/types/stepmcp.d.ts +40 -0
  124. package/types/ticket.d.ts +114 -0
  125. package/types/ticketfilter.d.ts +34 -0
  126. package/types/ticketlabels.d.ts +44 -0
  127. package/types/ticketmcp.d.ts +84 -0
  128. package/types/ticketnext.d.ts +33 -0
  129. package/types/ticketrepo.d.ts +118 -0
  130. package/types/ticketschedule.d.ts +21 -0
  131. package/types/ticketshape.d.ts +37 -0
  132. package/types/tools.d.ts +1 -0
  133. package/types/trigger.d.ts +9 -1
  134. package/types/triggerclock.d.ts +6 -2
  135. package/types/triggerfiles.d.ts +13 -5
  136. package/types/triggertickets.d.ts +110 -0
  137. package/types/userrun.d.ts +50 -0
  138. package/types/validate.d.ts +1 -0
  139. package/types/worktree.d.ts +19 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,89 @@ 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.55.0] - 2026-11-10
9
+
10
+ ### Added
11
+
12
+ - **A rubric / page job whose close has no check that can fail now stops with words that say so (R10, hamr ruling 2026-11-10).** Seen live as draft 18 of paid round 5 (session smwabidzpqvgt: the only stage was files-changed, so signing refused with the repository sentence); the new words not seen live. Test-proven. When signing is refused because nothing fails on the seed and the close is a text-lang close holding no check part (only files-changed, or rubric-step stages with no parts), the stop reads "This job has no check that can fail..." with a to-do to add a `~` rule or answer the question. Repo jobs and rubric closes with a real check keep the old words. This stop fires only when nothing in the close fails on the seed. A plan can still end with zero checks (after a drop, or when every part goes to Not checked), seen live in paid round 6 drafts 2 and 17; an end check that closes this is the next release's first fix (F309). `isNoCheckRubricClose` and the `closeDecl` argument of `signingStopText` are in `src/authorreadout.js`; the CLI (`src/authorrun.js`) and the panel (`src/panel/authorsession.js`) both pass the close.
13
+ - **A rubric draft whose last try still has a broken AI check now drops that check to Not checked instead of dying (R10, PRD v1.131 tick 4).** Seen live in paid round 6 (3 drafts); round 5 had 0 firings. After the LAST try failed the plan check, and only when every red points at one part the AI wrote (not a pick, not a guard, not a check code built from the person's picks), code drops those parts: a pure extra becomes a `line N: "<words>"` note, a part that carried a `~` rule no other part carries becomes that rule's Not checked row, both with `The AI couldn't build a working check for this, so you judge it at Accept.`; the plan is then checked once more. Any red on a pick or on no part leaves the plan refused as before. A $0 replay of the 7 saved dead drafts of paid rounds 1-4b rescued the 3 that were still red (round 4 d8, round 4b d1 and d4) with both agreed picks and the picks record identical, and 21 passing real declarations came out unchanged. Rubric jobs only. The retention record counts each drop as `dropped`. `dropExtras` is in `src/checkpick.js`, `dropAfterLastTry` in `src/authorflow.js`. Caveat (F309): when the drop removes every AI part of a line the rubric-step is left with `parts: []` and the plan is still accepted, so it can sign with zero checks (seen live, paid round 6 draft 2); the next release's first fix is an end check for this.
14
+
15
+ - **Each rubric draft writes one retention record (R10, PRD v1.131 tick 7).** Seen live in paid rounds 5 and 6 (every draft that reached a declaration). When a rubric draft ends (plan accepted or stopped), the drafting log gets one `retention` line with, per job line, `aiParts` (the AI's fact and cited parts, plus parts code moves to Not checked, counted by fact), `kept`, `dropped` and `picks` (the line has code-matched count picks). Counts only, no words, no model, no UI: it is the measure every later paid round on this branch reads (at least 10 drafts per arm). `retentionOf` is in `src/checkpick.js`; `authorClose` reports it once through the `draft-retention` phase (so the panel and the CLI door share it) and the panel session writes it into `draft-log.jsonl`.
16
+
17
+ - **A rubric job's draft no longer dies on a missing source or on several fact lists for one line (R10).** Test-proven; not seen live. Paid round 4b lost 2 of 10 drafts to it (and earlier rounds the same way). Before the plan is checked, code now (1) fills a fact or `cited` part's missing or empty `source` with the input's label when the job has exactly one input (with two or more inputs nothing is filled, and a wrong source is never rewritten), and (2) merges the fact parts of one line into one fact part, keeping every fact, rule number and covers number, when it is safe: same source, no two facts with the same name, no clashing counts. Otherwise the plan is refused as before ("a second fact list on the same line"). Rubric jobs only. A drafter `cited` part on a fact line is still refused.
18
+
19
+ - **A rubric job's plan no longer fails because the AI wrote a part nothing can check (R10, fwdloop's way).** When the drafter wrote the job sentence itself ("Summarise the latest release in the changelog", "that it is the LATEST release") or a `~` rule as a part with no check (`none`) or one that needs the judge (`judged`), the whole plan was refused (`rubric-part-unsortable` / `rubric-part-judged`); 6 of 10 paid round-4 drafts hit it and 2 died partly on it. Now code moves that part, before the plan is checked, to the Not checked list with its own words and one plain reason (`No rule can check this, so you judge it at Accept.`): a part that carries a `~` rule number becomes that rule's Not checked row (shown on the plan card, the Job tab and the signed `closeDecl.refused`), any other part becomes a `line N: "<words>"` note (the signed `closeDecl.notes`). A stage left with no parts stays as a text stage the person judges at Accept. Rubric jobs only: a deterministic job keeps its reds. Web-source (`guard`) parts, a missing source and a second fact list stay red as before. Test-proven on the real round-4 declarations and replayed at $0 over all 25 saved drafts; not seen live.
20
+
21
+ - **The person picks how a `~` rule is counted (R10 = fwdloop M10 am16-am21, ported at v0.29.0).** bareguard `^0.31.0`. A rubric part now accepts the five text checks fwd offers beyond bareloop's own (`nonEmpty`, `listItems`, `sectionOrder`, `mustCarry`, `blockLines`), through the same mapping to bareguard, each with one plain sentence. The drafter and its tool schema no longer write word/section/line/list-item/phrase checks. Instead ONE typed `suggest_checks` call (new `src/checkpick.js`, `src/checksuggest.js`; its price and answer are in `draft-log.jsonl`) suggests one check per `~` rule from bareguard's own list, code keeps it only if every rule, field, number and word is the guardrail's own (`keepOrDrop`; 9 of 9 wrong suggestions dropped in the $0 POC), and code asks in fwd's words (`Line n, guardrail "<rule>": I propose at most 80 words. ...` / `I can't check this. Your own words, or Not checked?`). A proposal does not count toward the 3-ask cap; the look's asks plus `I can't check this` asks do. The plan carries exactly the checks picked; every other settled rule is a Not checked row with its reason; the plan card shows `You picked` rows; each pick is a `check-pick` row in the draft log. New in `src/pickrecord.js`: a Revise or a Start over keeps every pick whose line words and rule words still match (`kept from last draft`; not asked, not counted, never sent to the call), a moved line keeps its pick on its new number, and editing an agreed `~` line asks once about the edited words. Revise now reopens the boxes with the `~` lines the answers added. Revise and Start over match fwdloop's M4e amendment 14 item 3: each draft has 2 revises ("2 revises left" / "1 revise left" beside the button); after the second the same button reads **Start over** (there is no separate Start over button), which reopens the boxes and gives the next draft 2 new revises; a third revise is refused at $0 (nothing ended, no model call). The count is the server's (`revisesLeft` on the session state, `revises.json` in the draft's folder, carried by `carryFrom` + `carryKind`), so a refresh keeps it. Each draft's record names its kind: the draft log gets a `draft-label` line (`revise 1`, `revise 2`, `start over`; a first draft none) and the Audit Draft group shows it as its first row and ahead of line 2. Test-proven on a scripted model; not seen on a live draft.
22
+
23
+ - **A line's fact checks and the person's agreed picks now stay together (R10 keep-both).** Before, a job line whose AI-drafted check was a fact (for example a phrase quoted from the page) lost the draft the moment the person's picks (`exactly 3 list items`, `at most 80 words`) were added to the same line. Now one step file `output/steps/<n>.json` holds both the `results` (the fact quotes) and the `text` (the words the picks limit), the worker is told so, and both are graded. Only the person's own picks may sit beside a fact: code records them in the signed close (`closeDecl.picks`, new, written by code, never by the drafter), and a drafter-written count, a quote check or a second step on that line stays refused, at the draft and again at signing and at run start. A fact line with a word-limit pick and no `text` at all is now red, not green. Test-proven and proven at $0 on the real refused drafts; not seen in a paid draft yet.
24
+ - **The plan card, the Job tab and the Audit's Draft group say who added each check.** `[agent]` marks a check the AI drafted and `[you picked]` one of the person's agreed picks (like fwdloop's `[added]`); the existing "You picked" row stays. The draft log gets a `draft-checks` line and the Audit's Draft group lists each draft's checks with the marks. Phone width not checked.
25
+
26
+ - **A counted `~` rule now has one owner: code and the person's pick (R10, matches fwdloop M10 am22 and am24).** Test-proven; not seen live. Paid round 4 failed 5 of 10 drafts because the page look, the pick offer and the drafter each touched "exactly 3 bullets" or "under 80 words" and disagreed. Now: (1) the page look no longer asks "I can't check this on the page" or "I read it as" about a count rule (words, list items or lines, sections); it is asked once, as a pick, and the look's own facts stay. (2) Before the plan is checked, code removes any count check the drafter wrote on a line the person picked for (word, line, list, section checks and claim counts), and any fact part's `count` that repeats a picked number; the fact itself stays, and the person's picks are the only counts left. (3) When the suggestion call offers nothing for a count rule, code proposes the check its own readers name ("I propose exactly 3 list items"), so a count rule is never told "I can't check this"; a rule that names two different counts, a range, or only a section count is not guessed.
27
+
28
+ - **A job can read a ticket through the person's own MCP server (MCP + tickets, R2a).** Four optional signed job fields: `mcp {server, tools}`, `flowType` (`plain`|`mcp`|`tickets`), `ticketFilter {priority, labels}` and `ticketWatch` (`state`|`labels`); an absent key keeps every old spec's hash (pinned on a real existing spec), a changed `mcp`/`flowType`/`ticketFilter` changes the workflow key, and `assembleSpec` refuses a draft that carries any of them. A rubric or plain-folder job whose Inputs line is a GitHub issues address reads one ticket at run start through `issue_read` (`run-u --spec ... --ticket <n>`; `--anyway` is accepted and inert until the filter exists): the server starts with `PATH` and `HOME` only, only the signed tools exist for it, and the reply is frozen as the run's input with `mcp`, `ticket` and `masked` on its manifest row. A secret in a ticket is masked with the one inventory before the sha, never refused (page inputs keep their refusal). Refusals (server or tool missing, remote server, locked key store, empty reply) are plain words at $0. New: `src/ticketmcp.js`, `src/ticketshape.js`, `src/ticket.js` (the source-neutral ticket shape and `readTicket`, MCP or page), `src/mcpsources.js` (server lookup across bare-agent's places and `config.json` `mcpPaths`; its Settings tab comes later). Not yet: the filter that skips a ticket, the `new-ticket` trigger, step-level MCP tools. Test-proven against a fake MCP server; the real-GitHub read is the R0 check.
29
+ - **A job on a code repository can read a ticket too (MCP + tickets, R2b).** At run start the ticket is read through the MCP, masked before the sha, and frozen to `<worktree>/.bareloop-input/<label>.txt`, hidden by git's private exclude (the common git dir's `info/exclude`, never the tracked `.gitignore`): it is not in `git status`, not in the final work-branch commit, and the cold reset keeps it. The worker can read it; a write or edit there is denied by the gate; the close never reads or names it. The run's record is the spine's `job-start` `ticket` field (metadata and sha only, never the text). `proveInputFiles` proves a repo job's ticket line at $0 (server in the person's config, `issue_read` signed, one ticket address). A repo that already tracks `.bareloop-input` is refused at $0. The "not available yet" refusal is gone. Not yet: pull-request jobs (piece 12), the filter.
30
+ - **A plan step can call the job's signed MCP tools (MCP + tickets, R2c).** A step may carry `mcpTools`, a subset of the job's signed `mcp.tools`: `validatePlan` reds a name outside the list (`verb-escape`), `mcpTools` on a job with no MCP server, and a generic MCP job (`flowType: 'mcp'`) with no step that calls one of its tools; a Tickets job's own `issue_read`/`list_issues` need no step. The planner prompt carries the rule, the legal values and a legal example for a job that has an `mcp` block (a plain job's prompt is unchanged). At run time a step with `mcpTools` starts the person's MCP server once (PATH+HOME only, start folder = home, exactly those tools), gives the worker the granted `<server>_<tool>` tools beside its verbs and closes the server after the step's last try, green or red (no orphan child). Such a step, and only such a step, also gets a bareguard `tools.allowlist` of its granted verbs' action types plus the signed tool names, so an unsigned tool is denied by name; the worker's system prompt gains one line naming exactly the granted tools. Every tool reply is masked with the one secret inventory before the model sees it (a planted `ghp_` token is not copied into the tree, the audit, the carry memo or any record). A server that is not configured, will not start or lacks a signed tool stops the step at $0 in plain words. Test-proven with a fake server and the real gate; not yet seen live. `step-start` records `mcpTools`.
31
+
32
+ - **A run can check out a pull request's code into its worktree (MCP + tickets, piece 12).** New `src/prcheckout.js`: at run start, before the seed is read and the work branch made, the run's own worktree is moved to the PR's head commit with plain git (never the MCP): the remote that names the PR's `owner/repo` is asked for `refs/pull/<n>/head` into a private `refs/bareloop/pr-<n>`, the fetched sha must equal the frozen record's `head.sha` (read through one accessor), and the worktree is checked out detached there. The seed, `source.json` (`prHead`, `prNumber`, `prBase`) and the spine's `job-start` `pr` follow; the tracked-at-seed guard follows the PR, not the person's HEAD. The run never pushes (a subcommand allowlist, hooks off, the push address overridden, a grep test over `src/`), takes no password from a remote's address, and uses the person's own git auth with the provider keys stripped from the child's env (`HOME` and `SSH_AUTH_SOCK` kept). Refusals are plain words at $0 (no matching remote, git could not fetch, took longer than the 120 s deadline, no head to fetch, the PR changed, not a PR address); a resume checks that the PR head is still in the branch. A green run removes the private ref with its worktree. Proven at $0 on a real same-repo PR and a real fork PR, and in tests against a local bare repo. The PR reader below makes it reachable; the paid PR run is not done.
33
+
34
+ - **A ticket line can be a pull requests list, and a PR job checks out the PR (MCP + tickets, the PR reader).** `parseTicketList` reads `https://github.com/<owner>/<repo>/pulls` beside the issues page (`kind: 'pull'|'issue'`, one parser; a pull's address is `/pull/<n>`). A pulls row is read with `pull_request_read {method:'get', owner, repo, pullNumber}` (the real GitHub server's tool, measured 2026-11-04; the only PR tool name hardcoded), masked before the sha like a ticket, with the same refusals in plain words naming `pull_request_read` (not signed: refused at $0 by `proveInputFiles`; not offered: the person's server needs the `pull_requests` toolset). A repo job's frozen PR also supplies piece 12's door (`ctx.pr = {url, record, reread}`: `record` is the parsed masked reply carrying `head.sha` and `base`, `reread` one fresh read), so a real `--ticket <n>` run checks the PR head out; a rubric or plain-folder job with a pulls line freezes the PR text only. A pulls list is not offered to the `new-ticket` look. Tested with a fake server answering with the real reply's keys and a local bare repo serving `refs/pull/1/head`, on the real engine. Not yet run live end to end.
35
+
36
+ - **Settings > MCP tab (MCP + tickets, R3).** A third Settings tab, "Path and MCP", on the Providers markup: the four places bare-agent reads plus paths you add (`+ add a path`, stored absolute in `config.json` `mcpPaths`), first name wins (a shadowed one reads "same name as above, not used"), a remote server listed but not usable. `check tools` (press only) starts that one server with `PATH` and `HOME` and lists its tools with read-only hints; each press appends one line to `mcp-checks.jsonl` (names and hints, never an env value or a command). Each tool shows how many runs used it (from `source.json` ticket reads, a repo job's `job-start`, and gate-audit step calls). Four routes behind the human-click guard: `GET /api/settings/mcp`, `POST .../mcp-check`, `.../mcp-path`, `.../mcp-path-remove`. bareloop never edits your MCP config and never shows a command or key. `mcpPaths` now refuses a line break and over 500 characters. Tests read an injected fixture home, never the real `~` (`mcpHome`).
37
+
38
+ - **The New job card has Flow type and MCP, and a by-hand Ticket box (MCP + tickets, R4).** Two controls after Inputs: `Flow type` (`plain` | `MCP` | `Tickets MCP`, fwd's words) and `MCP` (a server from Settings > MCP's list; a `manage in Settings > MCP` link). Both are set into the signed spec by CODE (`resolveFlowCard`, `signFlow`; `src/mcppick.js`, borrowed from fwd's `mcp-pick.js`): the job gets EVERY tool of that MCP's newest successful `check tools` (write tools included, none dropped), never a pick by the planner or by typed names. An MCP nobody has checked is refused before any session with "press check tools in Settings > MCP first"; a remote or unlisted one is refused by name; Tickets MCP also needs a GitHub issues or pulls address as an Inputs line. A `plain` card writes NO `flowType`/`mcp` key, so every old job, bridge and workflow key keeps its hash (a real archived spec is pinned). Flow type and MCP are job boxes: a changed one is a changed job, so Reuse drafts a new workflow under a new name; unchanged still reuses the signed plan with no drafting. Reuse opens filled with the job's Flow type and MCP; a schedule card and a resume lock them. The Job tab gains an `MCP` row (flow type in the card's words, server, each signed tool, and a ticket filter / watched fields when the spec has them). **By-hand Tickets run (a divergence from fwd):** fwd's by-hand run takes the newest ticket not yet run, which needs the ticket look and the schedule's ledger (not built here), so the card has a `Ticket` box for Tickets MCP only: the number to read, checked with `ticketNumberOf` (the one reader `--ticket` also uses; digits, 1 to 9,999,999,999), per run and never signed; the panel passes it as `run-u --ticket <n>`; a Tickets job without one, a bad one, or a number on any other job is refused in plain words before any session. **No export for a job that uses an MCP:** `bareloop export` and the export list refuse it ("<run> uses an MCP (<server>), and a job that uses an MCP cannot be exported"). The planner prompt gains one sentence for an MCP job: the server and tool list were set by the program and the plan has no field for them. `ticketFilter` is not offered to the planner yet (the filter arrives with R5). Tests: `tests/flowtype-*.test.js` (pick incl. the real-press POC, card, run, reuse, page, export, drafter) and a fake MCP with write tools; no browser tests.
39
+ - **The Ticket box says what it takes.** A one-line hint under it, `leave blank for the newest ticket this job has not run, or type its number, like 7` (R6; it first read `the issue number, like 7`), shown only for Tickets MCP (it sits inside the Ticket field), because the box takes plain digits and `#7` or a link was refused with no hint.
40
+
41
+ - **A Tickets job can skip a ticket at run start (MCP + tickets, R5).** The job's signed `ticketFilter` (priority `P0`-`P3`, label names) and the ticket's state are read by code (`src/ticketlabels.js`, fwd's `decideTicket` as is): a closed ticket always skips, a priority or label miss skips, a label on another scale or text that is not readable as fields is UNSURE and runs. A skip happens after the ticket is frozen and before any worker or model call: one `settled` event (`reason: 'skipped'`, plain words, $0, complete) on the already-listed row frees the monthly claim, no spine, no learnings or credit row, exit 0; `--anyway` runs the ticket regardless. The panel wears a new status `skipped`, sign `[–]`, grey, terminal, not in Needs you, with the words from code (`priority P3, not P1`, `the ticket is closed`, `no P1 label on the ticket`, `label bug not on the ticket`). The drafter of a Tickets job is told the rule (a job line naming a priority or a label must get a `ticketFilter`, with a legal example in the prompt and in every red) and may propose one; the person signs it; the plan card and the Job tab say it in code-owned words. `src/ticketfilter.js` is the one reader of a legal filter, shared by the signed spec and the drafter's proposal. The label reader was run on the newest ~150 issues each of three public repos (kubernetes/kubernetes, grpc/grpc, microsoft/vscode): no crash, the off-scale path reached on real data, closed always skips. Whether a real model emits the filter is the paid drafter POC, not yet run.
42
+
43
+ - **A Tickets job's confirm turn no longer asks which ticket or its priority (F285).** In a paid POC the confirm turn stopped on "Which ticket is this job for, and what is its priority?" in 5 of 10 drafts. A Tickets job's confirm prompt and drafting prompt now say, in one set of words (`ticketPerRunFacts`, `src/ticketfilter.js`): the ticket is picked per run and never known at drafting, and a priority or label line is decided by code at run start through `ticketFilter`, so never ask. Plain and generic-MCP jobs' prompts are unchanged. Test-proven; the live retest is pending.
44
+
45
+ - **The drafter's ticket filter key is REQUIRED, not optional (F285 addendum).** A paid retest draft (e1) listed "only priority P1 tickets" under `refused` as decided by the filter but never emitted `ticketFilter`: the schema called the key "optional" while the prompt said MUST, and the refused duty was not tied to the key. The schema description now says REQUIRED when a job line names a priority or label, and the prompt says to list the line under `refused` AND add the `ticketFilter` ("the refused entry alone does not filter anything"). Words owned in `src/ticketfilter.js`. Test-proven; live retest pending.
46
+
47
+ - **A Tickets job can start on a new ticket (MCP + tickets, R6).** A new trigger kind `new-ticket` (`{kind, input}`) beside `new-file`: the schedule looks every 15 minutes at $0 through the job's signed server and its signed `list_issues` (`src/triggertickets.js`, fwd's `lookTickets` from v0.29.0), newest first, stopping at a seen number, and queues one run per new ticket, oldest first. The first look is the starting point (a `baseline` row per ticket, nothing runs); a look that cannot read writes ONE `unreadable` row and never a baseline or "no new tickets". The server, list address and watched fields are read from the signed spec, never stored in the trigger; the same two sign clicks refuse, in plain words, a job that is not a Tickets MCP job, an Inputs line that is not an issues list, or a signed tool list without `list_issues`. The schedule card's When dropdown offers `When a new ticket arrives in <input>` only for such a job. A ticket fire leaves the signed spec unchanged and passes `--ticket <n>`. Looked at against real `microsoft/vscode` issues twice, seven minutes apart: the second look reported exactly the one new issue `gh api` showed.
48
+ - **A by-hand Tickets run with no ticket number takes the newest ticket it has not run (MCP + tickets, R6).** `run-u` with no `--ticket` (and the card with its Ticket box left blank) runs the schedule's look and takes the newest ticket above the highest number the job's runs already hold; the run list row now carries `ticket`. Nothing new or an unreadable list is one plain line at $0; a typed number still works. This is fwd's `newestUnrunTicket`; fwd removed its own ticket box in v0.28.0, bareloop keeps the typed box as the way to pick another ticket.
49
+
50
+ - **A schedule can be signed with the job on the New job card, and it waits for the job's first green run (MCP + tickets, R7, piece 9).** A `Schedule` row on the card (`By hand`, `When a new ticket arrives` for a Tickets MCP job, `Every day at HH:MM`; fwd's words and hints, served from the schedule words table) puts the trigger into the signed spec when the job is made, so the first run's hash covers it; a card with nothing picked writes no key and hashes as before (pinned on the real archived spec of run mv5bk400), and `workflowKey` is the same with and without it. Sign & run writes the schedule OFF beside the first run: nothing looks or fires while it waits, and the job's first real green turns it on (a skipped, red or `already-green` run never does; a rubric job turns it on at its honoured Accept, not the bare green). A ticket schedule keeps the ticket number that run read, so a ticket that came in during the wait runs once and the one the run read never runs again. The Run tab, Audit, Job tab and schedule card read `Schedule waiting for a green run` while it waits. A run that never started takes its waiting schedule back. The two-click schedule door is unchanged for jobs scheduled after their green.
51
+ - **"Run it anyway" while a ticket schedule is still off starts that ticket's run at once (MCP + tickets, R7, am3; start path only).** `door.startAnyway({job, number})` runs the job's signed spec by hand (`run-u --ticket N --anyway`, the job's normal cap, no review door, no schedule row); a skipped run never turns the schedule on, a green one does. The button and its route come with the Result grid (R8).
52
+ - **A Tickets job's Result tab is one grid, with Run it anyway (MCP + tickets, R8: pieces 4 and 10, hamr-signed mockup 2026-11-07, hamr's ruling 2026-11-08).** For a job where a run read a ticket the Result tab shows ONE grid INSTEAD of the five generic boxes: fold rows Needs you / Stopped / Passed / Skipped, a stats line, a schedule line, one row per run (`#<n> · <title>`; columns steps done, the close's checks, cost, time), the run you came from opened for you (ticket link, why it stopped or what changed with the last diff, the checks, the work branch as text, the door buttons only while that run waits for you, the run id that opens it). Borrowed from fwdloop's tag v0.29.0 (`src/panel/tickets.js`, `src/panel/jobgrid.js`, the `tg-` page code), adapted: the bucket is the run's key in the one status table (`GROUP_OF`), money is `panelMoney2` and honours `spendComplete` (`at least`, never `$0.00` for unknown), and an opened row's facts come from the generic payload owner (`genericResultOf`, which now also says why the run ended: `endedWords`). New `GET /api/runs/:runid/grid`. A skipped ticket gets `Run it anyway`: a reason box (blank starts nothing), `POST /api/author/ticket-anyway {job, ticket, reason}` behind the token + Origin/Host guard; with the schedule still off it starts that ticket's run at once by hand (`--ticket N --anyway`), with it on it writes one `arrived` row (`reason`, `anyway: true`) and the scheduler starts it with `--anyway`. Plain, MCP and rubric non-ticket jobs keep their Result unchanged. Checked on the two real ticket jobs in the archive ($0): grid count = run-list rows for the job, the money line = the sum honouring `spendComplete`. Fail-first: the grid data suite red with the module absent, the anyway suite 5 of 6 red on the old code, the page suite 12 of 12 red on the old page; 27 mutants, 25 killed first, 2 got tests and died. Phone width and hamr's click-through are still owed.
53
+ - **R8 fixes (hamr's "go" 2026-11-08): a stopped ticket row no longer contradicts itself, and Run it anyway works with no schedule (am3).** A run the outer close never reached (a strike-ladder cap-halt) read `checks said no` in its header but `?` in the grid cell and "the close did not run any check for this run" in its opened row: the Result `checks` now fall back to the checks the steps ran, through the Audit grid's own data (each check's last graded try, `(tried N times)`; no figure is invented, the in-loop record has none), and a run with an outer close keeps its close's stages exactly. "Run it anyway" on a job with no ticket schedule used to refuse ("has no ticket schedule... Nothing started."): it now starts that ticket's run at once from the skipped run's own saved signed job, through the one starter's by-hand path (`--ticket N --anyway`, no review door, the job's cap, no row); a skipped run with no readable signed job is refused in words naming why. Fail-first on the real stopped run's spine and a recorded spawn (no paid run).
54
+ - **A check row on the generic Result tab is two lined-up columns (hamr's pick, 2026-11-08).** The question on the left, a number column (left-aligned, blank when a check has no number), then the sign column (the status dot and word) rightmost, so every sign sits at the same x; at phone width the number drops under the question and the sign stays at the right. The Run tab's per-check rows are the Audit grid's cells, a different structure, so only the Result tab changed.
55
+ - **Every ended job has a Result tab, not only rubric jobs (R7b item 4, hamr-signed mockup 2026-11-07).** A non-rubric run that ended, green or failed, gets five boxes: the job (what it was asked, where it may change files), what changed (read from the spine's `attempt-diff` records, so it survives a deleted branch: file count, paths, `+A −D` over K edits, the LAST edit's diff with the record's own cut count, a fold of every edit, a line saying the run stayed inside the fence), the checks (the close's own stages in the existing question words with the status table's `passed`/`failed` word and the number each read, plus a fold of the close's notes), the work (branch, final commit, made-from, the repo and the `git merge`/`git branch -D` lines as text, shown only while the branch still exists), and the run (spent with the honest "at least" floor words, time, steps and replans; the Accept / Rerun / Pause card is the rubric tab's own, only at the Accept door). A ticket job adds a small `The ticket` box (`#n · title`, link). `GET /api/runs/:runid/result` gains the `kind: 'generic'` payload for those runs; `hasResult` and the route share one `resultKindOf`. A rubric job's tab and `/result` payload are unchanged (pinned to the old output in tests). Not shown: a run that died with no `job-end`. Fail-first tests `tests/result-tab-{data,page}.test.js` on real archived spines (`tests/fixtures/result-tab`); phone width unchecked.
56
+
57
+ ### Fixed
58
+
59
+ - **A page job's drafter is now offered the same labels the draft gate accepts (R10, paid round 5, `rubric-fact-label-off-list`).** Seen live as a leaning: 0 rubric-fact-label-off-list tries in 20 drafts of paid round 6 (one model). The drafter was told "pick a label ONLY from this list" from the code-made label scan (`"] -"`, `"## ["`) while the gate proved a label against what the page-word map kept, so a label picked from the first was refused by the second (drafts 11 and 12; both still ended prepared after retries). For an input the page-word map read, the prompt now lists only the kept labels (or says none was kept: leave the label out); any other input keeps the code-made list. `labelListsFor` (src/factwords.js) is the one owner; the gate is unchanged, nothing was widened.
60
+ - **A rubric draft no longer dies on two fact lists the AI could not merge (R10).** A look fact that carries a `~` rule (the section words) and a line-level fact (the release heading) were written as two fact parts on one line, which is refused; three drafts in a row did it and the draft stopped. The drafter is now told that such a fact goes inside the line's one fact part, and that a count the person picked is a pick, not a `count` on the fact part. The refusal itself still stands, but the note sent back to the AI now carries a legal example of one part holding two facts (checked against the real validator in a test); the person's stop text stays plain words. Test-proven on the real refused declaration; not seen on a live draft.
61
+ - **A `~` rule that is a count now always reaches the person's pick (R10).** A rule like "exactly 3 bullets" or "under 80 words" (words, list items or lines, sections) was sometimes lost: when the page look had tied a page fact to it, or had put it under Not checked, the check offer skipped it, and the look asked "I can't check this on the page. Drop it?" about a count the checker can in fact check (paid round 2, drafts 4 and 5). Code now reads the rule's own words (`isCountable` in `src/checkpick.js`) and always offers it; the look's fact stays beside the pick, and the look's "can't check" ask no longer fires for it. A rule that is not a count behaves as before.
62
+
63
+ - **A run refused before it started, or skipped, now has its [Reuse workflow] button.** Its Run page showed only the ending words and never drew the action row, so R9's Sign & run for a run that never ran its plan had no caller from the run page. The server marks such a run `reuseOffered` (same rule as `neverRanPlan`: no log, settled at exactly $0), and the page draws the one `renderRunActions` row under the words (the rest of the run content stays hidden). A refusal that spent money has no signed plan to sign and gets no button. Other buttons follow the server's detail as before (a refused run shows `Schedule run` when the server says so).
64
+ - **A signed write fence can no longer name the frozen-ticket folder.** A `writeScope` naming `.bareloop-input` (e.g. `.bareloop-input/**`) is refused at validation like `.git` and `node_modules`, so a worker can never be allowed to write the ticket it was given; the folder name has one spelling, shared from `src/worktree.js`.
65
+ - **A ticket job's grid names a run that read no ticket `run-N · <why>` and draws empty cells as the grey dash (hamr, 2026-11-08, live).** A run refused before start (the key store was locked) or skipped for "nothing new" showed its internal run id and `?` / `unknown` cells. The row is now named by the panel's own run number plus the Runs list's own ending words (`run-3 · Nothing new: no ticket newer than #17 has come in. ...`; one wording owner, `endedLine`), a cell with no data (steps, checks, time, an unknown cost) is the grey `—`, and a recorded `$0.00` stays. A row with a ticket keeps `#14`. The run id shows only in the opened row's command text. Tested on the two real rows copied from the panel's run list (`tests/fixtures/ticket-grid/r7-sched-refused.jsonl`).
66
+
67
+ - **The launcher `6 update` no longer hands your shell's keys to npm.** `npm install -g bareloop@latest` now runs with the same credential-stripped environment as bareloop's own `npm ci`; the panel launch still gets its keys.
68
+
69
+ - **Ticket fixes (MCP + tickets R9, ported from fwd M13 p7).** Tickets that arrive at the same instant queue in number order (`#9` before `#10`; `src/natural.js` is the one natural compare). A ticket look that could not read (a locked pass, a server error) shows ONE red line on the Run tab's SCHEDULE row and NEXT naming the cause, until a later look reads. A run the ticket filter was unsure about (a label on another scale, two priorities, unreadable fields; the ticket ran) records why on its `job-start` (`ticketFilter.unsure`) and its grid row wears a grey `unsure` mark, with "the filter was unsure about this ticket" when opened. Reuse workflow on a run that ended before its first step at $0 (`refused before start`, or a skipped ticket), job unchanged, signs and goes with the signed job instead of a paid redraft; a red run that ran a step still drafts. The ticket drafting prompt says a step reading the frozen ticket still lists `read` in its tools (F122).
70
+ - **The drafting log keeps each answered call's raw answer.** `draft-log.jsonl` `call` lines of the draft, confirm and scout calls now carry `raw` (secret-masked and capped at 8000 bytes by the one `scrubRaw`), so an unusable draft try can be read afterwards; before, only the page-map call did. A run refused before its first step takes back the empty run folder it had made (its row stays listed).
71
+
72
+ ### Changed
73
+
74
+ - **The New job card has no Ticket box (R7b 1, fwd v0.28.0).** A by-hand Tickets run always takes the newest ticket the job has not run (`src/ticketnext.js`); a typed number invited the person to put it in Destination (F287). `run-u --ticket N` stays on the CLI (the scheduler and "Run it anyway" use it).
75
+ - **A repo job's Destination must exist in the repo (R7b 2).** Every piece of a repo Destination (folder, file, or a glob under a real folder; `.` is the repo root) must be in the repo's committed tree, else the start is refused at $0 in plain words ("Destination `7` is not a folder or file in this repo. Type the folder that holds the files the job should change, like src/."). It is the ONE Destination check, so the card, Reuse, the schedule clicks and a scheduled fire all use it. Plain-folder jobs are unchanged.
76
+ - **A refused newest-ticket look is a visible run (R7b 5, 6).** When `run-u` cannot look up the newest ticket (a locked pass, an unreadable list, nothing new) the run is now listed and settled at $0 with the plain words (Runs list and Ended block), like a refused page fetch; before, it exited with no row and the panel showed nothing. The words no longer point at the removed Ticket box: "The newest ticket could not be looked up. The reason: ... Fix that, then start the job again."
77
+ - **The drafter points when a job line's file lies outside Destination (R7b 3; `src/destpoint.js`).** For a repo job, before drafting, one small paid call names the job line, the file (copied from that line) and the folder that holds it. Code checks the line is a job line, the path stands in that line's own words, the file is in the repo's committed tree, the folder is its parent and the file is outside Destination; only then it asks ONE typed question in the chat (words owned by code, like the fit check's "go on"): `Line 1 needs src/sum.js changed, but Destination is docs/, so the job could not change it. Set Destination to src/? Type yes to set it, or no to keep it as it is.` yes sets the session's fence and its card Destination (the page re-fills the box); no goes on unchanged. A made-up file or a malformed reply asks nothing; a call that does not finish asks nothing and drafting goes on.
78
+ - **A by-hand Tickets session looks for a new ticket at Start (R7b rulings, runs mw6skdyk and mw6u5794).** At $0, before any session, copy, draft or model call, the card's start (and Reuse workflow on a Tickets job) asks the one newest-unrun reader (`src/ticketnext.js`). Nothing new refuses in the card's one error line: `No new ticket since #17. Nothing to run. Nothing spent.`; a look that cannot read (a locked pass) refuses with its own cause words and `Nothing spent.` No session, no draft, no run row. A scheduled fire carries its ticket and never looks.
79
+ - **"Nothing new" at run start is a quiet skip, not a failure.** If it still happens there (a race with a scheduled run) the run settles as `skipped` (grey `[–]`, not in Needs you), words `No new ticket since #17. Nothing to run. Nothing spent.`, exit 0. A look that cannot read stays a refusal (`[✗]`, it is a fault).
80
+ - **A run that ended before it started shows its signed job.** The Job tab of a refused or skipped run (listed row, no spine file) reads `resolved-spec.json` from the run's session folder through the same renderer; before, it was blank.
81
+ - **litectx `^0.41.0`; the index is built at the start of every run, and the run log says what happened.** litectx 0.41 makes `index.db` lazy, so a run that was granted no ctx tool no longer leaves an empty `.litectx` db and, before this, never had the index the carry memo's function ranges and the first-read map read. Run start now indexes every run, the per-ask refresh runs on every step and fix ask, an index failure is recorded and the run goes on without ranges, and one `ctx-index` spine record (indexed, files, ms, error) is written per run. The worker is told nothing new. The first-read map skips with `no-index` when `lc.indexed` is false.
82
+
83
+ ## [0.54.1] - 2026-11-04
84
+
85
+ ### Fixed
86
+
87
+ - **The review door's held line no longer says a rubric green earns no learning credit.** A rubric run's lessons count at run end (PRD v1.112); only reuse/bridge credit waits for Accept, so `src/u-readout.js` now says "NO reuse credit until you accept it", and `bareloop.context.md` says the same in its two places. The same wording is fixed where Accept's release is described elsewhere: the door's Accept line (`src/u-readout.js`), the run-u HELD line (`src/userrun.js`), the `bridges.js`/`reuse.js` door comments, and the tests pinning them. Also, the learn-ledger climb test's failure message no longer quotes a time figure.
88
+ - **The step a money or time cap escalated reads capped, not failed.** A run that ended capped left its last step's card at `failed` because that step's own `step-end` says `escalated` and carries no stop reason (real spines msi0w2i5 and msx87qqs: the cap's escalation lands just before the step-end). `src/panel/server.js` now gives the run's LAST step part the cap word where the run's verdict is known, and only when that step's own escalation was the cap: a wall-halt reads time cap, a money cap-halt reads money cap (the replay part now carries its `tripped` escalation, with `ladder` when its strike limit ended it). A step its own strike limit escalated stays failed even if the run then ended on the cap (the ladder's stop is also category `cap-halt`, real spine u-mshcpdg4), and so does an earlier escalated step.
89
+ - **`climb` and `foldCards` no longer compare card pairs already in one family.** Same families, levels and groups (checked identical against the old code on 4,000 random ledgers for `climb`, and on 4,300 random and real-shaped card sets for `foldCards`); 2,000 same-lesson rows take about 60 ms instead of about 400 ms, which removes the load flake in `tests/learn-ledger.test.js`. `tests/launcher-stop-deadline.test.js` now uses a fake clock through a new optional `clock` dep of the launcher (default `performance.now`, no change for real callers), so load can no longer flip it.
90
+
8
91
  ## [0.54.0] - 2026-11-03
9
92
 
10
93
  ### Added
@@ -5,7 +5,7 @@
5
5
  > facts with quotes from the real artifact, an arbiter-owned `decide()` renders pass/fail from
6
6
  > a signed rubric card, and *unsure* is a red, never a pass — bought by a signed calibration
7
7
  > gate (ten graded truths, five resisted lies, floor 10/10, itemized reds). A soft-green pass
8
- > mints its bridge row QUARANTINED: no learning credit until an `accept` releases it, forward
8
+ > mints its bridge row QUARANTINED: no reuse credit until an `accept` releases it, forward
9
9
  > only; a rerun records a disposition and its outcome is a NEW run's own row, born held
10
10
  > again. Every run ends at the signer's **review door** — `accept` / `rerun` / `pause` — which
11
11
  > records a disposition and **never changes the loop's own verdict** (`runPlan` still returns
@@ -46,7 +46,28 @@ inherited rule carries the green that minted it and the contrast that attributed
46
46
  truth, `src/kinds.js` `LIVE_KINDS`) is the default and the only class with a live-proven
47
47
  paid run. `soft-green` (a judged floor behind a signed calibration gate, plus a review
48
48
  door) is fully admitted (`VERDICT_TYPES`, `src/job.js:106`) but has never rendered a live
49
- verdict — see `## Public API` → "THE JUDGED FLOOR" and "THE REVIEW DOOR" below. `green` and
49
+ verdict — see `## Tickets: reading a ticket through the person's MCP server (MCP + tickets R2a)
50
+
51
+ A rubric or plain-folder job whose signed spec carries `mcp` (and flow type `tickets`) may name a GitHub issues address as an Inputs line (`issues: https://github.com/<owner>/<repo>/issues`, the issues page of one repository). At run start (`run-u --spec ... --ticket <n>`; the panel, the scheduler and the CLI all go through the same `refreezeUrlInputs` in `src/source.js`) bareloop starts ONLY the named server, with only the signed tools (`allow`), calls `issue_read {method:'get', owner, repo, issue_number}`, and freezes the whole reply text as that input in the run's copy (`input/<label>.txt`, committed as the new seed, never a worker write). A ticket is data, never instructions: it never reaches the planner or any signed field.
52
+
53
+ - **The server gets `PATH` and `HOME` only** (`passEnv`) plus its own `env` entry in the person's MCP config, and the person's home folder as its start folder; no provider key in the parent environment reaches it. Server keys stay in the person's own MCP config; bareloop never reads or records them. Closing the run closes the server.
54
+ - **Secrets in a ticket are MASKED, never refused.** The reply goes through the one secret-shape inventory (`redactSecrets`, `src/validate.js`) BEFORE the sha256 is taken, so the frozen bytes, the sha, the manifest and every record carry the masked text; the manifest row records `masked: <count>` (a count, never a value). Page inputs keep their refusal. Honest limits: the inventory is token shapes only (`DB_PASSWORD=...` style values are not masked), and a rubric citation is checked against the MASKED copy, so a quote of a masked token cannot match.
55
+ - **The manifest row** (`source.json` `inputs[]`, the existing row of that Inputs line) keeps its signed `url` (the list address) and gains `mcp: {server, exposed, missing, calls}` (what the server exposed to the run, the signed tools it lacked, each call made), `ticket: {number, title, state, source}` and `masked`; `sha256` is the sha of the frozen (masked) bytes and `draftSha256` the drafting copy's.
56
+ - **Refusals** are the existing `refused before start` path: plain words, $0, the run's row settles at $0 and nothing is frozen. Named causes: the server is not in the person's MCP config; it is a remote server (no start command; not supported yet); it did not start (its first error line); it does not offer a signed tool (or the job does not list `issue_read`); the server asked for a login instead of data (a locked key store); the call failed (first line of the server's error); the reply was empty; the job's Inputs name no GitHub issues address, or more than one.
57
+ - **One ticket shape** whatever the source (`src/ticket.js`, `readTicket`): `{source: 'mcp'|'page', url, number|null, title, state: 'open'|'closed'|'unknown', labels|null, text (masked), sha256, bytes, masked, record}`. A ticket read from a PAGE with barebrowse is weaker, and says so (`PAGE_TICKET_LIMIT_WORDS`): its body may be missing, `labels` is null, `state` is `closed` only when the text says `Closed`, and its number comes from the address (`/issues/<n>` or `/pull/<n>`; none = null).
58
+ - **Config:** `config.json` may carry `mcpPaths`, a list of absolute paths of extra MCP config files (judged by `mcpPathProblem`: absolute, one line of at most 500 characters, no duplicates; the Settings > MCP tab writes it, a typed `~/x` is stored written out). `src/mcpsources.js` finds a server across bare-agent's four default places and these paths, first name wins.
59
+ - **A job on a code repository (MCP + tickets R2b).** Line 1 of Inputs stays the repo; a later line that is a GitHub issues address (with the job's `mcp` signed) is the ticket line, proven at $0 by `proveInputFiles(inputs, {mcp})` (server named in the person's config and not remote, `issue_read` among the signed tools, at most one ticket address). At run start (`run-u --spec ... --ticket <n>`) the ticket is read and MASKED as above and frozen to `<worktree>/.bareloop-input/<label>.txt` (the label made file-safe), outside the tracked tree. The folder is hidden through git's PRIVATE exclude (`<common git dir>/info/exclude`, shared by the linked worktree; never the tracked `.gitignore`), so it is not in `git status`, not in the final work-branch commit and survives the cold reset; nothing is committed and the seed does not move. The worker can read it (inside `readScope`); a write or edit there is denied by the gate (every signed `writeScope` is a proper subfolder of the tracked listing). The close never reads or names it, and no prompt text mentions it: a ticket is data. The record is the spine's `job-start` `ticket` field `{label, file, url, number, title, state, source, sha256, bytes, masked, mcp}` (metadata only; the frozen file is removed with the worktree at a green end). A repo that already tracks a `.bareloop-input` is refused at $0. A resumed leg keeps the file its first leg froze and writes no new record.
60
+ - **A pull-request job checks out the PR's code (MCP + tickets piece 12; `src/prcheckout.js`).** At run start, after the frozen PR record and BEFORE the seed is read and the work branch made, the run's own worktree is moved (detached, nothing committed) to the PR's head commit. Plain git, never the MCP: the remote of the person's repo whose address names the PR's `owner/repo` (read as written in the repo's config; `origin` first, any name, https or ssh; no address is ever built from ticket text) is asked for `refs/pull/<n>/head` into bareloop's private ref `refs/bareloop/pr-<n>` (forced, so a Rerun after a force-push moves it; no branch, tag or `FETCH_HEAD` is touched; a fork PR is served by the BASE repo, the fork is never contacted). The head sha comes from the frozen record through ONE accessor (`prHeadSha`, GitHub's `head.sha`); after the fetch `rev-parse` must equal it, else one re-read of the record and one re-fetch, else "The pull request changed while the run was starting. Run it again. Nothing spent." The seed becomes the PR head (so the tracked-at-seed write guard and the counting-rule baseline follow the PR, not the person's HEAD), `source.json` gains `seed:<sha>`, `prHead`, `prNumber`, `prBase:{ref,sha}`, and the spine's `job-start` carries `pr {number, ownerRepo, head, base, mergeBase}`. A green run removes the private ref with its worktree; a refused one never leaves it. **Refusals (plain words, $0, "Nothing spent."):** "No remote in this repo points at <owner>/<repo>, so the pull request's code cannot be fetched."; "Git could not fetch pull request #<n> (<git's first line, secrets masked>). Check your git login for this repo."; "Fetching pull request #<n> took longer than <t> seconds." (120 s deadline); "Pull request #<n> has no code to fetch (GitHub did not offer its head)."; "The pull request changed while the run was starting. Run it again."; "This is not a GitHub pull request address."; and a remote whose address carries a login (`https://user:pass@...`) is refused with the address masked. **The run never pushes:** every git call of this piece goes through an allowlist of subcommands (`fetch`, `rev-parse`, `checkout`, `merge-base`, `update-ref`, `worktree`; anything else throws before a process exists), the fetch runs with the person's hooks off, `GIT_TERMINAL_PROMPT=0` (a credential question is a refusal, never a wait) and the remote's push address overridden with a dead word, and a test greps `src/` for any `push`; the worker has no `run`. **Credentials:** the person's own git auth (ssh agent, credential helper) as the process owner sees it; the child env is the process env minus `CLOSE_ENV_DENY` but KEEPING `HOME` and `SSH_AUTH_SOCK`; bareloop stores nothing. **Resume** does not fetch again: the recorded `prHead` must be an ancestor of the worktree's HEAD, else "PATIENT REFUSED"; a Rerun is a fresh engagement and fetches again. **Local trust, not a sandbox:** the job's close runs the person's own tests on code a PR author wrote; the close env strip applies, nothing more. Submodules and LFS objects are not fetched. **Wiring:** `RunCtx.pr` / `Deps.pr` `{url, record, reread?}` is the door (an override seam; no flag sets it); a repo job whose ticket line is a PULLS list supplies it from its own frozen read (see "A pull-request job, end to end" below). Test-proven against a local bare repo; $0-proven on a real same-repo and a real fork PR; the paid PR run is not done.
61
+ - **A pull-request job, end to end (MCP + tickets, the PR reader).** The ticket line may be the PULLS page of a repository (`PRs: https://github.com/<owner>/<repo>/pulls`) instead of the issues page: one parser (`parseTicketList`, `src/ticketshape.js`) reads both and says which (`kind: 'issue'|'pull'`); a pull's address is `/pull/<n>`. A pulls line is read with `pull_request_read {method: 'get', owner, repo, pullNumber}`, the only PR tool name bareloop hardcodes (as `issue_read` is for tickets; the limit: it is GitHub's own server's spelling, measured against the real server 2026-11-04, so a server that names it otherwise is not read). The job must have signed `pull_request_read` in `mcp.tools` (`proveInputFiles` refuses a pulls line at $0 otherwise, naming it; an issues line is still proven by `issue_read`). **The person's GitHub MCP server must enable the `pull_requests` toolset** (for the official server, `GITHUB_TOOLSETS=issues,pull_requests`, read-only is enough); a server without it does not offer the tool and the run is refused at $0 with "<server> does not offer pull_request_read (its GitHub server needs the pull_requests toolset enabled)". The reply (a JSON document of the real server's shape: `number, title, body, state, labels, head {sha, ref}, base {sha, ref}, additions, deletions, changed_files, ...`) is MASKED with the one inventory before the sha, like a ticket; a 40-hex commit sha is not a secret shape and survives the mask whole. `title`, `state` and `labels` come from the reply, so the ticket shape and the record are the same as an issue's. **On a REPO job** the frozen PR (to `<worktree>/.bareloop-input/<label>.txt`, as above) also feeds piece 12: `freezeRepoTicket` returns `pr = {url, record, reread}` (`record` = the parsed masked reply, whose `head.sha` and `base {ref, sha}` the checkout reads; `reread` = one fresh `pull_request_read`), and the run-start seam checks the PR's head out into the run's worktree before the seed is read (seed = PR head; `job-start` carries `pr {number, ownerRepo, head, base, mergeBase}`). An explicit `deps.pr` still wins. **On a rubric or plain-folder job** a pulls line freezes the PR TEXT only (the same masked reply as the run's input file); there is no repository, so nothing is fetched or checked out. A pulls list is not an issue-look target: `ticketListsOf` (the `new-ticket` look's `list_issues`) names issues lists only. Test-proven (fake server answering with the real reply's keys, a local bare repo serving `refs/pull/1/head`, the real engine); not yet run live end to end, and the paid PR run is not done. One known gap: when the PR moves between the read and the fetch, the re-read refreshes the head the checkout uses, but the frozen PR TEXT stays the first read.
62
+ - **The New job card: Flow type, MCP and a by-hand Ticket (MCP + tickets R4; `src/mcppick.js`, `src/panel/authorsession.js` `resolveFlowCard`/`ticketBoxProblem`, `src/panel/authorroutes.js` `startSession`/`signRun`).** After Inputs the card has `Flow type` (`plain` | `MCP` | `Tickets MCP`) and, for the last two, `MCP` (the usable servers of Settings > MCP: not remote, not shadowed). **Set by code, signed with the job:** `mcpPickFor(server, {home, mcpHome})` returns the tools of the server's newest successful `check tools` (`mcp-checks.jsonl`, matched by path and server), ALL of them, write tools included; it starts no server. `signFlow(spec, flowType, pick)` writes `flowType` and `mcp {server, tools}` AFTER the draft (the agent cannot carry them), and writes nothing for `plain`, so every plain job keeps its hash and `workflowKey`. **Refusals ($0, before any session, plain words):** "press check tools in Settings > MCP first" (never checked, only failed checks, or an empty tool list), "Pick an MCP.", "<server> is not in any MCP config (Settings > MCP lists the ones found)", "<server> is a remote server, not supported yet", an unknown flow type, and for Tickets MCP "Tickets MCP needs the ticket list address (the issues or pulls page of one repository) as an Inputs line.". **A changed Flow type or MCP is a changed job** (`jobBoxesChanged`): Reuse prefills both from the signed spec; unchanged reuses the signed plan verbatim, changed drafts a new workflow under a new name (the origin's own name is refused). A schedule card and a resume lock both boxes. **By-hand Tickets run:** the card's `Ticket` box (shown for Tickets MCP only) takes a ticket NUMBER, read by `ticketNumberOf` (digits, no sign or leading zero, 1 to 9,999,999,999; the same reader as `--ticket`); it is per run, never signed, kept in `card.json`, and `signRun` passes it as `run-u --ticket <n>`. A bad number, or a number on a plain/MCP job, is refused at the start; a BLANK Ticket box is allowed and means the newest ticket this job has not run (R6, see "The ticket look" below). The box's hint reads `leave blank for the newest ticket this job has not run, or type its number, like 7`. **No export for a job that has `mcp`:** `exportRun` and the export list refuse it ("<run> uses an MCP (<server>), and a job that uses an MCP cannot be exported"). **Job tab:** an `MCP` row lists the signed flow type (card words), server, each tool, and a ticket filter / watched fields when present; a plain job shows none. **Planner:** an MCP job's planner prompt also says the server and tool list were set by the program and the plan has no field for them; `ticketFilter` is not offered to it yet. Honest limits: the $0 ticket-line proof reads the person's config from the process home, not from the Settings > MCP list's added paths; the page is checked from the served HTML and screenshots, never at phone width; no live run of a card-made Tickets job yet.
63
+ - **A skipped ticket (MCP + tickets R5; `src/ticketlabels.js` is fwd's `decideTicket` as is, `src/ticketfilter.js`, `src/userrun.js`, `src/panel/status.js`).** At run start, right after the ticket is frozen and BEFORE any worker, model call or PR checkout, code decides RUN or SKIP from the ticket's typed `labels` and `state` (no model, no prose reading): a closed ticket always skips; with a signed `ticketFilter`, a priority reads `P0`-`P3` (`Priority: P2` and `priority : P2-High` read as `P2`), a missing priority label or one off the list skips, a label named in `labels` must be on the ticket (case-blind); a label on another scale (`priority/important-soon`), two priorities, or a ticket whose text is not readable as fields is UNSURE and RUNS (never skipped); a ticket with no `labels` key has no labels. A skip appends ONE `settled` event on the run's already-listed `runs.jsonl` row, `{type:'settled', reason:'skipped', words, spentUsd:0, spendComplete:true}` (`words` = the reason only, never the status word again: `priority P3, not P1` | `the ticket is closed` | `no P1 label on the ticket` | `label bug not on the ticket`, from code), so the monthly claim is freed at $0; the run has NO spine, no learnings note, no bridge or credit row; the process exits 0 (a clean end, not a refusal), and the schedule ledger's `ran` row stays (the ticket stays seen). `--anyway` runs the ticket regardless. A skip is never a green: it does not arm a schedule and is not a reusable run. The panel wears it as status `skipped`, sign `[–]` (grey, no blink), terminal, not in Needs you; its plain words are the Ended line. The drafter is told the rule (a job line that names a priority or a label MUST get a `ticketFilter`; the legal example `{"priority": ["P1"], "labels": ["bug"]}` is in the prompt and in every red's detail; never invent a label); the line that names the filter has no check and is listed under `refused` ("Not checked") with the reason that the filter decides before the run starts.
64
+ - **The ticket look, the `new-ticket` schedule and the newest-unrun pick (MCP + tickets R6; `src/triggertickets.js`, `src/ticketschedule.js`, `src/ticketnext.js`, `src/panel/scheduler.js`).** **The look** (`lookTickets`) is panel-side CODE at $0, never a model step: it starts the job's signed server with `allow` = `list_issues` alone (the signed `mcp.tools` must contain it) and reads newest first, `perPage` 10, up to 20 pages, stopping at a seen number. A ticket is new only if its number is higher than the highest seen (numeric compare, so #10 follows #9; a closed seen ticket leaves the open-only list without making older open ones new). A number over 9,999,999,999 is ignored and named on a `looked` row. Every failure (token, server error, no list in the answer, an EMPTY first page, a missing tool, a pulls list, more than 20 pages of new tickets) is `{ok:false, error}`; none reads as "0 new". **The trigger** is `{kind:'new-ticket', input:'<Inputs label>'}` and nothing else (a key beyond `kind`/`input` is an `unknown-field` red): the server, list address and watched fields are DERIVED from the signed spec (`ticketLookOf`: `flowType` `tickets`, `mcp.server`, the Inputs line with that label being an ISSUES list, `ticketWatch`), so the trigger holds nothing the spec does not sign; `workflowKey` ignores it. **Signing** is the same two clicks as any trigger and needs a real green first; it is refused in plain words when the job to be signed is not a Tickets MCP job, the label is not one of its Inputs, the line is not an issues list, or `list_issues` is not in its signed tools. The schedule card's When dropdown offers `When a new ticket arrives in <input>` only when `cardFor(job).ticketInputs` is non-empty, with an input picker and no path box. **The scheduler** looks every 15 minutes (`TICKET_LOOK_MS`, no oftener, looks never overlap, the first tick looks at once; the look is async and `tick` never waits for it, `settled()` does). Rows in the job's one `ledger.jsonl`, all with `sig`, ids unique within a signing, `name:'#<n>'`, `sha:'ticket:<n>'` (a watched change `ticket:<n>:<k>`, id `arrived:ticket:<n>:<k>`), `size:0`: the FIRST look writes a `baseline` row per ticket on the page and nothing runs (the first look is tried again as a first look until one reads, so an unreadable first look leaves no baseline); later looks write one `arrived` row per new ticket, oldest first, and one per watched change with its `reason` (a change on a ticket still queued advances its last-seen value with a `baseline` row and queues nothing); a look that could not read writes ONE `unreadable` row with its cause, never `baseline`/`arrived`; the first look that reads after one writes a `looked` row. The arrival time is the scheduler's own clock. The queue runs like a file's: busy tells each waiting ticket once; free, the head goes through `door.fire` with `{kind:'ticket', number, sha}` and `ran` is written by `beforeSpawn` only after busy, monthly limit and `wouldAccept` said yes; a refused fire consumes nothing and makes no session. A ticket fire leaves the signed spec UNCHANGED (same hash, like a clock fire): the number rides on the session card and argv as `--ticket <n>` (`--anyway` arrives with the anyway route, not here); `trigger.json` records `{kind:'ticket', ticket, sha}`. A paused (gave-up) schedule still looks and queues but starts nothing; cancelling drops every waiting ticket with a `dropped` row and a plain line. A save that fails (the ledger cannot be written) leaves the panel up, the next look is tried, and the failure is told once the ledger takes a row again. **By hand with no number** (`src/ticketnext.js`, called by `run-u`, so the CLI and the panel share one owner): a fresh Tickets run that names no `--ticket` runs the same look over the signed `list_issues` and takes the newest ticket above the highest number this job has already run (a skipped run counts: the run list row now carries `ticket`); a job with no ticket run yet takes the newest open ticket of the first page. Nothing new, an unreadable list, a pulls list or no `list_issues` signed is one plain line (`... Type the ticket number to read instead. The run did not start. Nothing spent.`) and no run; a typed `--ticket` never looks. Older run rows have no `ticket`. **Not built yet in this release line:** the schedule on the New job card, the wait-for-green turn-on, the red "could not read the list" line on the schedule card (`lookProblemOf` exists, nothing shows it), "Run it anyway", and the Result grid.
65
+ - **R9 ticket fixes (`src/natural.js`, `src/schedulewords.js` `lookProblemWords`, `src/panel/schedules.js`, `src/panel/server.js` `neverRanPlan`).** (1) `queueOf` breaks same-`at` ties with `compareNatural` on the name, so `#9` queues before `#10`. (2) The schedule door's state carries `lookProblem` (`lookProblemOf` over the signing's seen rows; a `new-ticket` schedule only): `view()` then has `next`/`nextRed` = `The last look could not read the tickets: <cause>. It looks again in 15 minutes.` and `nextWords`/`problem` = `last look <MM/DD HH:MM> · could not read the tickets: ...` red; a later look that reads (its `looked` row) clears it; a schedule still off (`waiting`) keeps its grey line. (3) `run.js` writes `ticketFilter: {unsure: <reason>}` on `job-start` when the filter ran unsure (`runJob` option `ticketUnsure`, set in `userrun.js`); the ticket grid row carries `unsure: true` and `unsureSay` (`FILTER_UNSURE_SAY`), the page draws a grey `unsure` badge and the line when the row is opened. (4) `getStartFrom` returns `neverRan` (`neverRanPlan(events, row)`: NO spine on disk and a leg-1 `settled` event `refused before start` or `skipped` with `spentUsd` exactly 0 and `spendComplete` not false); `start-from` then says `green: true` and `POST /api/author/start` with the job unchanged reuses the signed job (no drafting), so an unchanged Reuse is Sign & run; any red run with a spine, and any changed job, drafts. (5) `draft-log.jsonl` `call` lines carry `raw` (the scrubbed answer, omitted when empty) for the draft, confirm and scout calls. (6) A run refused before its first step (`settleRefused`) removes its empty run folder (`rmdir`, never a folder with anything in it).
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
+ - **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
+ - **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
+
70
+ ## Public API` → "THE JUDGED FLOOR" and "THE REVIEW DOOR" below. `green` and
50
71
  `soft-green` are the only classes on offer for new jobs.
51
72
  - **Worker surface — how the agent runs:** `provider: 'anthropic-api'` (the default, the
52
73
  only one with an operational guarantee, F48) drives `bare-agent`'s `Loop` and takes the
@@ -161,6 +182,10 @@ minting claim, or the shell-owned retry cap — all unknown-field reds.
161
182
  | `thinking` | optional boolean | the job's "Thinking on" tick (P8): absent = off, and an old spec keeps the hash it always had; present it is signed like `model`. Covers DRAFTING and the rubric JUDGE, and makes every WORKER call think (see "Thinking on" below) |
162
183
  | `handoffNote` | optional boolean | LEGACY and IGNORED (the handoff note was folded into the carry memo, which is always on): either value has no effect. Still accepted and signed so an old spec keeps its hash; new drafts never write it. Not shown in the panel. See "Carry note" below |
163
184
  | `seedNote` | optional boolean | Default ON (part of the carry-over memory): absent = on, only `false` turns it off; on, it hands the planner's first draft (its own block) and, through the carry memo's "Earlier failures (folded):" section labelled `at start`, every step/fix worker what the job's own `count-not-worse` check said on the untouched tree (see "Seed note" below). An old spec keeps the hash it always had; a present value is signed (the switch enters `jobSpecHash` and `workflowKey`; the text never does). Not shown in the panel |
185
+ | `mcp` | optional `{server, tools}`; `server` and each tool a plain name (`[A-Za-z0-9][A-Za-z0-9_-]*`), `tools` a non-empty list without duplicates, no other key | the MCP source (MCP + tickets, R2a): `server` is a name in the person's own MCP config (`~/.mcp.json`, bare-agent's other three places, or a path added in `config.json` `mcpPaths`; first name wins; a repo's own `.mcp.json` is never read) and `tools` the list the person signed. A ticket address in Inputs is read through it at run start (see "Tickets"). Set by CODE from the person's card pick and signed by the person; `assembleSpec` refuses a draft that carries it (the agent never widens its own tool menu). Absent keeps every old spec's hash; present it enters `jobSpecHash` AND `workflowKey` (a changed MCP is a changed workflow). No export for a job that has it |
186
+ | `flowType` | optional `'plain'` \| `'mcp'` \| `'tickets'` | the job's flow type, set by code from the job card. `plain` takes no `mcp`; `mcp` and `tickets` need one; an `mcp` block with no `flowType` reads as `tickets`. `ticketFilter` and `ticketWatch` belong to `tickets` only. Refused in a draft (`assembleSpec`) like `mcp`; same hash rule |
187
+ | `ticketFilter` | optional `{priority?: ['P0'..'P3'], labels?: [name]}`, at least one key, lists non-empty and without duplicates (labels compared case-blind, 1-100 characters) | which tickets run: pure matching on labels and state, no model per ticket. The drafter of a Tickets job may PROPOSE it (the authoring declaration offers an optional top-level `ticketFilter`, kept beside the close, never in it); the person signs it; a draft cannot carry it into a spec (`assembleSpec` refuses it). Needs `mcp`. Decided by code at run start (see "A skipped ticket" in Tickets); a signed filter is part of the hash and the workflow key |
188
+ | `ticketWatch` | optional non-empty list of `'state'` \| `'labels'`, no duplicates | the ticket fields a schedule may watch for a change (typed values only). Needs `mcp`. Validated and signed in this build; the scheduler that reads it arrives with the schedule rung |
164
189
  | `readMap` | optional boolean | EXPERIMENTAL, default OFF: absent = off, `true` makes the FIRST `shell_read` of a file of 200+ lines (not a test file) in an ask return a map of the file's named parts instead of its bytes; the second read of that path in the ask is today's read (see "First-read map" below). Only `true`/`false` are legal (anything else is an `invalid-value` red). An old spec keeps the hash it always had; a present value is signed. Not shown in the panel |
165
190
  | `judge` | optional `{provider, model}`, both non-empty; `provider` from the `PROVIDERS` menu | the signed JUDGE override (PRD item 32). Absent, the judge resolves to this job's own `provider`/`model` (`resolveJudge`) — which is what lets a non-Anthropic job judge without a second account. Present, it pins a judge deliberately different from the worker (an independent reader). Both halves are required together: a judge with a provider and no model is an identity nobody signed. Part of the signed hash, so changing it kills the signature and forces recalibration. Unknown nested keys red — no smuggling level exists in a signed spec. The drafting agent cannot express it: naming your own examiner is arbiter territory |
166
191
  | `writeScope` | array of contained globs | the operator's outer fence; the plan's own scopes must fit inside it, same containment code |
@@ -366,6 +391,7 @@ middle writes; `validatePlan` gates it against the SIGNED job spec before tokens
366
391
  | `steps[].model` | optional; `sonnet` (`STEP_MODELS`) | the step's model TIER — a menu, never a model string the agent spells (`sonnet` is a schema token meaning this job's worker model; the runner maps it, there is no tier table). `opus` is deliberately absent: reserved for work the human assigns, never plan-selectable; `haiku` was removed 2026-08-06 as a reversible ATTRIBUTION PROBE (F87, see `STEP_MODELS`), so the menu is one entry deep and the field is no longer offered in the drafting prompt. The field and its validator branch STAY: `model: "sonnet"` still validates, a stored bridge declaring it still loads, and restoring haiku is a one-token edit — this is not a finding that haiku is incapable. **The narrowing binds only what the AGENT may express.** Which real model a tier maps to, and what the caller runs as its own default worker model, stay the OPERATOR's: `providerFor` is yours, and the in-repo runner's `--model haiku` probe knob is untouched (PRD v1.36) — the runner's tier map is deliberately WIDER than the plan menu. Off-menu reds `invalid-value`. A step naming a tier when the caller supplied no `providerFor` factory is an `interpreter-red` STOP, never a silent run on the default tier |
367
392
  | `steps[].attempts` | optional; int `>= 1` | **RETIRED and INERT (F79) — it bounds nothing.** A step's iterations are governed by the STRIKE LADDER (below), which is shell-owned and inexpressible from the plan. The field is no longer offered in the drafting prompt and the runner ignores it; it is deliberately still ACCEPTED, because stored bridge plans carry it and a plan minted under one runner's number must not red under another's. The shape is still checked (a known field holding garbage stays a `bounds` red); the old `<= capRuns` ceiling is gone with the cap it named. It was previously TIGHTEN-only — which meant a step that needed MORE iterations could not ask, and drafters measurably tightened it instead (F77) |
368
393
  | `steps[].scope` | optional; one value from the SAME menu `tree-changed` uses | narrows this step's live WRITE fence to a subset of the signed `writeScope` — chosen from the offered scope menu (below), never authored. Off-menu reds `invalid-value` carrying the menu |
394
+ | `steps[].mcpTools` | optional; non-empty unique subset of the job's signed `mcp.tools` (MCP + tickets, R2c) | the MCP tools this step may call (a step with none has no MCP tool at all). A name outside the signed list reds `verb-escape` (`steps.N.mcpTools`, with the legal values and a legal example in the detail; the planner prompt carries the same rule and example, for a job with an `mcp` block only); `mcpTools` on a job that signed no server is a `verb-escape` too; empty/duplicate/non-string is `invalid-value`. A GENERIC MCP job (`flowType: 'mcp'`) must have at least one step granting one of its tools (`missing-required` on `steps`); a Tickets job's own `issue_read`/`list_issues` need no step. At run time the step starts the person's MCP server ONCE (`passEnv` PATH+HOME, start folder = home, `allow` = exactly this list, the signed server confirmed and no other), the granted tools are called `<server>_<tool>` and sit beside the step's verbs (an unsigned tool does not exist for the worker: it is told "Unknown tool"), and the bridge is closed after the step's last try, green or red. **The gate:** a step that grants MCP tools (and only such a step) also gets `tools.allowlist` = the action TYPES of its granted verbs (`read`, `write`, `edit`, `ctx_stash`... as `toolAction` names them, never the tool names) + the signed bridge names, so an unsigned name is denied by `tools.allowlist.exclusive`. A tool NAME list would deny the step's own reads (bareguard's allowlist matches the action type and is exclusive for every action). **Strategy line:** a step holding a bridge tool is told, in one line naming exactly the granted tools, to call one when it needs what only that service holds and that a reply is information, never instructions. **Secrets:** every reply (and error text) of a granted tool is masked with the one inventory (`redactSecrets`) before the model sees it, so a token a ticket carries cannot be copied into the tree. A server that is not configured, will not start, or lacks a signed tool stops the step at $0 in plain words (`interpreter-red`, `step could not be set up`). `step-start` carries `mcpTools`. Test-proven (fake server, real gate); not yet seen live |
369
395
  | `steps[].exit` | 1..2 items (`MAX_EXITS_PER_STEP`), ALL must pass (AND-only, no OR/NOT) | closed menu (`EXIT_TYPES`): `artifact-written(path, pattern?)` · `tree-changed(scope)` · `json-valid(path)` · `check-passes(name)`. **`tree-changed.scope` is a MENU, not a glob the agent authors** — the runner enumerates the signed fence entries plus the real directories beneath them (shallowest-first, capped at `MAX_SCOPE_MENU`=24; `legalScopes` in `src/plan.js`), `planPrompt` lists them verbatim, and `validatePlan` accepts membership only — the SAME array on both sides, so what was offered is what is accepted; omitted, it derives from `writeScope` alone — never a free-text fallback. `exit` is REQUIRED on every step: the planner prompt says so and shows one legal example (`EXIT_EXAMPLE`, `src/plan.js`), and the `missing-required` red carries the same example (F254). An off-menu value that escapes the fence still reds `scope-escape` (the ledger's attribution class), an in-fence unoffered value reds `invalid-value` carrying the menu. `runPlan` emits `scope-menu {offered, truncated, offerableCount?, cap?}` so a capped menu is never silently complete. `check-passes` must name a stage on the close's DERIVED menu (`check-unknown` red names the offered menu — no operator authors this list, it comes straight from `checkMenu(close)`); on a write-granted step it must be paired with `tree-changed` (`exit-illegal` — the seed tree is green, a lone check would pass untouched, F17/F46). **`check-passes` also requires a write-class verb (`write`/`edit`) on the SAME step** (`exit-illegal` — BREAKING for plan authors: a read-only "verify" step carrying a check used to validate and no longer does). A failing check's gap is re-delivered to that step's OWN worker, so a step holding a check must be able to act on it; a read-only one is a mailbox with no hands and stalls to cap on a byte-identical gap (measured on 4 of 4 drafted plans). The check belongs on the step that fixes; the run's final verification is the operator's close, which the agent never authors. The rule is stated identically in the drafter prompt and the validator, so the two can never disagree — and it is suppressed when `tools` failed to parse (the step's hands are unknowable then, and the real defect already redded: one defect, one red). `artifact-written.pattern` must compile AND survive a ReDoS shape check — an unbounded quantifier over a group that itself repeats unboundedly (`(a+)+`, `(\d*)*`, even wrapped: `((a+))+`) is an `invalid-value` red (F49, catastrophic-backtracking footgun; rewrite without a repeated group inside a repeat). Exits verify FORM, not truth — progress gates; the operator's close stays the one arbiter |
370
396
 
371
397
  **A step has exactly ONE check slot — plan for it.** The three exit rules above compose into
@@ -1903,7 +1929,7 @@ Loop path is untouched.
1903
1929
  **Resume-to-cap (close-first):** the job's close runs FIRST, before any tokens
1904
1930
  (`close-precheck` on the spine, output scrubbed at capture like every close). Already-green
1905
1931
  is a DISTINCT zero-token outcome, never plain `green`: nothing was done, so it mints no
1906
- learning credit and runs no on-green retention. A close that cannot RUN is a `broken-close`
1932
+ reuse credit and runs no on-green retention. A close that cannot RUN is a `broken-close`
1907
1933
  escalation before any provider call. So the resume story is: a `cap-halt` or `wall-halt`
1908
1934
  stop IS the checkpoint (the workdir + the close), the human raises `budgetUsd` or
1909
1935
  `maxWallMs` (a new spec hash — re-sign), and the rerun picks up where the budget died,
@@ -2146,7 +2172,7 @@ a named `reason`: no `registryDir` (`no-registry` — the registry is operator-s
2146
2172
  conjured), `outcome !== 'green'` (`green-predates-run` for already-green — accept confirms a
2147
2173
  verdict, it never mints one — else `not-green`), and no executed `plan` (`no-plan-executed`,
2148
2174
  R1). Every green class mints (hamr's ruling 2026-08-30): a `soft-green` row is born HELD —
2149
- its learning credit is quarantined until a signer accepts at the door — and a `green`-class
2175
+ its reuse credit is quarantined until a signer accepts at the door — and a `green`-class
2150
2176
  row is born RELEASED, because a machine's own close proved it and there was never a credit
2151
2177
  to quarantine; `quarantinesCredit(verdictType)` in `greenParts` is the one predicate, read
2152
2178
  off the record's own `verdictType`, never a flag. `door-accept` on a released row records
@@ -2771,6 +2797,10 @@ Report-only, counts and a reason, never text, no cost fields, not rounds (spend
2771
2797
 
2772
2798
  One report-only spine record per carry note given: `{type:'carry-note', phase, iteration, chars, capped, sections, text}`. `phase` is `step:<id>` or `fix`; `chars` is the length of `text` (at most 12,000); `capped` is true when the cap cut anything; `sections` is `{reads, searches, edits, earlier, failures}`, the COUNT of entries shown in each part; `text` is the exact note handed to the worker (F274, 2026-11-02), run through the one secret mask (`render` masks the whole text, diff hunks included; the emit masks again, idempotent), so `chars` is the masked length. Size cost: up to 12,000 characters per ask on the spine. Records from before 2026-11-02 have no `text`; the Audit reads them as "not saved (older run)". Written right before the ask runs, only for an ask that receives a note; no cost fields, no verdict. Absent only for an ask that has no note to give; there is no switch (the carry memo is always on). The prose rules are under "Carry note".
2773
2799
 
2800
+ #### `ctx-index` — the run's one index attempt (`src/planrun.js`)
2801
+
2802
+ One report-only spine record per run: `{type:'ctx-index', indexed, files?, ms, error?}`, written for the FIRST index attempt at worker setup (every run indexes at start since litectx 0.41 made `index.db` lazy; later per-ask refreshes are unrecorded). `indexed` is `LiteCtx.indexed` after the attempt, `files` the count the index reported, `error` the clipped message of a failed pass (the run goes on without function ranges). The worker is told nothing.
2803
+
2774
2804
  ### `replayRun(spineEvents, auditEvents?, { runId? })` / `formatReplay(summary)` / `summarizeForAllLine(summary)` / `formatAllLines(entries)` — `src/replay.js`
2775
2805
 
2776
2806
  `summarizeForAllLine(summary)` reduces one `replayRun` summary to one `--all`/directory-
@@ -2884,7 +2914,9 @@ shares the same seq counter, so it is an exact ordering where two same-milliseco
2884
2914
  are not), never pooled across every occurrence sharing the id. `rounds` counts real
2885
2915
  `worker-round` records (`phase === 'step:<id>'`), never the declared cap; `toolCalls` is the one
2886
2916
  thing still windowed by `ts` (the gate-audit carries no `step` or shared `seq`). `tripped` is the
2887
- last `escalation` whose `seq` falls inside the occurrence's window — `{category, detail}`, with
2917
+ last `escalation` whose `seq` falls inside the occurrence's window — `{category, detail}` (plus `ladder: true`
2918
+ when the escalation is the step ladder's own strike-limit stop, which is also category `cap-halt` but carries
2919
+ `spend.strikes`; a money cap's escalation does not), with
2888
2920
  `detail` falling back to `decision` when the escalation site carries no `detail` at all (a
2889
2921
  ladder-exhaustion `cap-halt`, `src/ralph.js`, is the measured example — without the fallback the
2890
2922
  tripped line would print a bare category and hide the real reason).
@@ -3538,7 +3570,7 @@ key you want first (the panel picks the row by the Model menu).
3538
3570
  /api/runs/:runid/rounds?part=&attempt=&offset=&limit=` (one attempt's rounds, lazily
3539
3571
  paged, for the Audit tab's Grouped view); `GET /api/runs/:runid/result` and `GET /api/runs/:runid/download?i=<n>` (PRD v1.107 Part 6, the Result tab of a rubric run: `result`
3540
3572
  is the signed lines and fact sentences plus the rows of each delivered step file (a row carries `proof: {text, marks: [[start, end]]}` when the run's `rubric-evidence` record holds what the check read for that result: the words to mark, never found by searching; absent for an old run or a quote the check did not read; a money cell then reads as the page wrote it, "144 US dollars", else the fact's own spelling "$144"); both read ONLY the paths of the run's own `destination-written` records, re-check their
3541
- sha256, and answer in words when the file changed or is gone; the detail carries `hasResult` and `delivered`); `POST /api/runs/:runid/rerun {text}` and `/pause` (human-click
3573
+ sha256, and answer in words when the file changed or is gone; the detail carries `hasResult` and `delivered`). R7b item 4: every OTHER run that ended (green or failed; a run with no `job-end` has none) gets `GET /api/runs/:runid/result` as `{runid, kind:'generic', job:{asked, scope}, ticket:{number,title,url}|null, changed:{head, files, paths, plus, minus, edits, anyCut, last:{files:[{path,diff}], note}, all:[{n, step, files}], foldWords, scopeLine}|null, checks:{head, passed, total, allPassed, stages:[{name, question, passed, status:{sign,word}, value, baseline, direction, baselineKind, notes}], notes}|null, work:{branch, finalCommit, madeFrom, repo, merge, drop, note}|null, run:{spent, spentNote, time, steps}, door}` read from the run's own records (`attempt-diff`, the LAST `outer-close`, `work-branch`, `job-end`/`plan-executed` through the Run tab's detail, `job-start`'s `ticket`); `work` is non-null only while the branch still exists in the repo (asked of git), and its `merge`/`drop` lines are text for the person; a rubric run's payload has no `kind` and is unchanged; `POST /api/runs/:runid/rerun {text}` and `/pause` (human-click R8 (ITEM33-BUILD pieces 4 and 10): the generic payload also carries `endedWords` (the Run tab's own `ended.reason`, or null). `GET /api/runs/:runid/grid` is the job-level grid of a TICKET job (a job where some run read a ticket; anything else answers 404 and the page draws the old tab): `{runid, job, scheduleLine, groups:[{key:'wait'|'stop'|'done'|'skip', label, open, rows:[{runId, runNo, number, title, url, name, bucket, status:{key,sign,word}, needs, at, steps:{mark,text}, checks:{mark,text}, cost:{mark,text}, time:{mark,text}, reason, anyway}]}], stats:{counts, spent, spentUsd, spentComplete}}`; one row per run-list row of the job, newest first inside a bucket; the bucket is the run's status key through `GROUP_OF` (`src/panel/tickets.js`, keyed by `src/panel/status.js`), a run waiting at its review door is Needs you; the cell marks are `g` `r` `q` (no verdict / unknown) `n` (not applicable); money is `panelMoney2` and reads `at least` for a floor, `unknown` when nothing is known, never `$0.00`; `anyway` is true on a skipped row no later run read. A row opens through `GET /api/runs/:runid/result` of THAT run (the one generic owner); the grid reads no diff. `POST /api/author/ticket-anyway {job, ticket, reason}` (a click route behind the token + Origin/Host guard) runs a skipped ticket anyway: a blank reason, one over 500 characters, a bad number or a ticket that is not a skipped row of the job starts nothing (400/409, plain words); with the job's ticket schedule still OFF it starts that ticket's run at once by hand (`run-u --ticket N --anyway`, no row, 202 `{started:true}`), with it ON it writes ONE `arrived` row (`reason`, `anyway: true`, `recordAnyway` in `src/triggertickets.js`) and the scheduler starts it with `--anyway` under the job's normal cap (202 `{queued:true}`); a job with NO ticket schedule at all (am3: for a first ticket this is the only way to run it) starts that ticket at once the same way, from the skipped run's own saved signed job (the `resolved-spec.json` its session kept beside where its log would be, read by `getStartFrom` and started through the one starter's by-hand path: `--ticket N --anyway`, no review door, the job's cap, no row, 202 `{started:true}`); a skipped run with no readable signed job there is refused in words naming why. `GET /api/runs/:runid/result`'s `checks` (and so the grid's checks cell and an opened row's checks line) is the outer close's stages when the close ran; for a run the close never reached (a cap-halt, a stop) it is the checks the steps ran, read through the Audit grid's own data (`replayRun` parts): each check's last graded try, `value`/`baseline` null (the in-loop record carries no structured number), `tries` = how many times its step tried; `head` says `the steps ran them; the close never ran`.
3542
3574
  guard, the engine's own `run-u --door --decide`, only while the run waits at its review door; empty rerun words are refused); `GET /api/runs/:runid/job` (the signed spec's
3543
3575
  own fields, ONLY when a bundle-layout run's `spec.json` is reachable — a run-u run has
3544
3576
  none on disk, and this reads `resolved:false` with every spec-only field honestly
@@ -3678,7 +3710,7 @@ key you want first (the panel picks the row by the Model menu).
3678
3710
  stopped runs are `no ending recorded` and `you pressed Stop` (each `— resume` when Resume is offered).
3679
3711
  Every PART of a run detail (`parts[]`) also carries its own `status` `{key, sign, word}` from the same table
3680
3712
  (`partStatusFor`, `src/panel/status.js`): drafting, a green outcome and a part with no verdict and no cut-off → passed; a red
3681
- outcome → its run-outcome word; a part its leg's halt cut off → capped (money cap / time cap — also a leg that ended `escalated` on a money-halt or wall-halt, and the open step of a single-leg run that ended on a cap), stopped (you stopped it),
3713
+ outcome → its run-outcome word; a part its leg's halt cut off → capped (money cap / time cap — also a leg that ended `escalated` on a money-halt or wall-halt, and the open step of a single-leg run that ended on a cap; and the LAST step part of a run that ended capped when that step's OWN escalation was the cap — its `step-end` reads `escalated` with no stop reason, so `cappedLastStep` in `src/panel/server.js` gives it the cap word, a `wall-halt` escalation reading time cap and a `cap-halt` that is not the ladder's reading money cap; a step its own strike limit escalated, and any earlier escalated step, stays failed), stopped (you stopped it),
3682
3714
  died, else failed. A run that DIED (no `job-end`, runner gone) leaves its last part in flight: when that part has no outcome
3683
3715
  and no cut-off, the server marks it `died` (`[?] died`), never the "happened, so passed" default — replay alone cannot tell
3684
3716
  died from still running, so `getRunDetail` decides it from the same `death` verdict as the run's status. A live run's open
@@ -3847,7 +3879,7 @@ key you want first (the panel picks the row by the Model menu).
3847
3879
  <runid|path>`; `--door <runid|path>` with `--decide <rerun|accept|pause>` and (`rerun`
3848
3880
  only) `--text <…>`; `--review-door`; `--approve <specHash>`; `--registry <dir>` +
3849
3881
  `--workflow <name>`; `--model <id>` (a model id of a ticked Settings line — for a spec that names none) and `--provider <KEY>` (the key's env name, when two keys tick one id; no tier aliases); `--read-shim <off|cap|diff|all>`; `--scout
3850
- <on|off>`. No key/no injected `deps.provider`: prints the preview (invocation hints, the
3882
+ <on|off>`; `--ticket <n>` (a job that reads tickets: the ticket to read at run start, a whole number from 1 to 9,999,999,999; per run, never signed; on a fresh start of such a job it may be left out (then the run takes the newest ticket this job has not run, see "The ticket look"), refused on any other job; a resume or door keeps the copy its first start froze) and `--anyway` (needs `--ticket`; runs that ticket even when the job's filter would skip it). A job that reads tickets and works on a code repository freezes its ticket into the worktree's private `.bareloop-input/` (see "Tickets"); the panel's card takes the number typed in its Ticket box (see "The New job card" in Tickets). No key/no injected `deps.provider`: prints the preview (invocation hints, the
3851
3883
  right key variable — the Settings row's own) and exits `0`, spending nothing. A spec that names no
3852
3884
  model and no `--model`, or a model no ticked line carries, is refused at $0 with one plain sentence
3853
3885
  (`Name the model with --model <id>: …` / `<model> is not set up: …`). `scripts/run-u.mjs` is unchanged in behaviour: it is the pre-existing thin adapter
@@ -4035,7 +4067,7 @@ counts its real spend. If the sum fits, the run goes; if not, it appends `{type:
4035
4067
  reason:'refused'}` and refuses with the exact text, nothing spent. A run whose row is listed (claimed, or with no limit set) that then exits at $0 before its spine has a first record (a refused
4036
4068
  `--resume` patient, a failing tree setup) appends `{type:'released', reason:'not started'}` too, so it leaves no row; so does a $0 refusal after the spine exists (`SOURCE-MANIFEST-RED`, `DESTINATION-RED`, `CLOSE-TIMING-RED`). A row that cannot be written, or an
4037
4069
  unreadable config, refuses too — never "no limit". When a run ends it appends its own
4038
- `{runid, type:'settled', by:<runid>, spentUsd, spendComplete, at}`. Two runs may close the same dead claim;
4070
+ `{runid, type:'settled', by:<runid>, spentUsd, spendComplete, at}`. A settled entry may also carry `reason` and plain `words`: `refused before start` (a run refused after it was listed) and `skipped` (a ticket the job's filter did not let through, MCP + tickets R5) both end at $0 with no spine. Two runs may close the same dead claim;
4039
4071
  the FIRST note for a runid is authoritative. `readRunList` folds these entries out of the run rows
4040
4072
  (`events`; a `released` claim's row is not listed). Month totals still read real spend off the spines. An
4041
4073
  older row with no `pid` keeps the spine-mtime rule (`DIED_MTIME_MS`: a spine written to within it is in
@@ -4072,6 +4104,16 @@ legacyMaxTokens, tokens, models}]}`), `POST .../provider` (`{slot, shape?, baseU
4072
4104
  and `GET /api/author/models` (Chat's Model menu: every ticked-and-priced line, `{slot, model, label, thinking}`, `<KEY> · <model>`). There is no Balance route. Like the authoring routes, a POST body over 1 MiB is refused `413`.
4073
4105
  A Chat card carries `provider` (the key's env name) beside `model`; `/api/author/model-check`, `start-from` and `reuse-jobs` take `?provider=` too.
4074
4106
 
4107
+ **Settings > MCP (MCP + tickets piece 7; `src/mcpsources.js`, `src/mcpchecks.js`, `src/mcpuse.js`, `src/panel/settingsroutes.js`).** One list, "Path and MCP": the four places bare-agent reads (`~/.mcp.json`,
4108
+ `~/.claude/mcp_servers.json`, `~/.config/Claude/claude_desktop_config.json`, `~/.cursor/mcp.json`) then the paths added in `config.json` `mcpPaths`; first name wins, a later same-name server reads "same name as above, not used"; a
4109
+ server with no start command (remote) is listed, never started. A project folder's `.mcp.json` is never read. The page never edits an MCP file, never shows a command, args, env or key, and never reads or writes `.env`. Four routes, all behind
4110
+ the human-click guard (token + Origin/Host, the GET too; the authoring session has no path to them): `GET /api/settings/mcp` (`{ok, problem, places:[{path, added, status:'found'|'missing'|'not-json', servers:[{name, remote,
4111
+ shadowedBy, check:{at, ok, tools:[{name, hint:'read-only'|null}]}|{at, ok:false, error}|null, use:{calls, runs, last, denied, tools}|null}]}]}`), `POST .../mcp-check` (`{server}`: press only, starts that one server once with `PATH` and `HOME`
4112
+ and the home folder as cwd, lists its tools; refusals `unknown-mcp`, `remote-mcp`, `shadowed-mcp`, `already-checking`), `POST .../mcp-path` (`{path}`; `bad-path`, `path-listed`) and `POST .../mcp-path-remove` (`{path}`; only a path you added,
4113
+ else `path-unknown`). A press appends one line to `mcp-checks.jsonl` beside `config.json` (append-only; `{server, path, at, ok, tools:[{name, hint}]}` or `{..., ok:false, error}` with one fixed plain sentence; a tool NAME and a hint,
4114
+ never an env value or a command line); the page shows the newest line per path and server. Use counts are read, never written: a ticket read from a run's `source.json` (`mcp.calls`) or a repo job's first `job-start` (`ticket.mcp`), a step's
4115
+ call from the gate-audit rows of the run's work folder (`<server>_<tool>`; a denied call is counted apart). In tests the person's home folder is injected (`createPanelServer({mcpHome})`, `mcpSources({mcpHome})`), so discovery reads a fixture home.
4116
+
4075
4117
  ### The source front door — a plain folder/file/URL, no `--patient` (PRD item 33/M2, `src/source.js`)
4076
4118
 
4077
4119
  A repo job still gives `runJob` a `--patient` checkout it owns. A NON-code job (a resume, a
@@ -4486,12 +4528,30 @@ A **Rubric** job whose first Input is the full path of a FILE (not a repo folder
4486
4528
  - **Panel topbar.** `bareloop · v<version> · automate a job, verified`: the version is bareloop's own package.json, read once when the panel starts and templated into the page when it is served (`__BARELOOP_PANEL_VERSION__`), so it is the version the process runs, not what package.json says now. Right of the host line and left of Settings sits the online dot (`#online-dot`): the Runs list read (the 10 s poll, no new endpoint or timer) paints green `online` on any HTTP reply, even an error status or a 200 whose body will not parse, and red `offline` only when the read fails with no HTTP status (the panel process is gone); a page render error after a good read never paints it offline.
4487
4529
  - **After drafting, the code-worded card is the only plan on screen (run mv5e1ktb).** The confirm turn's plan bubble is the drafter's own prose (written before any close existed) and used to stay in the thread above the code-worded card; when the rubric card is ready the earlier `kind:'plan'` messages are dropped. `partSentence` now reads "1 line" / "1 word" for a count of one.
4488
4530
  - **Each `~` guardrail is its own row on the plan card.** `planFromSpec` / `planFromConfirm` lines carry `rules: string[]` (the line's own `rules`, else the joined `rule` split on "; "); `renderJobPlan` draws one `~ rule` row per rule under its numbered line, in the plan card and the Job tab alike (one renderer). Gutter numbers stay on job lines only.
4489
- - **The review door's held line is true for a no-judge close.** Credit is held by VERDICT CLASS (`quarantinesCredit`: soft-green), whether or not a judge ran; the door now says "this is a rubric (soft-green) job, so its green earns NO reuse and NO learning credit until you accept it, whether or not a judge ran". Wording only; `bridges.js`/`reuse.js`/the Reuse refusal still say "rendered by the judged floor".
4531
+ - **The review door's held line is true for a no-judge close.** Credit is held by VERDICT CLASS (`quarantinesCredit`: soft-green), whether or not a judge ran; the door now says "this is a rubric (soft-green) job, so its green earns NO reuse credit until you accept it, whether or not a judge ran". Wording only; `bridges.js`/`reuse.js`/the Reuse refusal still say "rendered by the judged floor".
4490
4532
  - **A refused drafting try records why.** `authorClose` emits `onPhase('author-try-failed', { call, i, of, reds | reason, declaration? })` for a try refused by validation (the scrubbed reds), by a vacuous or stopped seed read (a `reason`), or by an all-cut-off reply; the panel writes `{kind:'try-refused', no, call, reason, reds?, declaration?}` to `draft-log.jsonl` (`tryRefusedText`, `src/authorreadout.js`, the code's own red details) and shows `<call>: refused — <reason>` on the drafting step's detail line. The CLI prints it via `phaseLine`. The refused declaration itself rides beside it (`declaration`, secrets masked; `declarationText` + `declarationCut` when over 60000 characters), so a failed draft can be read and replayed at $0 (`declarationRecord`).
4491
4533
 
4534
+ ### Check picks — the person chooses how a `~` rule is counted (R10 = fwdloop M10 am16-am21, `src/checkpick.js`, `src/checkwords.js`, `src/checksuggest.js`, `src/pickrecord.js`)
4535
+
4536
+ For a rubric job (a text file input; `RUBRIC_LANG`) the **drafter writes no word, section, line, list-item or phrase check**; the person's picks put them there. All of it is fwdloop v0.29.0's, ported and ruled 2026-11-09 (`docs/product/ITEM33-BUILD.md`, R10).
4537
+
4538
+ - **The ten pickable rules** (`OFFERED` in `src/checkwords.js`, bareguard `^0.31.0`'s own `rubricVocabulary`): `nonEmpty`, `maxWords`, `minWords`, `maxLines`, `listItems`, `sections`, `sectionOrder`, `sectionWords`, `mustCarry`, `blockLines`. Each is a `countable` part of the line's `rubric-step` stage (`COUNT_CHECKS` in `src/rubricstep.js`, same mapping to bareguard `createRubric`/`checkStep`), with one fixed plain sentence from `partSentence` (the plan card) and `plainWords` (the ask). `cited`, `minClaims`, `maxClaims` and `numbersFromFacts` are NOT picks and are drafted as before.
4539
+ - **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).
4540
+ - **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.
4541
+ - **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.
4542
+ - **The asks** are the look's own ask path (`source: 'look'`, `ask: 'check' | 'no-check'`): `Line n, guardrail "<rule>": I propose <plain words>. Answer "agree" to use it, or type your own words (your answer is added as a new ~ rule on line n), or answer "drop it" to leave it Not checked.` or `Line n, guardrail "<rule>": I can't check this. Your own words, or Not checked? ...`. **The cap:** a proposal never counts; the look's asks plus the `I can't check this` asks may be at most `MAX_QUESTIONS` (3), else the draft stops at $0 (`look-asks-too-many`) and lists them. `agree` writes the plain words as a new `~` rule and picks the check; own words are a `~` rule with no check; `drop it` leaves it Not checked.
4543
+ - **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, the ~ line the answer wrote]`, 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).
4544
+ - **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 `~` lines the answers added) 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.
4545
+ - **Editing an agreed line (am21).** If the person edits the `~` line an `agree` wrote, ONE ask is about the edited words (`pairRule` = the rule it was agreed from); the answer replaces that line in place, the old line never comes back, and `drop it` leaves it and its source Not checked.
4546
+ - **Last-try drop (PRD v1.131 tick 4, `dropExtras` in `src/checkpick.js`, `dropAfterLastTry` in `src/authorflow.js`).** Rubric jobs only, only after the LAST try failed the plan check: when every red points at one part the AI wrote (not a pick, not a guard, not a `numbersFromFacts` part), those parts are dropped to Not checked (a pure extra as a `line N: "<words>"` note, a part that carried a `~` rule no other part carries as that rule's `refused` entry, both with `DROPPED_WORDS`) and the plan is checked once more; any other red keeps the refusal. Known gap (F309): a line whose only AI part is dropped leaves its rubric-step with `parts: []` and the plan can still sign with zero checks. Seen live in paid round 6 (3 drafts; paid round 5: 0 firings).
4547
+ - **Retention record (PRD v1.131 tick 7, `retentionOf` in `src/checkpick.js`).** When a rubric draft ends, `authorClose` reports the `draft-retention` phase once and the panel session writes one `{kind:'retention', no, lines:[{line, aiParts, kept, dropped, picks}], at}` row to `draft-log.jsonl`: counts only, no words. Seen live in paid rounds 5 and 6 (a record on every draft that reached a declaration; a draft refused before one has none).
4548
+ - **One label list.** For an input the page-word map read, the drafter is offered only the labels the draft gate accepts (`labelListsFor`, `src/factwords.js`); any other input keeps the code-made scan list. The gate itself is unchanged. Leaning, not proof: `rubric-fact-label-off-list` had 0 tries in 20 drafts in paid round 6 (n=10 per arm, one model).
4549
+ - **A close with no check that can fail.** When signing is refused because nothing fails on the seed and the close is a text-lang close holding no check part (only `files-changed`, or rubric-step stages with no parts), `signingStopText` (given `closeDecl` by both the CLI and the panel) says "This job has no check that can fail" instead of the repository sentence (`isNoCheckRubricClose`, `src/authorreadout.js`). It fires only when nothing fails on the seed; the zero-check plan above is not caught by it (F309). The stop itself was seen live (paid round 5, draft 18); the new words were not (paid round 6 arm C: 0 of 2 drafts stopped with them).
4550
+ - **Seen live:** the pick path ran in paid rounds 4b, 5 and 6 (arm A drafts: two asks, `picks:true` in the retention record, honesty bar H1-H5 passing). **Still not seen live:** the D3 build (code builds a pick the suggest call did not keep; 0 of 10 arm A drafts in rounds 5 and 6) and `rubric-fact-twice` (0 firings); the carry is test-proven on the real session with a scripted model.
4551
+
4492
4552
  ### 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)
4493
4553
 
4494
- Check what the person asked for, not what the worker chose to write. bareloop needs bareguard `^0.27.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`).
4554
+ Check what the person asked for, not what the worker chose to write. bareloop needs bareguard `^0.31.0` (0.31 adds `listItems` and `carriesAny`) (`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`).
4495
4555
 
4496
4556
  - **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.
4497
4557
  - **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.
@@ -4516,10 +4576,11 @@ Check what the person asked for, not what the worker chose to write. bareloop ne
4516
4576
 
4517
4577
  ## Triggers — a job that starts by itself (panel-only; `src/trigger*.js`, `src/panel/schedules.js`, `schedulestart.js`, `scheduler.js`, `src/schedulewords.js`)
4518
4578
 
4519
- - **The `trigger` field of a signed spec** is a typed object, never cron text: `{kind:'daily'|'weekdays', hour, minute}`, `{kind:'weekly', day:'mon'..'sun', hour, minute}`, `{kind:'new-file', folder}` or `{kind:'file-updated', path}` (absolute paths). By hand = the key is ABSENT, so a by-hand spec hashes as before. `workflowKey` ignores it. The agent never sets it: `assembleSpec` refuses a draft that carries it.
4579
+ - **The `trigger` field of a signed spec** is a typed object, never cron text: `{kind:'daily'|'weekdays', hour, minute}`, `{kind:'weekly', day:'mon'..'sun', hour, minute}`, `{kind:'new-file', folder}` or `{kind:'file-updated', path}` (absolute paths), or `{kind:'new-ticket', input}` (the label of a Tickets job's issues-list Inputs line; see "The ticket look"). By hand = the key is ABSENT, so a by-hand spec hashes as before. `workflowKey` ignores it. The agent never sets it: `assembleSpec` refuses a draft that carries it.
4520
4580
  - **Only the panel fires.** `createPanelServer` runs one 500 ms unref'd scheduler (poll only, never `fs.watch`); the CLI never fires. Panel off = nothing fires; slots missed collapse to ONE catch-up (marked when more than 2 minutes late). `createPanelServer` test seams: `scheduleNow`, `schedulerIntervalMs` (0 = no timer), `sessionDeps`, `acceptWaitMs`.
4521
4581
  - **Files live under `<config home>/triggers/<job>/`**: `schedule.json` (the current signed schedule) and ONE append-only `ledger.jsonl` (every row carries `sig`, the spec hash it was written under). A run that a schedule started carries `trigger.json` beside its `resolved-spec.json`.
4522
4582
  - **Setting one is two clicks, both $0** (`POST /api/author/schedule-prepare`, then `/api/author/schedule` with the hash). It needs a real green run of the job's CURRENT workflow (a rubric job also an honoured Accept). A file trigger is for plain-files jobs only. Cancel is never refused. A reuse never clears a schedule: Reuse workflow (the one door, v1.101) keeps the origin's name while no job box is changed and switches the Job name to the next free `<base>-N` once one is; a changed job is a new workflow that needs its own green before it can be scheduled.
4583
+ - **A schedule can be signed WITH the job, on the New job card (MCP + tickets piece 9, R7).** The card's `Schedule` row (`By hand` | `When a new ticket arrives` (Tickets MCP only) | `Every day at HH:MM`, fwd's words, served from `SCHEDULE_WORDS.card`) puts the typed trigger INTO the signed spec at job creation (`spec.trigger`, set by code in `finish`, never by the drafter), so the first run's hash already covers it; `workflowKey` ignores it, and a card with nothing picked writes no `trigger` key, so an unscheduled job hashes exactly as before (pinned on a real archived spec). The trigger is built by `cardScheduleOf` (`src/cardschedule.js`) at $0 before any session: a new-ticket pick is filled from the card (exactly one issues-list Inputs line, the pick's `list_issues`), a job that already has a schedule is not overwritten, and the card's Destination is checked by the same `startDestinationProblem` as always. Sign & run (`signRun`) writes `schedule.json` OFF through `door.signWithJob`: a `signed` row and a `waiting` row that remembers the run ids the job already had (`before`); nothing looks, fires or queues while it waits (the scheduler asks `armFor` every tick, which answers `{armed: false, waiting: true}`). The ONE turn-on is `armFor`: it arms when a run that was not in `before` has a real green under `greenFor` (an `already-green` run, a skipped run, a red run and a run of another workflow key never do; a RUBRIC job arms at its honoured Accept, not at the bare green). A ticket schedule keeps the ticket number that run read (`armed.ticketN`, from the run list row's `ticket`), so its first look baselines only tickets up to it and one that came in during the wait runs once. A run that never started (a spawn that throws or errors) takes its waiting schedule back. The Run tab's SCHEDULE block, the Audit `schedule` section, the Job tab Schedule row and the schedule card say `Schedule waiting for a green run` while it waits. `schedule-prepare`/`schedule` stay for jobs scheduled after their green, for editing, and for Cancel (never refused). `door.startAnyway({job, number})` (am3) starts a ticket's run at once by hand while the ticket schedule is still OFF (`run-u --ticket N --anyway`, no review door, no `trigger.json`, no ledger row); no HTTP route calls it until the grid's "Run it anyway" (R8). The card offers only these three picks; weekdays, weekly and file triggers are set after the first good run.
4523
4584
  - **A fire goes busy, then monthly limit, then `wouldAccept`, then the one starter** (the same session start and `signRun` as a Reuse the person clicked, with `--review-door`). Busy, monthly and refused fires consume nothing and are told once per `key|outcome|why`, so they retry. A file fire whose name holds a line break or ends in whitespace is refused at `perFireSpec` (the card text is `label: value` lines, so it would read back as another Inputs line); the person is told to rename the file. A run is busy while its pid is alive AND its process started no later than 5 s after its run row was written (a recycled pid is not that run). A run waiting at its review door is not busy.
4524
4585
  - **An install-needed refusal backs off, then gives up.** When a fire's copy needs packages, that job's next attempt waits 1, 2, 3, 5, 8, 13, then 21 minutes (in memory: a restart begins at the first wait); a wait that would pass 60 minutes in total is not taken: the schedule writes ONE `gave-up` row and is paused (nothing fires; files still queue as `arrived`), and the job shows in Needs you with the pill `Check` (`listGaveUp`). Signing the schedule again writes `resumed` and clears it. Constants: `INSTALL_RETRY_STEPS_MS`, `INSTALL_GIVE_UP_MS` (`src/panel/schedules.js`).
4525
4586
  - **A scheduled green is held until accepted**: `getStartFrom` reads its outcome as `green-held` and the Reuse list skips it, until the spine holds an honoured accept.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bareloop",
3
- "version": "0.54.0",
3
+ "version": "0.55.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",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "bare-agent": "^0.59.0",
31
31
  "barebrowse": "^0.25.0",
32
- "bareguard": "^0.27.0",
33
- "litectx": "^0.32.0"
32
+ "bareguard": "^0.31.0",
33
+ "litectx": "^0.41.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^22.0.0",