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.
- package/CHANGELOG.md +192 -0
- package/README.md +11 -4
- package/THIRD_PARTY_NOTICES.md +5 -5
- package/dist/agent-fence.js +28 -8
- package/dist/assignment.js +3 -0
- package/dist/browser/THIRD_PARTY_NOTICES.txt +5 -5
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +31 -31
- package/dist/builder.d.ts +14 -0
- package/dist/builder.js +140 -41
- package/dist/chat-decide.js +4 -0
- package/dist/check-failure.d.ts +92 -0
- package/dist/check-failure.js +267 -0
- package/dist/check-progress.d.ts +28 -1
- package/dist/check-progress.js +105 -6
- package/dist/check-report.d.ts +52 -6
- package/dist/check-report.js +193 -8
- package/dist/checkout-cleanup.js +2 -2
- package/dist/cli.js +8 -5
- package/dist/coding-handoff.d.ts +1 -0
- package/dist/coding-handoff.js +20 -11
- package/dist/commit-extract.d.ts +6 -0
- package/dist/commit-extract.js +63 -8
- package/dist/console-chrome.d.ts +41 -0
- package/dist/console-chrome.js +166 -0
- package/dist/contracts/release-check.d.ts +12 -0
- package/dist/contracts/release-check.js +17 -0
- package/dist/contracts/verification-receipt.d.ts +20 -2
- package/dist/contracts/verification-receipt.js +15 -3
- package/dist/contracts/verification-view.d.ts +8 -0
- package/dist/controller-supervisor.d.ts +8 -0
- package/dist/controller-supervisor.js +33 -1
- package/dist/demo.js +3 -2
- package/dist/deploy-gate.js +5 -0
- package/dist/dispose.d.ts +3 -0
- package/dist/dispose.js +6 -3
- package/dist/doctor.d.ts +7 -0
- package/dist/doctor.js +10 -2
- package/dist/envelope.js +2 -1
- package/dist/evidence.js +4 -1
- package/dist/exec.d.ts +7 -0
- package/dist/exec.js +7 -1
- package/dist/git-floor.d.ts +16 -0
- package/dist/git-floor.js +36 -0
- package/dist/grant.js +5 -1
- package/dist/guides.js +4 -3
- package/dist/operate.d.ts +13 -0
- package/dist/operate.js +773 -319
- package/dist/prepared-evidence.d.ts +2 -1
- package/dist/prepared-evidence.js +8 -3
- package/dist/project-knowledge.js +6 -2
- package/dist/project-learning.js +2 -2
- package/dist/proof.js +6 -0
- package/dist/read-executor-worker.js +8 -4
- package/dist/read-executor.d.ts +18 -1
- package/dist/read-executor.js +8 -0
- package/dist/release-adapters.d.ts +48 -1
- package/dist/release-adapters.js +343 -10
- package/dist/release-authority.js +6 -2
- package/dist/release-auto.d.ts +38 -7
- package/dist/release-auto.js +131 -15
- package/dist/release-card.d.ts +15 -3
- package/dist/release-card.js +25 -9
- package/dist/release-ci-hold.d.ts +41 -0
- package/dist/release-ci-hold.js +53 -0
- package/dist/release-cli.js +21 -12
- package/dist/release-coverage.js +5 -2
- package/dist/release-recheck.d.ts +1 -1
- package/dist/release-recheck.js +6 -1
- package/dist/release.d.ts +108 -11
- package/dist/release.js +294 -39
- package/dist/review-context.js +8 -6
- package/dist/runner.js +2 -1
- package/dist/sandbox-runtime.d.ts +8 -0
- package/dist/sandbox-runtime.js +14 -2
- package/dist/scope.js +7 -1
- package/dist/secret-mint.d.ts +1 -0
- package/dist/secret-mint.js +14 -0
- package/dist/serve.js +101 -51
- package/dist/server/chat.js +5 -5
- package/dist/server/render-tasks.d.ts +2 -0
- package/dist/server/render-tasks.js +2 -1
- package/dist/server/request-context.d.ts +6 -0
- package/dist/server/runtime.d.ts +2 -0
- package/dist/server/task-views.js +7 -2
- package/dist/setup-guide.d.ts +2 -2
- package/dist/storage.d.ts +5 -0
- package/dist/storage.js +28 -1
- package/dist/store.d.ts +10 -0
- package/dist/store.js +25 -1
- package/dist/task-base.d.ts +4 -0
- package/dist/task-base.js +22 -2
- package/dist/teardown-git.d.ts +52 -3
- package/dist/teardown-git.js +143 -31
- package/dist/test-infra.js +1 -1
- package/dist/up-processes.d.ts +137 -0
- package/dist/up-processes.js +165 -0
- package/dist/up-role-child.d.ts +1 -0
- package/dist/up-role-child.js +77 -0
- package/dist/verification-evidence.d.ts +1 -0
- package/dist/verification-evidence.js +13 -1
- package/package.json +2 -1
package/dist/release-auto.js
CHANGED
|
@@ -13,16 +13,19 @@
|
|
|
13
13
|
* adapter. Any refusal unseals `auto-check`, so the task asks a person, its passing check kept.
|
|
14
14
|
*/
|
|
15
15
|
import { assignmentOf } from "./assignment.js";
|
|
16
|
-
import { projectGitDir } from "./check-report.js";
|
|
16
|
+
import { fullCheckProblem, projectGitDir } from "./check-report.js";
|
|
17
|
+
import { sealedRun } from "./release-recheck.js";
|
|
17
18
|
import { runCheckLevel } from "./check-levels.js";
|
|
18
19
|
import { readVerifiedCommit, verifiedBlobs, verifiedTreeDiff, verifiedTreeEntries } from "./commit-extract.js";
|
|
19
20
|
import { mightName, testInfrastructure } from "./test-infra.js";
|
|
20
21
|
import { chatControlHref } from "./chat-controls.js";
|
|
21
|
-
import {
|
|
22
|
+
import { INFRA_RERUNS_PER_CANDIDATE, REQUIRED_PR_CHECKS, REQUIRED_PR_CHECKS_WORKFLOW, prChecksVerdict } from "./release.js";
|
|
23
|
+
import { releaseCheckStanding } from "./check-failure.js";
|
|
22
24
|
import { CARRY_RULES, rulePath } from "./release-carry.js";
|
|
23
25
|
import { AUTO_EVIDENCE_ACTION, AUTO_WITHDRAWN_ACTION, LIVE_RELEASE_STATES, RELEASE_APPROVAL_ACTION, releaseAuthorityOfTask, releaseAutoApproves, releaseApprovalSetting } from "./release-authority.js";
|
|
24
26
|
import { autoReleaseApprovalOf, personApprovalOf } from "./scope.js";
|
|
25
27
|
import { releaseOperations, revokeRelease } from "./store.js";
|
|
28
|
+
import { RELEASE_CI_HELD_ACTION, RELEASE_CI_PASSED_ACTION, RELEASE_CI_RUNNING_WORDS, releaseCiHoldOf, releaseCiRunningOf } from "./release-ci-hold.js";
|
|
26
29
|
import { verificationEvidence } from "./verification-evidence.js";
|
|
27
30
|
export { RELEASE_APPROVAL_ACTION, releaseApprovalSetting, releaseAutoApproves };
|
|
28
31
|
/** The setting's words, one place. */
|
|
@@ -212,13 +215,12 @@ export function autoPathProblem(path) {
|
|
|
212
215
|
return null;
|
|
213
216
|
return "it's outside what a release approves itself for (product code, tests, docs, the changelog and a version bump)";
|
|
214
217
|
}
|
|
215
|
-
/** Flakes: how many failed attempts one CI job, and how many unsuccessful release-check runs, may have before a person
|
|
216
|
-
* decides. The head and digest are pinned, so between attempts only nondeterminism differs. */
|
|
217
|
-
export const MAX_FAILED_ATTEMPTS = AUTO_FLAKE_CAP;
|
|
218
218
|
/**
|
|
219
219
|
* GitHub CI on the exact head, as the plane read it (every attempt): fresh, every run GitHub Actions, and the same
|
|
220
220
|
* verdict every later release boundary uses (release.ts prChecksVerdict: exact head, each job by its latest attempt,
|
|
221
|
-
* every required check present),
|
|
221
|
+
* every required check present), where an earlier failure stands only as confirmed infrastructure (GitHub's job record
|
|
222
|
+
* shows it ended before any workflow step ran), at most INFRA_RERUNS_PER_CANDIDATE of them. The tolerated failures are
|
|
223
|
+
* returned for the evidence.
|
|
222
224
|
*/
|
|
223
225
|
export function ciVerdict(observation, candidate, now) {
|
|
224
226
|
const no = (problem) => ({ ok: false, problem });
|
|
@@ -232,7 +234,7 @@ export function ciVerdict(observation, candidate, now) {
|
|
|
232
234
|
const other = observation.runs.find(run => run.app !== "github-actions");
|
|
233
235
|
if (other !== undefined)
|
|
234
236
|
return no(`${other.name} was reported by ${other.app ?? "an unknown app"}, not GitHub Actions`);
|
|
235
|
-
const verdict = prChecksVerdict(observation.runs, candidate, REQUIRED_PR_CHECKS, {
|
|
237
|
+
const verdict = prChecksVerdict(observation.runs, candidate, REQUIRED_PR_CHECKS, { auto: true, workflow: REQUIRED_PR_CHECKS_WORKFLOW });
|
|
236
238
|
if (verdict.state === "failed")
|
|
237
239
|
return no(verdict.failed.join(", "));
|
|
238
240
|
if (verdict.state === "pending")
|
|
@@ -317,6 +319,19 @@ function changeProblem(repo, base, candidate) {
|
|
|
317
319
|
// Taking a test away is never automatic, wherever it lives.
|
|
318
320
|
if (change.kind === "deleted" && TEST_FILE.test(rulePath(change.path)))
|
|
319
321
|
return `${change.path} was deleted (removing a test needs a person)`;
|
|
322
|
+
if (change.before !== null && TEST_FILE.test(rulePath(change.path))) {
|
|
323
|
+
// Counts cannot prove that an assertion survived: replacing it, commenting it out, or skipping its case can
|
|
324
|
+
// leave the counts unchanged. Only append-only additions preserve the existing code without interpretation.
|
|
325
|
+
// Both copies come from verified trees; no report or candidate-provided file list decides this permission.
|
|
326
|
+
const was = verifiedBlobs(gitDir, before.value.tree, [change.path]);
|
|
327
|
+
const now = verifiedBlobs(gitDir, after.value.tree, [change.path]);
|
|
328
|
+
if (!was.ok || !now.ok)
|
|
329
|
+
return `${change.path}'s existing test code couldn't be read (a person decides)`;
|
|
330
|
+
const original = was.value.get(change.path)?.bytes, revised = now.value.get(change.path)?.bytes;
|
|
331
|
+
if (original === undefined || revised === undefined || !revised.subarray(0, original.length).equals(original)) {
|
|
332
|
+
return `${change.path} changes existing test code (removing or rewriting tests needs a person)`;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
320
335
|
const why = autoPathProblem(change.path);
|
|
321
336
|
if (why !== null)
|
|
322
337
|
return `${change.path} changed (${why})`;
|
|
@@ -348,6 +363,12 @@ export function sealAutoGreen(store, input) {
|
|
|
348
363
|
const facts = releaseTaskFacts(store, input);
|
|
349
364
|
if (!facts.ok)
|
|
350
365
|
return facts;
|
|
366
|
+
// Head-only CI is the merged tree only when GitHub itself refuses a branch behind main (eval-harness review 1,
|
|
367
|
+
// finding 4): without that setting nothing approves itself.
|
|
368
|
+
if (input.mainUpToDate !== true)
|
|
369
|
+
return refuse(input.mainUpToDate === null
|
|
370
|
+
? "GitHub's branch protection for main couldn't be read, so whether it refuses a branch behind main is unknown"
|
|
371
|
+
: "main's branch protection doesn't hold for the account that merges: it must require branches to be up to date, require the release's checks, and allow no bypass (\"Do not allow bypassing the above settings\")");
|
|
351
372
|
const checking = autoReleaseApprovalOf(store, input.taskId, "auto-check");
|
|
352
373
|
if (!checking.ok)
|
|
353
374
|
return refuse(`its check wasn't authorized automatically: ${checking.why}`);
|
|
@@ -362,15 +383,26 @@ export function sealAutoGreen(store, input) {
|
|
|
362
383
|
return refuse(`run ${input.run} recorded no commit`);
|
|
363
384
|
if (runCheckLevel(store, run.id) !== "full")
|
|
364
385
|
return refuse("the release check wasn't Full");
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
// same signed scope
|
|
386
|
+
// Earlier builds of this task that didn't finish built with a passed check (a failed check, a check that never ran,
|
|
387
|
+
// a build that failed or was interrupted) stand only as confirmed infrastructure the release itself reran on the
|
|
388
|
+
// same signed scope, at most INFRA_RERUNS_PER_CANDIDATE (check-failure.ts): a failing test, an unexplained failure
|
|
389
|
+
// or a real-model journey before the pass means a person decides. So does anything that passed only on a retry.
|
|
368
390
|
const failedRuns = store.handle.prepare(`SELECT r.id, r.scope_digest FROM run r LEFT JOIN run_check c ON c.run = r.id
|
|
369
391
|
WHERE r.task_ref = ? AND r.role = 'builder' AND r.id <> ?
|
|
370
392
|
AND NOT (COALESCE(r.outcome, '') IN ('built', 'no-change') AND COALESCE(c.status, '') = 'passed') ORDER BY r.id`).all(facts.taskRef, run.id);
|
|
371
393
|
if (failedRuns.some(one => one["scope_digest"] !== input.digest))
|
|
372
394
|
return refuse("an earlier check of this release ran on different scope text, so a person decides");
|
|
373
|
-
if (failedRuns.
|
|
395
|
+
if (failedRuns.some(one => Number(one["id"]) > run.id))
|
|
396
|
+
return refuse(`run ${input.run} isn't this task's newest build`);
|
|
397
|
+
const standing = releaseCheckStanding(store, input.evidenceRoot, { taskId: input.taskId, run: run.id });
|
|
398
|
+
if (!standing.ok)
|
|
399
|
+
return refuse(standing.why);
|
|
400
|
+
// Unknown is never "no retries" (eval-harness review 1, finding 3).
|
|
401
|
+
if (standing.retried === null)
|
|
402
|
+
return refuse("the release check's retry record can't be read (its report or receipt is missing or damaged), so whether anything passed only on a retry is unknown and a person decides");
|
|
403
|
+
if (standing.retried.length > 0)
|
|
404
|
+
return refuse(`the release check passed only on a retry (${standing.retried.slice(0, 3).join(", ")}${standing.retried.length > 3 ? ", …" : ""}), so a person decides`);
|
|
405
|
+
if (failedRuns.length > INFRA_RERUNS_PER_CANDIDATE)
|
|
374
406
|
return refuse(`the release check failed ${failedRuns.length} times before it passed, so a person decides`);
|
|
375
407
|
const checkFailures = failedRuns.map(one => Number(one["id"]));
|
|
376
408
|
const newest = store.runsFor(facts.taskRef).find(one => one.role === "builder");
|
|
@@ -391,6 +423,22 @@ export function sealAutoGreen(store, input) {
|
|
|
391
423
|
const command = gate["command"];
|
|
392
424
|
if (gate["coverage"] !== undefined && gate["coverage"] !== "full")
|
|
393
425
|
return refuse(`the release check didn't cover everything (${String(gate["coverage"])})`);
|
|
426
|
+
// A readable, valid report and inventory of a Full attempt, the receipt's own, every obligation accounted for, and
|
|
427
|
+
// the retry summary sealed in the receipt: an automatic approval never stands on evidence it can't read.
|
|
428
|
+
const check = gate["check"];
|
|
429
|
+
const sealed = sealedRun(store, input.evidenceRoot, run.id);
|
|
430
|
+
if (check === undefined || sealed === null || sealed.attempt.mode !== "full" || check.attempt !== "full" || sealed.report === null || sealed.inventory === null || sealed.reportDigest !== check.report) {
|
|
431
|
+
return refuse("the release check's sealed report or inventory can't be read, so what it ran and retried is unknown");
|
|
432
|
+
}
|
|
433
|
+
const incomplete = fullCheckProblem({ report: sealed.report, inventory: sealed.inventory, exitCode: typeof result?.exitCode === "number" ? result.exitCode : null });
|
|
434
|
+
if (incomplete !== null)
|
|
435
|
+
return refuse(`the release check has no complete result: ${incomplete}`);
|
|
436
|
+
if (!Array.isArray(check.retried))
|
|
437
|
+
return refuse("the release check's receipt has no sealed retry record, so a person decides");
|
|
438
|
+
// Belt to the retry record (finding 6): a check that passed only on a rerun after the recovery setup never approves
|
|
439
|
+
// itself — its first failure isn't confirmed infrastructure.
|
|
440
|
+
if (result?.setupReplayed === true)
|
|
441
|
+
return refuse("the release check passed only when it was run again after the approved setup, so a person decides");
|
|
394
442
|
if (gate["run"] !== run.id || gate["head"] !== head || gate["scopeDigest"] !== input.digest || result?.ran !== true || result.exitCode !== 0 || live === null || command?.command !== live.command) {
|
|
395
443
|
return refuse("the release check didn't pass this candidate under the approved command");
|
|
396
444
|
}
|
|
@@ -442,14 +490,25 @@ export function giveUpAutoApproval(store, input) {
|
|
|
442
490
|
unseal(store, input.taskId, input.now);
|
|
443
491
|
const scope = store.getScope(input.taskId);
|
|
444
492
|
const version = scope?.releaseTerms?.packageVersion ?? null;
|
|
493
|
+
// Still waiting for CI (round 1, finding 4): nobody is asked to approve yet; `liftCiHold` asks once CI passed.
|
|
494
|
+
const ciHold = releaseCiHoldOf(store, input.taskId);
|
|
495
|
+
if (ciHold !== null) {
|
|
496
|
+
store.enqueueNotification({ dedupeKey: `release-auto-stopped:${input.taskId}:${input.why.slice(0, 120)}`, kind: "release-auto",
|
|
497
|
+
subject: `Release${version === null ? "" : ` ${version}`} won't approve itself`,
|
|
498
|
+
body: `Not approved automatically: ${input.why}. GitHub CI is still running on ${ciHold.candidate?.slice(0, 7) ?? "its commit"}; you're asked to approve it once CI passes.`,
|
|
499
|
+
link: chatControlHref("task", input.taskId), source: { taskRef: ref.id } }, input.now);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
// Filed while CI runs (Alex, 2026-10-29): a person may approve now; nothing deploys until CI passes.
|
|
503
|
+
const running = releaseCiRunningOf(store, input.taskId) === null ? "" : ` ${RELEASE_CI_RUNNING_WORDS}`;
|
|
445
504
|
store.enqueueNotification({ dedupeKey: `release-auto-stopped:${input.taskId}:${input.why.slice(0, 120)}`, kind: "release-auto", pushClass: "attention",
|
|
446
505
|
subject: `Release${version === null ? "" : ` ${version}`} needs you`,
|
|
447
|
-
body: `Not approved automatically: ${input.why}. Approve it yourself, or fix the branch and release the new commit
|
|
506
|
+
body: `Not approved automatically: ${input.why}. Approve it yourself, or fix the branch and release the new commit.${running}`,
|
|
448
507
|
link: chatControlHref("task", input.taskId), source: { taskRef: ref.id } }, input.now);
|
|
449
508
|
});
|
|
450
509
|
}
|
|
451
|
-
/** A release check failed while checking automatically: tell the owner. The `auto-check` stays
|
|
452
|
-
*
|
|
510
|
+
/** A release check failed while checking automatically: tell the owner. The `auto-check` stays: a rerun the release
|
|
511
|
+
* itself made after confirmed infrastructure may still approve itself; any other failure means a person decides. */
|
|
453
512
|
export function noteAutoCheckFailed(store, input) {
|
|
454
513
|
const ref = store.lookupRef(input.taskId);
|
|
455
514
|
if (ref === null)
|
|
@@ -457,7 +516,7 @@ export function noteAutoCheckFailed(store, input) {
|
|
|
457
516
|
const version = store.getScope(input.taskId)?.releaseTerms?.packageVersion ?? null;
|
|
458
517
|
store.enqueueNotification({ dedupeKey: `release-auto-check-failed:${input.taskId}:${input.why.slice(0, 120)}`, kind: "release-auto", pushClass: "attention",
|
|
459
518
|
subject: `Release${version === null ? "" : ` ${version}`} check failed`,
|
|
460
|
-
body: `${input.why}.
|
|
519
|
+
body: `${input.why}. Only a failure Toolroll confirmed as its own infrastructure is checked again automatically; for anything else, approve it yourself or fix the branch and release the new commit.`,
|
|
461
520
|
link: chatControlHref("task", input.taskId), source: { taskRef: ref.id } }, input.now);
|
|
462
521
|
}
|
|
463
522
|
/** "Released 0.9.x automatically": the release that approved itself finished. */
|
|
@@ -494,3 +553,60 @@ export function allowAutoPublish(store, input) {
|
|
|
494
553
|
action: PUBLISH_ALLOWED_ACTION, outcome: "allowed", source: "request", detail: `${input.by} lets the release's tag, publication and Homebrew go on` });
|
|
495
554
|
return { ok: true };
|
|
496
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* A release filed while its pull request's CI still ran (pipeline-speed.md D2): hold every approval but the automatic
|
|
558
|
+
* road's until the plane reads exact-head CI passing (Codex review round 1, finding 4). Recorded before the task is
|
|
559
|
+
* filed, so no moment exists where the filed task is approvable with CI pending. Idempotent.
|
|
560
|
+
*/
|
|
561
|
+
export function holdApprovalForCi(store, input) {
|
|
562
|
+
if (!/^[0-9a-f]{40}$/.test(input.candidate))
|
|
563
|
+
throw new Error("a CI hold needs the exact candidate commit");
|
|
564
|
+
const held = releaseCiHoldOf(store, input.taskId);
|
|
565
|
+
if (held !== null && held.candidate === input.candidate)
|
|
566
|
+
return;
|
|
567
|
+
store.recordAction({ at: input.now.toISOString(), actor: "toolroll", repo: store.lookupRef(input.taskId)?.repo ?? null, taskId: input.taskId, runId: null,
|
|
568
|
+
action: RELEASE_CI_HELD_ACTION, outcome: "held", source: "work", detail: input.candidate });
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Lift a release's CI hold (an older coordinator's) or end its "CI still running" note on the plane's own reading of
|
|
572
|
+
* GitHub CI (never the coordinator's word): fresh, whole, every run GitHub Actions, on exactly the held candidate, and
|
|
573
|
+
* every required check passed (release.ts prChecksVerdict, as a person's road judges it: a person decides about earlier
|
|
574
|
+
* attempts). With `ask`, the owner of a held release is told it needs them now. Nothing held or noted is a pass.
|
|
575
|
+
*/
|
|
576
|
+
export function liftCiHold(store, input) {
|
|
577
|
+
return store.transact(() => {
|
|
578
|
+
const held = releaseCiHoldOf(store, input.taskId);
|
|
579
|
+
const waiting = held ?? releaseCiRunningOf(store, input.taskId);
|
|
580
|
+
if (waiting === null)
|
|
581
|
+
return { ok: true };
|
|
582
|
+
if (waiting.candidate !== input.candidate)
|
|
583
|
+
return refuse(`the release waits for CI on ${waiting.candidate?.slice(0, 7) ?? "an unreadable commit"}, not ${input.candidate.slice(0, 7)}`);
|
|
584
|
+
const ci = input.ci;
|
|
585
|
+
if (ci.head !== input.candidate)
|
|
586
|
+
return refuse(`CI was read for ${ci.head.slice(0, 7)}, not ${input.candidate.slice(0, 7)}`);
|
|
587
|
+
const at = Date.parse(ci.observedAt);
|
|
588
|
+
if (!Number.isFinite(at) || at > input.now.getTime() + 60_000 || input.now.getTime() - at > CI_OBSERVATION_MS)
|
|
589
|
+
return refuse("the CI reading isn't fresh");
|
|
590
|
+
if (ci.complete !== true)
|
|
591
|
+
return refuse("GitHub's check history of this commit can't be read whole");
|
|
592
|
+
const other = ci.runs.find(run => run.app !== "github-actions");
|
|
593
|
+
if (other !== undefined)
|
|
594
|
+
return refuse(`${other.name} was reported by ${other.app ?? "an unknown app"}, not GitHub Actions`);
|
|
595
|
+
const verdict = prChecksVerdict(ci.runs, input.candidate, REQUIRED_PR_CHECKS, { workflow: REQUIRED_PR_CHECKS_WORKFLOW });
|
|
596
|
+
if (verdict.state === "failed")
|
|
597
|
+
return refuse(`CI failed: ${verdict.failed.join(", ")}`);
|
|
598
|
+
if (verdict.state === "pending")
|
|
599
|
+
return refuse(`CI hasn't finished: ${verdict.waiting.join(", ")}`);
|
|
600
|
+
const ref = store.lookupRef(input.taskId);
|
|
601
|
+
store.recordAction({ at: input.now.toISOString(), actor: "toolroll", repo: ref?.repo ?? null, taskId: input.taskId, runId: null,
|
|
602
|
+
action: RELEASE_CI_PASSED_ACTION, outcome: "passed", source: "work", detail: input.candidate });
|
|
603
|
+
if (input.ask && held !== null && ref !== null) {
|
|
604
|
+
const version = store.getScope(input.taskId)?.releaseTerms?.packageVersion ?? null;
|
|
605
|
+
store.enqueueNotification({ dedupeKey: `release-ci-passed:${input.taskId}:${input.candidate}`, kind: "release-auto", pushClass: "attention",
|
|
606
|
+
subject: `Release${version === null ? "" : ` ${version}`} needs you`,
|
|
607
|
+
body: `GitHub CI passed on ${input.candidate.slice(0, 7)}. Approve it yourself, or fix the branch and release the new commit.`,
|
|
608
|
+
link: chatControlHref("task", input.taskId), source: { taskRef: ref.id } }, input.now);
|
|
609
|
+
}
|
|
610
|
+
return { ok: true };
|
|
611
|
+
});
|
|
612
|
+
}
|
package/dist/release-card.d.ts
CHANGED
|
@@ -46,10 +46,22 @@ export type ChangeList = {
|
|
|
46
46
|
}[] | null;
|
|
47
47
|
source: "recorded" | "pull-request" | "unread";
|
|
48
48
|
digest: string;
|
|
49
|
+
/** A release is on the record but its merge commit can't be read (eval-harness review 2, finding 4). */
|
|
50
|
+
baselineUnreadable?: true;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The plane's own record of the last verified release of `repo`: the merge commit GitHub answered with, recorded once
|
|
54
|
+
* the release verified the merged tree (the newest merged authority whose merge operation succeeded). Never a tag.
|
|
55
|
+
* Whether the plane recorded one, and its merge commit (eval-harness review 2, finding 4):
|
|
56
|
+
* `recorded: false` only when no merged release is on the record at all; a recorded one whose commit isn't a full id is
|
|
57
|
+
* `recorded: true` with `sha: null` — something to refuse on, never "no previous release".
|
|
58
|
+
*/
|
|
59
|
+
export declare function releaseBaselineRecord(store: Store, repo: string): {
|
|
60
|
+
recorded: false;
|
|
61
|
+
} | {
|
|
62
|
+
recorded: true;
|
|
63
|
+
sha: string | null;
|
|
49
64
|
};
|
|
50
|
-
/** The plane's own record of the last verified release of `repo`: the merge commit GitHub answered with, recorded once
|
|
51
|
-
* the release verified the merged tree (the newest merged authority whose merge operation succeeded). Never a tag. */
|
|
52
|
-
export declare function releaseBaseline(store: Store, repo: string): string | null;
|
|
53
65
|
/** The commits after `from` up to `to`, as verified Git objects only, from the project's recorded Git directory: the
|
|
54
66
|
* release coordinator's checkout config allowlist first, then commit-extract's verified range (every commit hashed here,
|
|
55
67
|
* a shallow boundary, grafts or replacement refs refused, and the range proved to stop only in the last release's own
|
package/dist/release-card.js
CHANGED
|
@@ -25,6 +25,7 @@ import { verifiedRange } from "./commit-extract.js";
|
|
|
25
25
|
import { releaseTermsSchema } from "./contracts/release-terms.js";
|
|
26
26
|
import { routeFromJson } from "./phase-routing.js";
|
|
27
27
|
import { projectName } from "./project.js";
|
|
28
|
+
import { RELEASE_CI_RUNNING_WORDS, releaseCiRunningOf } from "./release-ci-hold.js";
|
|
28
29
|
import { RELEASE_PATH, releaseConfigProblem, releaseGitEnv, releaseRemote, releaseTools } from "./release-git.js";
|
|
29
30
|
const NONE = "none";
|
|
30
31
|
/** A budget in dollars from integer micro-dollars, in integer arithmetic: cents when it is whole cents, else every digit. */
|
|
@@ -152,13 +153,21 @@ export function approvalTermsOf(store, scope, words) {
|
|
|
152
153
|
export const termsText = (lines) => lines.map(line => `${line.label}: ${line.value}`).join("\n");
|
|
153
154
|
const SHA = /^[0-9a-f]{40}$/;
|
|
154
155
|
const sha256 = (text) => createHash("sha256").update(text).digest("hex");
|
|
155
|
-
/**
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
/**
|
|
157
|
+
* The plane's own record of the last verified release of `repo`: the merge commit GitHub answered with, recorded once
|
|
158
|
+
* the release verified the merged tree (the newest merged authority whose merge operation succeeded). Never a tag.
|
|
159
|
+
* Whether the plane recorded one, and its merge commit (eval-harness review 2, finding 4):
|
|
160
|
+
* `recorded: false` only when no merged release is on the record at all; a recorded one whose commit isn't a full id is
|
|
161
|
+
* `recorded: true` with `sha: null` — something to refuse on, never "no previous release".
|
|
162
|
+
*/
|
|
163
|
+
export function releaseBaselineRecord(store, repo) {
|
|
164
|
+
const row = store.handle.prepare(`SELECT o.external_ref FROM release_authority a LEFT JOIN release_operation o
|
|
165
|
+
ON o.authority = a.id AND o.kind = 'merge' AND o.state = 'succeeded'
|
|
166
|
+
WHERE a.repo = ? AND a.state = 'merged' ORDER BY a.id DESC, o.finished_at DESC LIMIT 1`).get(repo);
|
|
167
|
+
if (row === undefined)
|
|
168
|
+
return { recorded: false };
|
|
169
|
+
const ref = row["external_ref"];
|
|
170
|
+
return { recorded: true, sha: typeof ref === "string" && SHA.test(ref) ? ref : null };
|
|
162
171
|
}
|
|
163
172
|
/** The commits after `from` up to `to`, as verified Git objects only, from the project's recorded Git directory: the
|
|
164
173
|
* release coordinator's checkout config allowlist first, then commit-extract's verified range (every commit hashed here,
|
|
@@ -198,7 +207,12 @@ function pullRequestCommits(slug, pr) {
|
|
|
198
207
|
}
|
|
199
208
|
/** What changed since the last verified release, for a release's terms, from Toolroll's records only. */
|
|
200
209
|
export function releaseChangeList(store, terms) {
|
|
201
|
-
const
|
|
210
|
+
const record = releaseBaselineRecord(store, terms.repo);
|
|
211
|
+
// A release recorded with a merge commit that can't be read: the list couldn't be read (eval-harness review 2,
|
|
212
|
+
// finding 4) — never the pull request's commits, as if there were no previous release.
|
|
213
|
+
if (record.recorded && record.sha === null)
|
|
214
|
+
return { baseline: null, commits: null, source: "unread", baselineUnreadable: true, digest: sha256(`release-changes:${JSON.stringify({ baseline: null, source: "unread", commits: null, recorded: true })}`) };
|
|
215
|
+
const baseline = record.recorded ? record.sha : null;
|
|
202
216
|
let commits;
|
|
203
217
|
let source;
|
|
204
218
|
if (baseline !== null) {
|
|
@@ -221,7 +235,7 @@ function changeWords(changes, terms, cap) {
|
|
|
221
235
|
const head = changes.baseline === null ? `No earlier verified release is recorded. ${changes.source === "pull-request" ? `Pull request #${terms?.pr ?? "?"}'s commits:` : ""}`.trim()
|
|
222
236
|
: `Changes since the last verified release (${changes.baseline.slice(0, 7)}):`;
|
|
223
237
|
if (changes.commits === null)
|
|
224
|
-
return [head, changes.baseline === null ? `The pull request's commits couldn't be read; see #${terms?.pr ?? "?"} on GitHub.` : "The change list couldn't be read."];
|
|
238
|
+
return [head, changes.baseline === null && changes.baselineUnreadable !== true ? `The pull request's commits couldn't be read; see #${terms?.pr ?? "?"} on GitHub.` : "The change list couldn't be read."];
|
|
225
239
|
if (changes.commits.length === 0)
|
|
226
240
|
return [head, "No commits."];
|
|
227
241
|
return [head, ...changes.commits.slice(0, cap).map(one => `• ${one.sha.slice(0, 7)} ${one.subject.slice(0, 100)}`), ...(changes.commits.length > cap ? [`• and ${changes.commits.length - cap} more`] : [])];
|
|
@@ -242,6 +256,8 @@ export function releaseCardOf(store, scope, formDigest, words) {
|
|
|
242
256
|
terms === null ? `Checks: ${value("checks")} · check access: ${value("checkAccess")}` : `Carry later commits: ${terms.policy.carry ? "yes" : "no"} · checks: ${value("checks")} · expires ${terms.expiresAt}`,
|
|
243
257
|
// Option A's disclosure, on the card as on the approval sheet: never approved from chat without it.
|
|
244
258
|
...(terms !== null && terms.policy.carry && terms.access !== "sandboxed" ? ["This project's checks don't run in the sandbox: later test-only commits will run outside the sandbox without being shown to you first."] : []),
|
|
259
|
+
// Filed while CI runs (Alex, 2026-10-29): a person may approve now, and is told plainly what still waits.
|
|
260
|
+
...(releaseCiRunningOf(store, scope.taskId) === null ? [] : [RELEASE_CI_RUNNING_WORDS]),
|
|
245
261
|
"",
|
|
246
262
|
...changeWords(changes, terms, 5),
|
|
247
263
|
"",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** A release's approval held for its pull request's CI (Codex review round 1, finding 4). A leaf module: the seal
|
|
2
|
+
* primitive (store.ts), the person's ceremony (scope.ts), chat and release-auto.ts all read the same row. */
|
|
3
|
+
import type { Store } from "./store.js";
|
|
4
|
+
/**
|
|
5
|
+
* A release filed while its pull request's CI was still running (pipeline-speed.md D2) waits for CI before anyone but
|
|
6
|
+
* the automatic road may approve it (Codex review round 1, finding 4): `release-auto.ts holdApprovalForCi` records the
|
|
7
|
+
* hold before the task is filed, and only the plane's own reading of exact-head CI passing lifts it
|
|
8
|
+
* (`liftCiHold`). The newest row for the task wins; the hold names the candidate commit it waits on.
|
|
9
|
+
* Since Alex's decision of 2026-10-29 (a person may approve during CI) the coordinator records a "CI still running"
|
|
10
|
+
* note instead (below); a hold an older coordinator placed still holds until lifted.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RELEASE_CI_HELD_ACTION = "release approval waits for CI";
|
|
13
|
+
export declare const RELEASE_CI_PASSED_ACTION = "release approval CI passed";
|
|
14
|
+
/** The candidate whose CI a release task's approval waits for, or null when nothing holds it. Fail closed: a hold row
|
|
15
|
+
* whose candidate can't be read still holds. */
|
|
16
|
+
export declare function releaseCiHoldOf(store: Store, taskId: string): {
|
|
17
|
+
candidate: string | null;
|
|
18
|
+
} | null;
|
|
19
|
+
/** Why a person can't approve a release waiting for CI yet, in words. */
|
|
20
|
+
export declare function releaseCiHoldWords(hold: {
|
|
21
|
+
candidate: string | null;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* A person's release asks for approval while its pull request's CI still runs (Alex, 2026-10-29; pipeline-speed.md,
|
|
25
|
+
* "Decision: a person's release asks during CI"). This row never holds approval: it lets the approval card say so, until
|
|
26
|
+
* the plane reads exact-head CI passing (`liftCiHold` records RELEASE_CI_PASSED_ACTION, which ends it as it ends a
|
|
27
|
+
* hold). Deployment gates and operation issuance also refuse while it remains, so a direct deploy cannot bypass
|
|
28
|
+
* the coordinator's CI wait. Its absence is not a CI pass: the coordinator still reads exact-head checks itself.
|
|
29
|
+
*/
|
|
30
|
+
export declare const RELEASE_CI_RUNNING_ACTION = "release asked while CI runs";
|
|
31
|
+
export declare const RELEASE_CI_RUNNING_WORDS = "GitHub's checks are still running; nothing deploys until they pass.";
|
|
32
|
+
/** The candidate whose CI was still running when the release task was filed, or null once the plane read it passing. */
|
|
33
|
+
export declare function releaseCiRunningOf(store: Store, taskId: string): {
|
|
34
|
+
candidate: string | null;
|
|
35
|
+
} | null;
|
|
36
|
+
/** Record that the release task is filed while CI runs on `candidate` (before the task exists). Idempotent. */
|
|
37
|
+
export declare function noteCiRunning(store: Store, input: {
|
|
38
|
+
taskId: string;
|
|
39
|
+
candidate: string;
|
|
40
|
+
now: Date;
|
|
41
|
+
}): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A release filed while its pull request's CI was still running (pipeline-speed.md D2) waits for CI before anyone but
|
|
3
|
+
* the automatic road may approve it (Codex review round 1, finding 4): `release-auto.ts holdApprovalForCi` records the
|
|
4
|
+
* hold before the task is filed, and only the plane's own reading of exact-head CI passing lifts it
|
|
5
|
+
* (`liftCiHold`). The newest row for the task wins; the hold names the candidate commit it waits on.
|
|
6
|
+
* Since Alex's decision of 2026-10-29 (a person may approve during CI) the coordinator records a "CI still running"
|
|
7
|
+
* note instead (below); a hold an older coordinator placed still holds until lifted.
|
|
8
|
+
*/
|
|
9
|
+
export const RELEASE_CI_HELD_ACTION = "release approval waits for CI";
|
|
10
|
+
export const RELEASE_CI_PASSED_ACTION = "release approval CI passed";
|
|
11
|
+
/** The candidate whose CI a release task's approval waits for, or null when nothing holds it. Fail closed: a hold row
|
|
12
|
+
* whose candidate can't be read still holds. */
|
|
13
|
+
export function releaseCiHoldOf(store, taskId) {
|
|
14
|
+
const row = store.handle.prepare("SELECT action, detail FROM action_ledger WHERE task_id = ? AND action IN (?, ?) ORDER BY id DESC LIMIT 1")
|
|
15
|
+
.get(taskId, RELEASE_CI_HELD_ACTION, RELEASE_CI_PASSED_ACTION);
|
|
16
|
+
if (row === undefined || row["action"] !== RELEASE_CI_HELD_ACTION)
|
|
17
|
+
return null;
|
|
18
|
+
const detail = typeof row["detail"] === "string" ? row["detail"] : "";
|
|
19
|
+
return { candidate: /^[0-9a-f]{40}$/.test(detail) ? detail : null };
|
|
20
|
+
}
|
|
21
|
+
/** Why a person can't approve a release waiting for CI yet, in words. */
|
|
22
|
+
export function releaseCiHoldWords(hold) {
|
|
23
|
+
const commit = hold.candidate === null ? "this release's commit" : hold.candidate.slice(0, 7);
|
|
24
|
+
return `GitHub CI is still running on ${commit}. This release can be approved once every pull request check passes; \`toolroll release\` asks you then.`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A person's release asks for approval while its pull request's CI still runs (Alex, 2026-10-29; pipeline-speed.md,
|
|
28
|
+
* "Decision: a person's release asks during CI"). This row never holds approval: it lets the approval card say so, until
|
|
29
|
+
* the plane reads exact-head CI passing (`liftCiHold` records RELEASE_CI_PASSED_ACTION, which ends it as it ends a
|
|
30
|
+
* hold). Deployment gates and operation issuance also refuse while it remains, so a direct deploy cannot bypass
|
|
31
|
+
* the coordinator's CI wait. Its absence is not a CI pass: the coordinator still reads exact-head checks itself.
|
|
32
|
+
*/
|
|
33
|
+
export const RELEASE_CI_RUNNING_ACTION = "release asked while CI runs";
|
|
34
|
+
export const RELEASE_CI_RUNNING_WORDS = "GitHub's checks are still running; nothing deploys until they pass.";
|
|
35
|
+
/** The candidate whose CI was still running when the release task was filed, or null once the plane read it passing. */
|
|
36
|
+
export function releaseCiRunningOf(store, taskId) {
|
|
37
|
+
const row = store.handle.prepare("SELECT action, detail FROM action_ledger WHERE task_id = ? AND action IN (?, ?) ORDER BY id DESC LIMIT 1")
|
|
38
|
+
.get(taskId, RELEASE_CI_RUNNING_ACTION, RELEASE_CI_PASSED_ACTION);
|
|
39
|
+
if (row === undefined || row["action"] !== RELEASE_CI_RUNNING_ACTION)
|
|
40
|
+
return null;
|
|
41
|
+
const detail = typeof row["detail"] === "string" ? row["detail"] : "";
|
|
42
|
+
return { candidate: /^[0-9a-f]{40}$/.test(detail) ? detail : null };
|
|
43
|
+
}
|
|
44
|
+
/** Record that the release task is filed while CI runs on `candidate` (before the task exists). Idempotent. */
|
|
45
|
+
export function noteCiRunning(store, input) {
|
|
46
|
+
if (!/^[0-9a-f]{40}$/.test(input.candidate))
|
|
47
|
+
throw new Error("a CI note needs the exact candidate commit");
|
|
48
|
+
const running = releaseCiRunningOf(store, input.taskId);
|
|
49
|
+
if (running !== null && running.candidate === input.candidate)
|
|
50
|
+
return;
|
|
51
|
+
store.recordAction({ at: input.now.toISOString(), actor: "toolroll", repo: store.lookupRef(input.taskId)?.repo ?? null, taskId: input.taskId, runId: null,
|
|
52
|
+
action: RELEASE_CI_RUNNING_ACTION, outcome: "running", source: "work", detail: input.candidate });
|
|
53
|
+
}
|
package/dist/release-cli.js
CHANGED
|
@@ -84,7 +84,10 @@ export const LEASE_DEPRECATION = "`toolroll release <lease>` is now `toolroll wo
|
|
|
84
84
|
const VALUE_FLAGS = new Set(["--repo", "--limit", "--tap", "--release-gate", "--to", "--request", "--as", "--token", "--schedule"]);
|
|
85
85
|
const BARE_FLAGS = new Set(["--new", "--json", "--help", "--yes", "--no-carry", "--start"]);
|
|
86
86
|
export async function runReleaseCommand(args, write, deps = {}) {
|
|
87
|
-
|
|
87
|
+
// The flag, not a secret's value that happens to read "--json".
|
|
88
|
+
// A secret is never exactly one of these names (the loop below refuses that as a missing value).
|
|
89
|
+
const bare = new Set(args.filter(one => BARE_FLAGS.has(one)));
|
|
90
|
+
const json = bare.has("--json");
|
|
88
91
|
const refuse = (reason, message, code) => {
|
|
89
92
|
write(json ? checkedEnvelopeJson({ ok: false, command: "release", reason, message }) : message);
|
|
90
93
|
return code;
|
|
@@ -93,14 +96,20 @@ export async function runReleaseCommand(args, write, deps = {}) {
|
|
|
93
96
|
const limits = {};
|
|
94
97
|
let repo, tap, gate, to, request, as, token, scheduleFlag;
|
|
95
98
|
for (let i = 0; i < args.length; i += 1) {
|
|
96
|
-
const
|
|
97
|
-
if (BARE_FLAGS.has(
|
|
99
|
+
const raw = args[i];
|
|
100
|
+
if (BARE_FLAGS.has(raw))
|
|
98
101
|
continue;
|
|
102
|
+
// `--flag=value` for every value flag; a secret (--token) is also the next argument even when it starts with "--".
|
|
103
|
+
const equals = raw.startsWith("--") ? raw.indexOf("=") : -1;
|
|
104
|
+
const arg = equals === -1 ? raw : raw.slice(0, equals);
|
|
99
105
|
if (VALUE_FLAGS.has(arg)) {
|
|
100
|
-
const value = args[i + 1];
|
|
101
|
-
|
|
106
|
+
const value = equals === -1 ? args[i + 1] : raw.slice(equals + 1);
|
|
107
|
+
// A secret may start with "--"; it is the value unless it is exactly one of this command's flags (never swallowed).
|
|
108
|
+
const namesFlag = value !== undefined && (BARE_FLAGS.has(value) || VALUE_FLAGS.has(value.split("=")[0]));
|
|
109
|
+
if (value === undefined || (equals === -1 && value.startsWith("--") && (arg !== "--token" || namesFlag)))
|
|
102
110
|
return refuse("usage", `${arg} takes a value.`, 2);
|
|
103
|
-
|
|
111
|
+
if (equals === -1)
|
|
112
|
+
i += 1;
|
|
104
113
|
if (arg === "--repo")
|
|
105
114
|
repo = value;
|
|
106
115
|
else if (arg === "--to")
|
|
@@ -125,23 +134,23 @@ export async function runReleaseCommand(args, write, deps = {}) {
|
|
|
125
134
|
}
|
|
126
135
|
continue;
|
|
127
136
|
}
|
|
128
|
-
if (
|
|
137
|
+
if (raw.startsWith("--"))
|
|
129
138
|
return refuse("usage", `Unknown option ${arg}.\n${RELEASE_HELP}`, 2);
|
|
130
139
|
positional.push(arg);
|
|
131
140
|
}
|
|
132
|
-
if (
|
|
141
|
+
if (bare.has("--help")) {
|
|
133
142
|
write(RELEASE_HELP);
|
|
134
143
|
return 0;
|
|
135
144
|
}
|
|
136
145
|
if (gate !== undefined) {
|
|
137
146
|
if (positional.length > 0 || args.some(arg => ["--repo", "--limit", "--tap", "--new"].includes(arg)))
|
|
138
147
|
return refuse("usage", "--release-gate <id> takes no branch or release options.", 2);
|
|
139
|
-
return runGateRelease(gate,
|
|
148
|
+
return runGateRelease(gate, bare.has("--yes"), write, json, deps.gateWorld ?? installedGateWorld());
|
|
140
149
|
}
|
|
141
|
-
if (
|
|
150
|
+
if (bare.has("--yes"))
|
|
142
151
|
return refuse("usage", "--yes goes with --release-gate <id>; a release needs no confirmation beyond the owner's approval.", 2);
|
|
143
152
|
if (positional[0] === "nightly" && positional.length === 1)
|
|
144
|
-
return runNightlyCommand({ repo: repo === undefined ? undefined : resolve(deps.cwd ?? process.cwd(), repo), as, token, schedule: scheduleFlag, start:
|
|
153
|
+
return runNightlyCommand({ repo: repo === undefined ? undefined : resolve(deps.cwd ?? process.cwd(), repo), as, token, schedule: scheduleFlag, start: bare.has("--start") }, write, json, deps);
|
|
145
154
|
if (["carry", "revoke", "ask-every-commit", "unsandboxed-carry", "auto-approve", "publish-ok"].includes(positional[0] ?? "") && positional.length === 2) {
|
|
146
155
|
return runAuthorityCommand(positional[0], positional[1], { to, request, as, token, repo: repo === undefined ? undefined : resolve(deps.cwd ?? process.cwd(), repo) }, write, json, deps);
|
|
147
156
|
}
|
|
@@ -169,7 +178,7 @@ export async function runReleaseCommand(args, write, deps = {}) {
|
|
|
169
178
|
const adapters = deps.adapters === undefined
|
|
170
179
|
? releaseAdapters({ checkout, say, ...(tap === undefined ? {} : { tap }), ...(limits["deploy"] === undefined ? {} : { deployMinutes: limits["deploy"] }) })
|
|
171
180
|
: { ...deps.adapters, say };
|
|
172
|
-
const outcome = await runRelease({ branch, checkout, stateDir, limits, fresh:
|
|
181
|
+
const outcome = await runRelease({ branch, checkout, stateDir, limits, fresh: bare.has("--new"), noCarry: bare.has("--no-carry") }, adapters);
|
|
173
182
|
return report(outcome, write, json, lines);
|
|
174
183
|
}
|
|
175
184
|
function report(outcome, write, json, lines) {
|
package/dist/release-coverage.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* existing records and Git; nothing is written back, so no proof, receipt,
|
|
5
5
|
* scope digest or schema changes. Fails closed: a receipt that can't be read,
|
|
6
6
|
* a missing commit or any Git error leaves the result uncovered. */
|
|
7
|
-
import {
|
|
7
|
+
import { viewedGitSync } from "./teardown-git.js";
|
|
8
8
|
import { verificationEvidence } from "./verification-evidence.js";
|
|
9
9
|
import { runCheckLevel } from "./check-levels.js";
|
|
10
10
|
/** How many of the newest passing release checks one read considers. */
|
|
@@ -25,7 +25,10 @@ export const gitIsAncestor = (repo, ancestor, descendant) => {
|
|
|
25
25
|
return known;
|
|
26
26
|
let answer;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
// Every git version through a frozen read view, bounded (eval-harness review 1, finding 7).
|
|
29
|
+
const status = viewedGitSync(repo, ["merge-base", "--is-ancestor", ancestor, descendant], { timeoutMs: 5_000 }).status;
|
|
30
|
+
if (status !== 0)
|
|
31
|
+
throw Object.assign(new Error("git merge-base"), { status });
|
|
29
32
|
answer = true;
|
|
30
33
|
}
|
|
31
34
|
catch (error) {
|
|
@@ -72,7 +72,7 @@ export declare function planTargetedRecheck(store: Store, root: string, input: {
|
|
|
72
72
|
now: Date;
|
|
73
73
|
}): RecheckDecision;
|
|
74
74
|
/** Coverage of a check: full, composed from A, partial (never passes), or identity-removed (asks again). */
|
|
75
|
-
export type Coverage = "full" | "composed" | "partial" | "identity-removed";
|
|
75
|
+
export type Coverage = "full" | "composed" | "partial" | "identity-removed" | "no-result";
|
|
76
76
|
/**
|
|
77
77
|
* Whether a targeted run B, with A's sealed evidence, its plan and snapshot, covers every item of B's inventory
|
|
78
78
|
* (coverage conservation), and every required identity passed — re-derived from sealed values only.
|
package/dist/release-recheck.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* Coverage trusts test code (Alex, 2026-10-25): these results protect against accidental damage, not a hostile test.
|
|
21
21
|
* Authority never reads them; the release's own records do.
|
|
22
22
|
*/
|
|
23
|
-
import { CHECK_CONTEXT_CAPTURE, CHECK_INVENTORY_CAPTURE, CHECK_REPORT_CAPTURE, OBLIGATION_SNAPSHOT_CAPTURE, TARGETED_PLAN_CAPTURE, checkContextOf, isUnitFile, payloadDigest, projectGitDir, readSealedJson, treeFactsOf } from "./check-report.js";
|
|
23
|
+
import { CHECK_CONTEXT_CAPTURE, CHECK_INVENTORY_CAPTURE, CHECK_REPORT_CAPTURE, OBLIGATION_SNAPSHOT_CAPTURE, TARGETED_PLAN_CAPTURE, checkContextOf, fullCheckProblem, isUnitFile, payloadDigest, projectGitDir, readSealedJson, treeFactsOf } from "./check-report.js";
|
|
24
24
|
import { readVerifiedCommit, verifiedTreeDiff } from "./commit-extract.js";
|
|
25
25
|
import { checkContextSchema, fileIdentity, groupIdentity, journeyIdentity, obligationSnapshotSchema, readCheckReport, sealedInventorySchema, targetedPlanSchema, unitIdentity, versionIdentity, } from "./contracts/release-check.js";
|
|
26
26
|
import { parseContract } from "./contracts/contract.js";
|
|
@@ -483,6 +483,11 @@ export function settleCoverage(store, root, input, gateOf) {
|
|
|
483
483
|
if (removedProtected(b.report, b.inventory, protectedIdentities(store, root, b.attempt.authority, input.runId)))
|
|
484
484
|
return removed();
|
|
485
485
|
}
|
|
486
|
+
// A release's Full check (its task carries signed release terms, before or after its authority opens — an automatic
|
|
487
|
+
// approval's check runs before) counts only with a complete, valid result (check-report.ts): anything less is no result.
|
|
488
|
+
const release = b.attempt.authority !== null || (store.getScope(input.taskId)?.releaseTerms ?? null) !== null;
|
|
489
|
+
if (release && fullCheckProblem({ report: b.report, inventory: b.inventory, exitCode: input.exitCode }) !== null)
|
|
490
|
+
return { coverage: "no-result", composed: null };
|
|
486
491
|
return { coverage: "full", composed: null };
|
|
487
492
|
}
|
|
488
493
|
if (b.plan === null || b.snapshot === null || b.attempt.baseRun === null || b.attempt.authority === null)
|