toolroll 0.9.117 → 0.9.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +14 -14
- package/dist/agent-fence.js +54 -6
- package/dist/assignment.js +40 -29
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +32 -31
- package/dist/builder.js +295 -237
- package/dist/central-recovery-stage.js +3 -3
- package/dist/check-failure.js +2 -2
- package/dist/check-levels.js +3 -0
- package/dist/check-report.js +58 -7
- package/dist/coding-context.js +16 -2
- package/dist/coding-provider.js +7 -3
- package/dist/coding-workspace.js +5 -5
- package/dist/contracts/console-api.js +4 -1
- package/dist/contracts/engine-api.js +1 -0
- package/dist/contracts/release-check.js +7 -4
- package/dist/contracts/release-terms.js +11 -2
- package/dist/contracts/verification-receipt.js +1 -1
- package/dist/deploy-gate.js +7 -1
- package/dist/direct-chat.js +3 -3
- package/dist/easy-start.js +8 -6
- package/dist/engine-reads.js +72 -0
- package/dist/flexible-conversation-schema.js +24 -0
- package/dist/flexible-conversation.js +162 -0
- package/dist/flexible-custody.js +3 -0
- package/dist/flexible-import.js +51 -0
- package/dist/flexible-session.js +84 -11
- package/dist/install-mode.js +1 -1
- package/dist/invoke.js +18 -6
- package/dist/local-landing.js +500 -0
- package/dist/local-owner.js +1 -0
- package/dist/operate.js +143 -22
- package/dist/passwordless.js +1 -1
- package/dist/planner.js +6 -1
- package/dist/project-delete.js +1 -0
- package/dist/project-skills.js +28 -13
- package/dist/rehearsal.js +27 -0
- package/dist/release-adapters.js +170 -2
- package/dist/release-approval.js +11 -8
- package/dist/release-card.js +7 -2
- package/dist/release-carry.js +1 -1
- package/dist/release-cli.js +115 -14
- package/dist/release-main-proof.js +49 -0
- package/dist/release-main.js +110 -0
- package/dist/release-recheck.js +10 -3
- package/dist/release.js +221 -33
- package/dist/reply-shape.js +6 -1
- package/dist/result-actions.js +7 -1
- package/dist/result-follow-ups.js +8 -4
- package/dist/scout.js +6 -2
- package/dist/serve.js +31 -14
- package/dist/server/direct-chat.js +88 -3
- package/dist/server/engine-api.js +43 -5
- package/dist/server/render-results.js +3 -1
- package/dist/server/render-tasks.js +10 -1
- package/dist/server/route-table.js +9 -0
- package/dist/server/settings.js +31 -7
- package/dist/server/task-views.js +15 -0
- package/dist/server/tasks.js +63 -3
- package/dist/settings-groups-ui.js +2 -2
- package/dist/skills-manifest.js +57 -0
- package/dist/store.js +29 -4
- package/dist/surface.js +9 -1
- package/dist/tui/darwin-arm64/toolroll-tui +0 -0
- package/dist/tui/darwin-x64/toolroll-tui +0 -0
- package/dist/tui/linux-arm64/toolroll-tui +0 -0
- package/dist/tui/linux-x64/toolroll-tui +0 -0
- package/dist/verification-evidence.js +17 -6
- package/dist/workspace-ui.js +1 -1
- package/package.json +3 -2
- package/scripts/release-proof.mjs +240 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,48 @@ 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.119 — 2026-11-25
|
|
8
|
+
|
|
9
|
+
Thread agents remember the conversation, accepted work can land on your branch, and releases stop re-running the
|
|
10
|
+
whole test suite.
|
|
11
|
+
|
|
12
|
+
### New
|
|
13
|
+
|
|
14
|
+
- **Threads remember the conversation.** Each reply's agent gets your earlier messages and its earlier answers, so a
|
|
15
|
+
follow-up builds on what was said. Your messages show in the transcript, in the terminal and the browser.
|
|
16
|
+
- **A Diff for threads:** Tab on a thread in the workbench, or Open on Agents → Live in the browser.
|
|
17
|
+
- **Land a task on your branch:** `toolroll task land <id>`, or **Land it** on the task page, shows what lands where
|
|
18
|
+
first; **Undo** reverts it with a new commit. When your project folder has the branch checked out, it gives you the
|
|
19
|
+
exact `git merge --ff-only` command to run there instead.
|
|
20
|
+
- **Direct Chat pages:** `/direct-chats` lists your chats; each shows its turns, its changes and Ship.
|
|
21
|
+
- **Send back and build again right away**, on the same terms, from the result page.
|
|
22
|
+
- **Releasing Toolroll from main:** `toolroll release prepare <version>`, merge it, then `toolroll release <version>`
|
|
23
|
+
checks a copy of your database in a sealed sandbox in minutes instead of re-running every test.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **Accepted work stays accepted** when you change the check command; releases and pull requests still wait for fresh
|
|
28
|
+
checks.
|
|
29
|
+
- **Accept asks for a reason only for an exception;** after "Looks right" it just accepts.
|
|
30
|
+
- **The workbench key bar shows a thread's own keys,** and an ended thread says **T** starts a new one.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **`verify set --repo .`** saves the project, not ".".
|
|
35
|
+
- **Settings → Checks and Pull requests** open your project (or a picker) instead of "No such project".
|
|
36
|
+
- **Task ids work with or without `task-`,** and the README's links work from the installed package.
|
|
37
|
+
- **Quitting after a failed hand-over** no longer says "stopped" while a second Toolroll keeps running.
|
|
38
|
+
|
|
39
|
+
## 0.9.118 — 2026-11-25
|
|
40
|
+
|
|
41
|
+
Agents can read the project skills they are told about.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **Project skills reach the agent.** Planner, builder, scout and coding-terminal agents were told about a project's
|
|
46
|
+
skills but couldn't open them inside their sandbox. Each now gets exactly its own skill files, read-only, checked
|
|
47
|
+
against what Toolroll prepared; a file changed in between stops the launch instead of opening anything else.
|
|
48
|
+
|
|
7
49
|
## 0.9.117 — 2026-11-25
|
|
8
50
|
|
|
9
51
|
Interactive agent threads keep working reply after reply, Direct Chat arrives, and agents get tighter fences.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ For Claude Code, Codex, and Gemini — using the subscriptions already on your m
|
|
|
23
23
|
[](https://github.com/ap9000/homebrew-toolroll)
|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
**[Website](https://toolroll.dev)** · [Docs](docs/guide/README.md) · [For agents](docs/agents.md) · [Use cases](https://toolroll.dev/use-cases) · [Changelog](CHANGELOG.md)
|
|
26
|
+
**[Website](https://toolroll.dev)** · [Docs](https://github.com/ap9000/toolroll/blob/main/docs/guide/README.md) · [For agents](https://github.com/ap9000/toolroll/blob/main/docs/agents.md) · [Use cases](https://toolroll.dev/use-cases) · [Changelog](CHANGELOG.md)
|
|
27
27
|
|
|
28
28
|
</div>
|
|
29
29
|
|
|
@@ -48,7 +48,7 @@ cd mac && bash build-app.sh && open build/Toolroll.app
|
|
|
48
48
|
cd mac && bash build-dmg.sh
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
See [macOS release & signing guide](docs/guide/mac-release.md) for Developer ID signing, notarization, and Homebrew Cask automation.
|
|
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
52
|
|
|
53
53
|
</details>
|
|
54
54
|
|
|
@@ -76,7 +76,7 @@ npm uninstall -g standing-orders && npm install -g toolroll
|
|
|
76
76
|
|
|
77
77
|
</details>
|
|
78
78
|
|
|
79
|
-
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](docs/guide/getting-started.md).
|
|
79
|
+
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
80
|
|
|
81
81
|
## The terminal loop
|
|
82
82
|
|
|
@@ -92,8 +92,8 @@ you. A result becomes **Ready**, awaiting your review, with its diff and actual
|
|
|
92
92
|
check status. Accept marks it Complete; publishing and merging need their own
|
|
93
93
|
approvals. Set your project's check to verify the exact result.
|
|
94
94
|
|
|
95
|
-
[Coming from herdr](docs/guide/from-herdr.md) ·
|
|
96
|
-
[Terminal keys and layouts](docs/guide/getting-started.md#the-terminal-workbench)
|
|
95
|
+
[Coming from herdr](https://github.com/ap9000/toolroll/blob/main/docs/guide/from-herdr.md) ·
|
|
96
|
+
[Terminal keys and layouts](https://github.com/ap9000/toolroll/blob/main/docs/guide/getting-started.md#the-terminal-workbench)
|
|
97
97
|
|
|
98
98
|
## Use cases
|
|
99
99
|
|
|
@@ -158,19 +158,19 @@ toolroll contract --commands --json # the whole command surface
|
|
|
158
158
|
toolroll skills get operating # the rules, from the binary you're running
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
Start at [docs/agents.md](docs/agents.md). [`llms.txt`](llms.txt) indexes the
|
|
161
|
+
Start at [docs/agents.md](https://github.com/ap9000/toolroll/blob/main/docs/agents.md). [`llms.txt`](https://github.com/ap9000/toolroll/blob/main/llms.txt) indexes the
|
|
162
162
|
docs for language models.
|
|
163
163
|
|
|
164
164
|
## Docs
|
|
165
165
|
|
|
166
|
-
- [Getting started](docs/guide/getting-started.md): install, first task, terminal, desktop app
|
|
167
|
-
- [Tasks, results and revisions](docs/guide/tasks.md)
|
|
168
|
-
- [Chat and your phone](docs/guide/chat-and-phone.md)
|
|
169
|
-
- [Flows](docs/guide/flows.md) · [Steps that reach outside](docs/guide/steps-outside.md) · [Subagents](docs/guide/subagents.md)
|
|
170
|
-
- [Running unattended](docs/guide/unattended.md) · [Fleets and trackers](docs/guide/fleet.md)
|
|
171
|
-
- [Security](docs/guide/security.md) · [Models, spend and routing](docs/guide/routing.md)
|
|
172
|
-
- [A team server](docs/team-server.md) · [Linux](docs/guide/linux.md)
|
|
173
|
-
- [All docs](docs/guide/README.md)
|
|
166
|
+
- [Getting started](https://github.com/ap9000/toolroll/blob/main/docs/guide/getting-started.md): install, first task, terminal, desktop app
|
|
167
|
+
- [Tasks, results and revisions](https://github.com/ap9000/toolroll/blob/main/docs/guide/tasks.md)
|
|
168
|
+
- [Chat and your phone](https://github.com/ap9000/toolroll/blob/main/docs/guide/chat-and-phone.md)
|
|
169
|
+
- [Flows](https://github.com/ap9000/toolroll/blob/main/docs/guide/flows.md) · [Steps that reach outside](https://github.com/ap9000/toolroll/blob/main/docs/guide/steps-outside.md) · [Subagents](https://github.com/ap9000/toolroll/blob/main/docs/guide/subagents.md)
|
|
170
|
+
- [Running unattended](https://github.com/ap9000/toolroll/blob/main/docs/guide/unattended.md) · [Fleets and trackers](https://github.com/ap9000/toolroll/blob/main/docs/guide/fleet.md)
|
|
171
|
+
- [Security](https://github.com/ap9000/toolroll/blob/main/docs/guide/security.md) · [Models, spend and routing](https://github.com/ap9000/toolroll/blob/main/docs/guide/routing.md)
|
|
172
|
+
- [A team server](https://github.com/ap9000/toolroll/blob/main/docs/team-server.md) · [Linux](https://github.com/ap9000/toolroll/blob/main/docs/guide/linux.md)
|
|
173
|
+
- [All docs](https://github.com/ap9000/toolroll/blob/main/docs/guide/README.md)
|
|
174
174
|
|
|
175
175
|
## Contributing
|
|
176
176
|
|
package/dist/agent-fence.js
CHANGED
|
@@ -17,6 +17,7 @@ import { seccompHelperPath } from "./sandbox-tools.js";
|
|
|
17
17
|
import { protectedStorageDenies, protectedStorageNames } from "./protected-storage.js";
|
|
18
18
|
import { ensureSecretsDir, legacyLoginFileOf, SECRETS_DIR, secretsDirOf } from "./login-secrets.js";
|
|
19
19
|
import { getDefaultWritePaths } from "@anthropic-ai/sandbox-runtime";
|
|
20
|
+
export const RESERVED_STATE_FOLDERS = ["coding-context", "code-map-delivery"];
|
|
20
21
|
export const FLEXIBLE_THREADS_DIR = "threads";
|
|
21
22
|
const SENSITIVE_NAME = /(^up-login\.txt$|token|secret|login|password|credential|vapid|keys?\b|\.pem$|\.key$|^backups$|^evidence$|^remote$|^sign-in\.json$|^monitoring\.json$)/i;
|
|
22
23
|
function real(path) {
|
|
@@ -143,6 +144,20 @@ export function agentFence(options) {
|
|
|
143
144
|
catch { }
|
|
144
145
|
fence.add(codexSessions);
|
|
145
146
|
fence.add(real(codexSessions));
|
|
147
|
+
for (const name of RESERVED_STATE_FOLDERS) {
|
|
148
|
+
const path = join(state, name);
|
|
149
|
+
try {
|
|
150
|
+
mkdirSync(path, { mode: 0o700 });
|
|
151
|
+
}
|
|
152
|
+
catch { }
|
|
153
|
+
fence.add(path);
|
|
154
|
+
fence.add(real(path));
|
|
155
|
+
}
|
|
156
|
+
const evidence = join(state, "evidence");
|
|
157
|
+
if (process.platform === "darwin" || existsSync(evidence)) {
|
|
158
|
+
fence.add(evidence);
|
|
159
|
+
fence.add(real(evidence));
|
|
160
|
+
}
|
|
146
161
|
const threads = join(state, FLEXIBLE_THREADS_DIR);
|
|
147
162
|
try {
|
|
148
163
|
mkdirSync(threads, { mode: 0o700 });
|
|
@@ -682,6 +697,10 @@ function codexFilesystem(fence, fullAccess, grants) {
|
|
|
682
697
|
if (basename(path) === INSTANCE_DIR)
|
|
683
698
|
access.set(path, "deny");
|
|
684
699
|
}
|
|
700
|
+
for (const path of exactFileReads(grants)) {
|
|
701
|
+
access.set(path, "read");
|
|
702
|
+
access.set(join(path, "**"), "deny");
|
|
703
|
+
}
|
|
685
704
|
const storage = grants.protectedStorage ?? [];
|
|
686
705
|
if (storage.length > 0) {
|
|
687
706
|
for (const [path, mode] of [...access])
|
|
@@ -730,8 +749,9 @@ export const SPLIT_SECRET_PATTERNS = ["orders.db*", "*token*", "up-login*", "*.t
|
|
|
730
749
|
export function flattened(fence, grants = NO_GRANTS, list = path => readdirSync(path)) {
|
|
731
750
|
const deny = [];
|
|
732
751
|
const readOnly = new Set(grants.readOnly);
|
|
752
|
+
const exact = new Set([...exactFileReads(grants), ...grants.exactRegular ?? []]);
|
|
733
753
|
const split = (path) => {
|
|
734
|
-
const within = grants.readable.filter(one => inside(one, path));
|
|
754
|
+
const within = grants.readable.filter(one => inside(one, path) && !exact.has(one));
|
|
735
755
|
if (within.length === 0) {
|
|
736
756
|
deny.push(path);
|
|
737
757
|
return;
|
|
@@ -750,8 +770,10 @@ export function flattened(fence, grants = NO_GRANTS, list = path => readdirSync(
|
|
|
750
770
|
deny.push(join(path, pattern));
|
|
751
771
|
for (const entry of entries) {
|
|
752
772
|
const child = join(path, entry);
|
|
753
|
-
if (grants.readable.includes(child))
|
|
754
|
-
|
|
773
|
+
if (grants.readable.includes(child)) {
|
|
774
|
+
if (!exact.has(child))
|
|
775
|
+
readOnly.add(child);
|
|
776
|
+
}
|
|
755
777
|
else
|
|
756
778
|
split(child);
|
|
757
779
|
}
|
|
@@ -761,6 +783,20 @@ export function flattened(fence, grants = NO_GRANTS, list = path => readdirSync(
|
|
|
761
783
|
const denied = deny.filter(path => !path.includes("*"));
|
|
762
784
|
return { deny, readOnly: [...readOnly].filter(path => !denied.some(one => path === one || inside(path, one))) };
|
|
763
785
|
}
|
|
786
|
+
export function exactFileReads(grants) {
|
|
787
|
+
return (grants.exactFiles ?? []).filter(path => grants.readable.includes(path) && regularAt(path));
|
|
788
|
+
}
|
|
789
|
+
function regularAt(path) {
|
|
790
|
+
try {
|
|
791
|
+
const held = lstatSync(path);
|
|
792
|
+
return held.isFile() && !held.isSymbolicLink() && realpathSync(path) === path;
|
|
793
|
+
}
|
|
794
|
+
catch {
|
|
795
|
+
return false;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
export class ExactFileChanged extends Error {
|
|
799
|
+
}
|
|
764
800
|
export function claudeFenceSettings(fence, readOnly = []) {
|
|
765
801
|
const rules = [...fence.flatMap(path => [`Read(/${path})`, `Read(/${path}/**)`, `Edit(/${path})`, `Edit(/${path}/**)`]), ...readOnly.flatMap(path => [`Edit(/${path})`, `Edit(/${path}/**)`])];
|
|
766
802
|
return JSON.stringify({ permissions: { deny: rules } });
|
|
@@ -806,7 +842,9 @@ export class LinuxFenceUnavailable extends Error {
|
|
|
806
842
|
}
|
|
807
843
|
export function srtTermsOf(fence, grants = NO_GRANTS) {
|
|
808
844
|
const denyRead = new Set(fence.map(real));
|
|
809
|
-
const
|
|
845
|
+
const regular = new Set(grants.exactRegular ?? []);
|
|
846
|
+
const allowRead = new Set(grants.readable.flatMap(path => regular.has(path) ? (regularAt(path) ? [path] : [])
|
|
847
|
+
: grants.exactFiles?.includes(path) === true ? [real(path)] : [real(path), real(dirname(path))]));
|
|
810
848
|
const denyWrite = new Set([...fence, ...grants.readOnly].map(real));
|
|
811
849
|
for (const path of grants.writeDenies ?? [])
|
|
812
850
|
denyWrite.add(path);
|
|
@@ -938,11 +976,21 @@ export function fenceFor(kind, ctx) {
|
|
|
938
976
|
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 });
|
|
939
977
|
const made = installDenied(found, ctx.worktree, ctx.home ?? homedir(), ctx.binding?.main ?? null);
|
|
940
978
|
const written = ctx.writes ?? null;
|
|
941
|
-
const exact = ctx.exactFile ??
|
|
979
|
+
const exact = [...new Set([...(ctx.exactFile == null ? [] : [ctx.exactFile]), ...ctx.exactFiles ?? []])].filter(path => {
|
|
980
|
+
if (regularAt(path))
|
|
981
|
+
return true;
|
|
982
|
+
try {
|
|
983
|
+
lstatSync(path);
|
|
984
|
+
}
|
|
985
|
+
catch {
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
throw new ExactFileChanged("A file this launch was to read changed before it started, so nothing was started.");
|
|
989
|
+
});
|
|
942
990
|
const grants = {
|
|
943
991
|
...made,
|
|
944
992
|
...(written === null ? {} : { writes: written.writes, readOnly: [...new Set([...made.readOnly, ...written.readOnly])].sort() }),
|
|
945
|
-
...(exact ===
|
|
993
|
+
...(exact.length === 0 ? {} : { readable: [...made.readable, ...exact], exactFiles: exact, exactRegular: exact, readOnly: [...new Set([...made.readOnly, ...(written?.readOnly ?? []), ...exact])].sort() }),
|
|
946
994
|
...(ctx.network === undefined ? {} : { network: ctx.network }),
|
|
947
995
|
...(ctx.machLookup === undefined || ctx.machLookup.length === 0 ? {} : { machLookup: [...ctx.machLookup] }),
|
|
948
996
|
...(kind === "check" || (kind === "flow" && ctx.browser === true) ? { browser: true } : {}),
|
package/dist/assignment.js
CHANGED
|
@@ -76,11 +76,11 @@ function ownerOf(store, rootId, repo) {
|
|
|
76
76
|
return { kind: "coordinator", id, label: String(credential?.["name"] ?? "Former lead"),
|
|
77
77
|
active: credential !== undefined && credential["revoked_at"] === null && repo !== null && Array.isArray(repos) && repos.includes(repo) };
|
|
78
78
|
}
|
|
79
|
-
export function assignmentChecksForRun(given, root, runId, now) {
|
|
79
|
+
export function assignmentChecksForRun(given, root, runId, now, asOf) {
|
|
80
80
|
const store = readerOf(given);
|
|
81
|
-
const own = recordedFailureStands(store, runId, buildChecks(store, root, runId));
|
|
81
|
+
const own = recordedFailureStands(store, runId, buildChecks(store, root, runId, asOf));
|
|
82
82
|
const run = store.getRun(runId);
|
|
83
|
-
const followUps = followUpChecksOf(store, runId, now, root);
|
|
83
|
+
const followUps = followUpChecksOf(store, runId, now, root, asOf);
|
|
84
84
|
if (followUps.length === 0)
|
|
85
85
|
return own;
|
|
86
86
|
const read = withFollowUps({ status: own.status, level: own.level ?? null, exitCode: own.exitCode, head: run?.headRevision ?? null }, followUps);
|
|
@@ -106,13 +106,13 @@ function recordedFailureStands(store, runId, own) {
|
|
|
106
106
|
detail: `${own.level === "quick" ? "Quick checks" : "Checks"} failed${recorded.exitCode === null ? "" : ` (exit ${recorded.exitCode})`}. ${own.detail}` };
|
|
107
107
|
}
|
|
108
108
|
const COMMAND_MISSING_OR_CHANGED = "The original approved verification command is missing or changed.";
|
|
109
|
-
function buildChecks(store, root, runId) {
|
|
109
|
+
function buildChecks(store, root, runId, asOf) {
|
|
110
110
|
const level = runCheckLevel(store, runId);
|
|
111
111
|
const unavailable = (detail) => ({ status: "unavailable", exitCode: null, command: null, logArtifactId: null, detail, level });
|
|
112
112
|
if (root === undefined)
|
|
113
113
|
return unavailable("Saved checks are unavailable.");
|
|
114
114
|
try {
|
|
115
|
-
const gate = verificationEvidence(store, root, runId);
|
|
115
|
+
const gate = verificationEvidence(store, root, runId, asOf);
|
|
116
116
|
if (!gate.ok) {
|
|
117
117
|
const run = store.getRun(runId), repo = run === null ? null : store.refById(run.taskRef)?.repo ?? null;
|
|
118
118
|
const live = repo === null ? null : store.liveVerifyCommand(repo);
|
|
@@ -131,9 +131,11 @@ function buildChecks(store, root, runId) {
|
|
|
131
131
|
detail: "Checks gave no complete result, so they can't count as a pass." };
|
|
132
132
|
const sealedLevel = typeof receipt.command?.repo === "string" && receipt.command.repo.startsWith("quick:") ? "quick" : "full";
|
|
133
133
|
const words = sealedLevel === "quick" ? "Quick checks" : "Checks";
|
|
134
|
+
const deploy = receipt.coverage === "deploy";
|
|
134
135
|
return { status: ran ? exitCode === 0 ? "passed" : "failed" : "not-run", exitCode,
|
|
135
136
|
command: receipt.command.command, logArtifactId: receipt.log.artifactId, level: level === null ? null : sealedLevel,
|
|
136
|
-
|
|
137
|
+
...(typeof receipt.coverage === "string" ? { coverage: receipt.coverage } : {}),
|
|
138
|
+
detail: ran ? exitCode === 0 ? deploy ? "The deploy check passed." : `${words} passed.` : `${deploy ? "The deploy check" : words} failed (exit ${exitCode}).` : `${deploy ? "The deploy check" : words} did not finish.` };
|
|
137
139
|
}
|
|
138
140
|
catch {
|
|
139
141
|
return unavailable("Saved checks could not be read.");
|
|
@@ -172,29 +174,32 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
|
|
|
172
174
|
const reports = artifacts.filter(a => a.kind === "report");
|
|
173
175
|
const unavailable = family.versions.flatMap(version => store.runsFor(version.refId).flatMap(run => store.artifactsFor(run.id).filter(artifact => root === undefined || !verifyArtifact(root, artifact).ok)
|
|
174
176
|
.map(artifact => `Saved ${artifact.kind} #${artifact.id} (run ${run.id}) is unavailable or changed.`)));
|
|
175
|
-
const ownChecks = result === null ? null : assignmentChecksForRun(store, root, result.id, now);
|
|
176
|
-
const checks = ownChecks === null || ownChecks.level !== "off" || ownChecks.status === "passed" || ownChecks.status === "failed" ? ownChecks
|
|
177
|
-
: { ...ownChecks, release: releaseCoverageOf(store, root, current.repo, result.headRevision, memo === undefined ? {} : { memo }) };
|
|
178
177
|
const finishedBuild = result?.role === "builder" && (result.outcome === "built" || result.outcome === "no-change") &&
|
|
179
178
|
result.finishedAt !== null && /^[a-f0-9]{40}$/.test(result.headRevision ?? "");
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
...
|
|
192
|
-
|
|
179
|
+
const sealFor = (ownChecks) => {
|
|
180
|
+
const checks = ownChecks === null || ownChecks.level !== "off" || ownChecks.status === "passed" || ownChecks.status === "failed" ? ownChecks
|
|
181
|
+
: { ...ownChecks, release: releaseCoverageOf(store, root, current.repo, result.headRevision, memo === undefined ? {} : { memo }) };
|
|
182
|
+
const completionKind = result?.role === "scout" && result.outcome === "built" && result.finishedAt !== null ? "research-report"
|
|
183
|
+
: finishedBuild && acceptance !== null ? "accepted-exception"
|
|
184
|
+
: finishedBuild ? checks?.status === "passed" ? "checked-build" : "finished-build" : null;
|
|
185
|
+
const receiptBody = result === null ? null : {
|
|
186
|
+
rootId: family.root.id, taskId: current.id, runId: result.id, base: result.baseRevision,
|
|
187
|
+
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,
|
|
189
|
+
complete: !a.truncated && a.captureStatus !== "failed" })),
|
|
190
|
+
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"}.`)],
|
|
194
|
+
agentReport: result.handoff, evidence: "recorded",
|
|
195
|
+
};
|
|
196
|
+
const sealedBody = receiptBody === null ? null : { ...receiptBody, checks: sealedChecks(receiptBody.checks) };
|
|
197
|
+
const receipt = receiptBody === null ? null : { ...receiptBody, digest: digest({ receipt: sealedBody,
|
|
198
|
+
scope: scope === null ? null : { digest: scope.digest, approved: approvalOf(scope).approved, termsProblem: scope.termsProblem ?? null },
|
|
199
|
+
versions: family.versions.map(v => ({ id: v.id, state: v.state })) }) };
|
|
200
|
+
return { checks, completionKind, receipt };
|
|
193
201
|
};
|
|
194
|
-
const
|
|
195
|
-
const receipt = receiptBody === null ? null : { ...receiptBody, digest: digest({ receipt: sealedBody,
|
|
196
|
-
scope: scope === null ? null : { digest: scope.digest, approved: approvalOf(scope).approved, termsProblem: scope.termsProblem ?? null },
|
|
197
|
-
versions: family.versions.map(v => ({ id: v.id, state: v.state })) }) };
|
|
202
|
+
const { completionKind, receipt } = sealFor(result === null ? null : assignmentChecksForRun(store, root, result.id, now));
|
|
198
203
|
let completion = null;
|
|
199
204
|
let state = "working";
|
|
200
205
|
let detail = work.status.detail;
|
|
@@ -254,19 +259,25 @@ export function assignmentOf(given, taskId, now, access, root, memo) {
|
|
|
254
259
|
: completionKind === "accepted-exception" ? "An operator accepted this result with its recorded limitations. The lead can inspect that decision; the recorded checks are unchanged."
|
|
255
260
|
: receipt.checks.detail;
|
|
256
261
|
primaryAction = { code: "open-result", label: completionKind === "research-report" ? "Read report" : "Open result", target: { taskId: current.id, runId: result.id, decisionId: null }, access: "read", retry: "read-again" };
|
|
257
|
-
const
|
|
262
|
+
const exact = store.handle.prepare("SELECT actor,at,detail FROM action_ledger WHERE task_id = ? AND run_id = ? AND action = ? AND outcome = ? AND source = 'work' ORDER BY id DESC")
|
|
258
263
|
.all(family.root.id, result.id, CHECK_ACTION, receipt.digest).find(row => COMPLETER_ACTOR.test(String(row["actor"])));
|
|
264
|
+
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
|
+
.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"]));
|
|
267
|
+
const checked = exact ?? historical;
|
|
259
268
|
if (checked !== undefined) {
|
|
260
269
|
const rootRef = store.lookupRef(family.root.id);
|
|
261
270
|
const byLead = rootRef !== null && olderStoreSafe(() => store.taskActs(rootRef.id), []).filter(one => one.act === "completed").at(-1)?.lead === true;
|
|
262
271
|
const landed = landedReasonOf(String(checked["actor"]), checked["detail"] == null ? null : String(checked["detail"]));
|
|
263
|
-
completion = { actor: String(checked["actor"]), at: String(checked["at"]), digest:
|
|
272
|
+
completion = { actor: String(checked["actor"]), at: String(checked["at"]), digest: exact === undefined ? String(checked["outcome"]) : receipt.digest,
|
|
273
|
+
...(byLead && landed === null ? { lead: true } : {}), ...(landed === null ? {} : { landed }), ...(exact === undefined ? { historical: true } : {}) };
|
|
264
274
|
state = "complete";
|
|
265
275
|
primaryAction = { ...primaryAction, label: completionKind === "research-report" ? "Read report" : "Open result" };
|
|
266
276
|
const label = byLead ? "the lead" : completion.actor.startsWith("operator:") ? completion.actor.slice(9) : owner && completion.actor === actorOf(owner) ? owner.label : "the previous lead";
|
|
267
277
|
detail = landed !== null ? `Marked complete automatically: ${landed}. ${receipt.checks.detail}`
|
|
268
278
|
: completionKind === "research-report" ? `Research report checked by ${label}. No deployment is implied.`
|
|
269
|
-
: `Handled by ${label}. ${receipt.checks.detail} Publication and deployment
|
|
279
|
+
: exact === undefined ? `Handled by ${label}. Its checks read differently now: ${receipt.checks.detail} Publication and deployment need them to pass again.`
|
|
280
|
+
: `Handled by ${label}. ${receipt.checks.detail} Publication and deployment are separate.`;
|
|
270
281
|
}
|
|
271
282
|
}
|
|
272
283
|
else if (work.status.rank === 0 || (!live && (current.state === "done" || current.state === "failed" || work.status.views.includes("needs-you")))) {
|