toolroll 0.9.71 → 0.9.72
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 +79 -0
- package/dist/agent-fence.d.ts +5 -2
- package/dist/agent-fence.js +5 -2
- 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/builder.js +48 -6
- package/dist/chat-decide.js +17 -2
- package/dist/check-access.js +2 -2
- package/dist/check-report.d.ts +109 -0
- package/dist/check-report.js +204 -0
- package/dist/claim.js +1 -1
- package/dist/commit-extract.d.ts +94 -0
- package/dist/commit-extract.js +436 -0
- package/dist/contracts/console-api.d.ts +1 -1
- package/dist/contracts/console-api.js +1 -0
- 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 +60 -0
- package/dist/contracts/release-terms.js +70 -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/flow-engine.js +5 -1
- 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/flows-ui.js +7 -1
- package/dist/invoke.d.ts +17 -6
- package/dist/invoke.js +48 -18
- package/dist/lead-status.js +5 -2
- package/dist/live-terminal.d.ts +10 -6
- package/dist/live-terminal.js +55 -14
- 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/proof.js +2 -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 +8 -0
- package/dist/release-adapters.js +212 -15
- package/dist/release-authority.d.ts +112 -0
- package/dist/release-authority.js +126 -0
- package/dist/release-carry.d.ts +233 -0
- package/dist/release-carry.js +645 -0
- package/dist/release-cli.d.ts +3 -0
- package/dist/release-cli.js +124 -5
- package/dist/release-coverage.js +3 -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 +131 -1
- package/dist/release.js +562 -244
- 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 +115 -5
- package/dist/scope.js +219 -7
- 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/task-views.js +4 -0
- package/dist/server/tasks.js +12 -0
- package/dist/store.d.ts +227 -5
- package/dist/store.js +727 -37
- package/dist/task-outcome-cli.js +7 -3
- 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
package/dist/store.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { type Actor } from "./actor.js";
|
|
|
15
15
|
import { type LiveActivityKind } from "./live.js";
|
|
16
16
|
import { type CredentialKind, type TokenPurpose } from "./api-tokens.js";
|
|
17
17
|
import { type CriterionMatrixRow, type CriterionJudgementWord } from "./proof.js";
|
|
18
|
-
import { type ExecutionProfile, type UnattendedPermissionMode, type AcceptanceCriterion } from "./scope.js";
|
|
18
|
+
import { type ScopeAuthor, type ExecutionProfile, type UnattendedPermissionMode, type AcceptanceCriterion } from "./scope.js";
|
|
19
19
|
import { type ProviderRoom, type CandidateTier, type TaskSize, type TaskSizing, type PhaseRoute, type PublicationAuthority, type RouteStamp, type ReadinessLookup, type ReadinessObservation, type RouteOverride } from "./phase-routing.js";
|
|
20
20
|
import type { TerminalClass } from "./exhaustion.js";
|
|
21
21
|
import { type ProviderId } from "./provider.js";
|
|
@@ -26,6 +26,7 @@ import type { Scope } from "./scope.js";
|
|
|
26
26
|
import type { QualityMode } from "./quality.js";
|
|
27
27
|
import type { ProgressSnapshot } from "./plan.js";
|
|
28
28
|
import { type CheckProgressSnapshot } from "./check-progress.js";
|
|
29
|
+
import { type ReleaseTerms } from "./contracts/release-terms.js";
|
|
29
30
|
import { type ProjectAccess } from "./project-access.js";
|
|
30
31
|
import { type LedgerEntry } from "./action-ledger.js";
|
|
31
32
|
import type { LimitReading, LimitWindow } from "./provider-limits.js";
|
|
@@ -182,7 +183,7 @@ export type SealedLedgerEntry = LedgerEntry & {
|
|
|
182
183
|
hash: string;
|
|
183
184
|
} | null;
|
|
184
185
|
};
|
|
185
|
-
export declare const SCHEMA_VERSION =
|
|
186
|
+
export declare const SCHEMA_VERSION = 135;
|
|
186
187
|
/** v118: the tables merged into `credential`, in the order they move (a person's API tokens keep their ids first). */
|
|
187
188
|
export declare const V118_MERGED_TABLES: Readonly<Record<string, CredentialKind>>;
|
|
188
189
|
/**
|
|
@@ -316,6 +317,26 @@ export declare const V129_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record
|
|
|
316
317
|
definition: string;
|
|
317
318
|
saved: string;
|
|
318
319
|
}>>>>;
|
|
320
|
+
/** v134 (approval policy): how each protected-work vote was proved, and who decided a flow card at a decision zone.
|
|
321
|
+
* Saved rows read NULL: no proof or authority on record, which never counts as a person. */
|
|
322
|
+
export declare const V134_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
323
|
+
definition: string;
|
|
324
|
+
saved: string;
|
|
325
|
+
}>>>>;
|
|
326
|
+
/** v135 (docs/plans/release-once.md): a scope's release terms, part of its digest when present. Saved rows read NULL. */
|
|
327
|
+
export declare const V135_ADDED_COLUMNS: Readonly<Record<string, Readonly<Record<string, {
|
|
328
|
+
definition: string;
|
|
329
|
+
saved: string;
|
|
330
|
+
}>>>>;
|
|
331
|
+
/**
|
|
332
|
+
* v135: one approval per release (docs/plans/release-once.md). `release_authority` is the single source of truth for a
|
|
333
|
+
* release a person approved: one row per generation, changed only by compare-and-swap on `rev`, with a lease whose
|
|
334
|
+
* epoch goes up on every takeover. `release_carry` records each later commit carried under it, `release_operation` each
|
|
335
|
+
* deploy or merge that can't be undone. `release_check_attempt` seals a check's intended mode, inventory and context
|
|
336
|
+
* before it runs. `main_check_failure` keeps one row per item the nightly full check on main found failing, until a
|
|
337
|
+
* qualifying full pass clears that exact item; `nightly_check` records each nightly firing.
|
|
338
|
+
*/
|
|
339
|
+
export declare const RELEASE_ONCE_SCHEMA = "\nCREATE TABLE IF NOT EXISTS release_authority (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n repo TEXT NOT NULL,\n generation INTEGER NOT NULL,\n previous INTEGER REFERENCES release_authority(id),\n version TEXT NOT NULL,\n pr INTEGER NOT NULL,\n branch TEXT NOT NULL,\n base TEXT NOT NULL,\n anchor_task TEXT NOT NULL,\n anchor_digest TEXT NOT NULL,\n approved_sha TEXT NOT NULL,\n approved_tree TEXT NOT NULL,\n artifact_digest TEXT,\n tip_sha TEXT NOT NULL,\n tip_task TEXT NOT NULL,\n policy_json TEXT NOT NULL,\n policy_digest TEXT NOT NULL,\n verify_command INTEGER NOT NULL,\n verify_digest TEXT NOT NULL,\n access_digest TEXT NOT NULL,\n state TEXT NOT NULL CHECK (state IN ('open','deploying','merge-reserved','merged','revoked','expired','superseded')),\n rev INTEGER NOT NULL DEFAULT 0,\n lease_owner TEXT,\n lease_epoch INTEGER NOT NULL DEFAULT 0,\n lease_expires TEXT,\n expires_at TEXT NOT NULL,\n created_at TEXT NOT NULL,\n ended_at TEXT,\n ended_by TEXT,\n UNIQUE (repo, version, pr, generation)\n);\nCREATE UNIQUE INDEX IF NOT EXISTS release_authority_live ON release_authority (repo, version, pr)\n WHERE state IN ('open','deploying','merge-reserved');\nCREATE INDEX IF NOT EXISTS release_authority_anchor ON release_authority (anchor_task);\nCREATE TABLE IF NOT EXISTS release_carry (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n authority INTEGER NOT NULL REFERENCES release_authority(id),\n task_id TEXT NOT NULL UNIQUE,\n scope_digest TEXT NOT NULL,\n request_id TEXT NOT NULL,\n from_sha TEXT NOT NULL,\n to_sha TEXT NOT NULL,\n to_tree TEXT NOT NULL,\n artifact_digest TEXT NOT NULL,\n commits_json TEXT NOT NULL,\n changed_lines INTEGER NOT NULL,\n files INTEGER NOT NULL,\n churn INTEGER NOT NULL,\n runtime TEXT NOT NULL,\n proved_at TEXT NOT NULL,\n UNIQUE (authority, to_sha)\n);\nCREATE TABLE IF NOT EXISTS release_operation (\n id TEXT PRIMARY KEY,\n authority INTEGER NOT NULL REFERENCES release_authority(id),\n kind TEXT NOT NULL CHECK (kind IN ('deploy','merge')),\n task_id TEXT NOT NULL,\n candidate TEXT NOT NULL,\n epoch INTEGER NOT NULL,\n state TEXT NOT NULL CHECK (state IN ('reserved','running','succeeded','failed','unknown')),\n external_ref TEXT,\n -- The sha256 of a secret only the reserving coordinator holds: a deploy run adopting this operation proves it.\n secret_hash TEXT,\n -- 1: reserved by a person's own deploy run with no coordinator holding the release (its epoch is the one it found).\n direct INTEGER NOT NULL DEFAULT 0,\n -- The process that reserved, then issued, the call: its pid, its start time and when it was recorded (real time).\n -- Recovery settles a started operation only once that process is proven gone (review round 2).\n issuer_pid INTEGER,\n issuer_started TEXT,\n issued_at TEXT,\n -- A person's direct deploy: the staging folder its deployment journals in.\n stage TEXT,\n reserved_at TEXT NOT NULL,\n finished_at TEXT,\n detail TEXT\n);\nCREATE INDEX IF NOT EXISTS release_operation_open ON release_operation (authority, state);\nCREATE TABLE IF NOT EXISTS release_check_attempt (\n run INTEGER PRIMARY KEY REFERENCES run(id),\n authority INTEGER REFERENCES release_authority(id),\n mode TEXT NOT NULL CHECK (mode IN ('full','targeted')),\n base_run INTEGER REFERENCES run(id),\n plan_digest TEXT,\n snapshot_digest TEXT,\n inventory_digest TEXT NOT NULL,\n context_digest TEXT NOT NULL,\n nonce_hash TEXT NOT NULL,\n created_at TEXT NOT NULL,\n settled_at TEXT\n);\nCREATE TABLE IF NOT EXISTS main_check_failure (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n repo TEXT NOT NULL,\n sha TEXT NOT NULL,\n run INTEGER NOT NULL,\n item TEXT NOT NULL,\n opened_at TEXT NOT NULL,\n cleared_by_run INTEGER,\n cleared_at TEXT,\n UNIQUE (repo, run, item)\n);\nCREATE INDEX IF NOT EXISTS main_check_failure_open ON main_check_failure (repo) WHERE cleared_at IS NULL;\nCREATE TABLE IF NOT EXISTS nightly_check (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n repo TEXT NOT NULL,\n sha TEXT NOT NULL,\n task TEXT,\n run INTEGER,\n outcome TEXT,\n at TEXT NOT NULL\n);\n";
|
|
319
340
|
/** v130: a project's network (an approver's setting, egress.ts ProjectNetwork as JSON) and the installation's choice
|
|
320
341
|
* whether an agent may run where no OS confinement exists (one row; 0 until an instance operator turns it on). */
|
|
321
342
|
export declare const CONFINEMENT_SCHEMA = "\nCREATE TABLE IF NOT EXISTS project_network (\n repo TEXT PRIMARY KEY,\n network_json TEXT NOT NULL CHECK (length(network_json) <= 16384),\n updated_at TEXT NOT NULL,\n updated_by TEXT NOT NULL\n);\nCREATE TABLE IF NOT EXISTS confinement_setting (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n unfenced_allowed INTEGER NOT NULL DEFAULT 0 CHECK (unfenced_allowed IN (0, 1)),\n updated_at TEXT,\n updated_by TEXT\n);\nINSERT OR IGNORE INTO confinement_setting (id, unfenced_allowed) VALUES (1, 0);\n";
|
|
@@ -2312,7 +2333,9 @@ export declare class Store {
|
|
|
2312
2333
|
permissionMode?: UnattendedPermissionMode;
|
|
2313
2334
|
qualityMode?: QualityMode;
|
|
2314
2335
|
posture?: "escalated";
|
|
2315
|
-
proposedVia?:
|
|
2336
|
+
proposedVia?: ScopeAuthor | null;
|
|
2337
|
+
/** v135: release terms (release-once.md); undefined keeps the ones the scope carries, null removes them. */
|
|
2338
|
+
releaseTerms?: ReleaseTerms | null;
|
|
2316
2339
|
}): void;
|
|
2317
2340
|
/**
|
|
2318
2341
|
* Re-file a scope under its OWN current words (v47): the route is
|
|
@@ -2329,7 +2352,7 @@ export declare class Store {
|
|
|
2329
2352
|
* exactly what the signed digest was bound to. Returns false when the
|
|
2330
2353
|
* scope vanished mid-ceremony. */
|
|
2331
2354
|
sealScopeApproval(taskId: string, by: string, now: Date, mutation?: Mutation, basis?: {
|
|
2332
|
-
kind: "mode" | "chat" | "grant";
|
|
2355
|
+
kind: "mode" | "chat" | "grant" | "schedule";
|
|
2333
2356
|
modeDigest: string;
|
|
2334
2357
|
}, approverKind?: ApproverKind): boolean;
|
|
2335
2358
|
/** Whether this task's scope carries a LIVE seal: approved, and the
|
|
@@ -2449,7 +2472,7 @@ export declare class Store {
|
|
|
2449
2472
|
* changed files come from the build's own diff; `null` (unreadable) counts as protected. */
|
|
2450
2473
|
protectedResultProblem(taskId: string, changed: readonly string[] | null, completer: string | null): string | null;
|
|
2451
2474
|
/** One person's yes to these exact bytes (protected work counts two). */
|
|
2452
|
-
recordApprovalVote(taskId: string, digest: string, by: string, now: Date): void;
|
|
2475
|
+
recordApprovalVote(taskId: string, digest: string, by: string, now: Date, proof: string): void;
|
|
2453
2476
|
/** Who has approved the current scope so far (protected work). */
|
|
2454
2477
|
approvalVotes(taskId: string): {
|
|
2455
2478
|
approver: string;
|
|
@@ -5694,6 +5717,9 @@ export declare class Store {
|
|
|
5694
5717
|
expectEntry?: number;
|
|
5695
5718
|
/** v91: said in the card's history only; the card's note ({{note}}) is left as it is. */
|
|
5696
5719
|
historyNote?: string;
|
|
5720
|
+
/** v134: who decided a decision move (approval policy §1.7): a person, a subagent, or a machine credential. Only a
|
|
5721
|
+
* person's approval lets a Pull request zone merge. Absent on other moves. */
|
|
5722
|
+
authority?: FlowDecisionAuthority;
|
|
5697
5723
|
}, now: Date): boolean;
|
|
5698
5724
|
/** What a card's current zone is doing: its task, the card's main work, what it waits on, what zones reported. */
|
|
5699
5725
|
/** Read and written in one transaction, so a pass changing one field never writes back another pass's older task or waiting. */
|
|
@@ -5707,6 +5733,7 @@ export declare class Store {
|
|
|
5707
5733
|
actor: string;
|
|
5708
5734
|
note: string | null;
|
|
5709
5735
|
at: string;
|
|
5736
|
+
authority: FlowDecisionAuthority | null;
|
|
5710
5737
|
}[];
|
|
5711
5738
|
/** When a card came into the zone it is in: its latest history line (it is written with every move). */
|
|
5712
5739
|
flowCardEnteredAt(card: number): string | null;
|
|
@@ -7522,3 +7549,198 @@ export type VerifiedAuthor = string & {
|
|
|
7522
7549
|
readonly __verifiedAuthor: unique symbol;
|
|
7523
7550
|
};
|
|
7524
7551
|
export declare function verifiedAuthor(name: string): VerifiedAuthor;
|
|
7552
|
+
/**
|
|
7553
|
+
* Who wrote a scope's text after this write (docs/plans/approval-policy.md §1.4), from trusted context only. A person's
|
|
7554
|
+
* write sets what the caller says (null for their own words), as always. A machine's write — the lead's token or a
|
|
7555
|
+
* remote API run — never clears or downgrades a mark: a quarantined author (a chat proposal, a scout, a coordinator)
|
|
7556
|
+
* stays, and otherwise the lead's write is marked `lead` (a remote run's keeps whatever was there).
|
|
7557
|
+
*/
|
|
7558
|
+
export declare function provenanceAfter(prior: unknown, requested: ScopeAuthor | null): ScopeAuthor | null;
|
|
7559
|
+
/** Who decided a flow card at a decision zone (v134, approval policy §1.7). */
|
|
7560
|
+
export type FlowDecisionAuthority = "person" | "subagent" | "lead" | "remote";
|
|
7561
|
+
export declare const FLOW_DECISION_AUTHORITIES: readonly FlowDecisionAuthority[];
|
|
7562
|
+
/** A release check attempt, sealed before its command runs (release_check_attempt). */
|
|
7563
|
+
export type CheckAttempt = {
|
|
7564
|
+
run: number;
|
|
7565
|
+
authority: number | null;
|
|
7566
|
+
mode: "full" | "targeted";
|
|
7567
|
+
baseRun: number | null;
|
|
7568
|
+
planDigest: string | null;
|
|
7569
|
+
snapshotDigest: string | null;
|
|
7570
|
+
inventoryDigest: string;
|
|
7571
|
+
contextDigest: string;
|
|
7572
|
+
nonceHash: string;
|
|
7573
|
+
createdAt: string;
|
|
7574
|
+
settledAt: string | null;
|
|
7575
|
+
};
|
|
7576
|
+
/** Seal a check attempt before its command is spawned. Once written it never changes (bar its settled mark). */
|
|
7577
|
+
export declare function recordCheckAttempt(store: Store, attempt: Omit<CheckAttempt, "createdAt" | "settledAt">, now: Date): void;
|
|
7578
|
+
/** A run's sealed check attempt, or null. */
|
|
7579
|
+
export declare function checkAttemptOf(store: Store, run: number): CheckAttempt | null;
|
|
7580
|
+
/** Release terms as this code writes them: the contract's own reading of them, serialized. */
|
|
7581
|
+
export declare function serializeReleaseTerms(terms: ReleaseTerms): string;
|
|
7582
|
+
export { LIVE_RELEASE_STATES, belongsToRelease, newestReleaseGeneration, outstandingReleaseOperations, releaseAuthority, releaseAuthorityOfTask, releaseCarries, releaseCarryTo, releaseOperation, releaseOperations, releaseSealProblem, type ReleaseAuthority, type ReleaseCarry, type ReleaseOperation, type ReleaseState, } from "./release-authority.js";
|
|
7583
|
+
import { type ReleaseCarry, type ReleaseOperation } from "./release-authority.js";
|
|
7584
|
+
/**
|
|
7585
|
+
* Open a release's authority for a person's seal of its terms (inside the seal's transaction): the next generation,
|
|
7586
|
+
* superseding the live one. False when it can't (releaseSealProblem), which refuses the seal.
|
|
7587
|
+
*/
|
|
7588
|
+
export declare function openReleaseAuthority(store: Store, input: {
|
|
7589
|
+
taskId: string;
|
|
7590
|
+
digest: string;
|
|
7591
|
+
terms: ReleaseTerms;
|
|
7592
|
+
by: string;
|
|
7593
|
+
now: Date;
|
|
7594
|
+
}): number | null;
|
|
7595
|
+
/** Seal the anchor's artifact digest once (the person's seal authorized building that approved commit). */
|
|
7596
|
+
export declare function sealAnchorArtifact(store: Store, id: number, digest: string, now: Date): boolean;
|
|
7597
|
+
/** Take (or keep) a release's lease. A takeover by another owner raises the epoch, which fences every operation the
|
|
7598
|
+
* old owner reserved. */
|
|
7599
|
+
export declare function takeReleaseLease(store: Store, id: number, owner: string, now: Date, ttlMs?: number): {
|
|
7600
|
+
ok: true;
|
|
7601
|
+
epoch: number;
|
|
7602
|
+
} | {
|
|
7603
|
+
ok: false;
|
|
7604
|
+
why: string;
|
|
7605
|
+
};
|
|
7606
|
+
/** Renew a lease this owner still holds at this epoch. */
|
|
7607
|
+
export declare function renewReleaseLease(store: Store, id: number, owner: string, epoch: number, now: Date, ttlMs?: number): boolean;
|
|
7608
|
+
/**
|
|
7609
|
+
* Reserve a deploy or a merge of the release tip (the freeze happens here, in the store): a deploy moves `open` to
|
|
7610
|
+
* `deploying` (or, already deploying, reserves a new attempt of the same frozen candidate); a merge moves `deploying`
|
|
7611
|
+
* to `merge-reserved`. `epoch` null is a direct deploy by a person: it takes the current epoch, and only while no
|
|
7612
|
+
* coordinator holds a live lease. Refused while any earlier operation is unsettled.
|
|
7613
|
+
*/
|
|
7614
|
+
export declare function reserveRelease(store: Store, input: {
|
|
7615
|
+
authority: number;
|
|
7616
|
+
kind: "deploy" | "merge";
|
|
7617
|
+
taskId: string;
|
|
7618
|
+
candidate: string;
|
|
7619
|
+
epoch: number | null;
|
|
7620
|
+
operationId: string;
|
|
7621
|
+
now: Date;
|
|
7622
|
+
secret?: string;
|
|
7623
|
+
issuer?: ReleaseIssuer;
|
|
7624
|
+
stage?: string;
|
|
7625
|
+
}): {
|
|
7626
|
+
ok: true;
|
|
7627
|
+
operation: ReleaseOperation;
|
|
7628
|
+
} | {
|
|
7629
|
+
ok: false;
|
|
7630
|
+
why: string;
|
|
7631
|
+
};
|
|
7632
|
+
/** The external call's own fence, taken immediately before the call is spawned: `reserved` → `running` (issuing) only
|
|
7633
|
+
* at the epoch that reserved it, while that epoch still holds the lease (a direct deploy's epoch is checked as
|
|
7634
|
+
* reserved) and the release stands, recording the process that issues it. False: the call must not start. */
|
|
7635
|
+
export declare function runReleaseOperation(store: Store, id: string, epoch: number, now: Date, issuer?: ReleaseIssuer): boolean;
|
|
7636
|
+
/** Settle an operation: `succeeded`, `failed` or `unknown` (reconciled later). A merge that succeeded ends the release
|
|
7637
|
+
* as `merged`; one that failed puts it back to `deploying`. */
|
|
7638
|
+
export declare function finishReleaseOperation(store: Store, id: string, outcome: "succeeded" | "failed" | "unknown", facts: {
|
|
7639
|
+
externalRef?: string | null;
|
|
7640
|
+
detail?: string | null;
|
|
7641
|
+
}, now: Date, epoch: number): boolean;
|
|
7642
|
+
/** Stop carrying later commits: any active approver, any time before the merge starts. */
|
|
7643
|
+
export declare function revokeRelease(store: Store, id: number, by: string, now: Date): {
|
|
7644
|
+
ok: true;
|
|
7645
|
+
} | {
|
|
7646
|
+
ok: false;
|
|
7647
|
+
why: string;
|
|
7648
|
+
};
|
|
7649
|
+
/** Write the carry, in the one transaction that re-proves every mutable fact first (release-carry.ts proveCarry). */
|
|
7650
|
+
export type CarryWrite = {
|
|
7651
|
+
authority: number;
|
|
7652
|
+
expectRev: number;
|
|
7653
|
+
expectTip: string;
|
|
7654
|
+
to: string;
|
|
7655
|
+
toTree: string;
|
|
7656
|
+
requestId: string;
|
|
7657
|
+
artifactDigest: string;
|
|
7658
|
+
commits: ReleaseCarry["commits"];
|
|
7659
|
+
changedLines: number;
|
|
7660
|
+
files: number;
|
|
7661
|
+
churn: number;
|
|
7662
|
+
runtime: string;
|
|
7663
|
+
taskId: string;
|
|
7664
|
+
title: string;
|
|
7665
|
+
};
|
|
7666
|
+
/**
|
|
7667
|
+
* THE carry transaction (release-carry.ts proveCarry step 4), one BEGIN IMMEDIATE: every mutable fact is proved again
|
|
7668
|
+
* — the authority's `rev` and tip, its state and expiry and the whole live-release predicate (liveReleaseOf), the
|
|
7669
|
+
* anchor's sealed artifact digest equal to the candidate's, and whatever `recheck` re-reads (the policy, grant and
|
|
7670
|
+
* check access as they are now) — then it writes the carried task and its scope (the anchor's approved terms, profile,
|
|
7671
|
+
* route and acceptance verbatim, with candidate `to`), its seal (basis `carried`, reference `<authority>:<carry>`), the
|
|
7672
|
+
* carry row, the new tip with `rev + 1`, and the ledger row. A carry already written for (authority, `to`) is returned
|
|
7673
|
+
* as it is.
|
|
7674
|
+
*/
|
|
7675
|
+
export declare function carryReleaseApproval(store: Store, w: CarryWrite, now: Date, recheck: () => string | null): {
|
|
7676
|
+
ok: true;
|
|
7677
|
+
taskId: string;
|
|
7678
|
+
carry: ReleaseCarry;
|
|
7679
|
+
} | {
|
|
7680
|
+
ok: false;
|
|
7681
|
+
why: string;
|
|
7682
|
+
};
|
|
7683
|
+
/** Thrown inside a seal whose release authority can't open: the whole seal rolls back. */
|
|
7684
|
+
export declare class ReleaseSealRefused extends Error {
|
|
7685
|
+
}
|
|
7686
|
+
/**
|
|
7687
|
+
* Whether a deploy run may adopt operation `id` (deploy-browser.mjs --operation): it is this release's running deploy of
|
|
7688
|
+
* this candidate, reserved at the epoch that still holds a live lease, and the run proves the secret only the
|
|
7689
|
+
* reserving coordinator holds (handed over on stdin, never in argv).
|
|
7690
|
+
*/
|
|
7691
|
+
export declare function adoptReleaseOperation(store: Store, input: {
|
|
7692
|
+
id: string;
|
|
7693
|
+
authority: number;
|
|
7694
|
+
candidate: string;
|
|
7695
|
+
secret: string;
|
|
7696
|
+
now: Date;
|
|
7697
|
+
}): {
|
|
7698
|
+
ok: true;
|
|
7699
|
+
} | {
|
|
7700
|
+
ok: false;
|
|
7701
|
+
why: string;
|
|
7702
|
+
};
|
|
7703
|
+
/** The nightly check of main is a check only (release-once.md, part 3). */
|
|
7704
|
+
export declare const NIGHTLY_CHECK_ONLY = "The nightly check of main is only a check; it is never published or merged.";
|
|
7705
|
+
/** Whether a task reference is a nightly check of main. */
|
|
7706
|
+
export declare function nightlyTaskRef(store: Store, taskRef: number): boolean;
|
|
7707
|
+
/** Whether a publication belongs to a nightly check of main. */
|
|
7708
|
+
export declare function nightlyPublication(store: Store, publication: number): boolean;
|
|
7709
|
+
/** A release's result merges only through its coordinator: every other merge road refuses it. */
|
|
7710
|
+
export declare const RELEASE_MERGES_ONLY = "This result belongs to a release; it merges only through `toolroll release`.";
|
|
7711
|
+
/** Whether a task reference is a release's anchor or a carried release task. */
|
|
7712
|
+
export declare function releaseTaskRef(store: Store, taskRef: number): boolean;
|
|
7713
|
+
/** Whether a publication belongs to a release's task. */
|
|
7714
|
+
export declare function releasePublication(store: Store, publication: number): boolean;
|
|
7715
|
+
/** The ledger act that records a trusted read of a project's recorded remote main (remote-main.ts). */
|
|
7716
|
+
export declare const TRUSTED_MAIN_ACTION = "remote main read";
|
|
7717
|
+
/** The identity of a project's recorded remote: its URL and the ledger record that last set it (0: set on admission
|
|
7718
|
+
* with no record). A read of main stands only for the remote identity it was read from (review round 2). */
|
|
7719
|
+
export declare function trustedRemoteIdentity(store: Store, repo: string): {
|
|
7720
|
+
url: string;
|
|
7721
|
+
record: number;
|
|
7722
|
+
} | null;
|
|
7723
|
+
/** Record the commit the project's recorded remote main was at, as Toolroll's own process fetched it just now from
|
|
7724
|
+
* `url`, bound to the remote's identity at this moment. Refused (nothing recorded) when `url` isn't the recorded one. */
|
|
7725
|
+
export declare function recordTrustedMain(store: Store, repo: string, sha: string, url: string, now: Date): boolean;
|
|
7726
|
+
/** A failed read of the recorded remote: the last read no longer stands. */
|
|
7727
|
+
export declare function forgetTrustedMain(store: Store, repo: string, why: string, now: Date): void;
|
|
7728
|
+
/**
|
|
7729
|
+
* A pull request check failed after the deploy reservation (Alex, 2026-10-25): the candidate froze at deploy, so the
|
|
7730
|
+
* release stops and asks a person again — even for the same commit, a new person-approved generation continues it.
|
|
7731
|
+
*/
|
|
7732
|
+
export declare function requireFreshReleaseApproval(store: Store, id: number, reason: string, epoch: number, now: Date): boolean;
|
|
7733
|
+
/** The process that reserves or issues a release operation: its pid, its start time, and when it was recorded. */
|
|
7734
|
+
export type ReleaseIssuer = {
|
|
7735
|
+
pid: number;
|
|
7736
|
+
started: string;
|
|
7737
|
+
at: string;
|
|
7738
|
+
};
|
|
7739
|
+
/** This process, as a release operation's issuer. Real time, whatever clock a caller passes for the rest. */
|
|
7740
|
+
export declare function currentReleaseIssuer(): ReleaseIssuer;
|
|
7741
|
+
/**
|
|
7742
|
+
* Whether an operation's issuer is proven gone (review round 2): no process has its pid, or the process that has it
|
|
7743
|
+
* started after the issuer was recorded (so it is another one). Anything unknown — no issuer recorded, a start time
|
|
7744
|
+
* that can't be read — is not proof, and the operation stays for a person.
|
|
7745
|
+
*/
|
|
7746
|
+
export declare function releaseIssuerGone(op: ReleaseOperation): boolean;
|