toolroll 0.9.76 → 0.9.77

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 (102) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/README.md +11 -4
  3. package/THIRD_PARTY_NOTICES.md +5 -5
  4. package/dist/agent-fence.js +28 -8
  5. package/dist/assignment.js +3 -0
  6. package/dist/browser/THIRD_PARTY_NOTICES.txt +5 -5
  7. package/dist/browser/workspace.css +2 -2
  8. package/dist/browser/workspace.js +31 -31
  9. package/dist/builder.d.ts +14 -0
  10. package/dist/builder.js +140 -41
  11. package/dist/chat-decide.js +4 -0
  12. package/dist/check-failure.d.ts +92 -0
  13. package/dist/check-failure.js +267 -0
  14. package/dist/check-progress.d.ts +28 -1
  15. package/dist/check-progress.js +105 -6
  16. package/dist/check-report.d.ts +52 -6
  17. package/dist/check-report.js +193 -8
  18. package/dist/checkout-cleanup.js +2 -2
  19. package/dist/cli.js +8 -5
  20. package/dist/coding-handoff.d.ts +1 -0
  21. package/dist/coding-handoff.js +20 -11
  22. package/dist/commit-extract.d.ts +6 -0
  23. package/dist/commit-extract.js +63 -8
  24. package/dist/console-chrome.d.ts +41 -0
  25. package/dist/console-chrome.js +166 -0
  26. package/dist/contracts/release-check.d.ts +12 -0
  27. package/dist/contracts/release-check.js +17 -0
  28. package/dist/contracts/verification-receipt.d.ts +20 -2
  29. package/dist/contracts/verification-receipt.js +15 -3
  30. package/dist/contracts/verification-view.d.ts +8 -0
  31. package/dist/controller-supervisor.d.ts +8 -0
  32. package/dist/controller-supervisor.js +33 -1
  33. package/dist/demo.js +3 -2
  34. package/dist/deploy-gate.js +5 -0
  35. package/dist/dispose.d.ts +3 -0
  36. package/dist/dispose.js +6 -3
  37. package/dist/doctor.d.ts +7 -0
  38. package/dist/doctor.js +10 -2
  39. package/dist/envelope.js +2 -1
  40. package/dist/evidence.js +4 -1
  41. package/dist/exec.d.ts +7 -0
  42. package/dist/exec.js +7 -1
  43. package/dist/git-floor.d.ts +16 -0
  44. package/dist/git-floor.js +36 -0
  45. package/dist/grant.js +5 -1
  46. package/dist/guides.js +4 -3
  47. package/dist/operate.d.ts +13 -0
  48. package/dist/operate.js +773 -319
  49. package/dist/prepared-evidence.d.ts +2 -1
  50. package/dist/prepared-evidence.js +8 -3
  51. package/dist/project-knowledge.js +6 -2
  52. package/dist/project-learning.js +2 -2
  53. package/dist/proof.js +6 -0
  54. package/dist/read-executor-worker.js +8 -4
  55. package/dist/read-executor.d.ts +18 -1
  56. package/dist/read-executor.js +8 -0
  57. package/dist/release-adapters.d.ts +48 -1
  58. package/dist/release-adapters.js +343 -10
  59. package/dist/release-authority.js +6 -2
  60. package/dist/release-auto.d.ts +38 -7
  61. package/dist/release-auto.js +131 -15
  62. package/dist/release-card.d.ts +15 -3
  63. package/dist/release-card.js +25 -9
  64. package/dist/release-ci-hold.d.ts +41 -0
  65. package/dist/release-ci-hold.js +53 -0
  66. package/dist/release-cli.js +21 -12
  67. package/dist/release-coverage.js +5 -2
  68. package/dist/release-recheck.d.ts +1 -1
  69. package/dist/release-recheck.js +6 -1
  70. package/dist/release.d.ts +108 -11
  71. package/dist/release.js +294 -39
  72. package/dist/review-context.js +8 -6
  73. package/dist/runner.js +2 -1
  74. package/dist/sandbox-runtime.d.ts +8 -0
  75. package/dist/sandbox-runtime.js +14 -2
  76. package/dist/scope.js +7 -1
  77. package/dist/secret-mint.d.ts +1 -0
  78. package/dist/secret-mint.js +14 -0
  79. package/dist/serve.js +101 -51
  80. package/dist/server/chat.js +5 -5
  81. package/dist/server/render-tasks.d.ts +2 -0
  82. package/dist/server/render-tasks.js +2 -1
  83. package/dist/server/request-context.d.ts +6 -0
  84. package/dist/server/runtime.d.ts +2 -0
  85. package/dist/server/task-views.js +7 -2
  86. package/dist/setup-guide.d.ts +2 -2
  87. package/dist/storage.d.ts +5 -0
  88. package/dist/storage.js +28 -1
  89. package/dist/store.d.ts +10 -0
  90. package/dist/store.js +25 -1
  91. package/dist/task-base.d.ts +4 -0
  92. package/dist/task-base.js +22 -2
  93. package/dist/teardown-git.d.ts +52 -3
  94. package/dist/teardown-git.js +143 -31
  95. package/dist/test-infra.js +1 -1
  96. package/dist/up-processes.d.ts +137 -0
  97. package/dist/up-processes.js +165 -0
  98. package/dist/up-role-child.d.ts +1 -0
  99. package/dist/up-role-child.js +77 -0
  100. package/dist/verification-evidence.d.ts +1 -0
  101. package/dist/verification-evidence.js +13 -1
  102. package/package.json +2 -1
package/dist/release.d.ts CHANGED
@@ -34,7 +34,29 @@
34
34
  */
35
35
  /** The pull-request checks a release waits for, by exact job name (.github/workflows/ci.yml). Every one must have
36
36
  * concluded `success` on the gated commit; src/ci-workflow.test.ts holds the workflow to this list. */
37
- export declare const REQUIRED_PR_CHECKS: readonly ["node 22 · ubuntu-latest", "node 24 · ubuntu-latest", "linux native containment · delegated cgroup v2", "linux fence · sandbox-runtime", "Windows Job Object containment"];
37
+ export declare const REQUIRED_PR_CHECKS: readonly ["node 22 · ubuntu-latest", "node 24 · ubuntu-latest", "linux native containment · delegated cgroup v2", "linux fence · sandbox-runtime", "Windows Job Object containment", "git 2.41 · debian trixie", "git 2.47 · debian trixie"];
38
+ /** The workflow file every REQUIRED_PR_CHECKS job belongs to: a job of that name from any other workflow (a lookalike
39
+ * added beside it) never stands for it (Codex review round 1, inherited CI limitation). */
40
+ export declare const REQUIRED_PR_CHECKS_WORKFLOW = ".github/workflows/ci.yml";
41
+ /**
42
+ * The pull-request checks main's GitHub protection is not yet required to name (eval-harness review 2, finding 1): the
43
+ * git lanes join main's protection once they have run there, so a protection without them is reported, never refused.
44
+ * A later release empties this list; from then on main's protection must name every REQUIRED_PR_CHECKS check.
45
+ */
46
+ export declare const PROTECTION_REPORT_ONLY_CHECKS: readonly string[];
47
+ /** The checks main's protection must require at minimum: every required check that isn't report-only. */
48
+ export declare const PROTECTION_MINIMUM_CHECKS: readonly string[];
49
+ /**
50
+ * Main's protection as the plane's gh reads it (release-adapters.ts readMainProtection): `effective` only when one layer
51
+ * (classic protection or one active ruleset) requires up-to-date branches, binds every PROTECTION_MINIMUM_CHECKS check to GitHub Actions,
52
+ * and nobody merging as this gh can bypass it. `missing` names each absent property; `notYetRequired` the report-only
53
+ * checks the effective layer doesn't name.
54
+ */
55
+ export type MainProtection = {
56
+ effective: boolean;
57
+ missing: string[];
58
+ notYetRequired: string[];
59
+ };
38
60
  /** The checks a release tag runs (.github/workflows/publish.yml), awaited before Homebrew moves. */
39
61
  export declare const RELEASE_TAG_CHECKS: readonly ["node 22 · macos-latest", "node 24 · macos-latest", "publish"];
40
62
  export declare const RELEASE_STEPS: readonly ["gate", "approval", "check", "complete", "quiet", "deploy", "link", "ci", "merge", "tree", "tag", "publish", "homebrew", "done"];
@@ -55,10 +77,20 @@ export type CheckRun = {
55
77
  head?: string | null;
56
78
  /** The workflow (its id, from GitHub's workflow-run API) that this check's suite is a run of, when known. */
57
79
  workflow?: number | null;
80
+ /** That workflow's file in the repository (GitHub's workflow-run `path`), when known. */
81
+ workflowPath?: string | null;
82
+ /** GitHub's own job record (its steps, read by the plane's gh) shows this unsuccessful attempt ended before any of the
83
+ * workflow's own steps ran: the runner failed, not the tests. Absent or false: nothing shows that. */
84
+ beforeTests?: boolean | null;
58
85
  };
59
- /** How many failed attempts of one CI check, and failed release-check runs, an automatic approval tolerates (flakes on a
60
- * pinned commit and digest), before a person decides (auto-approve-green.md). */
61
- export declare const AUTO_FLAKE_CAP = 2;
86
+ /**
87
+ * Failure classes replace a flat flake allowance (docs/plans/eval-harness.md; check-failure.ts says the classes): only a
88
+ * failure the plane itself confirmed as infrastructure is ever run again under the same approval — at most once per
89
+ * incident and twice per candidate — for a release check and for a GitHub CI job alike. A failing test, a typecheck, an
90
+ * attack test, a migration: none tolerated. An unexplained failure blocks, and a person decides.
91
+ */
92
+ export declare const INFRA_RERUNS_PER_INCIDENT = 1;
93
+ export declare const INFRA_RERUNS_PER_CANDIDATE = 2;
62
94
  /** One failed attempt that a later attempt of the same job passed. */
63
95
  export type CheckFailure = {
64
96
  id: number;
@@ -168,6 +200,18 @@ export type AuthorityView = {
168
200
  landed: LandedCommit[];
169
201
  };
170
202
  export type ReleaseAction = "dispatch" | "deploy" | "merge" | "complete";
203
+ /** The plane's answer after a failed release check: rerun (confirmed infrastructure), already rerunning, or stop. */
204
+ export type FailureClassName = "deterministic" | "infrastructure" | "unknown" | "agent-behaviour";
205
+ export type RecheckView = {
206
+ action: "rerun";
207
+ why: string;
208
+ } | {
209
+ action: "pending";
210
+ } | {
211
+ action: "stop";
212
+ class: FailureClassName | null;
213
+ why: string;
214
+ };
171
215
  export type OperationView = {
172
216
  id: string;
173
217
  kind: "deploy" | "merge";
@@ -231,6 +275,20 @@ export type ReleaseAuthorityAdapter = {
231
275
  * the authority could not be stopped (a stale epoch, a merge already reserved): the coordinator fails closed. */
232
276
  needsApproval(authority: number, reason: string, epoch: number): Promise<boolean>;
233
277
  operations(authority: number): Promise<OperationView[]>;
278
+ /** After a failed release check (check-failure.ts): the plane classifies it from its own records and, only for
279
+ * confirmed infrastructure within its limits, runs the check again on the same candidate under the same approval.
280
+ * Absent on an older plane: a failed check stops as before. */
281
+ recheck?(taskId: string): Promise<RecheckView>;
282
+ /** Whether a passing check stands given every earlier attempt on the same commit (an earlier failure that wasn't
283
+ * confirmed infrastructure isn't erased by a pass), and what passed only on a retry. */
284
+ standing?(taskId: string, run: number): Promise<{
285
+ ok: true;
286
+ retried: string[] | null;
287
+ } | {
288
+ ok: false;
289
+ why: string;
290
+ retried: string[] | null;
291
+ }>;
234
292
  /** Releases that approve themselves when green (docs/plans/auto-approve-green.md): the plane's own seals, each proven
235
293
  * again inside the plane. Absent: a plane that can't, and every release asks a person as before. */
236
294
  auto?: AutoReleaseAdapter;
@@ -279,6 +337,17 @@ export type AutoReleaseAdapter = {
279
337
  }>;
280
338
  /** The automatic road ended without a release: the task asks a person, and the owner is told why. */
281
339
  giveUp(taskId: string, why: string): Promise<void>;
340
+ /** The task is filed while CI still runs on `candidate` (recorded in the plane before the task is filed): its approval
341
+ * card says so until the plane reads CI passing. It holds nothing (Alex, 2026-10-29: a person may approve during CI). */
342
+ ciRunning?(taskId: string, candidate: string): Promise<void>;
343
+ /** The plane reads CI on `candidate` itself and, when every required check passed, ends the "CI still running" note
344
+ * (and lifts a hold an older coordinator placed); `ask` tells the owner of a held release it needs them now. */
345
+ ciPassed?(taskId: string, candidate: string, ask: boolean): Promise<{
346
+ ok: true;
347
+ } | {
348
+ ok: false;
349
+ why: string;
350
+ }>;
282
351
  /** The release check failed while checking automatically: the owner is told; the commit may be checked again (a
283
352
  * regate of the same commit and digest, within the plane's cap on failed runs). */
284
353
  checkFailed(taskId: string, why: string): Promise<void>;
@@ -306,10 +375,6 @@ export type ReleaseAdapters = {
306
375
  deleteBranch(branch: string, head: string): Promise<void>;
307
376
  tree(sha: string): Promise<string>;
308
377
  fileAt(sha: string, path: string): Promise<string | null>;
309
- /** origin/main as the last sync fetched it. */
310
- mainHead(): Promise<string>;
311
- /** Whether `ancestor` is in `sha`'s history. */
312
- contains(sha: string, ancestor: string): Promise<boolean>;
313
378
  };
314
379
  toolroll: {
315
380
  /** Which runtime each launchd service and each CLI name (`toolroll`, `standing-orders`) runs from. */
@@ -382,6 +447,13 @@ export type ReleaseAdapters = {
382
447
  * endpoint's ceiling). Absent or false: an automatic release fails closed; a person's is unaffected. */
383
448
  complete?(repo: string, sha: string): Promise<boolean>;
384
449
  merge(repo: string, pr: number, head: string, message?: string): Promise<string>;
450
+ /** main's head as GitHub's API answers now (never a local ref a build could move). */
451
+ mainHead(repo: string): Promise<string>;
452
+ /** Whether `sha` already holds `ancestor`, by GitHub's own comparison. */
453
+ contains(repo: string, sha: string, ancestor: string): Promise<boolean>;
454
+ /** Whether GitHub refuses to merge a branch that is behind main ("Require branches to be up to date before
455
+ * merging"); null when it can't be read. Read only. */
456
+ upToDateRequired(repo: string): Promise<MainProtection | null>;
385
457
  tag(repo: string, tag: string): Promise<string | null>;
386
458
  createTag(repo: string, tag: string, sha: string): Promise<void>;
387
459
  release(repo: string, tag: string): Promise<boolean>;
@@ -490,6 +562,13 @@ export type ReleaseJournal = {
490
562
  why?: string;
491
563
  ci?: number[];
492
564
  } | null;
565
+ /** The gate filed the task while the pull request's checks still ran (pipeline-speed.md, D2 and "Decision: a person's
566
+ * release asks during CI"): the release check runs beside CI. A person may approve meanwhile; the plane's automatic
567
+ * approval waits for every check to pass, and nothing deploys, merges, tags or publishes before they do. */
568
+ ciAhead?: boolean;
569
+ /** Set with ciAhead and never cleared for this commit: a person's release reads CI again, fresh, right before the
570
+ * deploy, whatever was seen while asking (a green CI may have a newer attempt failing since). */
571
+ ciBeforeDeploy?: boolean;
493
572
  /** When each step was about to change something outside this machine: what a resume must look for before acting. */
494
573
  intents: Partial<Record<ReleaseStep, string>>;
495
574
  stopped: {
@@ -565,11 +644,14 @@ export declare function transientNetworkError(error: unknown): boolean;
565
644
  * each reported attempt must be filed under `head` with a check-run id; a required check counts only from GitHub
566
645
  * Actions (an app that names a check alike can't stand in for it); attempts are grouped by the job they belong to — the
567
646
  * app, its check suite (a workflow run, whose re-runs stay in it) and the name — and every group is judged by its
568
- * latest attempt; every required check needs a group. With `cap`, a group whose earlier attempts failed more than `cap`
569
- * times fails too (an automatic approval's flake allowance); the failures it tolerated are returned.
647
+ * latest attempt; every required check needs a group. With `auto` (an automatic approval), every other failed attempt on
648
+ * the commit — an earlier attempt, or a job a newer run renamed or dropped — must be one GitHub's own job record shows ending before any workflow step ran (`beforeTests`: confirmed
649
+ * infrastructure), and at most INFRA_RERUNS_PER_CANDIDATE of them on the commit; any other earlier failure — a test,
650
+ * a typecheck, or one nothing explains — fails the verdict, so a person decides. The failures it tolerated are returned.
570
651
  */
571
652
  export declare function prChecksVerdict(runs: readonly CheckRun[], head: string, required: readonly string[], options?: {
572
- cap?: number;
653
+ auto?: true;
654
+ workflow?: string;
573
655
  }): {
574
656
  state: "passed";
575
657
  failures: CheckFailure[];
@@ -580,4 +662,19 @@ export declare function prChecksVerdict(runs: readonly CheckRun[], head: string,
580
662
  state: "failed";
581
663
  failed: string[];
582
664
  };
665
+ /**
666
+ * What a failed release check means and what happens next, by its class (check-failure.ts), in words. Only confirmed
667
+ * infrastructure reruns on its own; nothing else is rerun to pass.
668
+ */
669
+ export declare function checkFailedWords(input: {
670
+ sha: string;
671
+ run: number;
672
+ class: FailureClassName | null;
673
+ why: string;
674
+ branch: string;
675
+ checkout: string;
676
+ taskId: string;
677
+ }): string;
678
+ /** Whether GitHub's workflow-run `path` names exactly `file` (it may carry the ref it ran from, after an `@`). */
679
+ export declare function workflowIs(path: string | null | undefined, file: string): boolean;
583
680
  export {};