toolroll 0.9.71 → 0.9.73
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 +155 -0
- package/dist/agent-fence.d.ts +10 -2
- package/dist/agent-fence.js +47 -9
- package/dist/approval-authority.d.ts +20 -0
- package/dist/approval-authority.js +67 -0
- package/dist/assignment.js +26 -4
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +28 -28
- package/dist/builder.js +48 -6
- package/dist/chat-actions.js +13 -8
- package/dist/chat-decide.d.ts +47 -1
- package/dist/chat-decide.js +186 -5
- package/dist/check-access.js +2 -2
- package/dist/check-report.d.ts +109 -0
- package/dist/check-report.js +205 -0
- package/dist/claim.js +1 -1
- package/dist/coding-provider.js +4 -2
- package/dist/commit-extract.d.ts +111 -0
- package/dist/commit-extract.js +514 -0
- package/dist/contracts/console-api.d.ts +4 -4
- package/dist/contracts/console-api.js +5 -4
- package/dist/contracts/flow.d.ts +16 -0
- package/dist/contracts/flow.js +3 -0
- package/dist/contracts/release-check.d.ts +335 -0
- package/dist/contracts/release-check.js +159 -0
- package/dist/contracts/release-terms.d.ts +66 -0
- package/dist/contracts/release-terms.js +74 -0
- package/dist/contracts/verification-receipt.d.ts +42 -8
- package/dist/contracts/verification-receipt.js +24 -7
- package/dist/contracts/verification-view.d.ts +1 -0
- package/dist/deploy-gate.d.ts +17 -0
- package/dist/deploy-gate.js +68 -0
- package/dist/dispatch.js +3 -10
- package/dist/dispose.js +4 -1
- package/dist/evidence-pack.d.ts +1 -1
- package/dist/evidence-pack.js +20 -2
- package/dist/evidence.d.ts +1 -0
- package/dist/evidence.js +2 -1
- package/dist/exec.d.ts +1 -1
- package/dist/exec.js +7 -3
- package/dist/flow-engine.js +5 -1
- package/dist/flow-gallery-ui.js +4 -2
- package/dist/flow-gallery.d.ts +3 -0
- package/dist/flow-gallery.js +6 -2
- package/dist/flow-pull-request.d.ts +5 -2
- package/dist/flow-pull-request.js +14 -5
- package/dist/flow-schedule.js +25 -6
- package/dist/flow-triggers.d.ts +8 -0
- package/dist/flow-triggers.js +15 -0
- package/dist/flows-cli.js +13 -3
- package/dist/flows-ui.js +7 -1
- package/dist/guides.js +10 -1
- package/dist/invoke.d.ts +17 -6
- package/dist/invoke.js +48 -18
- package/dist/kits-ui.js +4 -2
- package/dist/kits.d.ts +6 -4
- package/dist/kits.js +9 -11
- package/dist/lead-status.js +5 -2
- package/dist/live-terminal.d.ts +10 -6
- package/dist/live-terminal.js +55 -14
- package/dist/mcp-connect.d.ts +10 -0
- package/dist/mcp-connect.js +2 -0
- package/dist/nightly-check.d.ts +104 -0
- package/dist/nightly-check.js +362 -0
- package/dist/operate.js +39 -2
- package/dist/person-proof.d.ts +2 -0
- package/dist/person-proof.js +14 -0
- package/dist/plan-auto.js +4 -4
- package/dist/planner-source.d.ts +1 -1
- package/dist/project-delete-ui.js +1 -1
- package/dist/project-tools.js +3 -1
- package/dist/proof.js +2 -0
- package/dist/protected-storage.d.ts +67 -0
- package/dist/protected-storage.js +398 -0
- package/dist/publish.js +156 -144
- package/dist/pull-request-flow.d.ts +2 -0
- package/dist/pull-request-flow.js +24 -2
- package/dist/release-adapters.d.ts +16 -1
- package/dist/release-adapters.js +292 -29
- package/dist/release-authority.d.ts +118 -0
- package/dist/release-authority.js +135 -0
- package/dist/release-card.d.ts +76 -0
- package/dist/release-card.js +252 -0
- package/dist/release-carry.d.ts +236 -0
- package/dist/release-carry.js +664 -0
- package/dist/release-cli.d.ts +3 -0
- package/dist/release-cli.js +158 -6
- package/dist/release-coverage.js +3 -0
- package/dist/release-git.d.ts +43 -0
- package/dist/release-git.js +106 -0
- package/dist/release-recheck.d.ts +146 -0
- package/dist/release-recheck.js +657 -0
- package/dist/release-view.d.ts +34 -0
- package/dist/release-view.js +27 -0
- package/dist/release.d.ts +139 -3
- package/dist/release.js +641 -250
- package/dist/remote-main.d.ts +2 -0
- package/dist/remote-main.js +1 -1
- package/dist/result-completion.d.ts +6 -0
- package/dist/result-completion.js +15 -1
- package/dist/result-follow-ups.js +29 -1
- package/dist/sandbox-runtime.d.ts +16 -5
- package/dist/sandbox-runtime.js +19 -6
- package/dist/scope.d.ts +122 -5
- package/dist/scope.js +236 -7
- package/dist/server/flows.js +40 -10
- package/dist/server/render-settings.js +1 -1
- package/dist/server/render-tasks.d.ts +8 -0
- package/dist/server/render-tasks.js +50 -9
- package/dist/server/route-table.js +1 -0
- package/dist/server/settings.js +26 -5
- package/dist/server/task-views.js +4 -0
- package/dist/server/tasks.js +12 -0
- package/dist/setup-guide.d.ts +2 -2
- package/dist/store.d.ts +230 -5
- package/dist/store.js +733 -37
- package/dist/subagent-memory.d.ts +1 -0
- package/dist/subagent-memory.js +1 -1
- package/dist/subagent-tools.d.ts +22 -6
- package/dist/subagent-tools.js +44 -8
- package/dist/subagent-work.d.ts +2 -0
- package/dist/subagent-work.js +5 -2
- package/dist/subagents-ui.js +6 -4
- package/dist/task-outcome-cli.js +7 -3
- package/dist/telegram.d.ts +6 -1
- package/dist/telegram.js +58 -6
- package/dist/toolroll-update.js +2 -2
- package/dist/verification-evidence.d.ts +25 -1
- package/dist/verification-evidence.js +57 -2
- package/dist/work-index.js +3 -6
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Store } from "./store.js";
|
|
2
|
+
export type LandedView = {
|
|
3
|
+
sha: string;
|
|
4
|
+
task: string;
|
|
5
|
+
files: {
|
|
6
|
+
path: string;
|
|
7
|
+
added: number;
|
|
8
|
+
deleted: number;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export type ReleaseView = {
|
|
12
|
+
kind: "anchor" | "carried";
|
|
13
|
+
authority: number;
|
|
14
|
+
version: string;
|
|
15
|
+
pr: number;
|
|
16
|
+
state: string;
|
|
17
|
+
/** Whether the release still carries later commits, and why not. */
|
|
18
|
+
carrying: boolean;
|
|
19
|
+
why: string | null;
|
|
20
|
+
approver: string | null;
|
|
21
|
+
anchorTask: string;
|
|
22
|
+
tipTask: string;
|
|
23
|
+
expiresAt: string;
|
|
24
|
+
landed: LandedView[];
|
|
25
|
+
/** Identities a later check of this release must run again and pass (release-recheck.ts). */
|
|
26
|
+
obligations: string[];
|
|
27
|
+
nightly: {
|
|
28
|
+
at: string;
|
|
29
|
+
sha: string;
|
|
30
|
+
outcome: string | null;
|
|
31
|
+
} | null;
|
|
32
|
+
openMainFailures: number;
|
|
33
|
+
};
|
|
34
|
+
export declare function releaseViewOf(store: Store, taskId: string, now: Date, obligations?: (authority: number) => string[]): ReleaseView | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a release task's page shows (docs/plans/release-once.md, "What people see"): for the approved task, the release
|
|
3
|
+
* it's approved for, every later commit carried under it, the open check obligations and the last nightly result for
|
|
4
|
+
* main; for a carried task, whose release approval it was carried from. Read-only, from the store.
|
|
5
|
+
*/
|
|
6
|
+
import { liveReleaseOf } from "./scope.js";
|
|
7
|
+
import { releaseAuthorityOfTask, releaseCarries } from "./store.js";
|
|
8
|
+
export function releaseViewOf(store, taskId, now, obligations = () => []) {
|
|
9
|
+
const found = releaseAuthorityOfTask(store, taskId);
|
|
10
|
+
if (found === null)
|
|
11
|
+
return null;
|
|
12
|
+
const a = found.authority;
|
|
13
|
+
const live = liveReleaseOf(store, a.tipTask, "dispatch", now);
|
|
14
|
+
const anchor = store.getScope(a.anchorTask);
|
|
15
|
+
const nightly = store.handle.prepare("SELECT sha, outcome, at FROM nightly_check WHERE repo = ? ORDER BY id DESC LIMIT 1").get(a.repo);
|
|
16
|
+
const open = Number(store.handle.prepare("SELECT COUNT(*) AS n FROM main_check_failure WHERE repo = ? AND cleared_at IS NULL").get(a.repo)?.["n"] ?? 0);
|
|
17
|
+
return {
|
|
18
|
+
kind: found.carry === null ? "anchor" : "carried",
|
|
19
|
+
authority: a.id, version: a.version, pr: a.pr, state: a.state,
|
|
20
|
+
carrying: a.state === "open" && live.applies && live.ok, why: live.applies && !live.ok ? live.why : null,
|
|
21
|
+
approver: anchor?.approvedBy ?? null, anchorTask: a.anchorTask, tipTask: a.tipTask, expiresAt: a.expiresAt,
|
|
22
|
+
landed: releaseCarries(store, a.id).flatMap(carry => carry.commits.map(commit => ({ sha: commit.sha, task: carry.taskId, files: commit.files }))),
|
|
23
|
+
obligations: obligations(a.id),
|
|
24
|
+
nightly: nightly === undefined ? null : { at: String(nightly["at"]), sha: String(nightly["sha"]), outcome: nightly["outcome"] == null ? null : String(nightly["outcome"]) },
|
|
25
|
+
openMainFailures: open,
|
|
26
|
+
};
|
|
27
|
+
}
|
package/dist/release.d.ts
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* gate → approval → check → complete → quiet → deploy → link → ci → merge → tree → tag → publish → homebrew → done
|
|
7
7
|
*
|
|
8
|
-
* gate
|
|
8
|
+
* gate, before filing a task for that commit, looks at the pull request's required checks on it: one that failed stops
|
|
9
|
+
* the release before anything is filed or sent for approval; it waits, naming them, for checks not started or still
|
|
10
|
+
* running, and stops if they don't finish within its limit (a task already filed is not looked at again; ci checks
|
|
11
|
+
* once more before merging). It then files a prepared-candidate task pinned to the branch's exact commit, with the full
|
|
12
|
+
* release check. approval
|
|
9
13
|
* waits for an active approver's yes to that exact scope (never a mode's, an AI's or the lead's). check requires a Full
|
|
10
14
|
* result of that commit: a failed check stops the release and stays visible, nothing reruns it. complete marks that
|
|
11
15
|
* exact result Complete through the task's own authorization. quiet waits until nothing builds. deploy runs the
|
|
@@ -35,7 +39,7 @@ export declare const REQUIRED_PR_CHECKS: readonly ["node 22 · ubuntu-latest", "
|
|
|
35
39
|
export declare const RELEASE_TAG_CHECKS: readonly ["node 22 · macos-latest", "node 24 · macos-latest", "publish"];
|
|
36
40
|
export declare const RELEASE_STEPS: readonly ["gate", "approval", "check", "complete", "quiet", "deploy", "link", "ci", "merge", "tree", "tag", "publish", "homebrew", "done"];
|
|
37
41
|
export type ReleaseStep = typeof RELEASE_STEPS[number];
|
|
38
|
-
type WaitingStep = "approval" | "check" | "quiet" | "deploy" | "ci" | "publish" | "homebrew";
|
|
42
|
+
type WaitingStep = "gate" | "approval" | "check" | "quiet" | "deploy" | "ci" | "publish" | "homebrew";
|
|
39
43
|
/** How long each waiting step may take, in minutes, before the release stops there (rerunning continues from it). */
|
|
40
44
|
export declare const RELEASE_LIMITS: Readonly<Record<WaitingStep, number>>;
|
|
41
45
|
/** One check attempt; `app` is the GitHub App that made it (github-actions for a workflow), when known. */
|
|
@@ -65,6 +69,15 @@ export type GateState = {
|
|
|
65
69
|
basis: string | null;
|
|
66
70
|
role: string | null;
|
|
67
71
|
active: boolean;
|
|
72
|
+
/** The plane's own answer to "did a person give this approval, with a person's proof recorded?" (approval policy
|
|
73
|
+
* §1.5). Absent from a plane too old to say, which is no person's approval. */
|
|
74
|
+
person?: {
|
|
75
|
+
ok: true;
|
|
76
|
+
method: string;
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
why: string;
|
|
80
|
+
};
|
|
68
81
|
} | null;
|
|
69
82
|
/** The newest finished build of the task: its sealed result and check. */
|
|
70
83
|
result: {
|
|
@@ -115,7 +128,94 @@ export type HomebrewState = {
|
|
|
115
128
|
} | {
|
|
116
129
|
kind: "missing";
|
|
117
130
|
};
|
|
131
|
+
/** One commit that landed after the approval, with its files and line counts (release_carry). */
|
|
132
|
+
export type LandedCommit = {
|
|
133
|
+
sha: string;
|
|
134
|
+
files: {
|
|
135
|
+
path: string;
|
|
136
|
+
added: number;
|
|
137
|
+
deleted: number;
|
|
138
|
+
}[];
|
|
139
|
+
};
|
|
140
|
+
/** A release's authority record as the coordinator reads it (store.ts release_authority). */
|
|
141
|
+
export type AuthorityView = {
|
|
142
|
+
id: number;
|
|
143
|
+
generation: number;
|
|
144
|
+
state: string;
|
|
145
|
+
tipSha: string;
|
|
146
|
+
tipTask: string;
|
|
147
|
+
version: string;
|
|
148
|
+
pr: number;
|
|
149
|
+
landed: LandedCommit[];
|
|
150
|
+
};
|
|
151
|
+
export type ReleaseAction = "dispatch" | "deploy" | "merge" | "complete";
|
|
152
|
+
export type OperationView = {
|
|
153
|
+
id: string;
|
|
154
|
+
kind: "deploy" | "merge";
|
|
155
|
+
state: "reserved" | "running" | "succeeded" | "failed" | "unknown";
|
|
156
|
+
candidate: string;
|
|
157
|
+
externalRef: string | null;
|
|
158
|
+
reservedAt: string;
|
|
159
|
+
/** Reserved by a person's own deploy run (deploy-browser.mjs), not a coordinator. */
|
|
160
|
+
direct: boolean;
|
|
161
|
+
/** Whether the process that issued it is proven gone (store.ts releaseIssuerGone): read when the view is made. */
|
|
162
|
+
issuerGone: boolean;
|
|
163
|
+
/** A direct deploy's staging folder. */
|
|
164
|
+
stage: string | null;
|
|
165
|
+
};
|
|
166
|
+
/** The release's authority record, through the plane's store (release-once.md). Absent: a plane too old to carry, and
|
|
167
|
+
* every commit asks for a person as before. */
|
|
168
|
+
export type ReleaseAuthorityAdapter = {
|
|
169
|
+
authority(taskId: string): Promise<AuthorityView | null>;
|
|
170
|
+
live(taskId: string, action: ReleaseAction): Promise<{
|
|
171
|
+
applies: boolean;
|
|
172
|
+
ok: boolean;
|
|
173
|
+
why: string | null;
|
|
174
|
+
}>;
|
|
175
|
+
lease(authority: number, owner: string): Promise<{
|
|
176
|
+
ok: true;
|
|
177
|
+
epoch: number;
|
|
178
|
+
} | {
|
|
179
|
+
ok: false;
|
|
180
|
+
why: string;
|
|
181
|
+
}>;
|
|
182
|
+
renew(authority: number, owner: string, epoch: number): Promise<boolean>;
|
|
183
|
+
carry(authority: number, to: string, requestId: string, epoch: number): Promise<{
|
|
184
|
+
ok: true;
|
|
185
|
+
taskId: string;
|
|
186
|
+
} | {
|
|
187
|
+
ok: false;
|
|
188
|
+
message: string;
|
|
189
|
+
}>;
|
|
190
|
+
/** `secret`: proves a deploy run is this reservation's (handed to deploy-browser on stdin). */
|
|
191
|
+
reserve(input: {
|
|
192
|
+
authority: number;
|
|
193
|
+
kind: "deploy" | "merge";
|
|
194
|
+
taskId: string;
|
|
195
|
+
candidate: string;
|
|
196
|
+
epoch: number;
|
|
197
|
+
}): Promise<{
|
|
198
|
+
ok: true;
|
|
199
|
+
operation: string;
|
|
200
|
+
secret?: string;
|
|
201
|
+
} | {
|
|
202
|
+
ok: false;
|
|
203
|
+
why: string;
|
|
204
|
+
}>;
|
|
205
|
+
start(operation: string, epoch: number): Promise<boolean>;
|
|
206
|
+
/** Settle an operation at the epoch this coordinator holds; false: it no longer holds the release. */
|
|
207
|
+
finish(operation: string, outcome: "succeeded" | "failed" | "unknown", facts: {
|
|
208
|
+
detail?: string | null;
|
|
209
|
+
externalRef?: string | null;
|
|
210
|
+
}, epoch: number): Promise<boolean>;
|
|
211
|
+
/** A CI failure after the deploy (Alex's decision): the release stops and needs a person's fresh approval. False when
|
|
212
|
+
* the authority could not be stopped (a stale epoch, a merge already reserved): the coordinator fails closed. */
|
|
213
|
+
needsApproval(authority: number, reason: string, epoch: number): Promise<boolean>;
|
|
214
|
+
operations(authority: number): Promise<OperationView[]>;
|
|
215
|
+
};
|
|
118
216
|
export type ReleaseAdapters = {
|
|
217
|
+
/** One approval per release (release-once.md); absent on a plane that can't carry. */
|
|
218
|
+
release?: ReleaseAuthorityAdapter;
|
|
119
219
|
now(): Date;
|
|
120
220
|
sleep(ms: number): Promise<void>;
|
|
121
221
|
say(line: string): void;
|
|
@@ -147,6 +247,13 @@ export type ReleaseAdapters = {
|
|
|
147
247
|
candidate: string;
|
|
148
248
|
goal: string;
|
|
149
249
|
acceptance: string;
|
|
250
|
+
/** Release terms to file with the scope (task scope --release): the version, pull request and branch. */
|
|
251
|
+
release?: {
|
|
252
|
+
version: string;
|
|
253
|
+
pr: number;
|
|
254
|
+
branch: string;
|
|
255
|
+
noCarry: boolean;
|
|
256
|
+
};
|
|
150
257
|
}): Promise<{
|
|
151
258
|
scopeDigest: string;
|
|
152
259
|
}>;
|
|
@@ -165,6 +272,10 @@ export type ReleaseAdapters = {
|
|
|
165
272
|
run: number;
|
|
166
273
|
worktree: string;
|
|
167
274
|
stage: string;
|
|
275
|
+
operation?: {
|
|
276
|
+
id: string;
|
|
277
|
+
secret: string;
|
|
278
|
+
};
|
|
168
279
|
}): Promise<{
|
|
169
280
|
ok: true;
|
|
170
281
|
runtime: string;
|
|
@@ -177,6 +288,9 @@ export type ReleaseAdapters = {
|
|
|
177
288
|
}): Promise<{
|
|
178
289
|
ok: true;
|
|
179
290
|
} | DeployStop>;
|
|
291
|
+
/** Whether no deployment is at work or half done: no deploy-browser process, no update pause held, and `stage`'s
|
|
292
|
+
* journal (when given) unlocked and at a phase that changed nothing or finished. Null stage: unknown, so false. */
|
|
293
|
+
deploymentIdle(stage: string | null): Promise<boolean>;
|
|
180
294
|
/** Where both CLI names are on PATH now. */
|
|
181
295
|
cliLinks(): Promise<SavedLink[]>;
|
|
182
296
|
/** Point every saved link at `bin` and check each answers `version`; on any failure every link goes back to its
|
|
@@ -187,7 +301,7 @@ export type ReleaseAdapters = {
|
|
|
187
301
|
authenticated(): Promise<boolean>;
|
|
188
302
|
pullRequest(repo: string, branch: string): Promise<PullRequest | null>;
|
|
189
303
|
checks(repo: string, sha: string): Promise<CheckRun[]>;
|
|
190
|
-
merge(repo: string, pr: number, head: string): Promise<string>;
|
|
304
|
+
merge(repo: string, pr: number, head: string, message?: string): Promise<string>;
|
|
191
305
|
tag(repo: string, tag: string): Promise<string | null>;
|
|
192
306
|
createTag(repo: string, tag: string, sha: string): Promise<void>;
|
|
193
307
|
release(repo: string, tag: string): Promise<boolean>;
|
|
@@ -273,6 +387,22 @@ export type ReleaseJournal = {
|
|
|
273
387
|
head: string | null;
|
|
274
388
|
merged: boolean;
|
|
275
389
|
} | null;
|
|
390
|
+
/** The release's authority record (release-once.md), once a person approved terms: the id and generation. */
|
|
391
|
+
authority?: {
|
|
392
|
+
id: number;
|
|
393
|
+
generation: number;
|
|
394
|
+
} | null;
|
|
395
|
+
/** Commits that landed after the approval, carried under it: each with its files and line counts. */
|
|
396
|
+
landed?: LandedCommit[];
|
|
397
|
+
/** The deploy and merge operations this coordinator reserved (store.ts release_operation). */
|
|
398
|
+
operations?: {
|
|
399
|
+
deploy?: string;
|
|
400
|
+
merge?: string;
|
|
401
|
+
};
|
|
402
|
+
/** A pull request check failed after the deploy: nothing continues until a person approves again (--new). */
|
|
403
|
+
needsApproval?: boolean;
|
|
404
|
+
/** This journal's task was picked fresh after a CI failure after the deploy: an id that never existed, never another. */
|
|
405
|
+
freshTask?: boolean;
|
|
276
406
|
/** When each step was about to change something outside this machine: what a resume must look for before acting. */
|
|
277
407
|
intents: Partial<Record<ReleaseStep, string>>;
|
|
278
408
|
stopped: {
|
|
@@ -307,7 +437,11 @@ export type ReleaseOptions = {
|
|
|
307
437
|
/** Start over for a new commit on the branch, keeping the old journal aside. Refused once merging began. */
|
|
308
438
|
fresh?: boolean;
|
|
309
439
|
pollMs?: number;
|
|
440
|
+
/** File the release without carrying later commits: each one asks again. */
|
|
441
|
+
noCarry?: boolean;
|
|
310
442
|
};
|
|
443
|
+
/** Every commit that landed after the approval, in words: the summary and the merge message list them all. */
|
|
444
|
+
export declare function landedWords(landed: readonly LandedCommit[]): string[];
|
|
311
445
|
export declare const journalFile: (stateDir: string, branch: string) => string;
|
|
312
446
|
export declare const resumeCommand: (branch: string, checkout: string) => string;
|
|
313
447
|
/** Whole or not at all: a private temp file, synced, renamed into place, its folder synced. */
|
|
@@ -337,4 +471,6 @@ export declare function checksVerdict(runs: readonly CheckRun[], required: reado
|
|
|
337
471
|
};
|
|
338
472
|
/** Run the release from wherever its journal stopped. */
|
|
339
473
|
export declare function runRelease(options: ReleaseOptions, adapters: ReleaseAdapters): Promise<ReleaseOutcome>;
|
|
474
|
+
/** A probe's failure that is only the network to GitHub being slow, never a decision (a Stop) or another error. */
|
|
475
|
+
export declare function transientNetworkError(error: unknown): boolean;
|
|
340
476
|
export {};
|