@hearsay-tools/squawk 0.18.0-pr4089.7823 → 0.18.0-pr4090.7828
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/dist/activity/read-model.d.ts +3 -1
- package/dist/activity/read-model.js +17 -15
- package/dist/activity/read-model.js.map +1 -1
- package/dist/activity/requests.d.ts +3 -1
- package/dist/activity/requests.js +1 -1
- package/dist/activity/requests.js.map +1 -1
- package/dist/automations/service.js +1 -1
- package/dist/automations/service.js.map +1 -1
- package/dist/automations/task-template.js +3 -3
- package/dist/automations/task-template.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +46 -46
- package/dist/delegation/conversations.d.ts +6 -2
- package/dist/delegation/conversations.js +1 -1
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/family-end.d.ts +4 -2
- package/dist/delegation/family-end.js +1 -1
- package/dist/delegation/family-end.js.map +1 -1
- package/dist/delegation/routes.d.ts +10 -10
- package/dist/delegation/scratch-cleanup.js +2 -2
- package/dist/delegation/scratch-cleanup.js.map +1 -1
- package/dist/delegation/task-discovery.js +1 -1
- package/dist/delegation/task-discovery.js.map +1 -1
- package/dist/delegation/transport.d.ts +14 -14
- package/dist/delegation/worker-cleanup.js +4 -4
- package/dist/delegation/worker-cleanup.js.map +1 -1
- package/dist/project-commands.js +1 -1
- package/dist/project-commands.js.map +1 -1
- package/dist/project-migration/live.js +1 -1
- package/dist/project-migration/live.js.map +1 -1
- package/dist/runs/branch-owners.d.ts +2 -2
- package/dist/runs/cold-reads.d.ts +1 -1
- package/dist/runs/cold-reads.js +1 -1
- package/dist/runs/live-tasks.js +1 -1
- package/dist/runs/live-tasks.js.map +1 -1
- package/dist/runs/ports.d.ts +50 -28
- package/dist/runs/retention.d.ts +4 -3
- package/dist/runs/retention.js +2 -2
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-cold-reads.d.ts +98 -0
- package/dist/runs/run-cold-reads.js +194 -0
- package/dist/runs/run-cold-reads.js.map +1 -0
- package/dist/runs/run-queries.d.ts +190 -0
- package/dist/runs/run-queries.js +480 -0
- package/dist/runs/run-queries.js.map +1 -0
- package/dist/runs/run-repo-scope.d.ts +38 -0
- package/dist/runs/run-repo-scope.js +78 -0
- package/dist/runs/run-repo-scope.js.map +1 -0
- package/dist/runs/store.d.ts +9 -222
- package/dist/runs/store.js +82 -738
- package/dist/runs/store.js.map +1 -1
- package/dist/serve-boot.d.ts +3 -1
- package/dist/serve-boot.js +2 -2
- package/dist/serve-boot.js.map +1 -1
- package/dist/server/models-routes.d.ts +13 -13
- package/dist/server/project-context.js +3 -3
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/repo-branches.d.ts +5 -3
- package/dist/server/repo-branches.js +1 -1
- package/dist/server/repo-branches.js.map +1 -1
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/run-checkout.d.ts +3 -1
- package/dist/server/run-checkout.js +2 -2
- package/dist/server/run-checkout.js.map +1 -1
- package/dist/server/run-relationships.d.ts +3 -1
- package/dist/server/run-relationships.js +1 -1
- package/dist/server/run-relationships.js.map +1 -1
- package/dist/server/server.js +12 -12
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/workflows/run/auto-resume.js +2 -2
- package/dist/workflows/run/auto-resume.js.map +1 -1
- package/dist/workflows/run/completion-gate.js +1 -1
- package/dist/workflows/run/completion-gate.js.map +1 -1
- package/dist/workflows/run/family-reconciler.js +8 -8
- package/dist/workflows/run/family-reconciler.js.map +1 -1
- package/dist/workflows/run/maintenance-claims.js +2 -2
- package/dist/workflows/run/maintenance-claims.js.map +1 -1
- package/dist/workflows/run/run-cancel.js +1 -1
- package/dist/workflows/run/run-cancel.js.map +1 -1
- package/dist/workflows/run/run-line.js +2 -2
- package/dist/workflows/run/run-line.js.map +1 -1
- package/dist/workflows/run/run-recovery.js +6 -6
- package/dist/workflows/run/run-recovery.js.map +1 -1
- package/dist/workflows/run/run-start.js +1 -1
- package/dist/workflows/run/run-start.js.map +1 -1
- package/dist/workflows/run/wake-admission.js +1 -1
- package/dist/workflows/run/wake-admission.js.map +1 -1
- package/dist/workflows/run/worker-questions.js +3 -3
- package/dist/workflows/run/worker-questions.js.map +1 -1
- package/dist/workflows/run.js +1 -1
- package/dist/workflows/run.js.map +1 -1
- package/package.json +4 -4
- package/scripts/benchmark-automation-lookups.ts +2 -2
- package/scripts/benchmark-conversation-lookup.ts +2 -2
- package/scripts/benchmark-family-reconcile.ts +1 -1
- package/scripts/benchmark-worktree-retention.ts +1 -1
- package/scripts/seed-archive-profile.ts +2 -2
package/dist/runs/ports.d.ts
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
* `.ai/specs/2026-11-21-run-lifecycle-and-store-ports.md`), and the port then points at the module
|
|
9
9
|
* that implements it. A later slice may move a method between ports when its topic moves. The store stays the only writer of status and exit fields (ADR 0056).
|
|
10
10
|
*/
|
|
11
|
-
import type { ArchiveFinishedScope, ArchivePullRequestIdentity, MergedPullRequest, WorkerCollectedResult } from '../contract/index.js';
|
|
12
|
-
import type {
|
|
11
|
+
import type { ArchivedRunsResponse, ArchiveFinishedScope, ArchivePullRequestIdentity, MergedPullRequest, RunSummary, WorkerCollectedResult } from '../contract/index.js';
|
|
12
|
+
import type { AutomationNames } from '../contract/index.js';
|
|
13
|
+
import type { RepoHandle, RunEvent, RunRecord, RunStore } from './store.ts';
|
|
14
|
+
import type { BranchOwner } from './branch-owners.ts';
|
|
15
|
+
import type { PeerTaskPageOptions } from './run-summary-page.ts';
|
|
13
16
|
import type { ArchiveOnMergeSnapshot } from './run-archive.ts';
|
|
14
17
|
import type { RunOwnership } from './run-claims-topic.ts';
|
|
15
18
|
import type { RunPinHolder } from './run-pins.ts';
|
|
@@ -28,32 +31,51 @@ export interface RunLookup {
|
|
|
28
31
|
export interface RunReads extends RunLookup {
|
|
29
32
|
isUnreadable: RunStore['isUnreadable'];
|
|
30
33
|
}
|
|
31
|
-
/** Lists and finds over many runs. */
|
|
34
|
+
/** Lists and finds over many runs (`runs/run-queries.ts`, `store.queries`). */
|
|
32
35
|
export interface RunQueries {
|
|
33
|
-
listRuns:
|
|
34
|
-
listAllRunsForLegacyRoute:
|
|
35
|
-
listPeerTaskSummaries:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
listRuns(): RunRecord[];
|
|
37
|
+
listAllRunsForLegacyRoute(): RunRecord[];
|
|
38
|
+
listPeerTaskSummaries(options: PeerTaskPageOptions): {
|
|
39
|
+
runs: RunSummary[];
|
|
40
|
+
nextOffset?: number;
|
|
41
|
+
};
|
|
42
|
+
listRunSummaries(options?: {
|
|
43
|
+
archivedWindow?: number | undefined;
|
|
44
|
+
roots?: boolean;
|
|
45
|
+
}): {
|
|
46
|
+
runs: RunSummary[];
|
|
47
|
+
truncated: boolean;
|
|
48
|
+
};
|
|
49
|
+
listArchivedRuns(options: {
|
|
50
|
+
before?: string;
|
|
51
|
+
limit: number;
|
|
52
|
+
q?: string;
|
|
53
|
+
automationNames?: AutomationNames;
|
|
54
|
+
}): ArchivedRunsResponse | {
|
|
55
|
+
error: string;
|
|
56
|
+
};
|
|
57
|
+
searchRunSummaries(query: string, limit: number): {
|
|
58
|
+
runs: RunSummary[];
|
|
59
|
+
truncated: boolean;
|
|
60
|
+
};
|
|
61
|
+
heldIds(): string[];
|
|
62
|
+
listWorkerIds(): string[];
|
|
63
|
+
listQuarantinedRunIds(): string[];
|
|
64
|
+
countAutomationRuns(automationId: string): number;
|
|
65
|
+
findNonArchivedRunByIssue(repo: string, number: number): string | undefined;
|
|
66
|
+
findRunIdsByAutomationReceipt(receiptIds: readonly string[]): Map<string, string>;
|
|
67
|
+
listConversationRootIds(naming?: string): string[];
|
|
68
|
+
listRunIds(): string[];
|
|
69
|
+
listRunsWithWorktree(): RunRecord[];
|
|
70
|
+
listBranchOwners(): BranchOwner[];
|
|
71
|
+
findRunByClientRequestId(clientRequestId: string): RunRecord | undefined;
|
|
72
|
+
listFamilyRunIds(rootId: string): string[];
|
|
73
|
+
withReadCache<T>(fn: () => T): T;
|
|
52
74
|
}
|
|
53
|
-
/** The workers of one run. */
|
|
75
|
+
/** The workers of one run (`runs/run-queries.ts`, `store.queries`). */
|
|
54
76
|
export interface RunFamilyReads {
|
|
55
|
-
listWorkersOf:
|
|
56
|
-
listOwnedWorkers:
|
|
77
|
+
listWorkersOf(parentId: string): RunRecord[];
|
|
78
|
+
listOwnedWorkers(parentId: string): RunRecord[];
|
|
57
79
|
}
|
|
58
80
|
/** Every write that creates a run or changes its record, step or outcome. */
|
|
59
81
|
export interface RunWrites {
|
|
@@ -232,9 +254,9 @@ export interface RunPins {
|
|
|
232
254
|
unpin(id: string, holder: RunPinHolder): void;
|
|
233
255
|
republish(id: string): void;
|
|
234
256
|
}
|
|
235
|
-
/** The repository identity a store learns after it opens. */
|
|
257
|
+
/** The repository identity a store learns after it opens (`runs/run-repo-scope.ts`, `store.repoScope`). */
|
|
236
258
|
export interface RunRepoHandle {
|
|
237
|
-
setRepoHandle:
|
|
259
|
+
setRepoHandle(handle: RepoHandle | null): void;
|
|
238
260
|
}
|
|
239
261
|
/** Whether the store opened, and closing it. */
|
|
240
262
|
export interface StoreHandle {
|
|
@@ -258,7 +280,7 @@ export type CreateRunInput = Parameters<RunWrites['createRun']>[0];
|
|
|
258
280
|
export type RunEventInput = Parameters<RunEventLog['appendEvent']>[1];
|
|
259
281
|
/** What `projectLiveTasks` reads: the live task view of a project, over a store or over its files read-only. */
|
|
260
282
|
export interface LiveRunReads {
|
|
261
|
-
|
|
283
|
+
readonly queries: Pick<RunQueries, 'listRuns'>;
|
|
262
284
|
readonly claims: Pick<RunClaims, 'persistedLiveRunIds'>;
|
|
263
285
|
getRun: RunStore['getRun'];
|
|
264
286
|
}
|
package/dist/runs/retention.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RunPins, RunAccess, RunFamilyReads, WorkerExecutions, WorkerResults } from './ports.ts';
|
|
1
|
+
import type { RunPins, RunAccess, RunFamilyReads, RunQueries, WorkerExecutions, WorkerResults } from './ports.ts';
|
|
2
2
|
import type { RunRecord } from './store.ts';
|
|
3
3
|
/** Whether an owned worker's family has ended: its parent was archived, by the user or by history
|
|
4
4
|
* retention, and is settled (`isEndedRoot`, hearsay-tools/squawk#2987). */
|
|
@@ -25,7 +25,8 @@ export declare function isReclaimable(run: RunRecord, lookup?: (id: string) => R
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function selectReclaimableWorktrees(runs: readonly RunRecord[], keep: number, lookup?: (id: string) => RunRecord | undefined, workersOf?: (parentId: string) => readonly RunRecord[]): string[];
|
|
27
27
|
/** The store members a real store has and a structural test store may lack: each use checks for it. */
|
|
28
|
-
type RealStoreMembers = Partial<
|
|
28
|
+
type RealStoreMembers = Partial<{
|
|
29
|
+
readonly queries: Partial<RunFamilyReads>;
|
|
29
30
|
readonly claims: Partial<RunAccess>;
|
|
30
31
|
readonly runPins: Partial<RunPins>;
|
|
31
32
|
readonly workerExecutions: Partial<WorkerExecutions>;
|
|
@@ -36,7 +37,7 @@ export interface RetentionStore {
|
|
|
36
37
|
/** The worker results a reclaim preparation saves. */
|
|
37
38
|
readonly workerResults: WorkerResults;
|
|
38
39
|
/** The candidates: runs with a materialized worktree (an indexed query, #779). */
|
|
39
|
-
|
|
40
|
+
readonly queries: Pick<RunQueries, 'listRunsWithWorktree'>;
|
|
40
41
|
getRun(id: string): RunRecord | undefined;
|
|
41
42
|
updateRun(id: string, patch: {
|
|
42
43
|
worktreeReclaimedAt?: string;
|
package/dist/runs/retention.js
CHANGED
|
@@ -141,11 +141,11 @@ function readOnlyWorktree(repoRoot, store, run) {
|
|
|
141
141
|
Boolean(run.worktreePath && isFallbackProjectPath(repoRoot, run.worktreePath));
|
|
142
142
|
}
|
|
143
143
|
export async function reclaimWorktrees(repoRoot, store, keep, opts = {}) {
|
|
144
|
-
const runs = store.listRunsWithWorktree();
|
|
144
|
+
const runs = store.queries.listRunsWithWorktree();
|
|
145
145
|
const byId = new Map(runs.map((r) => [r.id, r]));
|
|
146
146
|
const reclaimed = [];
|
|
147
147
|
// A real store lists every worker; a structural test store answers from the candidates.
|
|
148
|
-
const workersOf = store.listWorkersOf?.bind(store);
|
|
148
|
+
const workersOf = store.queries?.listWorkersOf?.bind(store.queries);
|
|
149
149
|
const selected = selectReclaimableWorktrees(runs, keep, (parentId) => store.getRun(parentId), workersOf);
|
|
150
150
|
const readonly = (id) => Boolean(byId.get(id) && readOnlyWorktree(repoRoot, store, byId.get(id)));
|
|
151
151
|
const skipped = selected.filter(readonly).length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention.js","sourceRoot":"","sources":["../../src/runs/retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,4EAA4E;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIzD;;2EAE2E;AAC3E,MAAM,QAAQ,GAA2B,IAAI,GAAG,CAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CA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,cAAc,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACjG,IAAI,IAAI,CAAC,MAAM;YAAE,UAAU,EAAE,CAAC,CAAC,2CAA2C;QAC1E,MAAM,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;QACzC,IAAI,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,kCAAkC;QACjF,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;QACpB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the store reads a run it does not hold, and which runs it holds (hearsay-tools/squawk#4044):
|
|
3
|
+
* the anchors and the eviction of the held set, the cold load and decode of a row, the hold a write
|
|
4
|
+
* takes, and the detached reads. `RunStore` keeps one of these as its private `rows`; `getRun` and
|
|
5
|
+
* `isUnreadable` stay on the store.
|
|
6
|
+
*/
|
|
7
|
+
import { ColdReadCache, type StoredRow } from './cold-reads.ts';
|
|
8
|
+
import type { RunClaimsTopic } from './run-claims-topic.ts';
|
|
9
|
+
import type { RunRow } from './run-database.ts';
|
|
10
|
+
import type { PersistenceState, RunPersistenceTopic } from './run-persistence.ts';
|
|
11
|
+
import type { RunPinHolder } from './run-pins.ts';
|
|
12
|
+
import type { RunRecord } from './store.ts';
|
|
13
|
+
/** What the topic asks of the store; no import of `store.ts` values. The members it shares with
|
|
14
|
+
* the persistence topic are the same store state, so they keep that topic's types. */
|
|
15
|
+
export interface ColdReadsState extends Pick<PersistenceState, 'db' | 'repoHandle' | 'held' | 'committing' | 'dirty' | 'deleted' | 'quarantined' | 'claimed' | 'pendingClaims' | 'base' | 'decodeRunRow'> {
|
|
16
|
+
/** `open()`'s `keepLive`, which a run read later from `runs.db` is reconciled with too. */
|
|
17
|
+
keepLive(): boolean;
|
|
18
|
+
readonly pins: Map<string, Set<RunPinHolder>>;
|
|
19
|
+
claims(): Pick<RunClaimsTopic, 'claimFamilies' | 'releaseUnheldClaims'>;
|
|
20
|
+
persistence(): Pick<RunPersistenceTopic, 'scheduleSave'>;
|
|
21
|
+
}
|
|
22
|
+
export declare class RunColdReadsTopic {
|
|
23
|
+
private readonly state;
|
|
24
|
+
/** Rows read cold in the current synchronous turn, so a commit staged from one is fenced against
|
|
25
|
+
* the version it was computed from. `owned`: its family was already this store's when read.
|
|
26
|
+
* Cleared at the next microtask: no commit spans a turn. */
|
|
27
|
+
readonly coldBase: Map<string, StoredRow & {
|
|
28
|
+
owned: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
readonly coldReads: ColdReadCache;
|
|
31
|
+
/** Rows whose `data` this store tried to decode and could not: left in the database untouched,
|
|
32
|
+
* and left out of the list rows from then on, as the cold reader leaves them out (run-index.ts). */
|
|
33
|
+
readonly unreadable: Set<string>;
|
|
34
|
+
constructor(state: ColdReadsState);
|
|
35
|
+
private get db();
|
|
36
|
+
private get keepLive();
|
|
37
|
+
private get repoHandle();
|
|
38
|
+
private get held();
|
|
39
|
+
private get pins();
|
|
40
|
+
private get committing();
|
|
41
|
+
private get dirty();
|
|
42
|
+
private get deleted();
|
|
43
|
+
private get quarantined();
|
|
44
|
+
private get claimed();
|
|
45
|
+
private get pendingClaims();
|
|
46
|
+
private get base();
|
|
47
|
+
private get claims();
|
|
48
|
+
private get persistence();
|
|
49
|
+
/**
|
|
50
|
+
* Whether a held run anchors itself (and its family) in memory. Anything else held is a family
|
|
51
|
+
* member or a settled write, and leaves at the next sweep (`evictSettled`).
|
|
52
|
+
*
|
|
53
|
+
* The held set is: every run that is live (`isLiveRecord`), pinned by a RunManager (`pin`),
|
|
54
|
+
* dirty, or inside a durable commit; plus the whole delegation family (root and direct
|
|
55
|
+
* workers) of any such run. Families are held because the RunManager reads a live run's family
|
|
56
|
+
* on every run event — `GET /runs/:id/relationships`, the global `reconcileWorkerWaits` pass
|
|
57
|
+
* (about twenty call sites), completion blockers and conversations — and decoding a cold
|
|
58
|
+
* record costs about 200 µs (JSON.parse plus the schema). Measured on a copy of a real
|
|
59
|
+
* cockpit's `runs.json` (958 runs, 957 of them delegated): a running root with 26 workers
|
|
60
|
+
* paid about 5 ms per family read, and the live families together about 10 ms per global
|
|
61
|
+
* pass, all on the event loop. Holding them costs memory in proportion to active work, not to
|
|
62
|
+
* history.
|
|
63
|
+
*/
|
|
64
|
+
isAnchor(id: string, run: RunRecord): boolean;
|
|
65
|
+
/** The family roots with an anchoring member in memory. */
|
|
66
|
+
anchoredFamilies(): Set<string>;
|
|
67
|
+
/** Drop every held run that is neither an anchor nor in an anchored family. A store without a
|
|
68
|
+
* database keeps everything: memory is the only copy it has. */
|
|
69
|
+
evictSettled(): void;
|
|
70
|
+
/** A run read from `runs.db`, normalized like a loaded one (`reconcileLoadedRun`, then the
|
|
71
|
+
* repository scope) but held by nobody. Undefined when absent, deleted or unreadable. */
|
|
72
|
+
loadCold(id: string): RunRecord | undefined;
|
|
73
|
+
/** `loaded` sees the record once the load has normalized it, before it is scoped: a heal's `before`. */
|
|
74
|
+
decodeCold(row: RunRow, loaded?: (run: RunRecord) => void): RunRecord | undefined;
|
|
75
|
+
/** Hold a writable row. A fallback family's reads stay detached (the cold-read contract). */
|
|
76
|
+
holdDecoded(run: RunRecord): RunRecord;
|
|
77
|
+
/**
|
|
78
|
+
* Hold a claimed run for a write; leave after settlement unless anchored.
|
|
79
|
+
* Take the family claim before reading its row. Return undefined for a live foreign owner
|
|
80
|
+
* or a fallback family: neither claim is granted.
|
|
81
|
+
*/
|
|
82
|
+
hold(id: string): RunRecord | undefined;
|
|
83
|
+
/** The record a store write changes in place: held, or loaded to be. Undefined for a run this
|
|
84
|
+
* store may not write (another process's, or quarantined), so the write changes nothing. */
|
|
85
|
+
record(id: string): RunRecord | undefined;
|
|
86
|
+
/** Read held legacy family members, or a detached cold record. */
|
|
87
|
+
peek(id: string): RunRecord | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* A run just read off its row, as reads answer it: held when its family is in memory (a live
|
|
90
|
+
* family's members are read on every run event), else a copy nobody holds — frozen under
|
|
91
|
+
* vitest when it leaves the store (`freeze`).
|
|
92
|
+
*/
|
|
93
|
+
answerCold(run: RunRecord, freeze: boolean): RunRecord;
|
|
94
|
+
/** `getRun` for a row a query already read: the held object, else decoded from `row`. */
|
|
95
|
+
fromRow(row: RunRow): RunRecord | undefined;
|
|
96
|
+
/** Whether the run exists, held or not, without decoding it. */
|
|
97
|
+
hasRun(id: string): boolean;
|
|
98
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the store reads a run it does not hold, and which runs it holds (hearsay-tools/squawk#4044):
|
|
3
|
+
* the anchors and the eviction of the held set, the cold load and decode of a row, the hold a write
|
|
4
|
+
* takes, and the detached reads. `RunStore` keeps one of these as its private `rows`; `getRun` and
|
|
5
|
+
* `isUnreadable` stay on the store.
|
|
6
|
+
*/
|
|
7
|
+
import { ColdReadCache, storedRow } from './cold-reads.js';
|
|
8
|
+
import { reconcileLoadedRun } from './loaded-run-exits.js';
|
|
9
|
+
import { familyKey, rowFamily } from './run-claims.js';
|
|
10
|
+
import { rescopeRun } from './run-references.js';
|
|
11
|
+
import { familyRootOf, isLiveRecord } from './run-row.js';
|
|
12
|
+
/** Tests freeze the copies of cold runs, so an in-place write to one throws instead of vanishing. */
|
|
13
|
+
function deepFreeze(value) {
|
|
14
|
+
if (value && typeof value === 'object' && !Object.isFrozen(value)) {
|
|
15
|
+
Object.freeze(value);
|
|
16
|
+
for (const child of Object.values(value))
|
|
17
|
+
deepFreeze(child);
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
export class RunColdReadsTopic {
|
|
22
|
+
state;
|
|
23
|
+
/** Rows read cold in the current synchronous turn, so a commit staged from one is fenced against
|
|
24
|
+
* the version it was computed from. `owned`: its family was already this store's when read.
|
|
25
|
+
* Cleared at the next microtask: no commit spans a turn. */
|
|
26
|
+
coldBase = new Map();
|
|
27
|
+
coldReads = new ColdReadCache();
|
|
28
|
+
/** Rows whose `data` this store tried to decode and could not: left in the database untouched,
|
|
29
|
+
* and left out of the list rows from then on, as the cold reader leaves them out (run-index.ts). */
|
|
30
|
+
unreadable = new Set();
|
|
31
|
+
constructor(state) {
|
|
32
|
+
this.state = state;
|
|
33
|
+
}
|
|
34
|
+
get db() { return this.state.db(); }
|
|
35
|
+
get keepLive() { return this.state.keepLive(); }
|
|
36
|
+
get repoHandle() { return this.state.repoHandle(); }
|
|
37
|
+
get held() { return this.state.held; }
|
|
38
|
+
get pins() { return this.state.pins; }
|
|
39
|
+
get committing() { return this.state.committing; }
|
|
40
|
+
get dirty() { return this.state.dirty; }
|
|
41
|
+
get deleted() { return this.state.deleted; }
|
|
42
|
+
get quarantined() { return this.state.quarantined; }
|
|
43
|
+
get claimed() { return this.state.claimed; }
|
|
44
|
+
get pendingClaims() { return this.state.pendingClaims; }
|
|
45
|
+
get base() { return this.state.base; }
|
|
46
|
+
get claims() { return this.state.claims(); }
|
|
47
|
+
get persistence() { return this.state.persistence(); }
|
|
48
|
+
/**
|
|
49
|
+
* Whether a held run anchors itself (and its family) in memory. Anything else held is a family
|
|
50
|
+
* member or a settled write, and leaves at the next sweep (`evictSettled`).
|
|
51
|
+
*
|
|
52
|
+
* The held set is: every run that is live (`isLiveRecord`), pinned by a RunManager (`pin`),
|
|
53
|
+
* dirty, or inside a durable commit; plus the whole delegation family (root and direct
|
|
54
|
+
* workers) of any such run. Families are held because the RunManager reads a live run's family
|
|
55
|
+
* on every run event — `GET /runs/:id/relationships`, the global `reconcileWorkerWaits` pass
|
|
56
|
+
* (about twenty call sites), completion blockers and conversations — and decoding a cold
|
|
57
|
+
* record costs about 200 µs (JSON.parse plus the schema). Measured on a copy of a real
|
|
58
|
+
* cockpit's `runs.json` (958 runs, 957 of them delegated): a running root with 26 workers
|
|
59
|
+
* paid about 5 ms per family read, and the live families together about 10 ms per global
|
|
60
|
+
* pass, all on the event loop. Holding them costs memory in proportion to active work, not to
|
|
61
|
+
* history.
|
|
62
|
+
*/
|
|
63
|
+
isAnchor(id, run) {
|
|
64
|
+
return isLiveRecord(run) || this.pins.has(id) || this.dirty.has(id) || this.committing.has(id);
|
|
65
|
+
}
|
|
66
|
+
/** The family roots with an anchoring member in memory. */
|
|
67
|
+
anchoredFamilies() {
|
|
68
|
+
const roots = new Set();
|
|
69
|
+
for (const [id, run] of this.held) {
|
|
70
|
+
const root = familyRootOf(run);
|
|
71
|
+
if (root !== undefined && this.isAnchor(id, run))
|
|
72
|
+
roots.add(root);
|
|
73
|
+
}
|
|
74
|
+
return roots;
|
|
75
|
+
}
|
|
76
|
+
/** Drop every held run that is neither an anchor nor in an anchored family. A store without a
|
|
77
|
+
* database keeps everything: memory is the only copy it has. */
|
|
78
|
+
evictSettled() {
|
|
79
|
+
if (!this.db)
|
|
80
|
+
return;
|
|
81
|
+
const families = this.anchoredFamilies();
|
|
82
|
+
for (const [id, run] of this.held) {
|
|
83
|
+
if (this.isAnchor(id, run))
|
|
84
|
+
continue;
|
|
85
|
+
const root = familyRootOf(run);
|
|
86
|
+
if (root !== undefined && families.has(root))
|
|
87
|
+
continue;
|
|
88
|
+
this.held.delete(id);
|
|
89
|
+
this.base.delete(id);
|
|
90
|
+
this.coldReads.forget(id);
|
|
91
|
+
}
|
|
92
|
+
this.claims.releaseUnheldClaims();
|
|
93
|
+
}
|
|
94
|
+
/** A run read from `runs.db`, normalized like a loaded one (`reconcileLoadedRun`, then the
|
|
95
|
+
* repository scope) but held by nobody. Undefined when absent, deleted or unreadable. */
|
|
96
|
+
loadCold(id) {
|
|
97
|
+
if (!this.db || this.deleted.has(id))
|
|
98
|
+
return undefined;
|
|
99
|
+
const row = this.db.get(id);
|
|
100
|
+
return row ? this.decodeCold(row) : undefined;
|
|
101
|
+
}
|
|
102
|
+
/** `loaded` sees the record once the load has normalized it, before it is scoped: a heal's `before`. */
|
|
103
|
+
decodeCold(row, loaded) {
|
|
104
|
+
this.coldReads.at(row.id, row.revision); // the fence below moves to this revision
|
|
105
|
+
const decoded = this.state.decodeRunRow(row.data);
|
|
106
|
+
if (!decoded) {
|
|
107
|
+
this.unreadable.add(row.id);
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
this.unreadable.delete(row.id);
|
|
111
|
+
const { run, extras } = decoded;
|
|
112
|
+
if (this.coldBase.size === 0)
|
|
113
|
+
queueMicrotask(() => this.coldBase.clear());
|
|
114
|
+
const family = rowFamily(row);
|
|
115
|
+
this.coldBase.set(row.id, { revision: row.revision, seq: row.seq, data: row.data, extras, owned: this.claimed.has(family) || this.pendingClaims.has(family) });
|
|
116
|
+
reconcileLoadedRun(run, { keepLive: this.keepLive });
|
|
117
|
+
loaded?.(run);
|
|
118
|
+
rescopeRun(run, this.repoHandle);
|
|
119
|
+
return run;
|
|
120
|
+
}
|
|
121
|
+
/** Hold a writable row. A fallback family's reads stay detached (the cold-read contract). */
|
|
122
|
+
holdDecoded(run) {
|
|
123
|
+
if (this.db?.familyHasFallback(familyKey(run)))
|
|
124
|
+
return process.env.VITEST ? deepFreeze(run) : run;
|
|
125
|
+
const read = this.coldBase.get(run.id);
|
|
126
|
+
this.held.set(run.id, run);
|
|
127
|
+
if (read)
|
|
128
|
+
this.base.set(run.id, storedRow(read));
|
|
129
|
+
return run;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Hold a claimed run for a write; leave after settlement unless anchored.
|
|
133
|
+
* Take the family claim before reading its row. Return undefined for a live foreign owner
|
|
134
|
+
* or a fallback family: neither claim is granted.
|
|
135
|
+
*/
|
|
136
|
+
hold(id) {
|
|
137
|
+
const held = this.held.get(id);
|
|
138
|
+
if (held)
|
|
139
|
+
return held;
|
|
140
|
+
const family = this.db && !this.deleted.has(id) ? this.db.familyOf(id) : undefined;
|
|
141
|
+
if (family === undefined || !this.claims.claimFamilies([family]).has(family))
|
|
142
|
+
return undefined;
|
|
143
|
+
const run = this.coldReads.claimed(id, this.coldBase.get(id), () => this.db?.revisionOf(id)) ?? this.loadCold(id);
|
|
144
|
+
if (!run)
|
|
145
|
+
return undefined;
|
|
146
|
+
this.holdDecoded(run);
|
|
147
|
+
this.persistence.scheduleSave();
|
|
148
|
+
return run;
|
|
149
|
+
}
|
|
150
|
+
/** The record a store write changes in place: held, or loaded to be. Undefined for a run this
|
|
151
|
+
* store may not write (another process's, or quarantined), so the write changes nothing. */
|
|
152
|
+
record(id) {
|
|
153
|
+
if (this.quarantined.has(id))
|
|
154
|
+
return undefined;
|
|
155
|
+
return this.held.get(id) ?? this.hold(id);
|
|
156
|
+
}
|
|
157
|
+
/** Read held legacy family members, or a detached cold record. */
|
|
158
|
+
peek(id) {
|
|
159
|
+
const held = this.held.get(id);
|
|
160
|
+
if (held)
|
|
161
|
+
return held;
|
|
162
|
+
const run = this.loadCold(id);
|
|
163
|
+
return run && this.answerCold(run, false);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A run just read off its row, as reads answer it: held when its family is in memory (a live
|
|
167
|
+
* family's members are read on every run event), else a copy nobody holds — frozen under
|
|
168
|
+
* vitest when it leaves the store (`freeze`).
|
|
169
|
+
*/
|
|
170
|
+
answerCold(run, freeze) {
|
|
171
|
+
const root = familyRootOf(run);
|
|
172
|
+
if (root !== undefined && this.anchoredFamilies().has(root))
|
|
173
|
+
return this.holdDecoded(run);
|
|
174
|
+
return freeze && process.env.VITEST ? deepFreeze(run) : run;
|
|
175
|
+
}
|
|
176
|
+
/** `getRun` for a row a query already read: the held object, else decoded from `row`. */
|
|
177
|
+
fromRow(row) {
|
|
178
|
+
const held = this.held.get(row.id);
|
|
179
|
+
if (held)
|
|
180
|
+
return held;
|
|
181
|
+
if (this.deleted.has(row.id))
|
|
182
|
+
return undefined;
|
|
183
|
+
const cached = this.coldReads.at(row.id, row.revision);
|
|
184
|
+
if (cached)
|
|
185
|
+
return cached;
|
|
186
|
+
const run = this.decodeCold(row);
|
|
187
|
+
return run && this.coldReads.keep(this.answerCold(run, true), this.coldBase.get(row.id), this.held.has(row.id));
|
|
188
|
+
}
|
|
189
|
+
/** Whether the run exists, held or not, without decoding it. */
|
|
190
|
+
hasRun(id) {
|
|
191
|
+
return this.held.has(id) || (!!this.db && !this.deleted.has(id) && this.db.has(id));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=run-cold-reads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cold-reads.js","sourceRoot":"","sources":["../../src/runs/run-cold-reads.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG1D,qGAAqG;AACrG,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAA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