toolroll 0.9.51 → 0.9.53
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 +20 -0
- package/README.md +55 -80
- package/dist/agentconfig.d.ts +11 -36
- package/dist/agentconfig.js +3 -62
- package/dist/approval-policy.d.ts +1 -1
- package/dist/approval-policy.js +1 -1
- package/dist/backup.d.ts +8 -0
- package/dist/backup.js +10 -1
- package/dist/board.d.ts +3 -19
- package/dist/board.js +4 -42
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +18 -18
- package/dist/browser-workspace.d.ts +3 -1
- package/dist/builder.d.ts +9 -40
- package/dist/builder.js +50 -257
- package/dist/chat-actions.js +3 -14
- package/dist/chat-controls.d.ts +0 -4
- package/dist/chat-controls.js +0 -1
- package/dist/chat-decide.js +1 -3
- package/dist/chat-delivery.d.ts +0 -2
- package/dist/chat-delivery.js +0 -1
- package/dist/chat-quiet.js +2 -2
- package/dist/chat-task-actions.d.ts +1 -1
- package/dist/chat-task-actions.js +0 -2
- package/dist/claim.d.ts +79 -244
- package/dist/claim.js +688 -1023
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +10 -2
- package/dist/contracts/cli.d.ts +0 -13
- package/dist/contracts/cli.js +0 -2
- package/dist/contracts/console-api.d.ts +5 -10
- package/dist/contracts/console-api.js +4 -10
- package/dist/contracts/flow.d.ts +50 -0
- package/dist/contracts/flow.js +26 -1
- package/dist/contracts/lead-tools.d.ts +0 -13
- package/dist/contracts/lead-tools.js +3 -3
- package/dist/contracts/store-json.d.ts +1 -25
- package/dist/contracts/store-json.js +3 -13
- package/dist/converse.d.ts +1 -11
- package/dist/converse.js +6 -38
- package/dist/coordinator.d.ts +0 -1
- package/dist/coordinator.js +3 -5
- package/dist/database-reclaim.d.ts +4 -0
- package/dist/database-reclaim.js +13 -0
- package/dist/demo.d.ts +1 -1
- package/dist/demo.js +17 -27
- package/dist/desktop-update-gate.js +0 -1
- package/dist/desktop-update.d.ts +1 -1
- package/dist/desktop-update.js +1 -3
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +1 -1
- package/dist/dispose.d.ts +2 -3
- package/dist/dispose.js +17 -92
- package/dist/envelope.js +0 -3
- package/dist/exec.d.ts +0 -64
- package/dist/exec.js +3 -356
- package/dist/exhaustion.d.ts +22 -76
- package/dist/exhaustion.js +14 -140
- package/dist/export.js +4 -4
- package/dist/flow-engine.js +1 -1
- package/dist/flow-schedule.d.ts +154 -0
- package/dist/flow-schedule.js +321 -0
- package/dist/flow-share.js +1 -1
- package/dist/flow-triggers.d.ts +6 -1
- package/dist/flow-triggers.js +65 -10
- package/dist/flows-cli.js +8 -4
- package/dist/flows-ui.js +2 -0
- package/dist/flows.js +1 -1
- package/dist/guides.js +9 -29
- package/dist/invoke.d.ts +1 -24
- package/dist/invoke.js +17 -259
- package/dist/lead-status.js +2 -4
- package/dist/lead-voice.js +1 -1
- package/dist/live-bus.d.ts +3 -3
- package/dist/live-bus.js +3 -3
- package/dist/mate-doors.d.ts +1 -2
- package/dist/mate-doors.js +12 -25
- package/dist/mate-tools.d.ts +2 -2
- package/dist/mate-tools.js +10 -22
- package/dist/modes.d.ts +6 -7
- package/dist/modes.js +7 -13
- package/dist/monitoring.js +32 -8
- package/dist/notification-delivery.d.ts +19 -0
- package/dist/notification-delivery.js +37 -0
- package/dist/operate-remote-arguments.js +2 -6
- package/dist/operate-remote.js +6 -7
- package/dist/operate.d.ts +0 -6
- package/dist/operate.js +283 -2378
- package/dist/phase-routing.d.ts +13 -23
- package/dist/phase-routing.js +13 -35
- package/dist/plan-auto.js +2 -2
- package/dist/planner-source.js +2 -1
- package/dist/policy.d.ts +1 -4
- package/dist/policy.js +0 -8
- package/dist/process-recovery-eligibility.js +2 -3
- package/dist/process-recovery-settlement.js +1 -0
- package/dist/project-delete.js +3 -15
- package/dist/proposal.d.ts +4 -24
- package/dist/proposal.js +3 -88
- package/dist/provider-auth.d.ts +3 -3
- package/dist/provider-auth.js +4 -6
- package/dist/provider.d.ts +11 -25
- package/dist/provider.js +4 -36
- package/dist/push.js +1 -1
- package/dist/recipe-ui.js +6 -6
- package/dist/recipes.d.ts +3 -3
- package/dist/recipes.js +27 -23
- package/dist/retention.js +6 -5
- package/dist/run-closeout.d.ts +1 -1
- package/dist/run-closeout.js +1 -4
- package/dist/scope.d.ts +11 -65
- package/dist/scope.js +17 -82
- package/dist/serve.js +16 -25
- package/dist/server/chat.js +7 -30
- package/dist/server/flows.js +11 -10
- package/dist/server/guards.js +0 -1
- package/dist/server/pages-assets.js +1 -1
- package/dist/server/pages.js +0 -2
- package/dist/server/people-tokens.js +0 -4
- package/dist/server/route-table.d.ts +1 -1
- package/dist/server/route-table.js +2 -17
- package/dist/server/settings.js +4 -9
- package/dist/server/shared.d.ts +29 -212
- package/dist/server/shared.js +73 -780
- package/dist/server/task-views.js +9 -76
- package/dist/server/tasks.d.ts +1 -50
- package/dist/server/tasks.js +36 -946
- package/dist/setup-guide.d.ts +2 -2
- package/dist/slack-chat.d.ts +0 -2
- package/dist/slack-chat.js +0 -1
- package/dist/store.d.ts +142 -1382
- package/dist/store.js +900 -4083
- package/dist/surface.js +10 -25
- package/dist/task-composer.d.ts +1 -1
- package/dist/task-composer.js +1 -1
- package/dist/task-control.d.ts +3 -10
- package/dist/task-control.js +2 -7
- package/dist/teammate-desk.js +1 -1
- package/dist/teammates-ui.js +1 -1
- package/dist/telegram-mate.d.ts +0 -3
- package/dist/telegram-mate.js +0 -1
- package/dist/templates.d.ts +11 -7
- package/dist/templates.js +12 -9
- package/dist/toolroll-update.d.ts +24 -3
- package/dist/toolroll-update.js +159 -16
- package/dist/webhooks.d.ts +10 -22
- package/dist/webhooks.js +43 -81
- package/dist/work-index.js +3 -7
- package/dist/workspace-revision.d.ts +28 -1
- package/dist/workspace-revision.js +276 -49
- package/dist/workspace-ui.js +1 -1
- package/package.json +1 -3
- package/scripts/recovery-canary.mjs +3 -3
- package/dist/contest.d.ts +0 -318
- package/dist/contest.js +0 -753
- package/dist/held.d.ts +0 -150
- package/dist/held.js +0 -799
- package/dist/liveness.d.ts +0 -30
- package/dist/liveness.js +0 -42
- package/dist/pricing.d.ts +0 -45
- package/dist/pricing.js +0 -77
- package/dist/routine.d.ts +0 -228
- package/dist/routine.js +0 -764
- package/dist/supervisor.mjs +0 -297
package/dist/store.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import { type Actor } from "./actor.js";
|
|
|
6
6
|
import { type LiveActivityKind } from "./live.js";
|
|
7
7
|
import { type TokenPurpose } from "./api-tokens.js";
|
|
8
8
|
import { type CriterionMatrixRow, type CriterionJudgementWord } from "./proof.js";
|
|
9
|
-
import { type ExecutionProfile, type
|
|
10
|
-
import { type ProviderRoom, type CandidateTier, type TaskSize, type TaskSizing, type PhaseRoute, type PublicationAuthority, type RouteStamp, type ReadinessLookup, type ReadinessObservation, type
|
|
11
|
-
import {
|
|
9
|
+
import { type ExecutionProfile, type UnattendedPermissionMode, type AcceptanceCriterion } from "./scope.js";
|
|
10
|
+
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";
|
|
11
|
+
import type { TerminalClass } from "./exhaustion.js";
|
|
12
12
|
import { type ProviderId } from "./provider.js";
|
|
13
13
|
import type { BoardFacts } from "./board.js";
|
|
14
14
|
import type { BackendGrant, TaskOrigin } from "./grant.js";
|
|
@@ -152,7 +152,9 @@ export type SealedLedgerEntry = LedgerEntry & {
|
|
|
152
152
|
hash: string;
|
|
153
153
|
} | null;
|
|
154
154
|
};
|
|
155
|
-
export declare const SCHEMA_VERSION =
|
|
155
|
+
export declare const SCHEMA_VERSION = 115;
|
|
156
|
+
/** v115: the tables migrateToV115 drops. */
|
|
157
|
+
export declare const V115_DROPPED_TABLES: readonly string[];
|
|
156
158
|
/**
|
|
157
159
|
* The migrations `toolroll update` may carry a database through in place: each
|
|
158
160
|
* one only adds (a table, a column, an accepted value) and leaves every saved row
|
|
@@ -166,6 +168,19 @@ export declare const SCHEMA_VERSION = 113;
|
|
|
166
168
|
* api_token columns (project limit, rotation); existing tokens read as before.
|
|
167
169
|
* v112 only adds the two request-budget tables.
|
|
168
170
|
* v113 adds MCP sign-in tables and API-token purpose metadata.
|
|
171
|
+
* v114 is the one declared exception to "only adds", and the rehearsal checks
|
|
172
|
+
* it as such: a settled run's exited process witnesses become one summary row
|
|
173
|
+
* (rows removed equal the witnesses summarized), and notification drops its
|
|
174
|
+
* delivery columns only after every value moves into one legacy receipt per row
|
|
175
|
+
* (rows and ids carried whole; legacy receipts added equal the rows carried).
|
|
176
|
+
* v115 removes contests, held sessions, fallback chains and routines, and is
|
|
177
|
+
* checked under rules named for exactly that: the eleven removed tables may go
|
|
178
|
+
* whole, every kept flow and trigger row stays as it was, and the only rows
|
|
179
|
+
* added are one flow and one schedule trigger per saved routine (paused unless
|
|
180
|
+
* the routine was approved and running). Its other changes add a column or
|
|
181
|
+
* settle rows in place; a database whose removed features still held a hold
|
|
182
|
+
* to lift or place changes that table's rows and is refused, so it takes the
|
|
183
|
+
* separate procedure.
|
|
169
184
|
*/
|
|
170
185
|
export declare const UPDATE_SAFE_MIGRATIONS: readonly number[];
|
|
171
186
|
/** Whether a database settled at `version` reaches this build's schema through update-safe migrations alone. */
|
|
@@ -291,9 +306,7 @@ export type TaskRef = {
|
|
|
291
306
|
/** What comes back (v34): a branch to publish, or a report to read.
|
|
292
307
|
* Set at filing and never rewritten — a scout's strikes are the task's. */
|
|
293
308
|
deliverable: "branch" | "report";
|
|
294
|
-
/** The
|
|
295
|
-
routineId: number | null;
|
|
296
|
-
/** The pinned agent, when a fire transaction stamped one. Authoritative. */
|
|
309
|
+
/** The pinned agent, when an approved standing order stamped one. Authoritative. */
|
|
297
310
|
agentProvider: string | null;
|
|
298
311
|
agentModel: string | null;
|
|
299
312
|
/** Durable per-task override. null means the installation default is used
|
|
@@ -303,9 +316,6 @@ export type TaskRef = {
|
|
|
303
316
|
/** Durable per-task evidence-policy override. null inherits the
|
|
304
317
|
* installation default when a scope is next written. */
|
|
305
318
|
qualityMode?: QualityMode | null;
|
|
306
|
-
/** v47: the task's declared risk; null reads as routine when the next
|
|
307
|
-
* scope is filed. The scope stores the signed level. */
|
|
308
|
-
riskLevel?: RiskLevel | null;
|
|
309
319
|
/** v47: the approver's per-phase route overrides, applied when the next
|
|
310
320
|
* scope is filed and recorded in the sealed route. null = the stored
|
|
311
321
|
* list is malformed; the next filing goes unresolved rather than routing
|
|
@@ -329,88 +339,11 @@ export type TaskRef = {
|
|
|
329
339
|
origin: TaskOrigin;
|
|
330
340
|
};
|
|
331
341
|
/** A standing order: a pre-approved template whose instances build unattended. */
|
|
332
|
-
export type TournamentTerms = {
|
|
333
|
-
id: number;
|
|
334
|
-
taskRef: number;
|
|
335
|
-
generation: number;
|
|
336
|
-
active: boolean;
|
|
337
|
-
/** v27: 'race' = dollar-capped tournament; 'comparison' = labeled
|
|
338
|
-
* cross-runtime comparison with no dollar terms. */
|
|
339
|
-
kind: "race" | "comparison";
|
|
340
|
-
raceDigest: string;
|
|
341
|
-
/** Ordered agents: exact model ids, resolved at filing. */
|
|
342
|
-
agents: {
|
|
343
|
-
provider: string;
|
|
344
|
-
model: string;
|
|
345
|
-
repairModel: string;
|
|
346
|
-
permissionMode?: UnattendedPermissionMode;
|
|
347
|
-
}[];
|
|
348
|
-
n: number;
|
|
349
|
-
perAgentBudgetMicrousd: number;
|
|
350
|
-
overrunReserveMicrousd: number;
|
|
351
|
-
totalBudgetMicrousd: number;
|
|
352
|
-
priceVersion: number;
|
|
353
|
-
retries: number;
|
|
354
|
-
publicationPolicy: string;
|
|
355
|
-
createdAt: string;
|
|
356
|
-
approvedAt: string | null;
|
|
357
|
-
approvedBy: string | null;
|
|
358
|
-
approvedDigest: string | null;
|
|
359
|
-
};
|
|
360
|
-
export type ContestState = "dispatching" | "racing" | "pick-wait" | "decision-wait" | "picked" | "abandoned" | "interrupted" | "exhausted";
|
|
361
|
-
export type Contest = {
|
|
362
|
-
id: number;
|
|
363
|
-
taskRef: number;
|
|
364
|
-
terms: number;
|
|
365
|
-
generation: number;
|
|
366
|
-
state: ContestState;
|
|
367
|
-
scopeDigest: string;
|
|
368
|
-
raceDigest: string;
|
|
369
|
-
baseSha: string | null;
|
|
370
|
-
setupDigest: string | null;
|
|
371
|
-
currentLeaseId: string | null;
|
|
372
|
-
runner: string | null;
|
|
373
|
-
incarnation: string | null;
|
|
374
|
-
createdAt: string;
|
|
375
|
-
pickedAt: string | null;
|
|
376
|
-
pickedBy: string | null;
|
|
377
|
-
winnerContestant: number | null;
|
|
378
|
-
/** One escalation page per tournament, ever — set with the page. */
|
|
379
|
-
overduePaged: boolean;
|
|
380
|
-
/** v27: denormalized from the terms at admission. */
|
|
381
|
-
kind: "race" | "comparison";
|
|
382
|
-
};
|
|
383
|
-
export type ContestantState = "pending" | "ready" | "building" | "parked" | "built" | "failed" | "stopped";
|
|
384
|
-
export type Contestant = {
|
|
385
|
-
/** v24: the contestant's own sealed execution profile. */
|
|
386
|
-
profile?: ExecutionProfile | null;
|
|
387
|
-
id: number;
|
|
388
|
-
contest: number;
|
|
389
|
-
ordinal: number;
|
|
390
|
-
provider: string;
|
|
391
|
-
model: string;
|
|
392
|
-
repairModel: string;
|
|
393
|
-
branch: string;
|
|
394
|
-
worktree: string | null;
|
|
395
|
-
generation: number;
|
|
396
|
-
state: ContestantState;
|
|
397
|
-
activeRun: number | null;
|
|
398
|
-
budgetMicrousd: number;
|
|
399
|
-
reserveMicrousd: number;
|
|
400
|
-
/** What the provider reported — monotonic, never guessed. */
|
|
401
|
-
measuredMicrousd: number;
|
|
402
|
-
/** What the ledger charges — the full reservation when unknowable. */
|
|
403
|
-
accountedMicrousd: number;
|
|
404
|
-
unknownSpend: boolean;
|
|
405
|
-
cleanup: "pending" | "done" | "attention" | null;
|
|
406
|
-
custody: string | null;
|
|
407
|
-
};
|
|
408
342
|
export type ExecutionSlot = {
|
|
409
343
|
id: number;
|
|
410
344
|
runner: string;
|
|
411
345
|
state: "reserved" | "running" | "released";
|
|
412
346
|
run: number | null;
|
|
413
|
-
contestant: number | null;
|
|
414
347
|
incarnation: string | null;
|
|
415
348
|
processGroup: number | null;
|
|
416
349
|
reservedAt: string;
|
|
@@ -478,14 +411,6 @@ export type ChatSnapshot = {
|
|
|
478
411
|
ageHours: number;
|
|
479
412
|
}[];
|
|
480
413
|
incidentsSaturated: boolean;
|
|
481
|
-
routines: {
|
|
482
|
-
repoIndex: number;
|
|
483
|
-
name: string;
|
|
484
|
-
schedule: string;
|
|
485
|
-
status: string;
|
|
486
|
-
lastFire: string | null;
|
|
487
|
-
}[];
|
|
488
|
-
routinesSaturated: boolean;
|
|
489
414
|
publications: {
|
|
490
415
|
repoIndex: number;
|
|
491
416
|
pr: number | null;
|
|
@@ -879,76 +804,10 @@ export type MateTurn = {
|
|
|
879
804
|
tokensOut: number | null;
|
|
880
805
|
failureReason: string | null;
|
|
881
806
|
};
|
|
882
|
-
export type Routine = {
|
|
883
|
-
id: number;
|
|
884
|
-
name: string;
|
|
885
|
-
/** v102: who made it (its instances are filed as theirs); null before v102 or when no person is known. */
|
|
886
|
-
createdBy: string | null;
|
|
887
|
-
repo: string;
|
|
888
|
-
goal: string;
|
|
889
|
-
outOfScope: string | null;
|
|
890
|
-
touches: string[];
|
|
891
|
-
/** v39: the signed rubric every instance's scope copies forward. */
|
|
892
|
-
acceptance: AcceptanceCriterion[];
|
|
893
|
-
requirements: string[];
|
|
894
|
-
/** 'every:<minutes>', 'daily:<HH:MM>[@Zone]', or 'weekly:<0-6>:<HH:MM>[@Zone]' (UTC by default). */
|
|
895
|
-
schedule: string;
|
|
896
|
-
singleFlight: boolean;
|
|
897
|
-
/** Rolling 7-day dollar ceiling; null = none. Enforcement fails closed. */
|
|
898
|
-
costCeilingUsd: number | null;
|
|
899
|
-
/** Per-instance dollar cap (v16); copied into each instance's scope. */
|
|
900
|
-
budgetPerRunMicrousd: number | null;
|
|
901
|
-
paused: boolean;
|
|
902
|
-
/** Of every term above. Approval binds to this exact value. */
|
|
903
|
-
digest: string;
|
|
904
|
-
approvedAt: string | null;
|
|
905
|
-
approvedBy: string | null;
|
|
906
|
-
approvedDigest: string | null;
|
|
907
|
-
/** The next scheduled occurrence; null until approved. */
|
|
908
|
-
nextFireAt: string | null;
|
|
909
|
-
/** Immutable filing provenance (v12); null on rows from before it existed. */
|
|
910
|
-
filedVia: string | null;
|
|
911
|
-
createdAt: string;
|
|
912
|
-
updatedAt: string;
|
|
913
|
-
/** v24: the working execution profile and the approval's sealed snapshot. */
|
|
914
|
-
profile?: ExecutionProfile | null;
|
|
915
|
-
approvedProfile?: ExecutionProfile | null;
|
|
916
|
-
/** v48: the four-role agent route the digest binds, and the snapshot the
|
|
917
|
-
* approval sealed. Null on a routine filed before routing froze — such a
|
|
918
|
-
* routine cannot be approved or fired until it is filed again. A row
|
|
919
|
-
* carrying unreadable route bytes reads null too, and fails closed. */
|
|
920
|
-
route?: PhaseRoute | null;
|
|
921
|
-
approvedRoute?: PhaseRoute | null;
|
|
922
|
-
/** v48: true when the row CARRIES route or profile bytes that do not
|
|
923
|
-
* read back — a corrupt snapshot, as distinct from one never taken. Every
|
|
924
|
-
* surface says which, and both fail closed. */
|
|
925
|
-
routeUnreadable?: boolean;
|
|
926
|
-
approvedRouteUnreadable?: boolean;
|
|
927
|
-
approvedProfileUnreadable?: boolean;
|
|
928
|
-
/** THE RAW TERMS VERDICT (raw authority repair): null when every stored
|
|
929
|
-
* term the digest binds read back EXACTLY — touches and requirements as
|
|
930
|
-
* JSON lists of strings, the rubric as whole criteria with no unknown
|
|
931
|
-
* key, the flags as 0/1, the ceilings as numbers or null — and the words
|
|
932
|
-
* when one did not. The integrity projection reads it FIRST: a row whose
|
|
933
|
-
* terms cannot be read exactly is not approved, not live, not approvable,
|
|
934
|
-
* and not refreshable, so the lenient fields above can never become a
|
|
935
|
-
* firing's authority. Undefined on a hand-built routine. */
|
|
936
|
-
termsProblem?: string | null;
|
|
937
|
-
};
|
|
938
|
-
/** One scheduled slot's outcome, fired or skipped — never silent. */
|
|
939
|
-
export type RoutineFire = {
|
|
940
|
-
id: number;
|
|
941
|
-
routineId: number;
|
|
942
|
-
scheduledFor: string;
|
|
943
|
-
outcome: "fired" | "skipped";
|
|
944
|
-
reason: string | null;
|
|
945
|
-
instanceTaskRef: number | null;
|
|
946
|
-
createdAt: string;
|
|
947
|
-
};
|
|
948
807
|
/** Who placed a hold — and therefore who alone may lift it. */
|
|
949
808
|
/** 'stop' (v52) = the pause one exact attempt's operator stop placed — lifted
|
|
950
809
|
* only by resuming THAT attempt, never by `unhold` or by answering a decision. */
|
|
951
|
-
export type HoldOwner = "operator" | "decision" | "incident" | "backoff" | "
|
|
810
|
+
export type HoldOwner = "operator" | "decision" | "incident" | "backoff" | "revision" | "stop";
|
|
952
811
|
export type Hold = {
|
|
953
812
|
id: number;
|
|
954
813
|
taskRef: number;
|
|
@@ -1030,19 +889,15 @@ export type Notification = {
|
|
|
1030
889
|
subject: string;
|
|
1031
890
|
body: string;
|
|
1032
891
|
createdAt: string;
|
|
1033
|
-
attempts: number;
|
|
1034
|
-
lastAttemptAt: string | null;
|
|
1035
|
-
lastError: string | null;
|
|
1036
|
-
deliveredAt: string | null;
|
|
1037
|
-
receipt: string | null;
|
|
1038
892
|
/** The closed push attention class, or null = this fact never pushes. */
|
|
1039
893
|
pushClass: "decision" | "pick" | "merge" | "attention" | "progress" | null;
|
|
1040
894
|
/** The machine-minted console path a push may deep-link — never free text. */
|
|
1041
895
|
link: string | null;
|
|
1042
896
|
/**
|
|
1043
897
|
* When the fact stopped wanting a person — a decision answered, an incident
|
|
1044
|
-
* resolved. Distinct from delivery, and it never deletes the row:
|
|
1045
|
-
* are the audit trail of
|
|
898
|
+
* resolved. Distinct from delivery, and it never deletes the row: the
|
|
899
|
+
* per-destination receipts (notification_delivery) are the audit trail of
|
|
900
|
+
* what was actually sent.
|
|
1046
901
|
*/
|
|
1047
902
|
resolvedAt: string | null;
|
|
1048
903
|
scope: "unknown" | "installation" | "project" | "task";
|
|
@@ -1051,6 +906,14 @@ export type Notification = {
|
|
|
1051
906
|
taskId: string | null;
|
|
1052
907
|
run: number | null;
|
|
1053
908
|
};
|
|
909
|
+
/** One notification's delivery state at one destination (notification_delivery). */
|
|
910
|
+
export type NotificationReceipt = Notification & {
|
|
911
|
+
attempts: number;
|
|
912
|
+
lastAttemptAt: string | null;
|
|
913
|
+
lastError: string | null;
|
|
914
|
+
deliveredAt: string | null;
|
|
915
|
+
receipt: string | null;
|
|
916
|
+
};
|
|
1054
917
|
export type TelegramDelivery = Notification & {
|
|
1055
918
|
destination: string;
|
|
1056
919
|
claimGeneration: number;
|
|
@@ -1107,8 +970,9 @@ export type RunnerWorkRecovery = {
|
|
|
1107
970
|
requeued: string[];
|
|
1108
971
|
};
|
|
1109
972
|
/** How a stop's settlement was established (v52). `interrupted` = the
|
|
1110
|
-
* owning worker sealed the attempt after its processes ended; `held`
|
|
1111
|
-
* held-session supervisor fenced it;
|
|
973
|
+
* owning worker sealed the attempt after its processes ended; `held`
|
|
974
|
+
* (v52-v114, history only) = the removed held-session supervisor fenced it;
|
|
975
|
+
* `recovered` = dead-incarnation
|
|
1112
976
|
* recovery settled a run whose worker is proven gone; `finished` = the
|
|
1113
977
|
* attempt reached another ending first (the stop was recorded, but the
|
|
1114
978
|
* run's own outcome stands — the words say which). */
|
|
@@ -1209,11 +1073,9 @@ export type Run = {
|
|
|
1209
1073
|
branch: string | null;
|
|
1210
1074
|
worktree: string | null;
|
|
1211
1075
|
model: string | null;
|
|
1212
|
-
/** 'interrupted' (v25) = a held
|
|
1076
|
+
/** 'interrupted' (v25–v114) = a held session cut down mid-flight; kept so old rows read. */
|
|
1213
1077
|
outcome: "built" | "failed" | "refused" | "parked" | "no-change" | "interrupted" | null;
|
|
1214
1078
|
reason: string | null;
|
|
1215
|
-
/** The attended authorization this run consumed (v25); null = ordinary dispatch. */
|
|
1216
|
-
attendedAuthorization?: string | null;
|
|
1217
1079
|
committed: boolean | null;
|
|
1218
1080
|
startedAt: string;
|
|
1219
1081
|
finishedAt: string | null;
|
|
@@ -1229,24 +1091,12 @@ export type Run = {
|
|
|
1229
1091
|
headRevision: string | null;
|
|
1230
1092
|
/** The validated terminal handoff's conclusion. */
|
|
1231
1093
|
handoff: string | null;
|
|
1232
|
-
/** When racing: which tournament agent this run belongs to. */
|
|
1233
|
-
contestant: number | null;
|
|
1234
1094
|
/**
|
|
1235
1095
|
* Where the machine is in ITS OWN state machine — stamped by the control
|
|
1236
1096
|
* plane at boundaries it owns, never parsed from a provider stream (M5.4).
|
|
1237
1097
|
* Meaningful while the run is open; the last value simply remains after.
|
|
1238
1098
|
*/
|
|
1239
1099
|
phase: RunPhase | null;
|
|
1240
|
-
/**
|
|
1241
|
-
* The fallback-chain metadata (v30), NULL on every run outside a chain.
|
|
1242
|
-
* `chainCycle`/`chainIndex`/`entryDigest` are stamped at admission (or at
|
|
1243
|
-
* base-cycle open) and bind the run to exactly one entry of an immutable
|
|
1244
|
-
* approved chain — the runtime re-derives authority from the snapshot,
|
|
1245
|
-
* never from these, but reads them to know which entry ran.
|
|
1246
|
-
*/
|
|
1247
|
-
chainCycle?: number | null;
|
|
1248
|
-
chainIndex?: number | null;
|
|
1249
|
-
entryDigest?: string | null;
|
|
1250
1100
|
/**
|
|
1251
1101
|
* How this attempt authenticated (v30) — 'subscription' or 'api-key' —
|
|
1252
1102
|
* stamped by the gateway. Decides which exhaustion class a match yields.
|
|
@@ -1254,10 +1104,8 @@ export type Run = {
|
|
|
1254
1104
|
authMode?: "subscription" | "api-key" | null;
|
|
1255
1105
|
/**
|
|
1256
1106
|
* The gateway's honest classification of how this attempt ENDED (v30),
|
|
1257
|
-
* computed
|
|
1258
|
-
*
|
|
1259
|
-
* fixture-backed recognizer exists. NEVER an authority by itself — the
|
|
1260
|
-
* dispatch's C8 gate re-checks hasRecognizer before any advance.
|
|
1107
|
+
* computed where the structural terminal still exists (exhaustion.ts).
|
|
1108
|
+
* `auth-expired` pauses its provider; every other class is a record.
|
|
1261
1109
|
*/
|
|
1262
1110
|
terminalClass?: TerminalClass | null;
|
|
1263
1111
|
/** v44 (adaptive execution plans): the exact plan revision this attempt's
|
|
@@ -1271,88 +1119,6 @@ export type Run = {
|
|
|
1271
1119
|
/** The bounded activity vocabulary. Machine-authored — a model's prose never becomes one of these. */
|
|
1272
1120
|
export declare const RUN_PHASES: readonly ["agent-running", "validating-handoff", "capturing-evidence", "committing", "verifying-proof", "correcting-proof"];
|
|
1273
1121
|
export type RunPhase = (typeof RUN_PHASES)[number];
|
|
1274
|
-
/**
|
|
1275
|
-
* One person's signed authority for ONE watched attempt (ruling 12). The id
|
|
1276
|
-
* is a pre-minted UUID — it IS the attempt identity the dispatch proof
|
|
1277
|
-
* consumes. Consumed (attemptRun set) is NOT closed: the authorization
|
|
1278
|
-
* stays active across its held session; closure is explicit and terminal.
|
|
1279
|
-
*/
|
|
1280
|
-
export type AttendedAuthorization = {
|
|
1281
|
-
id: string;
|
|
1282
|
-
taskRef: number;
|
|
1283
|
-
approver: string;
|
|
1284
|
-
runner: string;
|
|
1285
|
-
runnerGeneration: number;
|
|
1286
|
-
compositeDigest: string;
|
|
1287
|
-
termsJson: string;
|
|
1288
|
-
maxSessionTurns: number;
|
|
1289
|
-
/** A STOP THRESHOLD, not a ceiling: the agent halts when its total crosses it. */
|
|
1290
|
-
budgetMicrousd: number;
|
|
1291
|
-
/** Continuation: the finished parent attempt, also inside the signed terms. */
|
|
1292
|
-
parentRun: number | null;
|
|
1293
|
-
followup: string | null;
|
|
1294
|
-
createdAt: string;
|
|
1295
|
-
absoluteExpiry: string;
|
|
1296
|
-
lastBeatAt: string | null;
|
|
1297
|
-
attemptRun: number | null;
|
|
1298
|
-
consumedAt: string | null;
|
|
1299
|
-
closedAt: string | null;
|
|
1300
|
-
endReason: string | null;
|
|
1301
|
-
};
|
|
1302
|
-
/**
|
|
1303
|
-
* One stdin injection into a held session (ruling 15). Author is a verified
|
|
1304
|
-
* operator name for 'operator' turns ONLY — brief and repair turns are
|
|
1305
|
-
* machine-authored and say so with null. 'uncertain' is TERMINAL: written
|
|
1306
|
-
* (or accepted) but never proven settled; charged at its reservation and
|
|
1307
|
-
* NEVER reinjected.
|
|
1308
|
-
*/
|
|
1309
|
-
export type SessionTurn = {
|
|
1310
|
-
id: number;
|
|
1311
|
-
run: number;
|
|
1312
|
-
seq: number;
|
|
1313
|
-
sourceKind: "brief" | "answer" | "operator" | "repair";
|
|
1314
|
-
/** The decision id for 'answer' turns, the triggering decision for 'repair'. */
|
|
1315
|
-
sourceId: number | null;
|
|
1316
|
-
author: string | null;
|
|
1317
|
-
text: string;
|
|
1318
|
-
reservedMicrousd: number;
|
|
1319
|
-
accountedMicrousd: number | null;
|
|
1320
|
-
accountedAt: string | null;
|
|
1321
|
-
recordedAt: string;
|
|
1322
|
-
writtenAt: string | null;
|
|
1323
|
-
acceptedAt: string | null;
|
|
1324
|
-
settledAt: string | null;
|
|
1325
|
-
/** Marginal delta from the held session's durable cumulative baseline. */
|
|
1326
|
-
measuredMicrousd: number | null;
|
|
1327
|
-
outputTokens: number | null;
|
|
1328
|
-
state: "recorded" | "written" | "accepted" | "settled" | "uncertain" | "cancelled";
|
|
1329
|
-
};
|
|
1330
|
-
/**
|
|
1331
|
-
* Durable crash custody for one held session (ruling 15). The orphan
|
|
1332
|
-
* predicate is lease-based; 'fencing' is a helpable, leased state with
|
|
1333
|
-
* deadline takeover. cumulativeMicrousd is the settlement baseline the
|
|
1334
|
-
* provider's cumulative totals are diffed against.
|
|
1335
|
-
*/
|
|
1336
|
-
export type HeldSession = {
|
|
1337
|
-
run: number;
|
|
1338
|
-
authorizationId: string;
|
|
1339
|
-
runner: string;
|
|
1340
|
-
leaseId: string;
|
|
1341
|
-
upIncarnation: string;
|
|
1342
|
-
cookie: string;
|
|
1343
|
-
socketPath: string;
|
|
1344
|
-
supervisorPid: number | null;
|
|
1345
|
-
agentPgid: number | null;
|
|
1346
|
-
cumulativeMicrousd: number;
|
|
1347
|
-
cumulativeTokensOut: number;
|
|
1348
|
-
state: "open" | "fencing";
|
|
1349
|
-
fencer: string | null;
|
|
1350
|
-
fencingDeadline: string | null;
|
|
1351
|
-
startedAt: string;
|
|
1352
|
-
endedAt: string | null;
|
|
1353
|
-
endReason: string | null;
|
|
1354
|
-
};
|
|
1355
|
-
export type RecordTurnRefusal = "no-held-session" | "fenced" | "turn-cap" | "turn-open" | "budget-exhausted" | "decision-open" | "repair-exhausted" | "answer-delivered";
|
|
1356
1122
|
/**
|
|
1357
1123
|
* One operator steering note (arc 1, v22). Attached ≠ delivered: attachment
|
|
1358
1124
|
* says which build the note rode toward; delivery settles only on the
|
|
@@ -1761,12 +1527,6 @@ export declare const DEFAULT_ACTOR = "operator";
|
|
|
1761
1527
|
export declare class RunAdmissionRefused extends Error {
|
|
1762
1528
|
constructor(message: string);
|
|
1763
1529
|
}
|
|
1764
|
-
/** A present fallback-chain row carries this many entries after the base
|
|
1765
|
-
* (atomic authority closure) — the same bound `config set fallback`
|
|
1766
|
-
* enforces at the CLI, held again at the store's read and write so a row
|
|
1767
|
-
* outside it is a stated problem, never an empty chain. */
|
|
1768
|
-
export declare const FALLBACK_ENTRIES_MIN = 1;
|
|
1769
|
-
export declare const FALLBACK_ENTRIES_MAX = 3;
|
|
1770
1530
|
/**
|
|
1771
1531
|
* The subset of `node:sqlite` this module uses, named so the rest of the file
|
|
1772
1532
|
* is not written against an `any` and so a test can substitute a handle.
|
|
@@ -1868,6 +1628,9 @@ export declare function openStoreNoMigrate(file: string, options?: OpenOptions):
|
|
|
1868
1628
|
* retries. Correction children (the same-session structured-output
|
|
1869
1629
|
* repairs) are not attempts; they continue one. */
|
|
1870
1630
|
export declare const REVIEW_ROOT_ATTEMPTS = 3;
|
|
1631
|
+
/** The receipt v114 keeps a notification's old single-destination delivery under. No sender claims it: every real
|
|
1632
|
+
* destination is a kind and a 64-character hash, or a Telegram binding. */
|
|
1633
|
+
export declare const LEGACY_NOTIFICATION_DESTINATION = "legacy:single-destination";
|
|
1871
1634
|
/** v34: artifact.kind admits 'report'. A table already rebuilt to the v38
|
|
1872
1635
|
* shape (migrate() runs unconditionally on every open, including a fresh
|
|
1873
1636
|
* database created straight at the current shape) is a DONE shape too —
|
|
@@ -2038,7 +1801,7 @@ export declare class Store {
|
|
|
2038
1801
|
* rank any still-dispatchable task holds, computed and written in ONE
|
|
2039
1802
|
* transaction (two racing "next" calls get distinct ranks; the later
|
|
2040
1803
|
* ask wins). Scheduling only: it refuses anything not plainly queued —
|
|
2041
|
-
* building, finished, failed,
|
|
1804
|
+
* building, finished, failed, or cancelled — and
|
|
2042
1805
|
* never touches updated_at, which the board reads as the stall clock.
|
|
2043
1806
|
*/
|
|
2044
1807
|
moveTaskNext(taskId: string, now: Date, mutation?: Mutation): {
|
|
@@ -2071,7 +1834,7 @@ export declare class Store {
|
|
|
2071
1834
|
* One atomic queue move (queue-columns review, findings 3/9/13): the
|
|
2072
1835
|
* revision CAS, every refusal, the assignment write, and the rerank of
|
|
2073
1836
|
* BOTH affected columns are one transaction. The rerank member set is
|
|
2074
|
-
* the FREE members only — anything live-claimed
|
|
1837
|
+
* the FREE members only — anything live-claimed
|
|
2075
1838
|
* keeps its rank untouched, so a drag can never rewrite work being
|
|
2076
1839
|
* taken (a setup-failure release rejoins with the rank the operator
|
|
2077
1840
|
* last gave it — intent, not a bug). Scheduling, never authority.
|
|
@@ -2216,8 +1979,7 @@ export declare class Store {
|
|
|
2216
1979
|
* Establish a mirror: the ONE act that makes a local task stand for a
|
|
2217
1980
|
* tracker item. Identity and provenance are immutable after this row
|
|
2218
1981
|
* (trigger-enforced); labels and titles may nominate work, only this
|
|
2219
|
-
* establishes whose it is.
|
|
2220
|
-
* tournament (D1 — external work does not race in this release).
|
|
1982
|
+
* establishes whose it is.
|
|
2221
1983
|
*/
|
|
2222
1984
|
establishMirror(mirror: {
|
|
2223
1985
|
localTaskId: string;
|
|
@@ -2232,7 +1994,7 @@ export declare class Store {
|
|
|
2232
1994
|
ok: true;
|
|
2233
1995
|
} | {
|
|
2234
1996
|
ok: false;
|
|
2235
|
-
reason: "unknown-task" | "duplicate"
|
|
1997
|
+
reason: "unknown-task" | "duplicate";
|
|
2236
1998
|
};
|
|
2237
1999
|
mirrorByTask(taskId: string): ExternalMirror | null;
|
|
2238
2000
|
mirrorByRemote(backend: string, remoteRepo: string, remoteId: string): ExternalMirror | null;
|
|
@@ -2251,7 +2013,7 @@ export declare class Store {
|
|
|
2251
2013
|
/**
|
|
2252
2014
|
* The reopen act (v3 §7 + findings 18/30): an authenticated CAS that
|
|
2253
2015
|
* requires the tracker to have been SEEN open again after the close,
|
|
2254
|
-
* and the task to be clean — no live claim, no
|
|
2016
|
+
* and the task to be clean — no live claim, no
|
|
2255
2017
|
* active hold, no open question, no unresolved incident. It reconciles
|
|
2256
2018
|
* task state from any admitted state back to queued; the approved
|
|
2257
2019
|
* scope is preserved (its digest never changed) — this act is the
|
|
@@ -2261,7 +2023,7 @@ export declare class Store {
|
|
|
2261
2023
|
ok: true;
|
|
2262
2024
|
} | {
|
|
2263
2025
|
ok: false;
|
|
2264
|
-
reason: "unknown-task" | "not-latched" | "not-seen-open" | "claimed" | "
|
|
2026
|
+
reason: "unknown-task" | "not-latched" | "not-seen-open" | "claimed" | "held" | "question-open" | "incident-open" | "bad-state";
|
|
2265
2027
|
};
|
|
2266
2028
|
/** The last COMPLETE sync pass for a tracker, or null — freshness's anchor. */
|
|
2267
2029
|
lastCompleteSync(backend: string, remoteRepo: string): {
|
|
@@ -2300,7 +2062,7 @@ export declare class Store {
|
|
|
2300
2062
|
why: "stale-mirror" | "external-closed" | "dispatch-revoked" | "plane-blocked";
|
|
2301
2063
|
}[];
|
|
2302
2064
|
/** Whether a fresh completion may stand as done (v4 §24) — read INSIDE
|
|
2303
|
-
*
|
|
2065
|
+
* finalize's complete-ending transaction. Non-mirrors always complete. */
|
|
2304
2066
|
mirrorAllowsCompletion(taskId: string): boolean;
|
|
2305
2067
|
/** Whether a stored acquire mutation exists — the replay marker's fact. */
|
|
2306
2068
|
hasMutationRecord(mutation: Mutation): boolean;
|
|
@@ -2321,14 +2083,13 @@ export declare class Store {
|
|
|
2321
2083
|
revokeGrant(repo: string, backend: string, mutation?: Mutation): boolean;
|
|
2322
2084
|
saveScope(scope: Scope, mutation?: Mutation, options?: {
|
|
2323
2085
|
profile?: ExecutionProfile;
|
|
2324
|
-
/** v48: a FROZEN route —
|
|
2086
|
+
/** v48: a FROZEN route — an approved standing order's snapshot —
|
|
2325
2087
|
* filed verbatim instead of being recommended afresh from today's
|
|
2326
2088
|
* configuration. Requires an explicit profile, and the two must
|
|
2327
2089
|
* agree exactly (the same belt every other road wears). */
|
|
2328
2090
|
route?: PhaseRoute;
|
|
2329
2091
|
permissionMode?: UnattendedPermissionMode;
|
|
2330
2092
|
qualityMode?: QualityMode;
|
|
2331
|
-
riskLevel?: RiskLevel;
|
|
2332
2093
|
posture?: "escalated";
|
|
2333
2094
|
proposedVia?: "mate" | "coordinator" | "scout" | null;
|
|
2334
2095
|
}): void;
|
|
@@ -2489,8 +2250,16 @@ export declare class Store {
|
|
|
2489
2250
|
fresh?: number;
|
|
2490
2251
|
}): LedgerChainReport;
|
|
2491
2252
|
/** A checkpoint of the chain as it stands: its head, recorded here and handed back to be copied off the machine.
|
|
2492
|
-
* Never over a chain that doesn't verify: that would vouch for what broke it.
|
|
2493
|
-
|
|
2253
|
+
* Never over a chain that doesn't verify: that would vouch for what broke it. `automatic` (before a backup, after
|
|
2254
|
+
* a monitoring delivery): at the verified head, or at `head` (one that was sent) once the walk reached it, only past
|
|
2255
|
+
* the newest checkpoint (null otherwise), and with no ledger entry of its own, so a checkpoint never makes new
|
|
2256
|
+
* activity for the next backup or delivery to checkpoint again. */
|
|
2257
|
+
ledgerCheckpoint(by: string, now: Date, automatic?: {
|
|
2258
|
+
head?: {
|
|
2259
|
+
through: number;
|
|
2260
|
+
hash: string;
|
|
2261
|
+
};
|
|
2262
|
+
}): {
|
|
2494
2263
|
through: number;
|
|
2495
2264
|
hash: string;
|
|
2496
2265
|
} | {
|
|
@@ -2796,8 +2565,8 @@ export declare class Store {
|
|
|
2796
2565
|
/**
|
|
2797
2566
|
* The revocation that actually severs (D7), one transaction: the stamp
|
|
2798
2567
|
* plus a generation bump (live console sessions die at their next
|
|
2799
|
-
* lookup; bearer credentials die at authenticateAccount), their
|
|
2800
|
-
*
|
|
2568
|
+
* lookup; bearer credentials die at authenticateAccount), their
|
|
2569
|
+
* unconsumed invites die, every
|
|
2801
2570
|
* mode THEY signed is revoked with the typed 'signer-revoked' event —
|
|
2802
2571
|
* demoting its derived merge authority through the one reconciliation
|
|
2803
2572
|
* road — and the derived-authority sweep clears Telegram and push.
|
|
@@ -2810,7 +2579,7 @@ export declare class Store {
|
|
|
2810
2579
|
* invites, modes and everything mode-derived (their sealed filings
|
|
2811
2580
|
* demote through the reconciliation road), Telegram, push. Standing
|
|
2812
2581
|
* acts they completed WITH full ceremony — publication/backend/intake
|
|
2813
|
-
* grants, worktree setups, approved
|
|
2582
|
+
* grants, worktree setups, approved standing orders, approved scopes sealed by
|
|
2814
2583
|
* password — deliberately survive: those are the instance's promises,
|
|
2815
2584
|
* approved as themselves, and undoing history is not what revocation
|
|
2816
2585
|
* means. An operator who distrusts those acts revokes them by their own
|
|
@@ -2819,18 +2588,11 @@ export declare class Store {
|
|
|
2819
2588
|
revokeAccount(name: string, by: string, now: Date): {
|
|
2820
2589
|
ok: true;
|
|
2821
2590
|
modesRevoked: number;
|
|
2822
|
-
authorizationsClosed: number;
|
|
2823
2591
|
invitesRevoked: number;
|
|
2824
2592
|
} | {
|
|
2825
2593
|
ok: false;
|
|
2826
2594
|
reason: "unknown" | "already-revoked" | "last-approver";
|
|
2827
2595
|
};
|
|
2828
|
-
/** One person's open attended sessions, for their People card. */
|
|
2829
|
-
openAttendedOf(name: string): {
|
|
2830
|
-
taskId: string;
|
|
2831
|
-
createdAt: string;
|
|
2832
|
-
lastBeatAt: string | null;
|
|
2833
|
-
}[];
|
|
2834
2596
|
/**
|
|
2835
2597
|
* One person's recent consequential acts (U3), from the rows that were
|
|
2836
2598
|
* ALREADY author-stamped — no new event kinds, just the ledger asked a
|
|
@@ -3146,321 +2908,6 @@ export declare class Store {
|
|
|
3146
2908
|
* finds nothing to consume instead of minting a duplicate task.
|
|
3147
2909
|
*/
|
|
3148
2910
|
consumeDiffComments(runId: number, ids: readonly number[], taskId: string): number;
|
|
3149
|
-
/** The open cycle for a task, if one exists (the runtime's read). */
|
|
3150
|
-
fallbackCycleFor(taskRef: number): FallbackCycle | null;
|
|
3151
|
-
/** Open a fresh cycle at index 0 for a running base attempt. One live
|
|
3152
|
-
* cycle per task — the SELECT-then-INSERT under BEGIN IMMEDIATE
|
|
3153
|
-
* serializes writers, and the one_live_fallback_cycle_per_task partial
|
|
3154
|
-
* unique index is the durable backstop (finding 5). A second refuses. */
|
|
3155
|
-
openFallbackCycle(taskRef: number, chainDigest: string, tailRun: number | null, now: Date): {
|
|
3156
|
-
ok: true;
|
|
3157
|
-
id: number;
|
|
3158
|
-
} | {
|
|
3159
|
-
ok: false;
|
|
3160
|
-
};
|
|
3161
|
-
/**
|
|
3162
|
-
* The task's IMMUTABLE approved chain — the runtime's single source of
|
|
3163
|
-
* truth for chain length and per-entry authority (never mutable config).
|
|
3164
|
-
* Returns the rehydrated entries when the approval sealed a chain and the
|
|
3165
|
-
* snapshot still rehydrates strictly; null otherwise (a single-profile
|
|
3166
|
-
* approval, or a snapshot that fails the strict rehydrator — fail closed,
|
|
3167
|
-
* so a corrupt chain dispatches nothing).
|
|
3168
|
-
*/
|
|
3169
|
-
approvedChainOf(taskId: string): ChainEntry[] | null;
|
|
3170
|
-
/**
|
|
3171
|
-
* The ONE chain-cycle resolver at a run's end (E3c/E3d): every concluded
|
|
3172
|
-
* tail resolves its cycle — success closes it, an ordinary end closes it
|
|
3173
|
-
* (the retry road runs the BASE entry under a FRESH cycle; a concluded
|
|
3174
|
-
* tail can never be re-tagged, so leaving it open would only strand it),
|
|
3175
|
-
* a parked tail is a PAUSED lineage and stays open for repair, and a
|
|
3176
|
-
* recognized eligible exhaustion advances. Both the disposition hook and
|
|
3177
|
-
* the crash reconciler call THIS method, so a crash between disposition
|
|
3178
|
-
* and resolution re-derives the same answer from durable state.
|
|
3179
|
-
*
|
|
3180
|
-
* The advance is FAIL CLOSED at every gate:
|
|
3181
|
-
* - an OPEN cycle whose tail is exactly this finished run;
|
|
3182
|
-
* - the run genuinely finished (outcome + finished_at +
|
|
3183
|
-
* provider_started_at, same task) — never live custody;
|
|
3184
|
-
* - a fallback-ELIGIBLE class consistent with the run's auth mode;
|
|
3185
|
-
* - the C8 re-check: THIS build recognizes the exact class/auth for the
|
|
3186
|
-
* run's (provider, version) — a downgrade severs to incident;
|
|
3187
|
-
* - the LIVE signed mode's paid-fallback grant, re-read IN-transaction;
|
|
3188
|
-
* - a next entry in the IMMUTABLE approved chain (else exhausted-end).
|
|
3189
|
-
* The fenced custody walk — sanitize, advance, release-to-pending — runs
|
|
3190
|
-
* atomically inside ONE transaction; a lost inner CAS rolls the whole
|
|
3191
|
-
* walk back. It NEVER dispatches: the admission pass creates the run.
|
|
3192
|
-
*/
|
|
3193
|
-
resolveChainOnRunEnd(taskRef: number, taskId: string, repo: string | null, finishedRunId: number, now: Date): {
|
|
3194
|
-
kind: "advanced";
|
|
3195
|
-
toIndex: number;
|
|
3196
|
-
} | {
|
|
3197
|
-
kind: "exhausted-end";
|
|
3198
|
-
} | {
|
|
3199
|
-
kind: "closed";
|
|
3200
|
-
reason: "succeeded" | "entry-ended";
|
|
3201
|
-
} | {
|
|
3202
|
-
kind: "blocked";
|
|
3203
|
-
reason: "no-recognizer" | "grant-withheld" | "corrupt-chain" | "cycle-mismatch";
|
|
3204
|
-
} | {
|
|
3205
|
-
kind: "parked-tail";
|
|
3206
|
-
} | {
|
|
3207
|
-
kind: "no-cycle";
|
|
3208
|
-
};
|
|
3209
|
-
/**
|
|
3210
|
-
* The crash reconciler's read (E3d, review finding 3): OPEN cycles whose
|
|
3211
|
-
* tail run CONCLUDED (non-parked) but whose cycle was never resolved — the
|
|
3212
|
-
* window a crash between disposition and resolveChainOnRunEnd leaves. The
|
|
3213
|
-
* reconciler feeds each through the SAME resolver, so nothing is decided
|
|
3214
|
-
* twice or differently.
|
|
3215
|
-
*/
|
|
3216
|
-
strandedChainCycles(repo: string): {
|
|
3217
|
-
cycleId: number;
|
|
3218
|
-
taskRef: number;
|
|
3219
|
-
taskId: string;
|
|
3220
|
-
tailRun: number;
|
|
3221
|
-
}[];
|
|
3222
|
-
/**
|
|
3223
|
-
* The chain reconciler in ONE callable piece (F+G review, finding 5): the
|
|
3224
|
-
* EXACT code the tick runs each pass, so the fault tests drive the same
|
|
3225
|
-
* road production does — deleting the tick's call would fail them.
|
|
3226
|
-
* Resolves every open cycle whose tail concluded (non-parked) through the
|
|
3227
|
-
* one resolver; returns how many it fed through.
|
|
3228
|
-
*/
|
|
3229
|
-
reconcileStrandedChains(repo: string, now: Date): number;
|
|
3230
|
-
/** Cycles awaiting their next entry's admission, for one repo — what the
|
|
3231
|
-
* tick's chain admission pass walks. */
|
|
3232
|
-
pendingChainAdmissions(repo: string): {
|
|
3233
|
-
cycleId: number;
|
|
3234
|
-
taskRef: number;
|
|
3235
|
-
taskId: string;
|
|
3236
|
-
cursor: number;
|
|
3237
|
-
}[];
|
|
3238
|
-
/**
|
|
3239
|
-
* The PROVING admission (E3d): create the next entry's run from a
|
|
3240
|
-
* pending-admission cycle, with EVERY authority re-derived inside one
|
|
3241
|
-
* transaction — the approved chain must still stand and match the cycle's
|
|
3242
|
-
* digest, the entry at the cursor must exist, the LIVE signed mode must
|
|
3243
|
-
* still grant the paid fallback (revocation between advance and admission
|
|
3244
|
-
* denies), and the exact unconsumed pending edge is consumed by the run
|
|
3245
|
-
* it creates (admitFallback's single-use CAS). The caller carries only
|
|
3246
|
-
* claim, worktree, and rail; nothing it asserts becomes authority.
|
|
3247
|
-
*/
|
|
3248
|
-
admitNextChainEntry(cycleId: number, run: {
|
|
3249
|
-
leaseId: string;
|
|
3250
|
-
runner: string;
|
|
3251
|
-
branch: string;
|
|
3252
|
-
worktree: string;
|
|
3253
|
-
recoveredFrom?: number;
|
|
3254
|
-
}, now: Date): {
|
|
3255
|
-
ok: true;
|
|
3256
|
-
runId: number;
|
|
3257
|
-
taskId: string;
|
|
3258
|
-
provider: string;
|
|
3259
|
-
model: string;
|
|
3260
|
-
} | {
|
|
3261
|
-
ok: false;
|
|
3262
|
-
reason: "not-pending" | "stale-approval" | "grant-withheld" | "no-edge" | "raced" | "provider-unavailable";
|
|
3263
|
-
detail?: string;
|
|
3264
|
-
};
|
|
3265
|
-
/**
|
|
3266
|
-
* The PRE-SPAWN custody proof (Codex E3d review, finding 3): the LAST
|
|
3267
|
-
* gate before a chain-bound run's provider process starts, coupled to the
|
|
3268
|
-
* start stamp in ONE transaction so nothing can lapse between the proof
|
|
3269
|
-
* and the money. Re-derives, from durable state only: the approved chain
|
|
3270
|
-
* still stands (freshness + digest); the run's cycle is live and OPEN
|
|
3271
|
-
* with THIS run as tail at THIS run's index; the entry digest and pinned
|
|
3272
|
-
* auth mode still match; and — for any entry past the base — the LIVE
|
|
3273
|
-
* signed mode still grants the paid fallback (a base entry is the
|
|
3274
|
-
* ordinary approved work and needs no grant). Only when every fact stands
|
|
3275
|
-
* is provider_started_at stamped (first-write, with the version when the
|
|
3276
|
-
* gateway proved one). Returns false — and stamps NOTHING — otherwise.
|
|
3277
|
-
*/
|
|
3278
|
-
proveChainCustodyForSpawn(runId: number, now: Date, providerVersion?: string): boolean;
|
|
3279
|
-
/**
|
|
3280
|
-
* open -> sanitizing (C7): a recognized ELIGIBLE exhaustion of the tail
|
|
3281
|
-
* run begins the sanitizer. CAS proves exact state, generation, and tail
|
|
3282
|
-
* run; a stale caller loses. Marks the cycle sanitizing so ordinary
|
|
3283
|
-
* admission is blocked even if the claim later expires.
|
|
3284
|
-
*/
|
|
3285
|
-
beginFallbackSanitize(cycleId: number, expectGeneration: number, tailRun: number, now: Date): boolean;
|
|
3286
|
-
/**
|
|
3287
|
-
* sanitizing -> awaiting-release (C2/C7): the durable one-step advance.
|
|
3288
|
-
* ONE transaction: prove the cycle is sanitizing at this generation and
|
|
3289
|
-
* cursor i with this tail run; insert the immutable transition (unique
|
|
3290
|
-
* per (cycle, from_index)); advance the cursor to i+1; bump generation.
|
|
3291
|
-
* The target index MUST be < chainLength (proven by the caller from the
|
|
3292
|
-
* approved snapshot). Returns the new transition id, or null on a lost
|
|
3293
|
-
* CAS or an already-recorded step.
|
|
3294
|
-
*/
|
|
3295
|
-
advanceFallbackFenced(args: {
|
|
3296
|
-
cycleId: number;
|
|
3297
|
-
expectGeneration: number;
|
|
3298
|
-
fromIndex: number;
|
|
3299
|
-
chainLength: number;
|
|
3300
|
-
predecessorRun: number;
|
|
3301
|
-
terminalClass: string;
|
|
3302
|
-
evidence: {
|
|
3303
|
-
provider: string;
|
|
3304
|
-
version: string | null;
|
|
3305
|
-
authMode: string;
|
|
3306
|
-
fp: string;
|
|
3307
|
-
};
|
|
3308
|
-
}, now: Date): {
|
|
3309
|
-
ok: true;
|
|
3310
|
-
transitionId: number;
|
|
3311
|
-
toIndex: number;
|
|
3312
|
-
} | {
|
|
3313
|
-
ok: false;
|
|
3314
|
-
reason: "raced" | "at-end" | "dup";
|
|
3315
|
-
};
|
|
3316
|
-
/** awaiting-release -> pending-admission (C7): the epoch-fenced custody
|
|
3317
|
-
* release completed; the next entry is now admittable. */
|
|
3318
|
-
releaseFallbackToPending(cycleId: number, expectGeneration: number, now: Date): boolean;
|
|
3319
|
-
/**
|
|
3320
|
-
* pending-admission -> open at the new index (C3): the SINGLE-USE
|
|
3321
|
-
* admission. ONE transaction: prove pending at this generation, consume
|
|
3322
|
-
* the transition (consumed_by set once — a replay finds it consumed and
|
|
3323
|
-
* loses), and open the cycle at the new tail. Returns false on a lost
|
|
3324
|
-
* CAS or an already-consumed transition.
|
|
3325
|
-
*/
|
|
3326
|
-
/**
|
|
3327
|
-
* THE FALLBACK ADMISSION (E3d; the ONE insert path for `fallback`
|
|
3328
|
-
* provenance since the v48 integrity repair). Every run bound to a
|
|
3329
|
-
* NON-primary entry of the approved chain — the entry's own admission
|
|
3330
|
-
* from a pending edge, a parked tail's successor, a repair turn under
|
|
3331
|
-
* the live tail — is created here and nowhere else; the generic
|
|
3332
|
-
* admission refuses `fallback` outright.
|
|
3333
|
-
*
|
|
3334
|
-
* EVERYTHING the caller states is re-proved against durable state
|
|
3335
|
-
* before any row exists, and one disagreement creates no run and
|
|
3336
|
-
* consumes no edge: the cycle is the task's own and live; the approved
|
|
3337
|
-
* chain still stands, is the cycle's, and its base entry is mirrored by
|
|
3338
|
-
* the sealed profile exactly as the caller presents it; the cursor,
|
|
3339
|
-
* the tail, the entry digest, the auth mode, the provider, the EXACT
|
|
3340
|
-
* model (required, never defaulted), and the repair binding all equal
|
|
3341
|
-
* the approved entry at the cursor; the presented stamp is `fallback`
|
|
3342
|
-
* on exactly that entry for the phase this run spends as; and the
|
|
3343
|
-
* kind-specific custody fact holds — an unconsumed pending edge at the
|
|
3344
|
-
* cursor, a parked tail the cycle still names, or a live parent tail.
|
|
3345
|
-
* The run is opened WITH its chain metadata (cycle, index, entry
|
|
3346
|
-
* digest, auth mode) and its route in one body, so nothing downstream
|
|
3347
|
-
* can substitute a foreign run.
|
|
3348
|
-
*/
|
|
3349
|
-
admitFallback(args: {
|
|
3350
|
-
run: {
|
|
3351
|
-
taskRef: number;
|
|
3352
|
-
leaseId: string;
|
|
3353
|
-
runner: string;
|
|
3354
|
-
branch: string;
|
|
3355
|
-
worktree: string;
|
|
3356
|
-
provider: string;
|
|
3357
|
-
model: string;
|
|
3358
|
-
sessionId?: string;
|
|
3359
|
-
/** The interrupted attempt whose draft this entry or resume
|
|
3360
|
-
* recovers (raw authority repair): proved this task's own run and
|
|
3361
|
-
* written as the row's parent in this same insert — never stamped
|
|
3362
|
-
* later. A repair turn's parent is its live tail; it recovers none. */
|
|
3363
|
-
recoveredFrom?: number;
|
|
3364
|
-
};
|
|
3365
|
-
cycleId: number;
|
|
3366
|
-
/** The cursor the caller understands the cycle to stand at — the
|
|
3367
|
-
* entry index this run binds to. */
|
|
3368
|
-
expectCursor: number;
|
|
3369
|
-
/** The cycle's tail as the caller understands it: null for an entry
|
|
3370
|
-
* admitted from a pending edge, the parked run for a resume, the
|
|
3371
|
-
* live parent for a repair turn. */
|
|
3372
|
-
expectTail: number | null;
|
|
3373
|
-
entryDigest: string;
|
|
3374
|
-
authMode: "subscription" | "api-key";
|
|
3375
|
-
/** The entry's effective repair model as the caller understands it —
|
|
3376
|
-
* `inherit` resolved to the build model — proved against the approved
|
|
3377
|
-
* entry so a repair turn later spends as exactly what was approved. */
|
|
3378
|
-
repairModel: string;
|
|
3379
|
-
/** The approved authority as the caller holds it: the chain's digest
|
|
3380
|
-
* and the FULL sealed-profile mirror (the chain's base entry). */
|
|
3381
|
-
approved: {
|
|
3382
|
-
chainDigest: string;
|
|
3383
|
-
profile: ExecutionProfile;
|
|
3384
|
-
};
|
|
3385
|
-
/** The run's `fallback` route provenance, proved against the exact
|
|
3386
|
-
* entry this admission binds (cursor + entry digest) BEFORE the row
|
|
3387
|
-
* exists and written beside it. Required: nothing is dictated here. */
|
|
3388
|
-
route: RouteStamp;
|
|
3389
|
-
} & ({
|
|
3390
|
-
kind: "entry";
|
|
3391
|
-
expectGeneration: number;
|
|
3392
|
-
transitionId: number;
|
|
3393
|
-
} | {
|
|
3394
|
-
kind: "resume";
|
|
3395
|
-
parkedRun: number;
|
|
3396
|
-
} | {
|
|
3397
|
-
kind: "repair";
|
|
3398
|
-
parentRun: number;
|
|
3399
|
-
}), now: Date): {
|
|
3400
|
-
ok: true;
|
|
3401
|
-
runId: number;
|
|
3402
|
-
} | {
|
|
3403
|
-
ok: false;
|
|
3404
|
-
reason: "refused" | "raced";
|
|
3405
|
-
problem: string;
|
|
3406
|
-
};
|
|
3407
|
-
/**
|
|
3408
|
-
* THE UNAVAILABLE-PRIMARY TRANSITION (v47): the approved chain's base
|
|
3409
|
-
* entry runs a provider THIS runner has reported unavailable, so the
|
|
3410
|
-
* task moves — before any claim, run, or spend — to the EXPLICITLY
|
|
3411
|
-
* APPROVED next entry, and only that one: a fresh cycle opens at index 0
|
|
3412
|
-
* with no tail and skips, one step, to pending-admission at index 1,
|
|
3413
|
-
* citing the readiness observation as its evidence. The admission pass
|
|
3414
|
-
* then re-proves everything (approved chain standing, live paid-fallback
|
|
3415
|
-
* grant, the next entry's own readiness) before it runs. Every other
|
|
3416
|
-
* case fails closed with the words: no approved chain, a live cycle
|
|
3417
|
-
* already, a base that is not actually unavailable, no next entry, a
|
|
3418
|
-
* next entry that is unavailable too, or no live grant — nothing
|
|
3419
|
-
* substitutes outside the approved chain.
|
|
3420
|
-
*/
|
|
3421
|
-
skipUnavailablePrimary(taskRef: number, taskId: string, repo: string | null, runner: string, now: Date): {
|
|
3422
|
-
ok: true;
|
|
3423
|
-
cycleId: number;
|
|
3424
|
-
toIndex: number;
|
|
3425
|
-
next: {
|
|
3426
|
-
provider: string;
|
|
3427
|
-
model: string;
|
|
3428
|
-
};
|
|
3429
|
-
} | {
|
|
3430
|
-
ok: false;
|
|
3431
|
-
reason: "no-chain" | "cycle-live" | "primary-available" | "at-end" | "next-unavailable" | "grant-withheld" | "raced";
|
|
3432
|
-
detail: string;
|
|
3433
|
-
};
|
|
3434
|
-
/** open -> open at i+1 via a quota-skip (C7): index 0 (or any) already
|
|
3435
|
-
* durably exhausted before dispatch is skipped, one step, recorded. */
|
|
3436
|
-
quotaSkipFallback(args: {
|
|
3437
|
-
cycleId: number;
|
|
3438
|
-
expectGeneration: number;
|
|
3439
|
-
fromIndex: number;
|
|
3440
|
-
chainLength: number;
|
|
3441
|
-
tailRun: number | null;
|
|
3442
|
-
evidence?: {
|
|
3443
|
-
provider: string;
|
|
3444
|
-
fp: string;
|
|
3445
|
-
};
|
|
3446
|
-
}, now: Date): {
|
|
3447
|
-
ok: true;
|
|
3448
|
-
toIndex: number;
|
|
3449
|
-
transitionId: number;
|
|
3450
|
-
} | {
|
|
3451
|
-
ok: false;
|
|
3452
|
-
reason: "raced" | "at-end" | "dup";
|
|
3453
|
-
};
|
|
3454
|
-
/** Any nonterminal state -> incident (C8): a sanitizer failure, a
|
|
3455
|
-
* severed grant, or a policy downgrade pages a human; never silent. */
|
|
3456
|
-
/** Any nonterminal -> incident (C8): CAS on the exact generation so a
|
|
3457
|
-
* STALE observer cannot terminate a cycle that has since advanced
|
|
3458
|
-
* (Codex E1 review, finding 1). */
|
|
3459
|
-
incidentFallback(cycleId: number, expectGeneration: number, reason: string, now: Date): boolean;
|
|
3460
|
-
/** A cycle succeeds or exhausts its chain: closed, terminally — CAS on
|
|
3461
|
-
* the exact generation (finding 1: a stale success observer cannot close
|
|
3462
|
-
* after an advance + admit). */
|
|
3463
|
-
closeFallbackCycle(cycleId: number, expectGeneration: number, reason: string, now: Date): boolean;
|
|
3464
2911
|
/**
|
|
3465
2912
|
* The bounded review-retry projection (v50): one source run's ROOT
|
|
3466
2913
|
* reviewer attempts in ordinal order, its open request, and the ONE
|
|
@@ -3649,7 +3096,7 @@ export declare class Store {
|
|
|
3649
3096
|
* exactly one wins; the loser refuses in words with zero rows.
|
|
3650
3097
|
*
|
|
3651
3098
|
* The child is filed UNAPPROVED, always: this method never stamps an
|
|
3652
|
-
* approval, never
|
|
3099
|
+
* approval, never touches a
|
|
3653
3100
|
* publication or merge grant. Only the normal approval roads — the
|
|
3654
3101
|
* password ceremony, or a live mode's own filing coverage re-proved by
|
|
3655
3102
|
* the caller inside its own transaction — can approve the child.
|
|
@@ -3975,12 +3422,10 @@ export declare class Store {
|
|
|
3975
3422
|
* default when the scope is filed. */
|
|
3976
3423
|
qualityMode?: QualityMode;
|
|
3977
3424
|
/** The revision road's inherited declarations (contract handoff task
|
|
3978
|
-
* 2): the
|
|
3979
|
-
* overrides, and its build/plan pins — stamped on the ref BEFORE the
|
|
3425
|
+
* 2): the approver's per-phase route overrides, and its build/plan pins — stamped on the ref BEFORE the
|
|
3980
3426
|
* scope resolves, so the child's route is recommended over them
|
|
3981
3427
|
* exactly as the source's was, never over the installation's
|
|
3982
3428
|
* defaults of the day. */
|
|
3983
|
-
riskLevel?: RiskLevel;
|
|
3984
3429
|
/** How big the change is, sized at filing (v2 routing). */
|
|
3985
3430
|
sizing?: TaskSizing;
|
|
3986
3431
|
routeOverridesJson?: string | null;
|
|
@@ -4114,34 +3559,6 @@ export declare class Store {
|
|
|
4114
3559
|
}[];
|
|
4115
3560
|
/** Write one complete pair. Audited: who changed spend routing, and when. */
|
|
4116
3561
|
setPhaseConfig(scope: string, phase: string, provider: string, model: string | null, by: string, now: Date): void;
|
|
4117
|
-
/** The ordered FALLBACK entries after the base, for a scope's build
|
|
4118
|
-
* phase (v30). Each entry: {provider, model, authMode, repairModel?}.
|
|
4119
|
-
* Returns [] when none configured — a chain-of-one is the base alone. */
|
|
4120
|
-
fallbackConfig(scope: string): {
|
|
4121
|
-
provider: string;
|
|
4122
|
-
model: string;
|
|
4123
|
-
authMode: "subscription" | "api-key";
|
|
4124
|
-
repairModel?: string;
|
|
4125
|
-
}[];
|
|
4126
|
-
/**
|
|
4127
|
-
* The configured fallback entries, or the words for why the row on file
|
|
4128
|
-
* cannot be read (v48): a row that EXISTS but is not a list of
|
|
4129
|
-
* well-shaped entries — corrupt JSON, a non-list, an entry missing its
|
|
4130
|
-
* provider, model, or auth mode — is a stated problem, never an empty
|
|
4131
|
-
* list. Filing a scope under such a row refuses in these words rather
|
|
4132
|
-
* than silently sealing a single-profile approval the operator did not
|
|
4133
|
-
* configure; the chain the person believes they set never shrinks to
|
|
4134
|
-
* nothing behind their back.
|
|
4135
|
-
*/
|
|
4136
|
-
fallbackConfigProblem(scope: string): string | null;
|
|
4137
|
-
private readFallbackConfig;
|
|
4138
|
-
setFallbackConfig(scope: string, entries: {
|
|
4139
|
-
provider: string;
|
|
4140
|
-
model: string;
|
|
4141
|
-
authMode: "subscription" | "api-key";
|
|
4142
|
-
repairModel?: string;
|
|
4143
|
-
}[], by: string, now: Date): void;
|
|
4144
|
-
clearFallbackConfig(scope: string): boolean;
|
|
4145
3562
|
clearPhaseConfig(scope: string, phase: string): boolean;
|
|
4146
3563
|
/** The operator's named STRONG candidate for a phase at a scope, or null.
|
|
4147
3564
|
* Read by the routing policy only — a phase_config row stays the routine
|
|
@@ -4189,7 +3606,7 @@ export declare class Store {
|
|
|
4189
3606
|
* nothing. A signed routing input, read at filing. */
|
|
4190
3607
|
publicationAuthorityOf(repo: string | null, now: Date): PublicationAuthority;
|
|
4191
3608
|
/**
|
|
4192
|
-
* THE ROUTE EDIT (v47):
|
|
3609
|
+
* THE ROUTE EDIT (v47): set the task's size, override one phase to an
|
|
4193
3610
|
* exact agent, or clear an override — ONE authenticated transaction that
|
|
4194
3611
|
* re-proves the editor's authority, CAS-checks the scope digest the
|
|
4195
3612
|
* editor saw (a string to match, null = "I saw no scope", undefined =
|
|
@@ -4199,7 +3616,7 @@ export declare class Store {
|
|
|
4199
3616
|
* is recomputed and the prior approval goes stale by digest, and — when
|
|
4200
3617
|
* a drafted plan came from the old planner — asks for a real re-plan.
|
|
4201
3618
|
* No claimant can observe a half-updated authority: it is all or
|
|
4202
|
-
* nothing, and refused under a live claim
|
|
3619
|
+
* nothing, and refused under a live claim.
|
|
4203
3620
|
*/
|
|
4204
3621
|
editTaskRoute(taskRef: number, edit: {
|
|
4205
3622
|
by: string;
|
|
@@ -4209,7 +3626,6 @@ export declare class Store {
|
|
|
4209
3626
|
ok: false;
|
|
4210
3627
|
reason: string;
|
|
4211
3628
|
};
|
|
4212
|
-
risk?: RiskLevel;
|
|
4213
3629
|
/** v2: a person's size for the task — it outranks the classifier's. */
|
|
4214
3630
|
size?: {
|
|
4215
3631
|
size: TaskSize;
|
|
@@ -4238,7 +3654,7 @@ export declare class Store {
|
|
|
4238
3654
|
overrides: RouteOverride[];
|
|
4239
3655
|
} | {
|
|
4240
3656
|
ok: false;
|
|
4241
|
-
reason: "unauthenticated" | "no-task" | "live-claim" | "
|
|
3657
|
+
reason: "unauthenticated" | "no-task" | "live-claim" | "changed" | "nothing" | "not-configured";
|
|
4242
3658
|
detail: string;
|
|
4243
3659
|
choices?: {
|
|
4244
3660
|
provider: string;
|
|
@@ -4247,9 +3663,8 @@ export declare class Store {
|
|
|
4247
3663
|
};
|
|
4248
3664
|
/** Store a task's size (v2 routing); the next scope filing routes by it. */
|
|
4249
3665
|
writeSizing(taskRef: number, sizing: TaskSizing): void;
|
|
4250
|
-
/** Planning follows the size
|
|
4251
|
-
*
|
|
4252
|
-
* risky one, or any task at elevated or high risk, asks for a plan. A
|
|
3666
|
+
/** Planning follows the size while nothing has run: a small change drops
|
|
3667
|
+
* a plan that is only requested; a large or risky one asks for a plan. A
|
|
4253
3668
|
* drafted plan is never discarded. */
|
|
4254
3669
|
private planToSizing;
|
|
4255
3670
|
/**
|
|
@@ -4294,11 +3709,9 @@ export declare class Store {
|
|
|
4294
3709
|
* phase's exact leg. A planner may also run under the working
|
|
4295
3710
|
* proposed route, or — with no scope yet — the live recommendation,
|
|
4296
3711
|
* re-derived here from durable state. Nothing else.
|
|
4297
|
-
* fallback —
|
|
4298
|
-
*
|
|
4299
|
-
*
|
|
4300
|
-
* legacy — only a row proven to predate routing, a task with no scope,
|
|
4301
|
-
* a tournament lane, or an attended session; never a routed row.
|
|
3712
|
+
* fallback — never (fallback chains were removed in v115).
|
|
3713
|
+
* legacy — only a row proven to predate routing or a task with no
|
|
3714
|
+
* scope; never a routed row.
|
|
4302
3715
|
*/
|
|
4303
3716
|
private routeAdmissionProblem;
|
|
4304
3717
|
/**
|
|
@@ -4337,41 +3750,6 @@ export declare class Store {
|
|
|
4337
3750
|
approvedRouteOf(taskId: string): PhaseRoute | null;
|
|
4338
3751
|
/** Pin a task's agent — the fire transaction's stamp; flags never override it. */
|
|
4339
3752
|
pinTaskAgent(taskRef: number, provider: string, model: string | null): void;
|
|
4340
|
-
/**
|
|
4341
|
-
* File a standing order, unapproved. The digest is computed by the caller
|
|
4342
|
-
* (routineDigestOf) from exactly the terms stored here; approval later
|
|
4343
|
-
* binds to it. Nothing fires until a person agrees to the template.
|
|
4344
|
-
*/
|
|
4345
|
-
createRoutine(spec: {
|
|
4346
|
-
name: string;
|
|
4347
|
-
repo: string;
|
|
4348
|
-
goal: string;
|
|
4349
|
-
outOfScope: string | null;
|
|
4350
|
-
touches: string[];
|
|
4351
|
-
acceptance: AcceptanceCriterion[];
|
|
4352
|
-
requirements: string[];
|
|
4353
|
-
schedule: string;
|
|
4354
|
-
singleFlight: boolean;
|
|
4355
|
-
costCeilingUsd: number | null;
|
|
4356
|
-
budgetPerRunMicrousd?: number | null;
|
|
4357
|
-
digest: string;
|
|
4358
|
-
/** Immutable provenance (v12), same contract as createConsoleTask's. */
|
|
4359
|
-
filedVia?: string;
|
|
4360
|
-
/** v102: who made it; its instances are filed as theirs. */
|
|
4361
|
-
createdBy?: string | null;
|
|
4362
|
-
/** v24: resolved at filing by the caller who computed the digest —
|
|
4363
|
-
* stored verbatim so digest and profile can never disagree. */
|
|
4364
|
-
profile?: ExecutionProfile;
|
|
4365
|
-
/** v48: the four-role route the digest binds, computed by the same
|
|
4366
|
-
* caller from the same configuration — stored verbatim. */
|
|
4367
|
-
route?: PhaseRoute;
|
|
4368
|
-
}, now: Date): {
|
|
4369
|
-
ok: true;
|
|
4370
|
-
id: number;
|
|
4371
|
-
} | {
|
|
4372
|
-
ok: false;
|
|
4373
|
-
reason: "duplicate";
|
|
4374
|
-
};
|
|
4375
3753
|
/**
|
|
4376
3754
|
* Set-once installation markers (v12). INSERT OR IGNORE is the whole
|
|
4377
3755
|
* contract: the first write wins forever, there is no update and no
|
|
@@ -4385,151 +3763,22 @@ export declare class Store {
|
|
|
4385
3763
|
isDemo(): boolean;
|
|
4386
3764
|
setSpendDefaults(defaults: {
|
|
4387
3765
|
buildPerRunMicrousd: number | null;
|
|
4388
|
-
racePerAgentMicrousd: number | null;
|
|
4389
|
-
raceTotalMicrousd: number | null;
|
|
4390
|
-
raceAgents?: number | null;
|
|
4391
3766
|
}, by: string, now: Date): void;
|
|
4392
3767
|
getSpendDefaults(): {
|
|
4393
3768
|
buildPerRunMicrousd: number | null;
|
|
4394
|
-
racePerAgentMicrousd: number | null;
|
|
4395
|
-
raceTotalMicrousd: number | null;
|
|
4396
|
-
raceAgents: number | null;
|
|
4397
3769
|
updatedBy: string;
|
|
4398
3770
|
} | null;
|
|
4399
|
-
/**
|
|
4400
|
-
* File a new terms row: the previous active row (if any) deactivates in
|
|
4401
|
-
* the same transaction — rows are immutable, the ACTIVE pointer moves.
|
|
4402
|
-
* Approval lands later, by the same ceremony that approves the scope.
|
|
4403
|
-
*/
|
|
4404
|
-
/** Withdraw the standing race: the row survives deactivated, exactly as
|
|
4405
|
-
* a superseding filing would leave it — the task returns to the ordinary
|
|
4406
|
-
* one-agent path. */
|
|
4407
|
-
retractTournamentTerms(taskRef: number): boolean;
|
|
4408
|
-
fileTournamentTerms(spec: {
|
|
4409
|
-
taskRef: number;
|
|
4410
|
-
/** v27: absent = 'race' (every historical caller). */
|
|
4411
|
-
kind?: "race" | "comparison";
|
|
4412
|
-
raceDigest: string;
|
|
4413
|
-
agents: {
|
|
4414
|
-
provider: string;
|
|
4415
|
-
model: string;
|
|
4416
|
-
repairModel: string;
|
|
4417
|
-
permissionMode?: UnattendedPermissionMode;
|
|
4418
|
-
}[];
|
|
4419
|
-
perAgentBudgetMicrousd: number;
|
|
4420
|
-
overrunReserveMicrousd: number;
|
|
4421
|
-
totalBudgetMicrousd: number;
|
|
4422
|
-
priceVersion: number;
|
|
4423
|
-
publicationPolicy: string;
|
|
4424
|
-
}, now: Date): number;
|
|
4425
|
-
activeTournamentTerms(taskRef: number): TournamentTerms | null;
|
|
4426
|
-
/** Approval persistence only — the restating ceremony wires in later. */
|
|
4427
|
-
approveTournamentTerms(id: number, by: string, sawDigest: string, now: Date): boolean;
|
|
4428
|
-
createContest(spec: {
|
|
4429
|
-
taskRef: number;
|
|
4430
|
-
terms: number;
|
|
4431
|
-
scopeDigest: string;
|
|
4432
|
-
raceDigest: string;
|
|
4433
|
-
kind?: "race" | "comparison";
|
|
4434
|
-
}, now: Date): number;
|
|
4435
|
-
getContest(id: number): Contest | null;
|
|
4436
|
-
/** The one non-finished tournament for a task, when one exists. */
|
|
4437
|
-
/** The newest tournament still owed to an operator — open states plus
|
|
4438
|
-
* the two that end with nothing pickable and wait for a human verdict. */
|
|
4439
|
-
contestNeedingOperator(taskRef: number): Contest | null;
|
|
4440
|
-
openContestFor(taskRef: number): Contest | null;
|
|
4441
|
-
/**
|
|
4442
|
-
* Every state change is a compare-and-swap on (state, generation): the
|
|
4443
|
-
* caller proves what it believes, the write bumps the generation, and
|
|
4444
|
-
* whichever of aggregation, reaping, or crash recovery loses the race
|
|
4445
|
-
* changes nothing (finding 17/27).
|
|
4446
|
-
*/
|
|
4447
|
-
casContestState(id: number, from: readonly ContestState[], to: ContestState, expectedGeneration: number): boolean;
|
|
4448
|
-
stampContestLease(id: number, leaseId: string, runner: string, incarnation: string | null): void;
|
|
4449
|
-
stampContestDispatch(id: number, baseSha: string, setupDigest: string | null): void;
|
|
4450
|
-
createContestants(contest: number, agents: {
|
|
4451
|
-
provider: string;
|
|
4452
|
-
model: string;
|
|
4453
|
-
repairModel: string;
|
|
4454
|
-
permissionMode?: UnattendedPermissionMode;
|
|
4455
|
-
branch: string;
|
|
4456
|
-
budgetMicrousd: number;
|
|
4457
|
-
reserveMicrousd: number;
|
|
4458
|
-
unknownSpend?: boolean;
|
|
4459
|
-
}[]): number[];
|
|
4460
|
-
/** The lane's CUMULATIVE wall clock across its whole lineage — main
|
|
4461
|
-
* attempt, resumes, and repair children (Phase 3 slice B, Codex
|
|
4462
|
-
* finding 1): three sealed clocks bound a comparison lane. */
|
|
4463
|
-
contestantCumulativeMs(contestantId: number): number;
|
|
4464
|
-
/** The lane's money and tokens across its WHOLE lineage — main attempt,
|
|
4465
|
-
* resumes, and repair children (Codex slice-B finding 6): a lane's cell
|
|
4466
|
-
* that reads only the newest run under-reports every park cycle. */
|
|
4467
|
-
contestantSpendRollup(contestantId: number): {
|
|
4468
|
-
costMicrousd: number;
|
|
4469
|
-
tokensIn: number;
|
|
4470
|
-
tokensOut: number;
|
|
4471
|
-
measuredRuns: number;
|
|
4472
|
-
totalRuns: number;
|
|
4473
|
-
};
|
|
4474
|
-
contestants(contest: number): Contestant[];
|
|
4475
|
-
getContestant(id: number): Contestant | null;
|
|
4476
|
-
casContestantState(id: number, from: readonly ContestantState[], to: ContestantState, expectedGeneration: number): boolean;
|
|
4477
|
-
/**
|
|
4478
|
-
* The exact authority a contest lane PRESENTS at admission (raw
|
|
4479
|
-
* authority repair): its race-approved profile's digest as a `legacy`
|
|
4480
|
-
* stamp, with the pair the lane spends as for the phase — the same
|
|
4481
|
-
* facts `startRun` re-proves against the lane before the row exists.
|
|
4482
|
-
* Null for no such lane.
|
|
4483
|
-
*/
|
|
4484
|
-
laneAuthorityFor(contestantId: number, phase?: "build" | "repair"): RouteStamp | null;
|
|
4485
|
-
releaseContestantRun(id: number, runId: number): void;
|
|
4486
|
-
setContestantWorktree(id: number, worktree: string): void;
|
|
4487
|
-
/** The lineage meter (finding 25 + round-2 finding on repairs): each
|
|
4488
|
-
* finished invocation settles ONCE, and the agent's total is the SUM
|
|
4489
|
-
* across its whole lineage — a park's spend and its resume's spend are
|
|
4490
|
-
* both real money. Accounted tracks at least the measured total. */
|
|
4491
|
-
recordContestantSpend(id: number, invocationMicrousd: number): void;
|
|
4492
|
-
/** A started invocation that never reported: the ledger charges the FULL
|
|
4493
|
-
* reservation — never the remaining amount — and says the real figure is
|
|
4494
|
-
* unknown (finding 25). Idempotent; never lowers a larger accounting. */
|
|
4495
|
-
latchContestantUnknownSpend(id: number): void;
|
|
4496
|
-
setContestantCustody(id: number, custody: string | null): void;
|
|
4497
|
-
/** The cleanup queue (stage 6): agents of DECIDED tournaments whose
|
|
4498
|
-
* checkouts still sit outside the pool. Terminal contest states only —
|
|
4499
|
-
* an undecided tournament's evidence is never touched. */
|
|
4500
|
-
contestantsForCleanup(): Contestant[];
|
|
4501
|
-
/** Exactly-once overdue escalation: the mark rides the page (stage 6). */
|
|
4502
|
-
markContestOverduePaged(contestId: number): boolean;
|
|
4503
|
-
/** The pick, stamped: who chose, when, and which agent won. */
|
|
4504
|
-
setContestWinner(contestId: number, contestantId: number, approver: string, now: Date): void;
|
|
4505
|
-
setContestantCleanup(id: number, cleanup: "pending" | "done" | "attention"): void;
|
|
4506
|
-
contestsInStates(states: readonly ContestState[]): Contest[];
|
|
4507
3771
|
/** The still-live claim behind a lease id, or null — recovery's question.
|
|
4508
3772
|
* The clock is INJECTED like everywhere else; SQL wall-clock time would
|
|
4509
3773
|
* silently disagree with every test's fixed timestamps. */
|
|
4510
3774
|
liveClaimByLease(leaseId: string, now: Date): {
|
|
4511
3775
|
leaseId: string;
|
|
4512
3776
|
} | null;
|
|
4513
|
-
/**
|
|
4514
|
-
* Close a racing agent's question WITHOUT answering it (the exclude
|
|
4515
|
-
* ceremony, round-3 finding 28): typed closure, never a fake option.
|
|
4516
|
-
* The caller owns authentication and the contestant's stop.
|
|
4517
|
-
*/
|
|
4518
|
-
excludeDecision(id: number, by: string, now: Date): boolean;
|
|
4519
|
-
/** A racing agent's answered-but-undelivered question, for the resume pass. */
|
|
4520
|
-
answeredDecisionForContestant(contestantId: number): number | null;
|
|
4521
|
-
/** A racing agent's one open (or expired-but-unanswered) question. */
|
|
4522
|
-
openDecisionForContestant(contestantId: number): number | null;
|
|
4523
|
-
/** Admission binds each reserved slot to its agent, so recovery can
|
|
4524
|
-
* find and free every one of them (nothing reserved is ever orphaned). */
|
|
4525
|
-
assignSlotContestant(slotId: number, contestantId: number): void;
|
|
4526
|
-
releaseSlotsForContest(contestId: number, now: Date): number;
|
|
4527
3777
|
reserveExecutionSlots(runner: string, count: number, now: Date): number[];
|
|
4528
3778
|
/** reserved → running happens in the stamp-before-spawn moment, carrying
|
|
4529
3779
|
* the process group so recovery can ask the OS before freeing capacity. */
|
|
4530
3780
|
markSlotRunning(id: number, facts: {
|
|
4531
3781
|
run: number;
|
|
4532
|
-
contestant?: number | null;
|
|
4533
3782
|
incarnation?: string | null;
|
|
4534
3783
|
processGroup?: number | null;
|
|
4535
3784
|
}, now: Date): boolean;
|
|
@@ -4537,7 +3786,6 @@ export declare class Store {
|
|
|
4537
3786
|
* root attempt. It may refresh only that attempt's exact occupied slot. */
|
|
4538
3787
|
refreshSlotProcess(id: number, facts: {
|
|
4539
3788
|
run: number;
|
|
4540
|
-
contestant?: number | null;
|
|
4541
3789
|
incarnation?: string | null;
|
|
4542
3790
|
processGroup: number;
|
|
4543
3791
|
}): boolean;
|
|
@@ -4672,7 +3920,7 @@ export declare class Store {
|
|
|
4672
3920
|
title: string;
|
|
4673
3921
|
repo: string | null;
|
|
4674
3922
|
}[];
|
|
4675
|
-
/** Whether any work was ever filed
|
|
3923
|
+
/** Whether any work was ever filed. */
|
|
4676
3924
|
hasAnyWork(): boolean;
|
|
4677
3925
|
/** Which door filed a task; null for history from before v12. */
|
|
4678
3926
|
/** The coordinator provenance label for a task — `mcp:<name>#<cid4>` —
|
|
@@ -4684,137 +3932,6 @@ export declare class Store {
|
|
|
4684
3932
|
filedAt: string | null;
|
|
4685
3933
|
} | null;
|
|
4686
3934
|
filedViaOf(taskId: string): string | null;
|
|
4687
|
-
getRoutine(id: number): Routine | null;
|
|
4688
|
-
routineByName(name: string): Routine | null;
|
|
4689
|
-
/** Every routine one view may see. NULL repo filter means "no filter". */
|
|
4690
|
-
listRoutines(repo: string | null, admitted?: string[] | null): Routine[];
|
|
4691
|
-
/**
|
|
4692
|
-
* Rewrite a template's terms. The new digest rides along, and the old
|
|
4693
|
-
* approval is kept — invalidated by the mismatch, exactly like a scope
|
|
4694
|
-
* edit, so the refusal can say "approved, then edited" rather than
|
|
4695
|
-
* "never approved". The firing transaction re-proves the match.
|
|
4696
|
-
*/
|
|
4697
|
-
updateRoutineTerms(id: number, terms: {
|
|
4698
|
-
goal: string;
|
|
4699
|
-
outOfScope: string | null;
|
|
4700
|
-
touches: string[];
|
|
4701
|
-
/** v39: absent leaves the stored rubric untouched (a caller editing
|
|
4702
|
-
* goal/touches without an opinion on acceptance); present REPLACES
|
|
4703
|
-
* it — never merged, so the digest the caller computed from these
|
|
4704
|
-
* exact terms is what ends up stored. */
|
|
4705
|
-
acceptance?: AcceptanceCriterion[];
|
|
4706
|
-
requirements: string[];
|
|
4707
|
-
schedule: string;
|
|
4708
|
-
costCeilingUsd: number | null;
|
|
4709
|
-
digest: string;
|
|
4710
|
-
/** v24: restatement carries the profile its digest binds. */
|
|
4711
|
-
profile?: ExecutionProfile | null;
|
|
4712
|
-
/** v48: restatement carries the route its digest binds; absent or
|
|
4713
|
-
* null leaves the stored route untouched. */
|
|
4714
|
-
route?: PhaseRoute | null;
|
|
4715
|
-
}, now: Date): boolean;
|
|
4716
|
-
/**
|
|
4717
|
-
* The approval stamp, raw. Callers own the ceremony — credential,
|
|
4718
|
-
* digest re-read, and the transaction — in approveRoutine (routine.ts).
|
|
4719
|
-
*/
|
|
4720
|
-
stampRoutineApproval(id: number, by: string, digest: string, nextFireAt: string, now: Date): void;
|
|
4721
|
-
/**
|
|
4722
|
-
* WITHDRAW an approval that no longer verifies (v48 authority repair): the refresh road
|
|
4723
|
-
* clears the approval's authority — its digest, its frozen snapshot, the
|
|
4724
|
-
* armed schedule — so a corrupt or never-taken snapshot cannot keep
|
|
4725
|
-
* reading as approved while the working agents happen to be unchanged.
|
|
4726
|
-
* `approved_at`/`approved_by` stay as history: the page reads "approved,
|
|
4727
|
-
* then refreshed — approve again", never "never approved".
|
|
4728
|
-
*/
|
|
4729
|
-
withdrawRoutineApproval(id: number, now: Date): boolean;
|
|
4730
|
-
/** Pausing is instant and needs no ceremony; resuming re-arms the schedule. */
|
|
4731
|
-
setRoutinePaused(id: number, paused: boolean, now: Date): boolean;
|
|
4732
|
-
/**
|
|
4733
|
-
* Routines a pass should try to fire: approved (digest intact), unpaused,
|
|
4734
|
-
* due, and placed in this pass's repository. Each candidate is re-proved
|
|
4735
|
-
* inside fireRoutine's own transaction — this list only nominates.
|
|
4736
|
-
*/
|
|
4737
|
-
dueRoutines(repo: string, now: Date): Routine[];
|
|
4738
|
-
/** The last firings, newest first — the board's run-history strip. */
|
|
4739
|
-
routineFires(routineId: number, limit?: number): (RoutineFire & {
|
|
4740
|
-
instanceTaskId: string | null;
|
|
4741
|
-
instanceState: string | null;
|
|
4742
|
-
})[];
|
|
4743
|
-
/**
|
|
4744
|
-
* What one routine's instances actually cost in a window, and whether any
|
|
4745
|
-
* paid run in it is unmeasured. NULL costs are counted, not summed over:
|
|
4746
|
-
* a sum that silently omits them reads as headroom that may not exist
|
|
4747
|
-
* (finding 5 — the arithmetic behind failing closed).
|
|
4748
|
-
*/
|
|
4749
|
-
routineSpend(routineId: number, sinceIso: string): {
|
|
4750
|
-
costUsd: number;
|
|
4751
|
-
unmeasuredRuns: number;
|
|
4752
|
-
totalRuns: number;
|
|
4753
|
-
};
|
|
4754
|
-
/**
|
|
4755
|
-
* The single-flight question: the oldest instance not successfully
|
|
4756
|
-
* completed nor explicitly abandoned — queued, running, held, parked,
|
|
4757
|
-
* and failed instances all block (finding 9's definition, verbatim).
|
|
4758
|
-
* A LIVE CLAIM blocks regardless of task state (Codex Phase C review,
|
|
4759
|
-
* H2): a state string written over a running build — `task state <id>
|
|
4760
|
-
* done` bypassing the guarded cancel — must not conjure a twin beside
|
|
4761
|
-
* a provider that is still spending.
|
|
4762
|
-
*/
|
|
4763
|
-
routineBlocker(routineId: number, now: Date): {
|
|
4764
|
-
taskId: string;
|
|
4765
|
-
state: string;
|
|
4766
|
-
} | null;
|
|
4767
|
-
/**
|
|
4768
|
-
* Whether a slot is still unrecorded. Only sound inside the fire
|
|
4769
|
-
* transaction — the IMMEDIATE lock is what makes read-then-insert atomic.
|
|
4770
|
-
*/
|
|
4771
|
-
routineSlotOpen(routineId: number, scheduledFor: string): boolean;
|
|
4772
|
-
/** Record one slot's outcome. False: the slot was already recorded — the caller lost the race. */
|
|
4773
|
-
recordRoutineFire(fire: {
|
|
4774
|
-
routineId: number;
|
|
4775
|
-
scheduledFor: string;
|
|
4776
|
-
outcome: "fired" | "skipped";
|
|
4777
|
-
reason: string | null;
|
|
4778
|
-
instanceTaskRef: number | null;
|
|
4779
|
-
}, now: Date): boolean;
|
|
4780
|
-
/** Advance the schedule. The fire transaction is the only caller. */
|
|
4781
|
-
setRoutineNextFire(id: number, nextFireAt: string, now: Date): void;
|
|
4782
|
-
/** Stamp which routine a task is an instance of. Set at spawn, never after. */
|
|
4783
|
-
linkRoutineInstance(taskRef: number, routineId: number): void;
|
|
4784
|
-
/**
|
|
4785
|
-
* Page a blocked track once per EPISODE: an open episode under this
|
|
4786
|
-
* prefix already nags, so nothing enqueues; a resolved one is history,
|
|
4787
|
-
* and the fresh suffix keys a new row past the dedupe uniqueness — a
|
|
4788
|
-
* recurrence after recovery pages again (Codex Phase C review, L1).
|
|
4789
|
-
* Prefix matching is exact-bytes (substr), never LIKE — task ids may
|
|
4790
|
-
* contain `_`, which LIKE would read as a wildcard.
|
|
4791
|
-
*/
|
|
4792
|
-
enqueueRoutineEpisode(prefix: string, notification: Omit<NotificationInput, "dedupeKey">, suffix: string, now: Date): boolean;
|
|
4793
|
-
/**
|
|
4794
|
-
* Close every blocked-track episode for a routine — called when a firing
|
|
4795
|
-
* succeeds, because success is the proof the blocker is gone (budget
|
|
4796
|
-
* cleared, blocking instance finished). Receipts stay; only the "wants a
|
|
4797
|
-
* person" bit resolves.
|
|
4798
|
-
*/
|
|
4799
|
-
resolveRoutineEpisodes(routineId: number, now: Date): void;
|
|
4800
|
-
/**
|
|
4801
|
-
* Everything the board's track rows need, in one snapshot: each routine
|
|
4802
|
-
* with its recent firings, its rolling-window spend, and the instance
|
|
4803
|
-
* blocking it, if any. The caller applies the ceiling row by row.
|
|
4804
|
-
*/
|
|
4805
|
-
routineTracks(repo: string | null, now: Date, admitted?: string[] | null): {
|
|
4806
|
-
routine: Routine;
|
|
4807
|
-
fires: ReturnType<Store["routineFires"]>;
|
|
4808
|
-
spend: {
|
|
4809
|
-
costUsd: number;
|
|
4810
|
-
unmeasuredRuns: number;
|
|
4811
|
-
totalRuns: number;
|
|
4812
|
-
};
|
|
4813
|
-
blocker: {
|
|
4814
|
-
taskId: string;
|
|
4815
|
-
state: string;
|
|
4816
|
-
} | null;
|
|
4817
|
-
}[];
|
|
4818
3935
|
/** The latest saved line for one approved check. Corrupt rows stay absent. */
|
|
4819
3936
|
checkProgress(run: number): CheckProgress | null;
|
|
4820
3937
|
/**
|
|
@@ -4847,8 +3964,8 @@ export declare class Store {
|
|
|
4847
3964
|
* not failed. Failures, refusals, parks, plans and reports already page
|
|
4848
3965
|
* through their own producers (build-failed, stalled, commit-failure,
|
|
4849
3966
|
* malformed-*, plan-ready, report-ready, fenced, external-closed) and are
|
|
4850
|
-
* not repeated here.
|
|
4851
|
-
*
|
|
3967
|
+
* not repeated here. Repair/correction children are the attempt's own
|
|
3968
|
+
* and say nothing on their own.
|
|
4852
3969
|
*/
|
|
4853
3970
|
private noteRunEnding;
|
|
4854
3971
|
/** True if this is a new fact; false if the episode already knows.
|
|
@@ -4869,13 +3986,6 @@ export declare class Store {
|
|
|
4869
3986
|
notificationById(id: number): Notification | null;
|
|
4870
3987
|
notificationsAfter(id: number, limit?: number): Notification[];
|
|
4871
3988
|
listNotifications(only?: "pending" | "all"): Notification[];
|
|
4872
|
-
recordDelivery(id: number, outcome: {
|
|
4873
|
-
ok: true;
|
|
4874
|
-
receipt: string | null;
|
|
4875
|
-
} | {
|
|
4876
|
-
ok: false;
|
|
4877
|
-
error: string;
|
|
4878
|
-
}, now: Date): void;
|
|
4879
3989
|
/**
|
|
4880
3990
|
* Close a gap's notification episode. Called when its capability verifies:
|
|
4881
3991
|
* the next failure is a *new* fact, and a dedupe key that suppressed it
|
|
@@ -4895,13 +4005,12 @@ export declare class Store {
|
|
|
4895
4005
|
* mid-flight, visible the next morning instead of vanished.
|
|
4896
4006
|
*
|
|
4897
4007
|
* THE GENERIC ADMISSION (atomic authority closure) opens exactly four
|
|
4898
|
-
* shapes: an ordinary builder (no parent, no lane,
|
|
4899
|
-
* authorization on its task), a planner (optionally continuing its own
|
|
4008
|
+
* shapes: an ordinary builder (no parent, no lane), a planner (optionally continuing its own
|
|
4900
4009
|
* same-task planner run), a scout, and a ROOT reviewer answering an open
|
|
4901
4010
|
* review request. Every other shape has its own admission that proves
|
|
4902
4011
|
* and consumes or binds its exact authority in one transaction —
|
|
4903
|
-
* `admitRepair`, `
|
|
4904
|
-
* `admitRecoveredBuilder
|
|
4012
|
+
* `admitRepair`, `admitCorrection`,
|
|
4013
|
+
* `admitRecoveredBuilder` — and this road refuses it in
|
|
4905
4014
|
* words before any row exists. Every run PRESENTS its route authority: a
|
|
4906
4015
|
* task with no scope presents the bare word `legacy` for the exact pair
|
|
4907
4016
|
* it spends as; nothing opens unstamped anywhere.
|
|
@@ -4922,20 +4031,6 @@ export declare class Store {
|
|
|
4922
4031
|
* a caller can spread the authority it resolved; absent at runtime
|
|
4923
4032
|
* it refuses in words. */
|
|
4924
4033
|
route?: RouteStamp;
|
|
4925
|
-
/** v48 authority repair: how this run takes fallback-chain custody, proved and
|
|
4926
|
-
* persisted in this same insert — `base` opens the task's cycle at
|
|
4927
|
-
* the approved chain's first entry (inert without a chain approval),
|
|
4928
|
-
* `resume` takes a parked BASE tail's custody through the proven
|
|
4929
|
-
* transfer. A binding that cannot be proved rolls the insert back.
|
|
4930
|
-
* Builder-only: no other role takes custody. Every run bound to a
|
|
4931
|
-
* NON-primary entry — the entry's own admission, a parked tail's
|
|
4932
|
-
* successor, a repair turn — is admitted by admitFallback alone. */
|
|
4933
|
-
custody?: {
|
|
4934
|
-
kind: "base";
|
|
4935
|
-
} | {
|
|
4936
|
-
kind: "resume";
|
|
4937
|
-
parkedRun: number;
|
|
4938
|
-
};
|
|
4939
4034
|
now: Date;
|
|
4940
4035
|
} & ({
|
|
4941
4036
|
role?: "builder" | "planner" | "scout";
|
|
@@ -4963,12 +4058,7 @@ export declare class Store {
|
|
|
4963
4058
|
* this task's, is a builder, is still open, and this turn runs under
|
|
4964
4059
|
* the parent's own runner and lease — which must be the task's CURRENT
|
|
4965
4060
|
* live claim, on the runner that claim names (repair custody closure:
|
|
4966
|
-
* the
|
|
4967
|
-
* attended parent's authorization
|
|
4968
|
-
* must have spent its one attempt on that parent; a racing lane's
|
|
4969
|
-
* parent must be the lane's live run; a chain-bound parent must be the
|
|
4970
|
-
* live base tail (a fallback entry's repair is admitFallback's). The
|
|
4971
|
-
* stamp is the repair leg of the authority the parent spent under.
|
|
4061
|
+
* the exact claim tuple). The stamp is the repair leg of the authority the parent spent under.
|
|
4972
4062
|
* Value-shaped: a refusal names its reason and leaves zero rows.
|
|
4973
4063
|
*/
|
|
4974
4064
|
admitRepair(run: {
|
|
@@ -4990,41 +4080,6 @@ export declare class Store {
|
|
|
4990
4080
|
ok: false;
|
|
4991
4081
|
problem: string;
|
|
4992
4082
|
};
|
|
4993
|
-
/**
|
|
4994
|
-
* THE ATTENDED ADMISSION (atomic authority closure): one watched attempt
|
|
4995
|
-
* opens under exactly ONE live authorization the caller names — open on
|
|
4996
|
-
* this task, unexpired, unspent, minted for this runner at this
|
|
4997
|
-
* generation, pinning a readable profile the stamp restates as its
|
|
4998
|
-
* legacy authority; a continuation names the finished parent the
|
|
4999
|
-
* authorization continues, nothing else names a parent. The insert
|
|
5000
|
-
* binds the row to the authorization and CONSUMES its one attempt in
|
|
5001
|
-
* the same transaction: `run.attended_authorization` and
|
|
5002
|
-
* `authorization.attempt_run` move together or not at all.
|
|
5003
|
-
*/
|
|
5004
|
-
admitAttended(run: {
|
|
5005
|
-
taskRef: number;
|
|
5006
|
-
leaseId: string;
|
|
5007
|
-
runner: string;
|
|
5008
|
-
branch: string;
|
|
5009
|
-
worktree: string;
|
|
5010
|
-
provider: string;
|
|
5011
|
-
model?: string;
|
|
5012
|
-
sessionId?: string;
|
|
5013
|
-
parentRun?: number;
|
|
5014
|
-
authorization: {
|
|
5015
|
-
id: string;
|
|
5016
|
-
runner: string;
|
|
5017
|
-
generation: number;
|
|
5018
|
-
};
|
|
5019
|
-
route: RouteStamp;
|
|
5020
|
-
now: Date;
|
|
5021
|
-
}): {
|
|
5022
|
-
ok: true;
|
|
5023
|
-
runId: number;
|
|
5024
|
-
} | {
|
|
5025
|
-
ok: false;
|
|
5026
|
-
problem: string;
|
|
5027
|
-
};
|
|
5028
4083
|
/**
|
|
5029
4084
|
* THE CORRECTION ADMISSION (atomic authority closure): a reviewer
|
|
5030
4085
|
* correction continues a LIVE root review in the SAME session — the
|
|
@@ -5051,37 +4106,6 @@ export declare class Store {
|
|
|
5051
4106
|
ok: false;
|
|
5052
4107
|
problem: string;
|
|
5053
4108
|
};
|
|
5054
|
-
/**
|
|
5055
|
-
* THE CONTEST LANE ADMISSION (atomic authority closure): a racing agent's
|
|
5056
|
-
* run opens on ITS lane, in a contest still dispatching or racing, under
|
|
5057
|
-
* the contest's live custody — the caller's lease, runner, and watch
|
|
5058
|
-
* incarnation are exactly the ones the contest was stamped with — and it
|
|
5059
|
-
* presents the lane's STORED sealed profile as its legacy authority: no
|
|
5060
|
-
* synthesized profile, no other digest. The lane's pointer moves to the
|
|
5061
|
-
* row inside the insert (from free, or from the parked attempt this run
|
|
5062
|
-
* resumes); a lane that moved rolls the row back.
|
|
5063
|
-
*/
|
|
5064
|
-
admitContestLane(run: {
|
|
5065
|
-
taskRef: number;
|
|
5066
|
-
leaseId: string;
|
|
5067
|
-
runner: string;
|
|
5068
|
-
incarnation: string | null;
|
|
5069
|
-
branch: string;
|
|
5070
|
-
worktree: string;
|
|
5071
|
-
provider: string;
|
|
5072
|
-
model?: string;
|
|
5073
|
-
sessionId?: string;
|
|
5074
|
-
contestant: number;
|
|
5075
|
-
parentRun?: number;
|
|
5076
|
-
route: RouteStamp;
|
|
5077
|
-
now: Date;
|
|
5078
|
-
}): {
|
|
5079
|
-
ok: true;
|
|
5080
|
-
runId: number;
|
|
5081
|
-
} | {
|
|
5082
|
-
ok: false;
|
|
5083
|
-
problem: string;
|
|
5084
|
-
};
|
|
5085
4109
|
/**
|
|
5086
4110
|
* THE RECOVERED-DRAFT ADMISSION (atomic authority closure): a fresh
|
|
5087
4111
|
* builder attempt that inherits an INTERRUPTED attempt's draft names it
|
|
@@ -5101,12 +4125,6 @@ export declare class Store {
|
|
|
5101
4125
|
model?: string;
|
|
5102
4126
|
sessionId?: string;
|
|
5103
4127
|
recoveredFrom: number;
|
|
5104
|
-
custody?: {
|
|
5105
|
-
kind: "base";
|
|
5106
|
-
} | {
|
|
5107
|
-
kind: "resume";
|
|
5108
|
-
parkedRun: number;
|
|
5109
|
-
};
|
|
5110
4128
|
route: RouteStamp;
|
|
5111
4129
|
now: Date;
|
|
5112
4130
|
}): {
|
|
@@ -5121,22 +4139,17 @@ export declare class Store {
|
|
|
5121
4139
|
private admission;
|
|
5122
4140
|
private admitRun;
|
|
5123
4141
|
/**
|
|
5124
|
-
* THE CURRENT CLAIM, exactly (final admission closure):
|
|
5125
|
-
*
|
|
5126
|
-
*
|
|
5127
|
-
*
|
|
5128
|
-
*
|
|
5129
|
-
*
|
|
5130
|
-
* expired, or superseded by a newer generation, or a claim another
|
|
5131
|
-
* machine holds admits nothing: the words say which, and no cycle,
|
|
5132
|
-
* edge, tail, or claim moves. Shared by the fallback road, the primary
|
|
5133
|
-
* repair road, and the generic road's custody so all refuse in the
|
|
5134
|
-
* same words.
|
|
4142
|
+
* THE CURRENT CLAIM, exactly (final admission closure): a repair turn
|
|
4143
|
+
* proves in its own transaction that the run it opens is the task's,
|
|
4144
|
+
* under the lease that holds the task RIGHT NOW, on the runner that
|
|
4145
|
+
* claim names. A lease nobody holds, one released, expired, or
|
|
4146
|
+
* superseded by a newer generation, or a claim another machine holds
|
|
4147
|
+
* admits nothing: the words say which.
|
|
5135
4148
|
*/
|
|
5136
4149
|
private custodyClaimProblem;
|
|
5137
4150
|
/**
|
|
5138
4151
|
* THE ONE RECOVERY GRANT (final authority closure), shared by the
|
|
5139
|
-
* recovered-draft admission
|
|
4152
|
+
* recovered-draft admission's `recoveredFrom`:
|
|
5140
4153
|
* the interrupted attempt whose draft a fresh run inherits is THIS
|
|
5141
4154
|
* task's own builder or repair turn, left in this very worktree on this
|
|
5142
4155
|
* branch, either ended as `failed` for `interrupted` (or `no-handoff`) or still open under
|
|
@@ -5146,25 +4159,15 @@ export declare class Store {
|
|
|
5146
4159
|
* say which, and the caller opens nothing.
|
|
5147
4160
|
*/
|
|
5148
4161
|
private recoveryGrantProblem;
|
|
5149
|
-
/**
|
|
5150
|
-
* Whether `holder` is the LIVE tail of its task's open fallback cycle
|
|
5151
|
-
* under the approved chain — the words when it is not (v48 integrity).
|
|
5152
|
-
* Re-derived from durable state only: the task's one live cycle is the
|
|
5153
|
-
* holder's cycle, open, its cursor at the holder's index, the holder as
|
|
5154
|
-
* its tail, its digest the approved chain's, and the approved entry at
|
|
5155
|
-
* that index carrying exactly the holder's digest and auth mode.
|
|
5156
|
-
*/
|
|
5157
|
-
private liveTailProblem;
|
|
5158
4162
|
/**
|
|
5159
4163
|
* THE WORKING PLAN AUTHORITY (final authority closure): the route a
|
|
5160
4164
|
* planner runs under before any approval, believed only as the ONE strict
|
|
5161
4165
|
* stored-scope projection proves it — exact raw terms (a proposed-via
|
|
5162
4166
|
* marker this code never writes is a terms problem), a resolved profile,
|
|
5163
|
-
* a
|
|
5164
|
-
* readable route whose build and repair legs are the profile's exact
|
|
4167
|
+
* a readable route whose build and repair legs are the profile's exact
|
|
5165
4168
|
* pairs and whose signed risk and quality are the row's, the digest
|
|
5166
4169
|
* re-derived from those very values, the operator's live auth mode read
|
|
5167
|
-
* strictly
|
|
4170
|
+
* strictly, and no leg
|
|
5168
4171
|
* stating a problem. The claim, the admission, and the invocation all
|
|
5169
4172
|
* ask this same question; one disagreement is the words, and nothing
|
|
5170
4173
|
* opens or spawns on it. A sealed route is not this road's business —
|
|
@@ -5195,8 +4198,7 @@ export declare class Store {
|
|
|
5195
4198
|
* The exact route authority a task holds for one run, in the caller's
|
|
5196
4199
|
* hands (v48 authority repair): the sealed route's leg for the run's phase when the
|
|
5197
4200
|
* approval stands; the working proposed route's plan leg for a planner
|
|
5198
|
-
* before any approval
|
|
5199
|
-
* entry's `fallback` provenance for its phase. The store never applies
|
|
4201
|
+
* before any approval. The store never applies
|
|
5200
4202
|
* this on a caller's behalf — `startRun` requires the caller to PRESENT
|
|
5201
4203
|
* it and proves the presented stamp against the same durable state, so
|
|
5202
4204
|
* a caller that holds no authority opens nothing. Null when the task is
|
|
@@ -5204,10 +4206,7 @@ export declare class Store {
|
|
|
5204
4206
|
* scope — those roads stamp when they spend); the words when the task
|
|
5205
4207
|
* is routed and nothing could govern the run.
|
|
5206
4208
|
*/
|
|
5207
|
-
routeAuthorityFor(taskRef: number, role: Run["role"] | "scout",
|
|
5208
|
-
index: number;
|
|
5209
|
-
entryDigest: string;
|
|
5210
|
-
} | null,
|
|
4209
|
+
routeAuthorityFor(taskRef: number, role: Run["role"] | "scout",
|
|
5211
4210
|
/** What the run would spend as, for the roads no profile governs: the
|
|
5212
4211
|
* bare word `legacy` on a task with no scope, and the plan/review
|
|
5213
4212
|
* pair of a pre-routing row (its profile names only build and
|
|
@@ -5287,8 +4286,7 @@ export declare class Store {
|
|
|
5287
4286
|
committed?: boolean;
|
|
5288
4287
|
now: Date;
|
|
5289
4288
|
/** v52: how this ending settles a pending operator stop on the run,
|
|
5290
|
-
* when one stands. The fenced interruption seal
|
|
5291
|
-
* name their own word; every other road settles it as `finished` —
|
|
4289
|
+
* when one stands. The fenced interruption seal names its own word; every other road settles it as `finished` —
|
|
5292
4290
|
* the attempt reached this ending first, and its outcome stands. */
|
|
5293
4291
|
stopSettlement?: StopSettlement;
|
|
5294
4292
|
}): void;
|
|
@@ -5309,15 +4307,12 @@ export declare class Store {
|
|
|
5309
4307
|
*/
|
|
5310
4308
|
stampProviderStart(id: number, now: Date, providerVersion?: string): void;
|
|
5311
4309
|
/**
|
|
5312
|
-
* The gateway's honest disposal record
|
|
5313
|
-
*
|
|
5314
|
-
*
|
|
5315
|
-
*
|
|
5316
|
-
*
|
|
5317
|
-
*
|
|
5318
|
-
* attempt (usually 'unknown'/'not-exhausted', since the recognizers ship
|
|
5319
|
-
* empty), and it authorizes NOTHING on its own — the dispatch's C8 gate
|
|
5320
|
-
* re-proves hasRecognizer before any advance ever reads it.
|
|
4310
|
+
* The gateway's honest disposal record (E2): how this attempt
|
|
4311
|
+
* authenticated, and the class its terminal fell into. Recorded where the
|
|
4312
|
+
* evidence still exists — the gateway holds the structural terminal and
|
|
4313
|
+
* the auth mode — and NEVER re-derived in disposal, by which time the
|
|
4314
|
+
* structural signal is gone. `auth-expired` pauses its provider; every
|
|
4315
|
+
* other class is observational.
|
|
5321
4316
|
*/
|
|
5322
4317
|
stampTerminalClass(id: number, authMode: "subscription" | "api-key", terminalClass: TerminalClass): void;
|
|
5323
4318
|
/** The race-refusal stamp (Phase 3 C5): the version that was REFUSED,
|
|
@@ -5363,14 +4358,12 @@ export declare class Store {
|
|
|
5363
4358
|
setOrgPolicy(policy: OrgPolicy, by: string, now: Date): SavedPolicy;
|
|
5364
4359
|
/** The policy's changes, newest first, from the action ledger. */
|
|
5365
4360
|
policyHistory(limit?: number): LedgerEntry[];
|
|
5366
|
-
/** Why the policy stops a task's approved terms (its profile, every
|
|
4361
|
+
/** Why the policy stops a task's approved terms (its profile, every routed leg), or null. */
|
|
5367
4362
|
scopePolicyRefusal(taskId: string): string | null;
|
|
5368
4363
|
/** Why the policy stops an agent on a provider and model now, or null (chats, teammates, flow steps). */
|
|
5369
4364
|
agentPolicyRefusal(provider: string, model: string | null): string | null;
|
|
5370
4365
|
/** Why the policy stops a planner, scout or native coding session (no profile to lower) on a provider and model, or null. */
|
|
5371
4366
|
sessionPolicyRefusal(provider: string, model: string | null, what: string): string | null;
|
|
5372
|
-
/** Why the policy stops an attended session's signed profile, or null (it is never lowered: see policy.attendedRefusal). */
|
|
5373
|
-
attendedPolicyRefusal(profile: ExecutionProfile): string | null;
|
|
5374
4367
|
/** The policy's word on a profile about to run: refused, or what runs (lowered under the ceiling, with words). */
|
|
5375
4368
|
runPolicy(profile: ExecutionProfile): ReturnType<typeof underCeiling>;
|
|
5376
4369
|
/** The budgets in force. */
|
|
@@ -5526,8 +4519,6 @@ export declare class Store {
|
|
|
5526
4519
|
recommendation: string;
|
|
5527
4520
|
assignee?: string;
|
|
5528
4521
|
deadline?: string;
|
|
5529
|
-
/** Which racing agent asked (v14); absent = ordinary. */
|
|
5530
|
-
contestant?: number;
|
|
5531
4522
|
}, now: Date): number;
|
|
5532
4523
|
getDecision(id: number): Decision | null;
|
|
5533
4524
|
decisionForRun(run: number): Decision | null;
|
|
@@ -5665,223 +4656,21 @@ export declare class Store {
|
|
|
5665
4656
|
attachAnswers(runId: number, taskRef: number): (Decision & {
|
|
5666
4657
|
taskId: string;
|
|
5667
4658
|
})[];
|
|
5668
|
-
/**
|
|
5669
|
-
* Mint one attended authorization. Expired predecessors are closed in the
|
|
5670
|
-
* SAME transaction (end reason 'expired'); a live one refuses — revoke
|
|
5671
|
-
* first, never silently supersede a signature.
|
|
5672
|
-
*/
|
|
5673
|
-
mintAttendedAuthorization(input: {
|
|
5674
|
-
id: string;
|
|
5675
|
-
taskRef: number;
|
|
5676
|
-
approver: string;
|
|
5677
|
-
runner: string;
|
|
5678
|
-
runnerGeneration: number;
|
|
5679
|
-
compositeDigest: string;
|
|
5680
|
-
termsJson: string;
|
|
5681
|
-
maxSessionTurns: number;
|
|
5682
|
-
budgetMicrousd: number;
|
|
5683
|
-
parentRun?: number | null;
|
|
5684
|
-
followup?: string | null;
|
|
5685
|
-
absoluteExpiry: string;
|
|
5686
|
-
/** Quick mint (C2/M4): the mode signature substitutes for the
|
|
5687
|
-
* per-mint password — RE-PROVED here, in the mint transaction
|
|
5688
|
-
* itself, never a pre-checked flag: the mode must be live, its
|
|
5689
|
-
* digest exact, and the minting approver must BE the signer. */
|
|
5690
|
-
basis?: {
|
|
5691
|
-
kind: "mode";
|
|
5692
|
-
digest: string;
|
|
5693
|
-
};
|
|
5694
|
-
now: Date;
|
|
5695
|
-
}, mutation?: Mutation): {
|
|
5696
|
-
ok: true;
|
|
5697
|
-
authorization: AttendedAuthorization;
|
|
5698
|
-
} | {
|
|
5699
|
-
ok: false;
|
|
5700
|
-
reason: "authorization-open" | "mode-ended" | "approval-rules";
|
|
5701
|
-
};
|
|
5702
|
-
/** Close every authorization past its absolute expiry (round-6 finding
|
|
5703
|
-
* 8): the durable closure the gates and the partial unique rely on —
|
|
5704
|
-
* an expired corpse must not keep a task locked to its named runner. */
|
|
5705
|
-
sweepExpiredAuthorizations(now: Date): number;
|
|
5706
|
-
readAuthorization(id: string): AttendedAuthorization | null;
|
|
5707
|
-
/** Open continuation authorizations named to this runner (Phase 2E, A4):
|
|
5708
|
-
* unconsumed, carrying a parent attempt — tick's continuation pass reads
|
|
5709
|
-
* this; liveness is the caller's check, as everywhere. */
|
|
5710
|
-
openContinuationAuthorizations(runner: string): AttendedAuthorization[];
|
|
5711
|
-
/**
|
|
5712
|
-
* Why a finished run cannot be continued right now, in words — or null.
|
|
5713
|
-
* The ENUMERATED non-terminal publication states (round-3 R7 demanded
|
|
5714
|
-
* the concrete list, not "open intents"): a publication still moving
|
|
5715
|
-
* ('intended','pushed', or 'opened' with the remote not yet settled) and
|
|
5716
|
-
* a merge intent still live ('pending','claimed') both block.
|
|
5717
|
-
*/
|
|
5718
|
-
continuationBlockOf(runId: number): string | null;
|
|
5719
|
-
/** The one OPEN authorization for a task, or null. */
|
|
5720
|
-
openAuthorizationFor(taskRef: number): AttendedAuthorization | null;
|
|
5721
|
-
/**
|
|
5722
|
-
* One durable liveness beat. The DURABLE COLUMN IS THE AUTHORITATIVE
|
|
5723
|
-
* CLOCK; the only suppressed writes are duplicate-tab beats landing
|
|
5724
|
-
* within 5 seconds of the stored value, so observed grace never shrinks
|
|
5725
|
-
* below 40 of the nominal 45 seconds.
|
|
5726
|
-
*/
|
|
5727
|
-
beatAuthorization(id: string, now: Date): boolean;
|
|
5728
|
-
/** Explicit terminal closure — run end, expiry, or revocation. CAS on open. */
|
|
5729
|
-
closeAuthorization(id: string, endReason: string, now: Date): boolean;
|
|
5730
|
-
/**
|
|
5731
|
-
* Money already committed against an authorization: settled and uncertain
|
|
5732
|
-
* turns at their accounted charge, plus the live reservation of any
|
|
5733
|
-
* unsettled turn. The budget gate reads THIS, never run.cost_usd.
|
|
5734
|
-
*/
|
|
5735
|
-
authorizationSpendMicrousd(id: string): number;
|
|
5736
|
-
/**
|
|
5737
|
-
* Record one turn — the gate where the cap, the single-flight rule, the
|
|
5738
|
-
* budget reservation, the lease re-proof, and the open-decision rule all
|
|
5739
|
-
* hold or refuse ATOMICALLY (v6 W6: a fenced coordinator fails inside
|
|
5740
|
-
* this transaction, not at its next poll). For 'answer' turns the
|
|
5741
|
-
* delivery-CAS on decision.delivered_turn happens here; run_decision
|
|
5742
|
-
* attaches only at ACCEPTANCE (v6 W5).
|
|
5743
|
-
*/
|
|
5744
|
-
recordSessionTurn(input: {
|
|
5745
|
-
run: number;
|
|
5746
|
-
sourceKind: SessionTurn["sourceKind"];
|
|
5747
|
-
sourceId?: number | null;
|
|
5748
|
-
author?: string | null;
|
|
5749
|
-
text: string;
|
|
5750
|
-
repairLimit?: number;
|
|
5751
|
-
now: Date;
|
|
5752
|
-
}): {
|
|
5753
|
-
ok: true;
|
|
5754
|
-
turn: SessionTurn;
|
|
5755
|
-
} | {
|
|
5756
|
-
ok: false;
|
|
5757
|
-
reason: RecordTurnRefusal;
|
|
5758
|
-
};
|
|
5759
|
-
/** Answered decisions on a held run whose answer has not yet been
|
|
5760
|
-
* injected — the coordinator's per-pulse scan (v3 R3). */
|
|
5761
|
-
undeliveredDecisionsOf(run: number): Decision[];
|
|
5762
|
-
readSessionTurn(id: number): SessionTurn | null;
|
|
5763
|
-
sessionTurnsOf(run: number): SessionTurn[];
|
|
5764
|
-
/** Bytes flushed to stdin. Write success is NOT acceptance (spike fact 5). */
|
|
5765
|
-
markTurnWritten(id: number, now: Date): boolean;
|
|
5766
|
-
/**
|
|
5767
|
-
* Bind pending answers to the BRIEF turn (round-6 finding 2): a held
|
|
5768
|
-
* build's brief carries every answered-but-undelivered decision, and the
|
|
5769
|
-
* builder's ordinary pre-spawn attach would claim delivery the agent
|
|
5770
|
-
* never proved. The pre-attached run_decision rows are WITHDRAWN here and
|
|
5771
|
-
* each decision's delivery-CAS points at the brief turn — run_decision
|
|
5772
|
-
* re-attaches only at that turn's acceptance, exactly like answer turns.
|
|
5773
|
-
*/
|
|
5774
|
-
bindBriefDeliveries(runId: number, briefTurn: number, decisionIds: readonly number[]): void;
|
|
5775
|
-
/**
|
|
5776
|
-
* Acceptance — THIS turn's system/init (or its result, retroactively).
|
|
5777
|
-
* This is also where run_decision attaches, for EVERY decision whose
|
|
5778
|
-
* delivery-CAS points at this turn (answer turns claim one at recording;
|
|
5779
|
-
* a brief turn claims every pending answer it carried): delivery is
|
|
5780
|
-
* claimed only once the agent provably received the words (v6 W5).
|
|
5781
|
-
*/
|
|
5782
|
-
markTurnAccepted(id: number, now: Date): boolean;
|
|
5783
|
-
private attachDeliveriesOf;
|
|
5784
|
-
/**
|
|
5785
|
-
* Settle a turn from its result. The provider's totals are CUMULATIVE per
|
|
5786
|
-
* process, so the measured charge is the marginal delta from the held
|
|
5787
|
-
* session's durable baseline, advanced here atomically. A missing or
|
|
5788
|
-
* regressing total is a TELEMETRY FAILURE: the turn settles uncertain at
|
|
5789
|
-
* its reservation, the baseline stays, and the caller must end the hold.
|
|
5790
|
-
* Run aggregates gain the same delta so attended spend never disappears
|
|
5791
|
-
* from routine reporting (v3 R4).
|
|
5792
|
-
*/
|
|
5793
|
-
settleTurn(id: number, result: {
|
|
5794
|
-
cumulativeMicrousd: number | null;
|
|
5795
|
-
outputTokens: number | null;
|
|
5796
|
-
now: Date;
|
|
5797
|
-
}): {
|
|
5798
|
-
ok: true;
|
|
5799
|
-
measuredMicrousd: number;
|
|
5800
|
-
} | {
|
|
5801
|
-
ok: false;
|
|
5802
|
-
reason: "telemetry" | "not-unsettled";
|
|
5803
|
-
};
|
|
5804
|
-
/**
|
|
5805
|
-
* Terminal conservative settlement on process exit (ruling 15).
|
|
5806
|
-
* 'cancelled' = recorded but never written: charged zero. 'uncertain' =
|
|
5807
|
-
* written or accepted but never proven settled: charged its reservation.
|
|
5808
|
-
* A turn that never reached ACCEPTANCE reverts its delivery claim so the
|
|
5809
|
-
* ordinary road can deliver the answer later (v6 W5); an accepted turn
|
|
5810
|
-
* keeps its attach — acceptance is the proof.
|
|
5811
|
-
*/
|
|
5812
|
-
settleTurnTerminal(id: number, terminal: "uncertain" | "cancelled", now: Date): boolean;
|
|
5813
|
-
private chargeRunAggregates;
|
|
5814
|
-
/**
|
|
5815
|
-
* Custody intent — INSERTed in the final dispatch-proof transaction,
|
|
5816
|
-
* before spawn. The run-held partial unique refuses a
|
|
5817
|
-
* second hold typed, not by accident.
|
|
5818
|
-
*/
|
|
5819
|
-
openHeldSession(input: {
|
|
5820
|
-
run: number;
|
|
5821
|
-
authorizationId: string;
|
|
5822
|
-
runner: string;
|
|
5823
|
-
leaseId: string;
|
|
5824
|
-
upIncarnation: string;
|
|
5825
|
-
cookie: string;
|
|
5826
|
-
socketPath: string;
|
|
5827
|
-
now: Date;
|
|
5828
|
-
}): {
|
|
5829
|
-
ok: true;
|
|
5830
|
-
} | {
|
|
5831
|
-
ok: false;
|
|
5832
|
-
reason: "run-held";
|
|
5833
|
-
};
|
|
5834
|
-
/** Stamp pids after spawn. False = the row closed underneath the spawn — kill the child. */
|
|
5835
|
-
stampHeldSession(run: number, supervisorPid: number, agentPgid: number): boolean;
|
|
5836
|
-
heldSessionOf(run: number): HeldSession | null;
|
|
5837
|
-
/** Every un-ended custody row — the fence sweep's and hard-stop's read. */
|
|
5838
|
-
/** The durable session gauge (v28): open custody rows for this runner —
|
|
5839
|
-
* a restarted `up` with orphans pending must count them, so the
|
|
5840
|
-
* in-process map is never the truth. */
|
|
5841
|
-
openHeldSessionCount(runner: string): number;
|
|
5842
|
-
/** Every open authorization on this runner — the beat-all's worklist. */
|
|
5843
|
-
openAuthorizationsOf(runner: string): AttendedAuthorization[];
|
|
5844
|
-
openHeldSessions(): HeldSession[];
|
|
5845
|
-
/** Ordinary close by the owning coordinator. CAS on un-ended. */
|
|
5846
|
-
endHeldSession(run: number, endReason: string, now: Date): boolean;
|
|
5847
|
-
/**
|
|
5848
|
-
* SEIZE custody for fencing (v6, after v4 Q5): CAS open→fencing AND fence
|
|
5849
|
-
* the recorded lease in ONE transaction, so a wedged owner's heartbeat
|
|
5850
|
-
* revival and every later coordinator write fail before any kill happens.
|
|
5851
|
-
*/
|
|
5852
|
-
seizeHeldSession(run: number, fencer: string, deadline: Date, now: Date): {
|
|
5853
|
-
ok: true;
|
|
5854
|
-
session: HeldSession;
|
|
5855
|
-
} | {
|
|
5856
|
-
ok: false;
|
|
5857
|
-
reason: "not-open";
|
|
5858
|
-
};
|
|
5859
|
-
/**
|
|
5860
|
-
* Take over a fencing operation whose owner went quiet (v5 P3): CAS on
|
|
5861
|
-
* the EXPIRED deadline. A loser stops only while a live fencer owns it.
|
|
5862
|
-
*/
|
|
5863
|
-
takeoverHeldFencing(run: number, fencer: string, deadline: Date, now: Date): boolean;
|
|
5864
|
-
/** Re-arm the fencing deadline while the work continues. Owner-CASed. */
|
|
5865
|
-
renewHeldFencing(run: number, fencer: string, deadline: Date): boolean;
|
|
5866
|
-
/** Final close of a fenced session — owner-CASed, after kill + settlement. */
|
|
5867
|
-
closeHeldFencing(run: number, fencer: string, endReason: string, now: Date): boolean;
|
|
5868
4659
|
/**
|
|
5869
4660
|
* File one steering note (arc 1). Validation is validateNote EXACTLY —
|
|
5870
|
-
* no bespoke rule — and filing refuses on finished tasks
|
|
5871
|
-
* tournaments (contestants share a task; all-racer delivery is a future
|
|
5872
|
-
* many-to-many, not a silent single-racer lie).
|
|
4661
|
+
* no bespoke rule — and filing refuses on finished tasks.
|
|
5873
4662
|
*/
|
|
5874
4663
|
fileSteerNote(taskId: string, author: VerifiedAuthor, note: string, now: Date, mutation?: Mutation): {
|
|
5875
4664
|
ok: true;
|
|
5876
4665
|
id: number;
|
|
5877
4666
|
} | {
|
|
5878
4667
|
ok: false;
|
|
5879
|
-
reason: "unknown-task" | "task-finished" | "
|
|
4668
|
+
reason: "unknown-task" | "task-finished" | "invalid-note";
|
|
5880
4669
|
problem?: string;
|
|
5881
4670
|
};
|
|
5882
4671
|
/** Every steering note of a task, filing order, delivery state included. */
|
|
5883
4672
|
listSteerNotes(taskRef: number): SteerNote[];
|
|
5884
|
-
/** Undelivered, unsuperseded notes
|
|
4673
|
+
/** Undelivered, unsuperseded notes. */
|
|
5885
4674
|
pendingSteerCount(taskRef: number): number;
|
|
5886
4675
|
/**
|
|
5887
4676
|
* The attach transaction (arc 1 finding 9): a DEDICATED pre-invocation
|
|
@@ -6866,10 +5655,30 @@ export declare class Store {
|
|
|
6866
5655
|
flowTriggerCard(trigger: number, key: string): number | null;
|
|
6867
5656
|
/** The active chat trigger a channel feeds (v89), if any: one per channel. */
|
|
6868
5657
|
chatTriggerFor(app: string, installation: string, chat: string): FlowTriggerRow | null;
|
|
6869
|
-
/**
|
|
6870
|
-
|
|
5658
|
+
/**
|
|
5659
|
+
* Record what a trigger did with one outside thing: the card it made, or why it made none, and (a standing order's
|
|
5660
|
+
* firing) the task it filed. False when it was already recorded.
|
|
5661
|
+
*/
|
|
5662
|
+
recordFlowTriggerEvent(trigger: number, key: string, card: number | null, note: string | null, now: Date, task?: string | null): boolean;
|
|
6871
5663
|
/** The last card a trigger made, if any. */
|
|
6872
5664
|
lastFlowTriggerCard(trigger: number): number | null;
|
|
5665
|
+
/**
|
|
5666
|
+
* One at a time (v115, from routines): the oldest task a standing order filed that has neither finished nor been
|
|
5667
|
+
* cancelled — queued, running, held, parked and failed ones all count. A live claim counts whatever the task's state
|
|
5668
|
+
* says, so a state written over a running build can't start a twin beside it.
|
|
5669
|
+
*/
|
|
5670
|
+
standingOrderBlocker(trigger: number, routine: number | null, now: Date): {
|
|
5671
|
+
taskId: string;
|
|
5672
|
+
state: string;
|
|
5673
|
+
} | null;
|
|
5674
|
+
/**
|
|
5675
|
+
* What a standing order's tasks spent since `sinceIso` (v115, from routines), anchored to when each provider started:
|
|
5676
|
+
* a paid run whose cost never landed is counted as unmeasured, and a ceiling fails closed on it.
|
|
5677
|
+
*/
|
|
5678
|
+
standingOrderSpend(trigger: number, routine: number | null, sinceIso: string): {
|
|
5679
|
+
costUsd: number;
|
|
5680
|
+
unmeasuredRuns: number;
|
|
5681
|
+
};
|
|
6873
5682
|
/** The tools a project's builds get now (active only), oldest first. */
|
|
6874
5683
|
projectTools(repo: string): {
|
|
6875
5684
|
id: number;
|
|
@@ -7335,9 +6144,8 @@ export declare class Store {
|
|
|
7335
6144
|
* built-in task ids it returned to the queue — rather than a bare count.
|
|
7336
6145
|
* Nothing here decides liveness: the caller proves the runner is gone (or
|
|
7337
6146
|
* is taking its name over) inside the transaction that calls this. What it
|
|
7338
|
-
* never does: touch a run that already has an outcome,
|
|
7339
|
-
*
|
|
7340
|
-
* owns. A second pass over the same runner settles nothing and says so.
|
|
6147
|
+
* never does: touch a run that already has an outcome, another runner's
|
|
6148
|
+
* rows, or a task some newer live lease owns. A second pass over the same runner settles nothing and says so.
|
|
7341
6149
|
*/
|
|
7342
6150
|
recoverRunnerWork(runner: string, now: Date): RunnerWorkRecovery;
|
|
7343
6151
|
/**
|
|
@@ -7388,8 +6196,7 @@ export declare class Store {
|
|
|
7388
6196
|
* durably with who asked and when BEFORE any process is signalled. The
|
|
7389
6197
|
* transaction proves the run is this task's, is still open, holds the
|
|
7390
6198
|
* task's CURRENT live claim (a reviewer's synthetic lease counts through
|
|
7391
|
-
* its open outcome alone),
|
|
7392
|
-
* own controls), and has admitted no publication — an external request
|
|
6199
|
+
* its open outcome alone), and has admitted no publication — an external request
|
|
7393
6200
|
* in flight is never recalled by a stop, and the words say so. The
|
|
7394
6201
|
* stop's hold rides the same write, owned by this run, so nothing
|
|
7395
6202
|
* automatic retries the task while it is paused; a repeated request
|
|
@@ -7406,7 +6213,7 @@ export declare class Store {
|
|
|
7406
6213
|
repeated: boolean;
|
|
7407
6214
|
} | {
|
|
7408
6215
|
ok: false;
|
|
7409
|
-
reason: "no-run" | "wrong-task" | "finished" | "not-live" | "
|
|
6216
|
+
reason: "no-run" | "wrong-task" | "finished" | "not-live" | "publication";
|
|
7410
6217
|
detail: string;
|
|
7411
6218
|
};
|
|
7412
6219
|
/** Settle a stop — compare-and-set on the unsettled row. True when THIS
|
|
@@ -7448,6 +6255,12 @@ export declare class Store {
|
|
|
7448
6255
|
* every finished run is visited, a batch at a time. Never signals. */
|
|
7449
6256
|
recordFinishedRunExits(now: Date, batch?: number): number;
|
|
7450
6257
|
finishUnspawnedProcess(witness: number, now: Date): void;
|
|
6258
|
+
/** Settled custody, compacted (v114; compactSettledRunProcesses): a finished run whose witnesses all exited keeps
|
|
6259
|
+
* one summary row. A settled stop, an approver's settlement and a recovery compact their run at once; the worker's
|
|
6260
|
+
* reconcile pass (recordFinishedRunExits) compacts every other settled run, including one that settled at run end. */
|
|
6261
|
+
compactRunProcesses(now: Date, only?: number): number;
|
|
6262
|
+
/** Whether a run's witnesses were compacted into its summary: they existed, and all exited. */
|
|
6263
|
+
processesSummarized(runId: number): boolean;
|
|
7451
6264
|
/** The reconcile road for a pid-less witness a crash or a thrown spawn
|
|
7452
6265
|
* left behind: once its run has finished, no live child is tracked for it
|
|
7453
6266
|
* here, every other witness of the run has exited and none of the run's
|
|
@@ -7555,10 +6368,7 @@ export declare class Store {
|
|
|
7555
6368
|
clearQuota(runner: string, provider: string, scope: string, authMode?: "subscription" | "api-key", credentialFp?: string): boolean;
|
|
7556
6369
|
/**
|
|
7557
6370
|
* Live claims this runner holds right now — the occupied slots of §8's
|
|
7558
|
-
* capacity gate.
|
|
7559
|
-
* (v6 W2): capacity governs unattended work; the attended bound is the
|
|
7560
|
-
* session's own signed envelope (v28: any number of them), so watched
|
|
7561
|
-
* conversations never freeze the runner's queue.
|
|
6371
|
+
* capacity gate.
|
|
7562
6372
|
*/
|
|
7563
6373
|
liveClaimCount(runner: string, now: Date): number;
|
|
7564
6374
|
/** The same live claims as liveClaimCount, by the project their task is placed in. */
|
|
@@ -7739,24 +6549,8 @@ export declare class Store {
|
|
|
7739
6549
|
error: string;
|
|
7740
6550
|
retryAt?: string;
|
|
7741
6551
|
}, now: Date): boolean;
|
|
7742
|
-
/**
|
|
7743
|
-
telegramDeliveries(binding: TelegramBinding):
|
|
7744
|
-
/**
|
|
7745
|
-
* Claim pending notifications for one deliverer. Two deliverers — the
|
|
7746
|
-
* bridge and `outbox deliver` — select-then-send-then-record, and without
|
|
7747
|
-
* a claim both can send the same row in the gap. The claim is a short
|
|
7748
|
-
* lease on the act of sending; a deliverer that dies mid-send leaves rows
|
|
7749
|
-
* that unclaim themselves by expiry.
|
|
7750
|
-
*/
|
|
7751
|
-
claimDeliveries(owner: string, ttlMs: number, now: Date, only?: "all" | "urgent"): Notification[];
|
|
7752
|
-
/** Finalize only what this owner still holds. A lapsed claim writes nothing. */
|
|
7753
|
-
finalizeDelivery(id: number, owner: string, outcome: {
|
|
7754
|
-
ok: true;
|
|
7755
|
-
receipt: string | null;
|
|
7756
|
-
} | {
|
|
7757
|
-
ok: false;
|
|
7758
|
-
error: string;
|
|
7759
|
-
}, now: Date): boolean;
|
|
6552
|
+
/** The notifications this pairing holds, each with its delivery state there. */
|
|
6553
|
+
telegramDeliveries(binding: TelegramBinding): NotificationReceipt[];
|
|
7760
6554
|
/** The digest cadence: null everyMs = off. */
|
|
7761
6555
|
telegramDigest(): TelegramDigest;
|
|
7762
6556
|
/** Set (or clear, with null) the cadence. Turning it on starts the
|
|
@@ -7879,14 +6673,6 @@ export declare class Store {
|
|
|
7879
6673
|
/** The message now showing this card, and what it shows. */
|
|
7880
6674
|
setChatCardMessage(id: number, message: string, digest: string): void;
|
|
7881
6675
|
markTelegramDigestSent(now: Date): void;
|
|
7882
|
-
/** Every batched row finalized delivered AND the anchor moved, in ONE
|
|
7883
|
-
* transaction (v4 review, finding 5): a digest is either recorded whole
|
|
7884
|
-
* or not at all. Rows whose claim lapsed meanwhile are reported, not
|
|
7885
|
-
* silently skipped. */
|
|
7886
|
-
finalizeDigest(ids: readonly number[], owner: string, receipt: string | null, now: Date): {
|
|
7887
|
-
finalized: number;
|
|
7888
|
-
lapsed: number;
|
|
7889
|
-
};
|
|
7890
6676
|
/** Routine rows waiting for the next digest: pending, and not urgent.
|
|
7891
6677
|
* A row the live pairing delivered, or skipped as pre-pairing history,
|
|
7892
6678
|
* is settled and not waiting. */
|
|
@@ -8038,15 +6824,6 @@ export declare const TELEGRAM_HOLD_REASONS: Readonly<{
|
|
|
8038
6824
|
order: "Earlier task notification is still undelivered";
|
|
8039
6825
|
disabled: "Telegram delivery is disabled";
|
|
8040
6826
|
}>;
|
|
8041
|
-
/**
|
|
8042
|
-
* Why a contest lane cannot present or accept authority (final authority
|
|
8043
|
-
* closure), or null when it can: the lane must be nonterminal, carry a
|
|
8044
|
-
* readable stored profile, and that profile's provider, model, and
|
|
8045
|
-
* effective repair model must BE the lane's own columns. A profile_json
|
|
8046
|
-
* copied from another agent beside stale provider/model columns is a row
|
|
8047
|
-
* two authorities wrote; nothing spends on it.
|
|
8048
|
-
*/
|
|
8049
|
-
export declare function laneAuthorityProblem(lane: Contestant): string | null;
|
|
8050
6827
|
export type WorktreeRow = {
|
|
8051
6828
|
path: string;
|
|
8052
6829
|
repo: string;
|
|
@@ -8079,16 +6856,6 @@ export type IntakeGrant = {
|
|
|
8079
6856
|
revokedBy: string | null;
|
|
8080
6857
|
};
|
|
8081
6858
|
/** A review comment bound to the exact bytes of an immutable terminal diff. */
|
|
8082
|
-
export type FallbackCycle = {
|
|
8083
|
-
id: number;
|
|
8084
|
-
taskRef: number;
|
|
8085
|
-
chainDigest: string;
|
|
8086
|
-
cursor: number;
|
|
8087
|
-
state: "open" | "sanitizing" | "awaiting-release" | "pending-admission" | "incident" | "closed";
|
|
8088
|
-
transitionGeneration: number;
|
|
8089
|
-
tailRun: number | null;
|
|
8090
|
-
closedReason: string | null;
|
|
8091
|
-
};
|
|
8092
6859
|
export type DiffComment = {
|
|
8093
6860
|
id: number;
|
|
8094
6861
|
artifact: number;
|
|
@@ -8197,21 +6964,19 @@ export type RevisionRefusal = "busy" | "source-task" | "source-run" | "stale-sou
|
|
|
8197
6964
|
* INHERITED, verbatim, from the source (declared requirements and
|
|
8198
6965
|
* constraints — never the installation's defaults of the day):
|
|
8199
6966
|
* goal (the child appends its explicitly described repair), exclusions,
|
|
8200
|
-
* touches, the exact rubric,
|
|
8201
|
-
* signed level or its durable task choice), quality mode (strict stays
|
|
6967
|
+
* touches, the exact rubric, quality mode (strict stays
|
|
8202
6968
|
* strict), permission posture (the source's durable choice, else the
|
|
8203
6969
|
* posture its sealed profile ran under — never wider), the per-attempt
|
|
8204
6970
|
* budget ceiling (never lifted; a mode's filing default may only
|
|
8205
6971
|
* tighten it), the approver's per-phase route overrides, and the
|
|
8206
6972
|
* build/plan agent pins.
|
|
8207
6973
|
* RE-RESOLVED at filing, then approved afresh: the phase route and its
|
|
8208
|
-
* execution profile (recommended over the inherited
|
|
8209
|
-
* overrides, and pins under today's configuration), the
|
|
8210
|
-
* chain (from the repository's configuration, never copied), and the
|
|
6974
|
+
* execution profile (recommended over the inherited quality,
|
|
6975
|
+
* overrides, and pins under today's configuration), and the
|
|
8211
6976
|
* auth mode. The child's digest binds what it resolved to; a yes on
|
|
8212
6977
|
* the source never covers it.
|
|
8213
|
-
* NEVER INHERITED: the approval stamp and its basis,
|
|
8214
|
-
*
|
|
6978
|
+
* NEVER INHERITED: the approval stamp and its basis,
|
|
6979
|
+
* publication and merge grants, the plan document and
|
|
8215
6980
|
* its revision ledger (a revision is planned afresh, if at all; the
|
|
8216
6981
|
* brief plus the source scope are its contract), strikes, holds.
|
|
8217
6982
|
* FRESH from a live mode, only when the caller re-proved coverage inside
|
|
@@ -8226,7 +6991,6 @@ export type RevisionTerms = {
|
|
|
8226
6991
|
outOfScope: string | null;
|
|
8227
6992
|
touches: string[];
|
|
8228
6993
|
acceptance: AcceptanceCriterion[];
|
|
8229
|
-
riskLevel: RiskLevel;
|
|
8230
6994
|
qualityMode: QualityMode;
|
|
8231
6995
|
permissionMode: UnattendedPermissionMode;
|
|
8232
6996
|
budgetMicrousd: number | null;
|
|
@@ -8245,7 +7009,7 @@ export type RevisionTerms = {
|
|
|
8245
7009
|
};
|
|
8246
7010
|
/** The operator-facing posture a sealed profile actually ran under. */
|
|
8247
7011
|
export declare function permissionModeOfProfile(profile: ExecutionProfile | null): UnattendedPermissionMode | null;
|
|
8248
|
-
export declare function revisionTermsOf(sourceRef: Pick<TaskRef, "
|
|
7012
|
+
export declare function revisionTermsOf(sourceRef: Pick<TaskRef, "qualityMode" | "permissionMode" | "routeOverrides" | "agentProvider" | "agentModel" | "planProvider" | "planModel">, sourceScope: Scope | null, coverage: {
|
|
8249
7013
|
defaultBudgetMicrousd: number | null;
|
|
8250
7014
|
escalated: boolean;
|
|
8251
7015
|
} | null, permissionDefault: UnattendedPermissionMode, qualityDefault: QualityMode): RevisionTerms;
|
|
@@ -8269,7 +7033,6 @@ export type RevisionLineage = {
|
|
|
8269
7033
|
ancestors: string[];
|
|
8270
7034
|
root: string;
|
|
8271
7035
|
terms: {
|
|
8272
|
-
riskLevel: RiskLevel;
|
|
8273
7036
|
qualityMode: QualityMode;
|
|
8274
7037
|
permissionMode: UnattendedPermissionMode;
|
|
8275
7038
|
budgetMicrousd: number | null;
|
|
@@ -8310,9 +7073,6 @@ export type ProofAcceptanceRow = {
|
|
|
8310
7073
|
note: string | null;
|
|
8311
7074
|
acceptedAt: string;
|
|
8312
7075
|
};
|
|
8313
|
-
/** A contestant's execution profile (v24): exact ids from the race terms,
|
|
8314
|
-
* effective limits from the same constants every dispatch uses. */
|
|
8315
|
-
export declare function contestantProfileOf(provider: string, model: string, repairModel: string, permissionMode?: UnattendedPermissionMode): ExecutionProfile;
|
|
8316
7076
|
/**
|
|
8317
7077
|
* The raw terms verdict for one stored scope row (raw authority repair):
|
|
8318
7078
|
* every term the digest binds and every metadata word an authority reads,
|