toolroll 0.9.119 → 0.9.122

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 (64) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +18 -31
  3. package/dist/agent-fence.js +57 -9
  4. package/dist/assignment.js +9 -7
  5. package/dist/batch-checks.js +2 -2
  6. package/dist/browser/workspace.js +23 -23
  7. package/dist/builder.js +12 -8
  8. package/dist/central-recovery-stage.js +3 -3
  9. package/dist/cli-help.js +1 -0
  10. package/dist/codex-limits.js +40 -22
  11. package/dist/coding-provider.js +3 -3
  12. package/dist/contracts/console-api.js +3 -0
  13. package/dist/direct-chat-fence.js +9 -3
  14. package/dist/direct-chat.js +82 -10
  15. package/dist/engine-reads.js +3 -1
  16. package/dist/flexible-agents.js +16 -2
  17. package/dist/flexible-import.js +38 -0
  18. package/dist/flexible-save.js +128 -0
  19. package/dist/flexible-session.js +11 -3
  20. package/dist/flexible-ship.js +3 -3
  21. package/dist/flexible-thread.js +7 -3
  22. package/dist/install-method.js +1 -3
  23. package/dist/invoke.js +11 -9
  24. package/dist/lead-tools.js +3 -2
  25. package/dist/live-terminal.js +24 -3
  26. package/dist/local-checks.js +32 -0
  27. package/dist/local-landing.js +321 -63
  28. package/dist/local-owner.js +3 -0
  29. package/dist/operate.js +25 -7
  30. package/dist/plan-limits-demand.js +48 -0
  31. package/dist/planner.js +2 -0
  32. package/dist/project-delete.js +1 -1
  33. package/dist/project-skills.js +105 -17
  34. package/dist/result-follow-ups.js +24 -10
  35. package/dist/review-context.js +2 -1
  36. package/dist/scout.js +2 -1
  37. package/dist/serve.js +8 -1
  38. package/dist/server/direct-chat.js +25 -3
  39. package/dist/server/engine-api.js +24 -3
  40. package/dist/server/render-release.js +27 -15
  41. package/dist/server/render-results.js +6 -4
  42. package/dist/server/route-table.js +8 -1
  43. package/dist/server/send-back-build.js +4 -0
  44. package/dist/server/settings.js +153 -3
  45. package/dist/server/task-views.js +8 -3
  46. package/dist/server/tasks.js +51 -9
  47. package/dist/server/terminals.js +3 -1
  48. package/dist/settings-groups-ui.js +1 -1
  49. package/dist/skill-library-schema.js +70 -0
  50. package/dist/skill-library.js +693 -0
  51. package/dist/skill-local-sync.js +334 -0
  52. package/dist/skills-manifest.js +6 -3
  53. package/dist/skills-ui.js +122 -1
  54. package/dist/store.js +22 -4
  55. package/dist/subscription-usage.js +11 -5
  56. package/dist/surface.js +3 -2
  57. package/dist/task-base.js +23 -4
  58. package/dist/task-outcome-cli.js +10 -1
  59. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  60. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  61. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  62. package/dist/tui/linux-x64/toolroll-tui +0 -0
  63. package/dist/verification-evidence.js +3 -1
  64. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,83 @@ Each release opens with one line on its theme, then **New**, **Changed**, **Fixe
4
4
  the ones it has). Each item is at most two lines and says where to find it. Notes for maintainers (CI, the release
5
5
  tooling) go on the GitHub release, not here. Entries before 0.9.104 use the older format.
6
6
 
7
+ ## 0.9.122 — 2026-11-26
8
+
9
+ Share one pinned skill library across every project and agent, approve releases on one clear screen, and enjoy a cleaner Mac titlebar.
10
+
11
+ ### New
12
+
13
+ - **Global Skill Library:** add skills or import a pinned GitHub skill bundle (including 59+ skill packs) once in **Settings → Skills**, shared across all projects by default with whole-library or per-skill project opt-out.
14
+ - **Automatic skill bundle updates & rollback:** daily checks apply clean updates automatically, hold suspicious changes for review with reasons, and offer one-step rollback without touching your manual skills.
15
+ - **Also install on this computer:** mirror enabled global skills into your detected local Claude Code, Codex, and Gemini CLI folders in **Settings → Skills** without overwriting your own skills.
16
+ - **Unified skills across every agent:** tasks, coding sessions, Direct Chat (Claude, Codex, Gemini), Flexible threads, live terminals, and the lead all receive the same pinned skill set.
17
+
18
+ ### Changed
19
+
20
+ - **One-screen release sheet:** `/t/<id>/release` now shows a compact summary card with optional disclosure sections instead of two pages of boilerplate.
21
+ - **Solo-owner skill library management:** solo installs can manage the global skill library, bundles, project opt-outs, and local sync without a password prompt.
22
+
23
+ ### Fixed
24
+
25
+ - **Mac app titlebar alignment:** the top bar now sits cleanly on a single line beside the macOS window controls.
26
+ - **Workbench help layout:** `T`/`S` keys fit on one row with shorter Land labels.
27
+ - **Skill sandbox hardening:** custom evidence roots are denied across all launch kinds, and exact skill file digests and ancestor folders are re-verified at spawn time.
28
+ - **`toolroll update` on checkout-deployed planes:** updating a plane originally deployed from a local checkout now works cleanly.
29
+
30
+ ## 0.9.121 — 2026-11-26
31
+
32
+ Share one pinned skill library across every project and agent, approve releases on one clear screen, and enjoy a cleaner Mac titlebar.
33
+
34
+ ### New
35
+
36
+ - **Global Skill Library:** add skills or import a pinned GitHub skill bundle (including 59+ skill packs) once in **Settings → Skills**, shared across all projects by default with whole-library or per-skill project opt-out.
37
+ - **Automatic skill bundle updates & rollback:** daily checks apply clean updates automatically, hold suspicious changes for review with reasons, and offer one-step rollback without touching your manual skills.
38
+ - **Also install on this computer:** mirror enabled global skills into your detected local Claude Code, Codex, and Gemini CLI folders in **Settings → Skills** without overwriting your own skills.
39
+ - **Unified skills across every agent:** tasks, coding sessions, Direct Chat (Claude, Codex, Gemini), Flexible threads, live terminals, and the lead all receive the same pinned skill set.
40
+
41
+ ### Changed
42
+
43
+ - **One-screen release sheet:** `/t/<id>/release` now shows a compact summary card with optional disclosure sections instead of two pages of boilerplate.
44
+ - **Solo-owner skill library management:** solo installs can manage the global skill library, bundles, project opt-outs, and local sync without a password prompt.
45
+
46
+ ### Fixed
47
+
48
+ - **Mac app titlebar alignment:** the top bar now sits cleanly on a single line beside the macOS window controls.
49
+ - **Workbench help layout:** `T`/`S` keys fit on one row with shorter Land labels.
50
+ - **Skill sandbox hardening:** custom evidence roots are denied across all launch kinds, and exact skill file digests and ancestor folders are re-verified at spawn time.
51
+ - **`toolroll update` on checkout-deployed planes:** updating a plane originally deployed from a local checkout now works cleanly.
52
+
53
+ ## 0.9.120 — 2026-11-25
54
+
55
+ Landing puts exactly the change you reviewed on your branch, thread work can reach a local project, and Toolroll
56
+ stops spending plan usage while it sits idle.
57
+
58
+ ### New
59
+
60
+ - **Save a thread's work as a branch** in your project: `S` on a thread in the workbench, **Save as branch** in the
61
+ browser, or `toolroll thread save <id>`. It works after the thread ends and shows the `git merge` to run.
62
+ - **Land from the workbench:** **B** on a finished task (and "Land" in the palette). `task land` is listed in
63
+ `toolroll task --help`, and accepting a task says how to land it.
64
+ - **Reply to a Direct Chat** from its page in the browser.
65
+
66
+ ### Changed
67
+
68
+ - **Land puts one commit on your branch:** exactly the files that were checked, never the attempts you sent back.
69
+ With the branch checked out in your project folder, Toolroll never touches it: it gives you one `git merge` to run.
70
+ - **A sent-back revision shows its whole change since main,** not only what changed since the rejected attempt.
71
+ - **No plan-usage checks while Toolroll is idle:** it reads plan limits only while work runs, or for a few minutes
72
+ after you open Spend.
73
+ - **Build again right away** is offered wherever Approve would work with an empty password field.
74
+ - **Run checks** works from the browser session `toolroll` opens on a solo install, for the check command you approved.
75
+
76
+ ### Fixed
77
+
78
+ - **Running checks again no longer reopens accepted work;** a failing re-check blocks Land and says why.
79
+ - **"Looks right" accepts a passed result** in the browser without asking for a reason.
80
+ - **The task page says "On main"** after you merge the work yourself, and Undo still works.
81
+ - **A thread's Diff refreshes when a turn ends** and says when the agent has edits it hasn't committed.
82
+ - **Settings shows signed-in sessions,** not "devices", and the README's links work from npm.
83
+
7
84
  ## 0.9.119 — 2026-11-25
8
85
 
9
86
  Thread agents remember the conversation, accepted work can land on your branch, and releases stop re-running the
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  <div align="center">
2
2
 
3
3
  <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset="docs/media/wordmark-dark.svg">
5
- <img src="docs/media/wordmark-light.svg" alt="Toolroll" width="440">
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ap9000/toolroll/main/docs/media/wordmark-dark.svg">
5
+ <img src="https://raw.githubusercontent.com/ap9000/toolroll/main/docs/media/wordmark-light.svg" alt="Toolroll" width="440">
6
6
  </picture>
7
7
 
8
8
  ### Your agents build. You decide.
@@ -10,8 +10,8 @@
10
10
  **Delegate changes. Review verified diffs. Ship in one keystroke — in the native macOS app or your terminal.**
11
11
 
12
12
  <picture>
13
- <source media="(prefers-color-scheme: light)" srcset="docs/media/terminal-workbench-light.png">
14
- <img src="docs/media/terminal-workbench.png" alt="Toolroll: native macOS app and terminal workbench with tasks that need you and live streaming output" width="900">
13
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ap9000/toolroll/main/docs/media/terminal-workbench-light.png">
14
+ <img src="https://raw.githubusercontent.com/ap9000/toolroll/main/docs/media/terminal-workbench.png" alt="Toolroll: native macOS app and terminal workbench with tasks that need you and live streaming output" width="900">
15
15
  </picture>
16
16
  <sub>Native SwiftUI macOS app and keyboard-driven terminal workbench, zero Electron, zero telemetry.</sub>
17
17
 
@@ -19,7 +19,7 @@ For Claude Code, Codex, and Gemini — using the subscriptions already on your m
19
19
 
20
20
  [![npm](https://img.shields.io/npm/v/toolroll?color=171717)](https://www.npmjs.com/package/toolroll)
21
21
  [![CI](https://github.com/ap9000/toolroll/actions/workflows/ci.yml/badge.svg)](https://github.com/ap9000/toolroll/actions/workflows/ci.yml)
22
- [![license](https://img.shields.io/badge/license-MIT-171717)](LICENSE)
22
+ [![license](https://img.shields.io/badge/license-MIT-171717)](https://github.com/ap9000/toolroll/blob/main/LICENSE)
23
23
  [![Homebrew](https://img.shields.io/badge/homebrew-ap9000%2Ftoolroll-171717)](https://github.com/ap9000/homebrew-toolroll)
24
24
  ![node](https://img.shields.io/badge/node-%E2%89%A5%2022.20-171717)
25
25
 
@@ -29,29 +29,6 @@ For Claude Code, Codex, and Gemini — using the subscriptions already on your m
29
29
 
30
30
  ## Quick start
31
31
 
32
- ### Native macOS app (recommended on Mac)
33
-
34
- Install the native SwiftUI macOS app and local CLI together via Homebrew Cask (macOS 14 Sonoma+, Apple Silicon & Intel):
35
-
36
- ```sh
37
- brew install --cask ap9000/toolroll/toolroll
38
- ```
39
-
40
- Or download the signed, notarized `Toolroll-<version>-macos.dmg` directly from [GitHub Releases](https://github.com/ap9000/toolroll/releases/latest) and drag **Toolroll.app** to Applications. On launch, Toolroll automatically discovers or starts your local engine — no manual terminal setup required.
41
-
42
- <details>
43
- <summary>Building the native Mac app from source</summary>
44
-
45
- ```sh
46
- cd mac && bash build-app.sh && open build/Toolroll.app
47
- # Or package a local .dmg:
48
- cd mac && bash build-dmg.sh
49
- ```
50
-
51
- See [macOS release & signing guide](https://github.com/ap9000/toolroll/blob/main/docs/guide/mac-release.md) for Developer ID signing, notarization, and Homebrew Cask automation.
52
-
53
- </details>
54
-
55
32
  ### CLI & Terminal Workbench (macOS or Linux)
56
33
 
57
34
  Requires Node.js 22.20+, git 2.41+, and Claude Code (`claude`), Codex (`codex`), or Gemini signed in on this computer. On Linux, also install the sandbox tools: `sudo apt update && sudo apt install bubblewrap socat ripgrep`.
@@ -76,6 +53,16 @@ npm uninstall -g standing-orders && npm install -g toolroll
76
53
 
77
54
  </details>
78
55
 
56
+ ### Native macOS app (macOS 14 Sonoma+)
57
+
58
+ Build and launch the native SwiftUI **Toolroll.app** from a checkout (requires Xcode 16 / Swift 6; automatically discovers or starts your local Toolroll engine):
59
+
60
+ ```sh
61
+ cd mac && bash build-app.sh && open build/Toolroll.app
62
+ ```
63
+
64
+ Signed, notarized `.dmg` downloads and Homebrew Cask distribution are configured in [macOS release & signing guide](https://github.com/ap9000/toolroll/blob/main/docs/guide/mac-release.md) and will publish automatically once Developer ID signing secrets are enabled.
65
+
79
66
  Toolroll opens locally with no password and no login file — on your own computer you're already in. Start a **Direct Chat** for fast interactive iteration in an isolated clone, or delegate a **Task** to build while you walk away. Every result returns **Ready** with its diff and real check status; press `⌘⏎` (Mac app) or `a` (terminal) to accept and ship, or send it back with notes. To explore without model calls or spend, run `toolroll demo`. More: [Getting started](https://github.com/ap9000/toolroll/blob/main/docs/guide/getting-started.md).
80
67
 
81
68
  ## The terminal loop
@@ -175,9 +162,9 @@ docs for language models.
175
162
  ## Contributing
176
163
 
177
164
  Provider adapters are the most useful place to start. See
178
- [CONTRIBUTING.md](CONTRIBUTING.md). Report security issues as
179
- [SECURITY.md](SECURITY.md) describes.
165
+ [CONTRIBUTING.md](https://github.com/ap9000/toolroll/blob/main/CONTRIBUTING.md). Report security issues as
166
+ [SECURITY.md](https://github.com/ap9000/toolroll/blob/main/SECURITY.md) describes.
180
167
 
181
168
  ## License
182
169
 
183
- [MIT](LICENSE)
170
+ [MIT](https://github.com/ap9000/toolroll/blob/main/LICENSE)
@@ -228,6 +228,10 @@ export function agentFence(options) {
228
228
  }
229
229
  for (const path of options.extra ?? [])
230
230
  fence.add(real(path));
231
+ if (typeof options.evidenceRoot === "string" && options.evidenceRoot !== "") {
232
+ fence.add(resolve(options.evidenceRoot));
233
+ fence.add(real(options.evidenceRoot));
234
+ }
231
235
  for (const path of options.boundary?.protectedShell ?? [])
232
236
  fence.add(real(path));
233
237
  const protectedPaths = new Set([...fence].flatMap(path => literal.has(path) ? [path] : path === runFolder || [RUNNER_PROCESS_DIR, "backups", SECRETS_DIR].includes(basename(path)) ? [path, real(path)] : [real(path)]));
@@ -784,17 +788,48 @@ export function flattened(fence, grants = NO_GRANTS, list = path => readdirSync(
784
788
  return { deny, readOnly: [...readOnly].filter(path => !denied.some(one => path === one || inside(path, one))) };
785
789
  }
786
790
  export function exactFileReads(grants) {
787
- return (grants.exactFiles ?? []).filter(path => grants.readable.includes(path) && regularAt(path));
791
+ return (grants.exactFiles ?? []).filter(path => grants.readable.includes(path) && exactEntryValid(path, grants));
788
792
  }
789
- function regularAt(path) {
793
+ function exactRegularDigest(path) {
794
+ let fd = null;
790
795
  try {
791
- const held = lstatSync(path);
792
- return held.isFile() && !held.isSymbolicLink() && realpathSync(path) === path;
796
+ const there = lstatSync(path);
797
+ if (!there.isFile() || there.isSymbolicLink())
798
+ return null;
799
+ fd = openSync(path, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW | fsConstants.O_NONBLOCK);
800
+ const held = fstatSync(fd);
801
+ if (!held.isFile() || realpathSync(path) !== path)
802
+ return null;
803
+ return createHash("sha256").update(readFileSync(fd)).digest("hex");
804
+ }
805
+ catch {
806
+ return null;
807
+ }
808
+ finally {
809
+ if (fd !== null)
810
+ closeSync(fd);
811
+ }
812
+ }
813
+ function realFolderAt(folder) {
814
+ try {
815
+ const held = lstatSync(folder);
816
+ return held.isDirectory() && !held.isSymbolicLink() && realpathSync(folder) === folder;
793
817
  }
794
818
  catch {
795
819
  return false;
796
820
  }
797
821
  }
822
+ function exactEntryValid(path, grants) {
823
+ for (const folder of grants.exactFolders ?? []) {
824
+ if ((path === folder || inside(path, folder)) && !realFolderAt(folder))
825
+ return false;
826
+ }
827
+ const digest = exactRegularDigest(path);
828
+ if (digest === null)
829
+ return false;
830
+ const expected = grants.exactDigests?.[path];
831
+ return expected === undefined || digest === expected;
832
+ }
798
833
  export class ExactFileChanged extends Error {
799
834
  }
800
835
  export function claudeFenceSettings(fence, readOnly = []) {
@@ -843,7 +878,7 @@ export class LinuxFenceUnavailable extends Error {
843
878
  export function srtTermsOf(fence, grants = NO_GRANTS) {
844
879
  const denyRead = new Set(fence.map(real));
845
880
  const regular = new Set(grants.exactRegular ?? []);
846
- const allowRead = new Set(grants.readable.flatMap(path => regular.has(path) ? (regularAt(path) ? [path] : [])
881
+ const allowRead = new Set(grants.readable.flatMap(path => regular.has(path) ? (exactEntryValid(path, grants) ? [path] : [])
847
882
  : grants.exactFiles?.includes(path) === true ? [real(path)] : [real(path), real(dirname(path))]));
848
883
  const denyWrite = new Set([...fence, ...grants.readOnly].map(real));
849
884
  for (const path of grants.writeDenies ?? [])
@@ -972,13 +1007,26 @@ export function launchSandboxOf(profile) {
972
1007
  export function fenceFor(kind, ctx) {
973
1008
  const home = ctx.home === undefined ? {} : { home: ctx.home };
974
1009
  const storage = ctx.storage?.denies ?? protectedStorageDenies(ctx.home ?? homedir());
975
- const fence = agentFence({ databaseFile: ctx.databaseFile, worktree: ctx.worktree, ...home, boundary: ctx.boundary, binding: ctx.binding, runFolders: ctx.runFolders, extra: [...ctx.extra ?? [], ...ctx.readDeny ?? []], protectedStorage: storage });
1010
+ const fence = agentFence({ databaseFile: ctx.databaseFile, worktree: ctx.worktree, ...home, boundary: ctx.boundary, binding: ctx.binding, runFolders: ctx.runFolders, extra: [...ctx.extra ?? [], ...ctx.readDeny ?? []], ...(ctx.evidenceRoot === undefined ? {} : { evidenceRoot: ctx.evidenceRoot }), protectedStorage: storage });
976
1011
  const found = fenceGrants({ databaseFile: ctx.databaseFile, worktree: ctx.worktree, boundary: ctx.boundary, runFolders: ctx.runFolders, linked: ctx.linked ?? null, binding: ctx.binding, ...home, poolRoots: ctx.poolRoots });
977
1012
  const made = installDenied(found, ctx.worktree, ctx.home ?? homedir(), ctx.binding?.main ?? null);
978
1013
  const written = ctx.writes ?? null;
979
- const exact = [...new Set([...(ctx.exactFile == null ? [] : [ctx.exactFile]), ...ctx.exactFiles ?? []])].filter(path => {
980
- if (regularAt(path))
1014
+ const exactFolders = [...ctx.exactFolders ?? []];
1015
+ const rawExact = [...new Set([...(ctx.exactFile == null ? [] : [ctx.exactFile]), ...ctx.exactFiles ?? []])];
1016
+ if (rawExact.length > 0 && exactFolders.some(folder => !realFolderAt(folder))) {
1017
+ throw new ExactFileChanged("A skill folder this launch was to read changed before it started, so nothing was started.");
1018
+ }
1019
+ const exactDigests = {};
1020
+ const exact = rawExact.filter(path => {
1021
+ const digest = exactRegularDigest(path);
1022
+ if (digest !== null) {
1023
+ const expected = ctx.exactDigests?.[path];
1024
+ if (expected !== undefined && digest !== expected) {
1025
+ throw new ExactFileChanged("A file this launch was to read changed before it started, so nothing was started.");
1026
+ }
1027
+ exactDigests[path] = digest;
981
1028
  return true;
1029
+ }
982
1030
  try {
983
1031
  lstatSync(path);
984
1032
  }
@@ -990,7 +1038,7 @@ export function fenceFor(kind, ctx) {
990
1038
  const grants = {
991
1039
  ...made,
992
1040
  ...(written === null ? {} : { writes: written.writes, readOnly: [...new Set([...made.readOnly, ...written.readOnly])].sort() }),
993
- ...(exact.length === 0 ? {} : { readable: [...made.readable, ...exact], exactFiles: exact, exactRegular: exact, readOnly: [...new Set([...made.readOnly, ...(written?.readOnly ?? []), ...exact])].sort() }),
1041
+ ...(exact.length === 0 ? {} : { readable: [...made.readable, ...exact], exactFiles: exact, exactRegular: exact, exactDigests, ...(exactFolders.length === 0 ? {} : { exactFolders }), readOnly: [...new Set([...made.readOnly, ...(written?.readOnly ?? []), ...exact])].sort() }),
994
1042
  ...(ctx.network === undefined ? {} : { network: ctx.network }),
995
1043
  ...(ctx.machLookup === undefined || ctx.machLookup.length === 0 ? {} : { machLookup: [...ctx.machLookup] }),
996
1044
  ...(kind === "check" || (kind === "flow" && ctx.browser === true) ? { browser: true } : {}),
@@ -18,7 +18,7 @@ import { historicalAssessmentReason } from "./assignment-presentation.js";
18
18
  import { manualReviewOnly, shownVerdictOf } from "./proof.js";
19
19
  import { ACCEPT_NEEDS_REASON, cantAcceptYetOf } from "./result-acts.js";
20
20
  import { requiredCheckCommandFor, runCheckLevel } from "./check-levels.js";
21
- import { followUpChecksOf, withFollowUps } from "./result-follow-ups.js";
21
+ import { FOLLOW_UP_LOG, FOLLOW_UP_RECEIPT, followUpChecksOf, withFollowUps } from "./result-follow-ups.js";
22
22
  import { buildReviewOf, findingWords } from "./review-switch.js";
23
23
  import { NEEDS, WAITS, processNeedOf, resultHoldUpSentence } from "./needs-you.js";
24
24
  import { assignmentStageOf, checkBackingOf, completionBlockersOf, receiptChecksOf, requirementWordOf } from "./task-status.js";
@@ -176,7 +176,9 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
176
176
  .map(artifact => `Saved ${artifact.kind} #${artifact.id} (run ${run.id}) is unavailable or changed.`)));
177
177
  const finishedBuild = result?.role === "builder" && (result.outcome === "built" || result.outcome === "no-change") &&
178
178
  result.finishedAt !== null && /^[a-f0-9]{40}$/.test(result.headRevision ?? "");
179
- const sealFor = (ownChecks) => {
179
+ const sealFor = (ownChecks, asOf) => {
180
+ const sealed = asOf === undefined ? artifacts : artifacts.filter(a => !(a.kind === "structured-output" && (a.capture === FOLLOW_UP_LOG || a.capture === FOLLOW_UP_RECEIPT)
181
+ && Date.parse(a.createdAt) > asOf.getTime()));
180
182
  const checks = ownChecks === null || ownChecks.level !== "off" || ownChecks.status === "passed" || ownChecks.status === "failed" ? ownChecks
181
183
  : { ...ownChecks, release: releaseCoverageOf(store, root, current.repo, result.headRevision, memo === undefined ? {} : { memo }) };
182
184
  const completionKind = result?.role === "scout" && result.outcome === "built" && result.finishedAt !== null ? "research-report"
@@ -185,12 +187,12 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
185
187
  const receiptBody = result === null ? null : {
186
188
  rootId: family.root.id, taskId: current.id, runId: result.id, base: result.baseRevision,
187
189
  head: result.headRevision, scopeDigest: result.scopeDigest ?? null, proof, completionKind, proofAcceptance: acceptance, checks: checks,
188
- artifacts: artifacts.map(a => ({ id: a.id, kind: a.kind, sha256: a.sha256, bytes: a.bytesStored,
190
+ artifacts: sealed.map(a => ({ id: a.id, kind: a.kind, sha256: a.sha256, bytes: a.bytesStored,
189
191
  complete: !a.truncated && a.captureStatus !== "failed" })),
190
192
  caveats: [...(proof?.reasons ?? []), ...unavailable,
191
- ...(completionKind === "research-report" && reports.length !== 1 ? ["The report artifact is missing or ambiguous."] : []), ...(completionKind === "accepted-exception" && !artifacts.some(a => a.kind === "proof") ? ["No builder proof artifact is recorded."] : []),
192
- ...(artifacts.some(a => a.kind === "check-log" && a.truncated) ? ["The check log was shortened when stored; only the retained output is available."] : []),
193
- ...artifacts.filter(a => a.kind !== "check-log" && (a.truncated || a.captureStatus === "failed")).map(a => `Saved ${a.kind} #${a.id} is ${a.captureStatus === "failed" ? "a failed capture" : "incomplete"}.`)],
193
+ ...(completionKind === "research-report" && reports.length !== 1 ? ["The report artifact is missing or ambiguous."] : []), ...(completionKind === "accepted-exception" && !sealed.some(a => a.kind === "proof") ? ["No builder proof artifact is recorded."] : []),
194
+ ...(sealed.some(a => a.kind === "check-log" && a.truncated) ? ["The check log was shortened when stored; only the retained output is available."] : []),
195
+ ...sealed.filter(a => a.kind !== "check-log" && (a.truncated || a.captureStatus === "failed")).map(a => `Saved ${a.kind} #${a.id} is ${a.captureStatus === "failed" ? "a failed capture" : "incomplete"}.`)],
194
196
  agentReport: result.handoff, evidence: "recorded",
195
197
  };
196
198
  const sealedBody = receiptBody === null ? null : { ...receiptBody, checks: sealedChecks(receiptBody.checks) };
@@ -263,7 +265,7 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
263
265
  .all(family.root.id, result.id, CHECK_ACTION, receipt.digest).find(row => COMPLETER_ACTOR.test(String(row["actor"])));
264
266
  const historical = exact !== undefined ? undefined : store.handle.prepare("SELECT actor,at,detail,outcome FROM action_ledger WHERE task_id = ? AND run_id = ? AND action = ? AND source = 'work' ORDER BY id DESC LIMIT 3")
265
267
  .all(family.root.id, result.id, CHECK_ACTION).filter(row => COMPLETER_ACTOR.test(String(row["actor"])) && !Number.isNaN(Date.parse(String(row["at"]))))
266
- .find(row => sealFor(assignmentChecksForRun(store, root, result.id, now, new Date(String(row["at"])))).receipt?.digest === String(row["outcome"]));
268
+ .find(row => sealFor(assignmentChecksForRun(store, root, result.id, now, new Date(String(row["at"]))), new Date(String(row["at"]))).receipt?.digest === String(row["outcome"]));
267
269
  const checked = exact ?? historical;
268
270
  if (checked !== undefined) {
269
271
  const rootRef = store.lookupRef(family.root.id);
@@ -174,7 +174,7 @@ async function checkCohort(store, root, repo, cohort, deps) {
174
174
  return { conflict: false, tested, outcome: { ran: false, failure: "The project's approved setup changed before the check started." }, setupFailed: false };
175
175
  if (liveSetup !== null) {
176
176
  const shell = approvedCommandShell(liveSetup.command);
177
- const prepared = await runWithIsolatedDatabase(checkoutRunner(store, repo, checkout, guardedRunner, set.map(one => one.runId), setRan), shell.file, shell.args, { cwd: checkout, timeoutMs: liveSetup.timeoutMs, processGroup: true, envAllowlist: SETUP_ENV_ALLOWLIST, omitEnv: SETUP_ENV_DENYLIST });
177
+ const prepared = await runWithIsolatedDatabase(checkoutRunner(store, repo, checkout, guardedRunner, set.map(one => one.runId), setRan, undefined, root), shell.file, shell.args, { cwd: checkout, timeoutMs: liveSetup.timeoutMs, processGroup: true, envAllowlist: SETUP_ENV_ALLOWLIST, omitEnv: SETUP_ENV_DENYLIST });
178
178
  note(set, section(`${label} · approved project setup on ${tested.slice(0, 7)}`, liveSetup.command, prepared));
179
179
  proveSet(set);
180
180
  if (prepared.code !== 0 || prepared.timedOut || prepared.notFound)
@@ -184,7 +184,7 @@ async function checkCohort(store, root, repo, cohort, deps) {
184
184
  if (live === null || live.digest !== command.digest)
185
185
  return { conflict: false, tested, outcome: { ran: false, failure: "The approved check changed before it started." }, setupFailed: false };
186
186
  const shell = approvedCommandShell(live.command);
187
- const ran = await runWithIsolatedDatabase(checkoutRunner(store, repo, checkout, guardedRunner, set.map(one => one.runId), setRan), shell.file, shell.args, { cwd: checkout, timeoutMs: live.timeoutMs, processGroup: true, envAllowlist: SETUP_ENV_ALLOWLIST, omitEnv: SETUP_ENV_DENYLIST });
187
+ const ran = await runWithIsolatedDatabase(checkoutRunner(store, repo, checkout, guardedRunner, set.map(one => one.runId), setRan, undefined, root), shell.file, shell.args, { cwd: checkout, timeoutMs: live.timeoutMs, processGroup: true, envAllowlist: SETUP_ENV_ALLOWLIST, omitEnv: SETUP_ENV_DENYLIST });
188
188
  note(set, section(`${label} · full check on ${tested.slice(0, 7)}`, live.command, ran));
189
189
  proveSet(set);
190
190
  if (set.length === 1 && !ran.timedOut && !ran.notFound) {