niceeval 0.16.2-canary.98 → 0.16.2
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/inspection/facts.cjs +86 -31
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/facts.d.cts +2 -2
- package/dist/inspection/facts.d.mts +2 -2
- package/dist/inspection/facts.d.ts +2 -2
- package/dist/inspection/overview.cjs +2 -1
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/project-source.cjs +28 -19
- package/dist/inspection/project-source.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +17 -17
- package/dist/inspection/protocol.d.mts +17 -17
- package/dist/inspection/protocol.d.ts +17 -17
- package/dist/inspection/select.cjs +10 -6
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +4 -2
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/source.d.cts +1 -0
- package/dist/inspection/source.d.mts +1 -0
- package/dist/inspection/source.d.ts +1 -0
- package/dist/record/sqlite/database.cjs +2 -8
- package/dist/record/sqlite/database.cjs.map +1 -1
- package/dist/record/sqlite/index.cjs +13 -11
- package/dist/record/sqlite/index.cjs.map +1 -1
- package/dist/record/sqlite/index.d.cts +4 -2
- package/dist/record/sqlite/index.d.mts +4 -2
- package/dist/record/sqlite/index.d.ts +4 -2
- package/dist/record/sqlite/storage.cjs +118 -64
- package/dist/record/sqlite/storage.cjs.map +1 -1
- package/dist/record/sqlite/storage.d.cts +12 -5
- package/dist/record/sqlite/storage.d.mts +12 -5
- package/dist/record/sqlite/storage.d.ts +12 -5
- package/dist/record/sqlite/storage.js +48 -44
- package/dist/record/sqlite/types.cjs.map +1 -1
- package/dist/record/sqlite/types.d.cts +1 -1
- package/dist/record/sqlite/types.d.mts +1 -1
- package/dist/record/sqlite/types.d.ts +1 -1
- package/dist/view/cli/contribution.cjs +3 -2
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/function-runtime.mjs +251 -464
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RecordDatabase } from "./database.cjs";
|
|
2
|
-
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.cjs";
|
|
2
|
+
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunCutoff, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.cjs";
|
|
3
3
|
export declare function discardAttempt(connection: RecordDatabase, input: DiscardAttemptInput): void;
|
|
4
4
|
export declare function logicalSealIdentity(entries: readonly SealEntry[]): string;
|
|
5
5
|
export declare function collectRunSealEntries(connection: RecordDatabase, runId: string): readonly SealEntry[];
|
|
@@ -29,21 +29,28 @@ export declare function sealRun(connection: RecordDatabase, input: SealRunInput)
|
|
|
29
29
|
/** Constant-row atomic publication; staged Seal rows become visible through the parent status. */
|
|
30
30
|
export declare function publishRunSeal(connection: RecordDatabase, input: SealRunInput): void;
|
|
31
31
|
export declare function verifyAllSealedRuns(connection: RecordDatabase, requireSealedOnly?: boolean, deadlineEpochMs?: number): number;
|
|
32
|
+
/** Summary metadata never materializes Core, Attachment payload or collection rows. */
|
|
32
33
|
export declare function readSealedRunSummary(connection: RecordDatabase, runId: string): SealedRunSummary | undefined;
|
|
34
|
+
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
|
+
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
|
+
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
33
38
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
34
39
|
/**
|
|
35
40
|
* Computes the stable sealed cutoff without retaining the inventory, then
|
|
36
41
|
* returns one bounded page from the same caller-owned read transaction.
|
|
37
42
|
*/
|
|
38
|
-
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number): SealedRunSummaryPage;
|
|
43
|
+
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
39
44
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
40
45
|
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
41
46
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
42
47
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
49
|
+
export declare function readPublishedSealedRun(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): PublishedSealedRun | undefined;
|
|
50
|
+
/** Inspection may defer Attachment reads within its existing pinned session. */
|
|
51
|
+
export declare function readSealedRunCore(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): SealedRunCore | undefined;
|
|
46
52
|
/** Fixed, decoded projection sufficient to rebuild sealed Core and attachment metadata. */
|
|
47
53
|
export declare function readSealedRunDocument(connection: RecordDatabase, runId: string): SealedRunDocument | undefined;
|
|
48
54
|
export declare function appendContentChunks(connection: RecordDatabase, input: AppendContentChunksInput): void;
|
|
49
55
|
export declare function readContentChunkPage(connection: RecordDatabase, contentId: string, afterOrdinal: number, pageSize: number): ContentChunkPage;
|
|
56
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RecordDatabase } from "./database.mjs";
|
|
2
|
-
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.mjs";
|
|
2
|
+
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunCutoff, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.mjs";
|
|
3
3
|
export declare function discardAttempt(connection: RecordDatabase, input: DiscardAttemptInput): void;
|
|
4
4
|
export declare function logicalSealIdentity(entries: readonly SealEntry[]): string;
|
|
5
5
|
export declare function collectRunSealEntries(connection: RecordDatabase, runId: string): readonly SealEntry[];
|
|
@@ -29,21 +29,28 @@ export declare function sealRun(connection: RecordDatabase, input: SealRunInput)
|
|
|
29
29
|
/** Constant-row atomic publication; staged Seal rows become visible through the parent status. */
|
|
30
30
|
export declare function publishRunSeal(connection: RecordDatabase, input: SealRunInput): void;
|
|
31
31
|
export declare function verifyAllSealedRuns(connection: RecordDatabase, requireSealedOnly?: boolean, deadlineEpochMs?: number): number;
|
|
32
|
+
/** Summary metadata never materializes Core, Attachment payload or collection rows. */
|
|
32
33
|
export declare function readSealedRunSummary(connection: RecordDatabase, runId: string): SealedRunSummary | undefined;
|
|
34
|
+
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
|
+
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
|
+
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
33
38
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
34
39
|
/**
|
|
35
40
|
* Computes the stable sealed cutoff without retaining the inventory, then
|
|
36
41
|
* returns one bounded page from the same caller-owned read transaction.
|
|
37
42
|
*/
|
|
38
|
-
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number): SealedRunSummaryPage;
|
|
43
|
+
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
39
44
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
40
45
|
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
41
46
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
42
47
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
49
|
+
export declare function readPublishedSealedRun(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): PublishedSealedRun | undefined;
|
|
50
|
+
/** Inspection may defer Attachment reads within its existing pinned session. */
|
|
51
|
+
export declare function readSealedRunCore(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): SealedRunCore | undefined;
|
|
46
52
|
/** Fixed, decoded projection sufficient to rebuild sealed Core and attachment metadata. */
|
|
47
53
|
export declare function readSealedRunDocument(connection: RecordDatabase, runId: string): SealedRunDocument | undefined;
|
|
48
54
|
export declare function appendContentChunks(connection: RecordDatabase, input: AppendContentChunksInput): void;
|
|
49
55
|
export declare function readContentChunkPage(connection: RecordDatabase, contentId: string, afterOrdinal: number, pageSize: number): ContentChunkPage;
|
|
56
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RecordDatabase } from "./database.js";
|
|
2
|
-
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.js";
|
|
2
|
+
import { type AdmitAttachmentInput, type AdmitAttemptInput, type AdmitContentInput, type AttemptLocatorCandidates, type AppendContentChunksInput, type BeginRunInput, type ContentChunkPage, type DiscardAttemptInput, type CollectionItemPage, type FenceRunFinalizationInput, type PersistSealedRunInput, type PublishedSealedRun, type PrepareRunFinalizationInput, type PreparedRunFinalization, type RunFinalization, type SealEntry, type SealedRunCore, type SealedRunCutoff, type SealedRunDocument, type SealedRunSummary, type SealedRunSummaryPage, type SealRunInput, type StageAttachmentInput, type StageAttachmentReferencesInput, type StageCollectionItemsInput, type StageSealEntriesInput, type StageSealEntriesResult, type StageRunCoreInput } from "./types.js";
|
|
3
3
|
export declare function discardAttempt(connection: RecordDatabase, input: DiscardAttemptInput): void;
|
|
4
4
|
export declare function logicalSealIdentity(entries: readonly SealEntry[]): string;
|
|
5
5
|
export declare function collectRunSealEntries(connection: RecordDatabase, runId: string): readonly SealEntry[];
|
|
@@ -29,21 +29,28 @@ export declare function sealRun(connection: RecordDatabase, input: SealRunInput)
|
|
|
29
29
|
/** Constant-row atomic publication; staged Seal rows become visible through the parent status. */
|
|
30
30
|
export declare function publishRunSeal(connection: RecordDatabase, input: SealRunInput): void;
|
|
31
31
|
export declare function verifyAllSealedRuns(connection: RecordDatabase, requireSealedOnly?: boolean, deadlineEpochMs?: number): number;
|
|
32
|
+
/** Summary metadata never materializes Core, Attachment payload or collection rows. */
|
|
32
33
|
export declare function readSealedRunSummary(connection: RecordDatabase, runId: string): SealedRunSummary | undefined;
|
|
34
|
+
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
|
+
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
|
+
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
33
38
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
34
39
|
/**
|
|
35
40
|
* Computes the stable sealed cutoff without retaining the inventory, then
|
|
36
41
|
* returns one bounded page from the same caller-owned read transaction.
|
|
37
42
|
*/
|
|
38
|
-
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number): SealedRunSummaryPage;
|
|
43
|
+
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
39
44
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
40
45
|
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
41
46
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
42
47
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
49
|
+
export declare function readPublishedSealedRun(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): PublishedSealedRun | undefined;
|
|
50
|
+
/** Inspection may defer Attachment reads within its existing pinned session. */
|
|
51
|
+
export declare function readSealedRunCore(connection: RecordDatabase, runId: string, defer?: DeferredRecordRead): SealedRunCore | undefined;
|
|
46
52
|
/** Fixed, decoded projection sufficient to rebuild sealed Core and attachment metadata. */
|
|
47
53
|
export declare function readSealedRunDocument(connection: RecordDatabase, runId: string): SealedRunDocument | undefined;
|
|
48
54
|
export declare function appendContentChunks(connection: RecordDatabase, input: AppendContentChunksInput): void;
|
|
49
55
|
export declare function readContentChunkPage(connection: RecordDatabase, contentId: string, afterOrdinal: number, pageSize: number): ContentChunkPage;
|
|
56
|
+
export {};
|
|
@@ -21,48 +21,52 @@ const __niceevalExport8 = __niceevalCanonical["finalizeRun"];
|
|
|
21
21
|
export { __niceevalExport8 as finalizeRun };
|
|
22
22
|
const __niceevalExport9 = __niceevalCanonical["findAttemptLocatorCandidates"];
|
|
23
23
|
export { __niceevalExport9 as findAttemptLocatorCandidates };
|
|
24
|
-
const __niceevalExport10 = __niceevalCanonical["
|
|
25
|
-
export { __niceevalExport10 as
|
|
26
|
-
const __niceevalExport11 = __niceevalCanonical["
|
|
27
|
-
export { __niceevalExport11 as
|
|
28
|
-
const __niceevalExport12 = __niceevalCanonical["
|
|
29
|
-
export { __niceevalExport12 as
|
|
30
|
-
const __niceevalExport13 = __niceevalCanonical["
|
|
31
|
-
export { __niceevalExport13 as
|
|
32
|
-
const __niceevalExport14 = __niceevalCanonical["
|
|
33
|
-
export { __niceevalExport14 as
|
|
34
|
-
const __niceevalExport15 = __niceevalCanonical["
|
|
35
|
-
export { __niceevalExport15 as
|
|
36
|
-
const __niceevalExport16 = __niceevalCanonical["
|
|
37
|
-
export { __niceevalExport16 as
|
|
38
|
-
const __niceevalExport17 = __niceevalCanonical["
|
|
39
|
-
export { __niceevalExport17 as
|
|
40
|
-
const __niceevalExport18 = __niceevalCanonical["
|
|
41
|
-
export { __niceevalExport18 as
|
|
42
|
-
const __niceevalExport19 = __niceevalCanonical["
|
|
43
|
-
export { __niceevalExport19 as
|
|
44
|
-
const __niceevalExport20 = __niceevalCanonical["
|
|
45
|
-
export { __niceevalExport20 as
|
|
46
|
-
const __niceevalExport21 = __niceevalCanonical["
|
|
47
|
-
export { __niceevalExport21 as
|
|
48
|
-
const __niceevalExport22 = __niceevalCanonical["
|
|
49
|
-
export { __niceevalExport22 as
|
|
50
|
-
const __niceevalExport23 = __niceevalCanonical["
|
|
51
|
-
export { __niceevalExport23 as
|
|
52
|
-
const __niceevalExport24 = __niceevalCanonical["
|
|
53
|
-
export { __niceevalExport24 as
|
|
54
|
-
const __niceevalExport25 = __niceevalCanonical["
|
|
55
|
-
export { __niceevalExport25 as
|
|
56
|
-
const __niceevalExport26 = __niceevalCanonical["
|
|
57
|
-
export { __niceevalExport26 as
|
|
58
|
-
const __niceevalExport27 = __niceevalCanonical["
|
|
59
|
-
export { __niceevalExport27 as
|
|
60
|
-
const __niceevalExport28 = __niceevalCanonical["
|
|
61
|
-
export { __niceevalExport28 as
|
|
62
|
-
const __niceevalExport29 = __niceevalCanonical["
|
|
63
|
-
export { __niceevalExport29 as
|
|
64
|
-
const __niceevalExport30 = __niceevalCanonical["
|
|
65
|
-
export { __niceevalExport30 as
|
|
66
|
-
const __niceevalExport31 = __niceevalCanonical["
|
|
67
|
-
export { __niceevalExport31 as
|
|
24
|
+
const __niceevalExport10 = __niceevalCanonical["findExperimentRunIds"];
|
|
25
|
+
export { __niceevalExport10 as findExperimentRunIds };
|
|
26
|
+
const __niceevalExport11 = __niceevalCanonical["listSealedRunSummaries"];
|
|
27
|
+
export { __niceevalExport11 as listSealedRunSummaries };
|
|
28
|
+
const __niceevalExport12 = __niceevalCanonical["logicalSealIdentity"];
|
|
29
|
+
export { __niceevalExport12 as logicalSealIdentity };
|
|
30
|
+
const __niceevalExport13 = __niceevalCanonical["persistSealedRun"];
|
|
31
|
+
export { __niceevalExport13 as persistSealedRun };
|
|
32
|
+
const __niceevalExport14 = __niceevalCanonical["prepareRunFinalization"];
|
|
33
|
+
export { __niceevalExport14 as prepareRunFinalization };
|
|
34
|
+
const __niceevalExport15 = __niceevalCanonical["publishRunSeal"];
|
|
35
|
+
export { __niceevalExport15 as publishRunSeal };
|
|
36
|
+
const __niceevalExport16 = __niceevalCanonical["readCollectionItemPage"];
|
|
37
|
+
export { __niceevalExport16 as readCollectionItemPage };
|
|
38
|
+
const __niceevalExport17 = __niceevalCanonical["readContentChunkPage"];
|
|
39
|
+
export { __niceevalExport17 as readContentChunkPage };
|
|
40
|
+
const __niceevalExport18 = __niceevalCanonical["readPublishedSealedRun"];
|
|
41
|
+
export { __niceevalExport18 as readPublishedSealedRun };
|
|
42
|
+
const __niceevalExport19 = __niceevalCanonical["readRecordCore"];
|
|
43
|
+
export { __niceevalExport19 as readRecordCore };
|
|
44
|
+
const __niceevalExport20 = __niceevalCanonical["readSealedRunCore"];
|
|
45
|
+
export { __niceevalExport20 as readSealedRunCore };
|
|
46
|
+
const __niceevalExport21 = __niceevalCanonical["readSealedRunCutoff"];
|
|
47
|
+
export { __niceevalExport21 as readSealedRunCutoff };
|
|
48
|
+
const __niceevalExport22 = __niceevalCanonical["readSealedRunDocument"];
|
|
49
|
+
export { __niceevalExport22 as readSealedRunDocument };
|
|
50
|
+
const __niceevalExport23 = __niceevalCanonical["readSealedRunSummary"];
|
|
51
|
+
export { __niceevalExport23 as readSealedRunSummary };
|
|
52
|
+
const __niceevalExport24 = __niceevalCanonical["readSealedRunSummaryPage"];
|
|
53
|
+
export { __niceevalExport24 as readSealedRunSummaryPage };
|
|
54
|
+
const __niceevalExport25 = __niceevalCanonical["sealRun"];
|
|
55
|
+
export { __niceevalExport25 as sealRun };
|
|
56
|
+
const __niceevalExport26 = __niceevalCanonical["stageAttachmentMetadata"];
|
|
57
|
+
export { __niceevalExport26 as stageAttachmentMetadata };
|
|
58
|
+
const __niceevalExport27 = __niceevalCanonical["stageAttachmentReferences"];
|
|
59
|
+
export { __niceevalExport27 as stageAttachmentReferences };
|
|
60
|
+
const __niceevalExport28 = __niceevalCanonical["stageCollectionItems"];
|
|
61
|
+
export { __niceevalExport28 as stageCollectionItems };
|
|
62
|
+
const __niceevalExport29 = __niceevalCanonical["stageRunCore"];
|
|
63
|
+
export { __niceevalExport29 as stageRunCore };
|
|
64
|
+
const __niceevalExport30 = __niceevalCanonical["stageRunFinalMetadata"];
|
|
65
|
+
export { __niceevalExport30 as stageRunFinalMetadata };
|
|
66
|
+
const __niceevalExport31 = __niceevalCanonical["stageRunPublicationMetadata"];
|
|
67
|
+
export { __niceevalExport31 as stageRunPublicationMetadata };
|
|
68
|
+
const __niceevalExport32 = __niceevalCanonical["stageSealEntries"];
|
|
69
|
+
export { __niceevalExport32 as stageSealEntries };
|
|
70
|
+
const __niceevalExport33 = __niceevalCanonical["verifyAllSealedRuns"];
|
|
71
|
+
export { __niceevalExport33 as verifyAllSealedRuns };
|
|
68
72
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,gCAAgC,CAAC;AACxD,QAAA,8BAA8B,GAAG,CAAC,CAAC;AACnC,QAAA,yBAAyB,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC,QAAA,8BAA8B,GAAG,IAAI,CAAC;AACtC,QAAA,+BAA+B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,QAAA,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,QAAA,2BAA2B,GAAG,EAAE,CAAC;AACjC,QAAA,4BAA4B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,QAAA,iCAAiC,GAAG,MAAM,CAAC;AAC3C,QAAA,iCAAiC,GAAG,OAAO,CAAC;AAC5C,QAAA,oCAAoC,GAAG,KAAK,CAAC","sourcesContent":["export const RECORD_SQLITE_FORMAT = \"niceeval.project-database/0.18\";\nexport const RECORD_SQLITE_STORAGE_REVISION = 1;\nexport const RECORD_SQLITE_CHUNK_BYTES = 256 * 1024;\nexport const RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;\nexport const RECORD_SQLITE_MAX_PUBLISH_BYTES = 8 * 1024 * 1024;\nexport const RECORD_SQLITE_MAX_ROW_BYTES = 1024 * 1024;\nexport const RECORD_SQLITE_MAX_PAGE_ROWS = 64;\nexport const RECORD_SQLITE_MAX_PAGE_BYTES = 4 * 1024 * 1024;\nexport const RECORD_SQLITE_MAX_VALIDATION_RUNS = 100000;\nexport const RECORD_SQLITE_MAX_VALIDATION_ROWS = 2000000;\nexport const RECORD_SQLITE_VALIDATION_DEADLINE_MS = 30000;\nexport type RunStatus = \"open\" | \"sealing\" | \"sealed\";\nexport type RecordOwnerKind = import(\"../model/core.ts\").RecordAttachmentOwner;\nexport type SealEntryKind = \"record\" | \"run\" | \"slot\" | \"member\" | \"attempt\" | \"attachment\" | \"attachment-reference\" | \"collection-item\" | \"content\" | \"content-chunk\";\nexport interface PersistedSlot {\n readonly slotId: string;\n readonly ordinal: number;\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n}\nexport interface PersistedAttempt {\n readonly attemptId: string;\n /** Canonical, persisted 60-bit locator projection. It is intentionally non-unique. */\n readonly attemptLocator: string;\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n readonly publicationIdentity?: {\n readonly originRunId: string;\n readonly attemptId: string;\n readonly revision: number;\n };\n}\nexport interface PersistedMember {\n /** Internal publication order; absent for legacy facts without a binding revision. */\n readonly bindingRevision?: number;\n readonly slotId: string;\n readonly originRunId?: string;\n readonly attemptId?: string;\n readonly action: \"executed\" | \"carried\" | \"accepted\" | \"not-dispatched\" | \"interrupted\";\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n readonly publicationIdentity?: {\n readonly originRunId: string;\n readonly attemptId: string;\n readonly revision: number;\n };\n}\nexport interface PersistedAttachmentReference {\n readonly ordinal: number;\n readonly owner: RecordOwnerKind;\n readonly family: string;\n readonly canonicalBytes: Uint8Array;\n readonly referenceDigest: string;\n}\nexport interface PersistedCollectionItem {\n readonly ordinal: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n}\nexport interface PersistedContentChunk {\n readonly ordinal: number;\n readonly bytes: Uint8Array;\n readonly chunkDigest: string;\n}\nexport interface PersistedContent {\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly byteLength: number;\n readonly digest: string;\n readonly chunks: readonly PersistedContentChunk[];\n}\nexport interface PersistedAttachment {\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly collectionItems: readonly PersistedCollectionItem[];\n readonly contents: readonly PersistedContent[];\n}\n/** Frozen physical input accepted by the Record Host's finalizer. */\nexport interface PersistSealedRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n /** Canonical root RecordDocument bytes (`format` and `recordId`). */\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n /** Canonical RunDocument bytes only; never an aggregate Record envelope. */\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly expectedLogicalSealIdentity?: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly PersistedAttachment[];\n readonly deadlineEpochMs: number;\n}\nexport interface SealEntry {\n readonly kind: SealEntryKind;\n readonly logicalIdentity: string;\n readonly digest: string;\n}\nexport interface SealedRunSummary {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly slotCount: number;\n readonly memberCount: number;\n readonly attemptCount: number;\n readonly attachmentCount: number;\n readonly contentCount: number;\n readonly contentByteLength: number;\n readonly sealEntryCount: number;\n}\nexport interface SealedRunCutoff {\n /** Hash of the ordered (RunId, logical Seal identity) pairs in the pinned generation. */\n readonly identity: string;\n readonly runCount: number;\n}\nexport interface SealedRunSummaryPage {\n readonly cutoff: SealedRunCutoff;\n readonly afterRunId: string;\n readonly summaries: readonly SealedRunSummary[];\n readonly nextAfterRunId: string | null;\n}\nexport interface AttemptLocatorCandidateRun {\n readonly locator: string;\n readonly originRunId: string;\n readonly attemptId: string;\n readonly relation: \"origin\" | \"target\";\n readonly runId: string;\n}\nexport interface AttemptLocatorCandidates {\n readonly locator: string;\n /** True when the non-unique locator names more than one exact Attempt identity. */\n readonly ambiguous: boolean;\n readonly candidates: readonly AttemptLocatorCandidateRun[];\n}\nexport interface ContentChunkPage {\n readonly contentId: string;\n readonly afterOrdinal: number;\n readonly chunks: readonly PersistedContentChunk[];\n readonly nextOrdinal: number | null;\n}\nexport interface CollectionItemPage {\n readonly attachmentId: string;\n readonly afterOrdinal: number;\n readonly items: readonly PersistedCollectionItem[];\n readonly nextOrdinal: number | null;\n}\nexport interface AppendContentChunksInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly contentId: string;\n readonly chunks: readonly PersistedContentChunk[];\n readonly deadlineEpochMs: number;\n}\nexport interface StageRunCoreInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly FinalizedAttachmentClosure[];\n readonly deadlineEpochMs: number;\n}\nexport type FinalizeRunInput = StageRunCoreInput;\nexport interface BeginRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitAttemptInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attemptId: string;\n readonly attemptLocator: string;\n readonly deadlineEpochMs: number;\n}\nexport interface DiscardAttemptInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attemptId: string;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitAttachmentInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitContentInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly deadlineEpochMs: number;\n}\nexport interface FinalizedAttachmentMetadata {\n readonly attachmentId: string;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly contents: readonly PersistedContentMetadata[];\n}\nexport interface FinalizedAttachmentClosure extends FinalizedAttachmentMetadata {\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n}\nexport interface RunFinalization {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly logicalSealIdentity: string;\n readonly sealEntryCount: number;\n}\nexport interface PreparedRunFinalization extends RunFinalization {\n readonly mutationSequence: number;\n}\nexport interface PrepareRunFinalizationInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly deadlineEpochMs: number;\n}\nexport interface FenceRunFinalizationInput extends PrepareRunFinalizationInput {\n readonly mutationSequence: number;\n readonly expectedLogicalSealIdentity: string;\n readonly expectedSealEntryCount: number;\n}\nexport interface StageAttachmentInput {\n readonly runId: string;\n readonly attachment: Omit<PersistedAttachment, \"references\" | \"collectionItems\" | \"contents\"> & {\n readonly contents: readonly PersistedContentMetadata[];\n };\n readonly deadlineEpochMs: number;\n}\nexport interface StageAttachmentReferencesInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly deadlineEpochMs: number;\n}\nexport interface StageCollectionItemsInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly items: readonly PersistedCollectionItem[];\n readonly deadlineEpochMs: number;\n}\nexport interface SealRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly expectedLogicalSealIdentity: string;\n readonly deadlineEpochMs: number;\n}\nexport interface StageSealEntriesInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly expectedLogicalSealIdentity: string;\n readonly startOrdinal: number;\n readonly maximumRows: number;\n readonly deadlineEpochMs: number;\n}\nexport interface StageSealEntriesResult {\n readonly nextOrdinal: number | null;\n readonly stagedCount: number;\n}\n/** Internal receipt for the storage worker's private generation primitive. */\nexport interface PersistedContentMetadata {\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly byteLength: number;\n readonly digest: string;\n readonly chunkCount: number;\n}\nexport interface SealedAttachmentDocument {\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly collectionItems: readonly PersistedCollectionItem[];\n readonly contents: readonly PersistedContentMetadata[];\n}\nexport interface SealedAttachmentMetadata extends Omit<SealedAttachmentDocument, \"collectionItems\"> {\n readonly collectionItemCount: number;\n readonly collectionItemByteLength: number;\n}\nexport interface SealedRunCore {\n readonly createdRevision?: number;\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly publicationManaged?: boolean;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly SealedAttachmentMetadata[];\n}\n/** One immutable Record read owns publication visibility, closure, and its derived overview. */\nexport interface PublishedSealedRun {\n readonly core: SealedRunCore;\n readonly summary: SealedRunSummary;\n}\nexport interface SealedRunDocument {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly SealedAttachmentDocument[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,gCAAgC,CAAC;AACxD,QAAA,8BAA8B,GAAG,CAAC,CAAC;AACnC,QAAA,yBAAyB,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC,QAAA,8BAA8B,GAAG,IAAI,CAAC;AACtC,QAAA,+BAA+B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,QAAA,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,QAAA,2BAA2B,GAAG,EAAE,CAAC;AACjC,QAAA,4BAA4B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,QAAA,iCAAiC,GAAG,MAAM,CAAC;AAC3C,QAAA,iCAAiC,GAAG,OAAO,CAAC;AAC5C,QAAA,oCAAoC,GAAG,KAAK,CAAC","sourcesContent":["export const RECORD_SQLITE_FORMAT = \"niceeval.project-database/0.18\";\nexport const RECORD_SQLITE_STORAGE_REVISION = 1;\nexport const RECORD_SQLITE_CHUNK_BYTES = 256 * 1024;\nexport const RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;\nexport const RECORD_SQLITE_MAX_PUBLISH_BYTES = 8 * 1024 * 1024;\nexport const RECORD_SQLITE_MAX_ROW_BYTES = 1024 * 1024;\nexport const RECORD_SQLITE_MAX_PAGE_ROWS = 64;\nexport const RECORD_SQLITE_MAX_PAGE_BYTES = 4 * 1024 * 1024;\nexport const RECORD_SQLITE_MAX_VALIDATION_RUNS = 100000;\nexport const RECORD_SQLITE_MAX_VALIDATION_ROWS = 2000000;\nexport const RECORD_SQLITE_VALIDATION_DEADLINE_MS = 30000;\nexport type RunStatus = \"open\" | \"sealing\" | \"sealed\";\nexport type RecordOwnerKind = import(\"../model/core.ts\").RecordAttachmentOwner;\nexport type SealEntryKind = \"record\" | \"run\" | \"slot\" | \"member\" | \"attempt\" | \"attachment\" | \"attachment-reference\" | \"collection-item\" | \"content\" | \"content-chunk\";\nexport interface PersistedSlot {\n readonly slotId: string;\n readonly ordinal: number;\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n}\nexport interface PersistedAttempt {\n readonly attemptId: string;\n /** Canonical, persisted 60-bit locator projection. It is intentionally non-unique. */\n readonly attemptLocator: string;\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n readonly publicationIdentity?: {\n readonly originRunId: string;\n readonly attemptId: string;\n readonly revision: number;\n };\n}\nexport interface PersistedMember {\n /** Internal publication order; absent for legacy facts without a binding revision. */\n readonly bindingRevision?: number;\n readonly slotId: string;\n readonly originRunId?: string;\n readonly attemptId?: string;\n readonly action: \"executed\" | \"carried\" | \"accepted\" | \"not-dispatched\" | \"interrupted\";\n readonly coreBytes: Uint8Array;\n readonly coreDigest: string;\n readonly publicationIdentity?: {\n readonly originRunId: string;\n readonly attemptId: string;\n readonly revision: number;\n };\n}\nexport interface PersistedAttachmentReference {\n readonly ordinal: number;\n readonly owner: RecordOwnerKind;\n readonly family: string;\n readonly canonicalBytes: Uint8Array;\n readonly referenceDigest: string;\n}\nexport interface PersistedCollectionItem {\n readonly ordinal: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n}\nexport interface PersistedContentChunk {\n readonly ordinal: number;\n readonly bytes: Uint8Array;\n readonly chunkDigest: string;\n}\nexport interface PersistedContent {\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly byteLength: number;\n readonly digest: string;\n readonly chunks: readonly PersistedContentChunk[];\n}\nexport interface PersistedAttachment {\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly collectionItems: readonly PersistedCollectionItem[];\n readonly contents: readonly PersistedContent[];\n}\n/** Frozen physical input accepted by the Record Host's finalizer. */\nexport interface PersistSealedRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n /** Canonical root RecordDocument bytes (`format` and `recordId`). */\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n /** Canonical RunDocument bytes only; never an aggregate Record envelope. */\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly expectedLogicalSealIdentity?: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly PersistedAttachment[];\n readonly deadlineEpochMs: number;\n}\nexport interface SealEntry {\n readonly kind: SealEntryKind;\n readonly logicalIdentity: string;\n readonly digest: string;\n}\nexport interface SealedRunSummary {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly slotCount: number;\n readonly memberCount: number;\n readonly attemptCount: number;\n readonly attachmentCount: number;\n readonly contentCount: number;\n readonly contentByteLength: number;\n readonly sealEntryCount: number;\n}\nexport interface SealedRunCutoff {\n /** Pinned publication identity; standalone inventory reads hash the ordered Seals. */\n readonly identity: string;\n readonly runCount: number;\n}\nexport interface SealedRunSummaryPage {\n readonly cutoff: SealedRunCutoff;\n readonly afterRunId: string;\n readonly summaries: readonly SealedRunSummary[];\n readonly nextAfterRunId: string | null;\n}\nexport interface AttemptLocatorCandidateRun {\n readonly locator: string;\n readonly originRunId: string;\n readonly attemptId: string;\n readonly relation: \"origin\" | \"target\";\n readonly runId: string;\n}\nexport interface AttemptLocatorCandidates {\n readonly locator: string;\n /** True when the non-unique locator names more than one exact Attempt identity. */\n readonly ambiguous: boolean;\n readonly candidates: readonly AttemptLocatorCandidateRun[];\n}\nexport interface ContentChunkPage {\n readonly contentId: string;\n readonly afterOrdinal: number;\n readonly chunks: readonly PersistedContentChunk[];\n readonly nextOrdinal: number | null;\n}\nexport interface CollectionItemPage {\n readonly attachmentId: string;\n readonly afterOrdinal: number;\n readonly items: readonly PersistedCollectionItem[];\n readonly nextOrdinal: number | null;\n}\nexport interface AppendContentChunksInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly contentId: string;\n readonly chunks: readonly PersistedContentChunk[];\n readonly deadlineEpochMs: number;\n}\nexport interface StageRunCoreInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly FinalizedAttachmentClosure[];\n readonly deadlineEpochMs: number;\n}\nexport type FinalizeRunInput = StageRunCoreInput;\nexport interface BeginRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitAttemptInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attemptId: string;\n readonly attemptLocator: string;\n readonly deadlineEpochMs: number;\n}\nexport interface DiscardAttemptInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attemptId: string;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitAttachmentInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly deadlineEpochMs: number;\n}\nexport interface AdmitContentInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly deadlineEpochMs: number;\n}\nexport interface FinalizedAttachmentMetadata {\n readonly attachmentId: string;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly contents: readonly PersistedContentMetadata[];\n}\nexport interface FinalizedAttachmentClosure extends FinalizedAttachmentMetadata {\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n}\nexport interface RunFinalization {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly logicalSealIdentity: string;\n readonly sealEntryCount: number;\n}\nexport interface PreparedRunFinalization extends RunFinalization {\n readonly mutationSequence: number;\n}\nexport interface PrepareRunFinalizationInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly deadlineEpochMs: number;\n}\nexport interface FenceRunFinalizationInput extends PrepareRunFinalizationInput {\n readonly mutationSequence: number;\n readonly expectedLogicalSealIdentity: string;\n readonly expectedSealEntryCount: number;\n}\nexport interface StageAttachmentInput {\n readonly runId: string;\n readonly attachment: Omit<PersistedAttachment, \"references\" | \"collectionItems\" | \"contents\"> & {\n readonly contents: readonly PersistedContentMetadata[];\n };\n readonly deadlineEpochMs: number;\n}\nexport interface StageAttachmentReferencesInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly deadlineEpochMs: number;\n}\nexport interface StageCollectionItemsInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly attachmentId: string;\n readonly items: readonly PersistedCollectionItem[];\n readonly deadlineEpochMs: number;\n}\nexport interface SealRunInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly expectedLogicalSealIdentity: string;\n readonly deadlineEpochMs: number;\n}\nexport interface StageSealEntriesInput {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly expectedLogicalSealIdentity: string;\n readonly startOrdinal: number;\n readonly maximumRows: number;\n readonly deadlineEpochMs: number;\n}\nexport interface StageSealEntriesResult {\n readonly nextOrdinal: number | null;\n readonly stagedCount: number;\n}\n/** Internal receipt for the storage worker's private generation primitive. */\nexport interface PersistedContentMetadata {\n readonly contentId: string;\n readonly logicalHandle: string;\n readonly byteLength: number;\n readonly digest: string;\n readonly chunkCount: number;\n}\nexport interface SealedAttachmentDocument {\n readonly attachmentId: string;\n readonly ownerKind: RecordOwnerKind;\n readonly ownerRunId: string;\n readonly ownerAttemptId?: string;\n readonly family: string;\n readonly familyRevision: number;\n readonly logicalIdentity: string;\n readonly canonicalBytes: Uint8Array;\n readonly canonicalDigest: string;\n readonly logicalInventoryBytes: Uint8Array;\n readonly inventoryDigest: string;\n readonly references: readonly PersistedAttachmentReference[];\n readonly collectionItems: readonly PersistedCollectionItem[];\n readonly contents: readonly PersistedContentMetadata[];\n}\nexport interface SealedAttachmentMetadata extends Omit<SealedAttachmentDocument, \"collectionItems\"> {\n readonly collectionItemCount: number;\n readonly collectionItemByteLength: number;\n}\nexport interface SealedRunCore {\n readonly createdRevision?: number;\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly publicationManaged?: boolean;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly SealedAttachmentMetadata[];\n}\n/** One immutable Record read owns publication visibility, closure, and its derived overview. */\nexport interface PublishedSealedRun {\n readonly core: SealedRunCore;\n readonly summary: SealedRunSummary;\n}\nexport interface SealedRunDocument {\n readonly runId: string;\n readonly writerGeneration: string;\n readonly startedAt: string;\n readonly logicalSealIdentity: string;\n readonly recordCoreBytes: Uint8Array;\n readonly recordCoreDigest: string;\n readonly runCoreBytes: Uint8Array;\n readonly runCoreDigest: string;\n readonly slots: readonly PersistedSlot[];\n readonly attempts: readonly PersistedAttempt[];\n readonly members: readonly PersistedMember[];\n readonly attachments: readonly SealedAttachmentDocument[];\n}\n"]}
|
|
@@ -123,7 +123,7 @@ export interface SealedRunSummary {
|
|
|
123
123
|
readonly sealEntryCount: number;
|
|
124
124
|
}
|
|
125
125
|
export interface SealedRunCutoff {
|
|
126
|
-
/**
|
|
126
|
+
/** Pinned publication identity; standalone inventory reads hash the ordered Seals. */
|
|
127
127
|
readonly identity: string;
|
|
128
128
|
readonly runCount: number;
|
|
129
129
|
}
|
|
@@ -123,7 +123,7 @@ export interface SealedRunSummary {
|
|
|
123
123
|
readonly sealEntryCount: number;
|
|
124
124
|
}
|
|
125
125
|
export interface SealedRunCutoff {
|
|
126
|
-
/**
|
|
126
|
+
/** Pinned publication identity; standalone inventory reads hash the ordered Seals. */
|
|
127
127
|
readonly identity: string;
|
|
128
128
|
readonly runCount: number;
|
|
129
129
|
}
|
|
@@ -123,7 +123,7 @@ export interface SealedRunSummary {
|
|
|
123
123
|
readonly sealEntryCount: number;
|
|
124
124
|
}
|
|
125
125
|
export interface SealedRunCutoff {
|
|
126
|
-
/**
|
|
126
|
+
/** Pinned publication identity; standalone inventory reads hash the ordered Seals. */
|
|
127
127
|
readonly identity: string;
|
|
128
128
|
readonly runCount: number;
|
|
129
129
|
}
|
|
@@ -11,6 +11,7 @@ const application_ts_1 = require("../../cli/application.cjs");
|
|
|
11
11
|
const contribution_ts_1 = require("../../cli/contribution.cjs");
|
|
12
12
|
const identifiers_ts_1 = require("../../record/codec/identifiers.cjs");
|
|
13
13
|
const index_ts_1 = require("../../record/sqlite/index.cjs");
|
|
14
|
+
const cutoff_ts_1 = require("../../run/storage/cutoff.cjs");
|
|
14
15
|
const external_record_import_ts_1 = require("../../record/sqlite/external-record-import.cjs");
|
|
15
16
|
const project_configuration_ts_1 = require("../../cli/project-configuration.cjs");
|
|
16
17
|
const project_source_ts_1 = require("../../inspection/project-source.cjs");
|
|
@@ -152,7 +153,7 @@ function operationalCutoffAt(cwd) {
|
|
|
152
153
|
return effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
|
|
153
154
|
const session = yield* (0, index_ts_1.acquireProjectRecordReadSession)((0, node_path_1.resolve)(cwd, ".niceeval")).pipe(effect_1.Effect.mapError((cause) => failure("open operational sealed cutoff", cause)));
|
|
154
155
|
return yield* effect_1.Effect.try({
|
|
155
|
-
try: () => session.
|
|
156
|
+
try: () => ({ identity: (0, cutoff_ts_1.publicationCutoffIdentity)(session.publicationCutoff()) }),
|
|
156
157
|
catch: (cause) => failure("read operational sealed cutoff", cause),
|
|
157
158
|
});
|
|
158
159
|
}));
|
|
@@ -165,7 +166,7 @@ function importedCutoffAt(recordPath) {
|
|
|
165
166
|
}
|
|
166
167
|
function withRecordSession(acquire, operation) {
|
|
167
168
|
return effect_1.Effect.acquireUseRelease(acquire, (session) => effect_1.Effect.try({
|
|
168
|
-
try: () => session.
|
|
169
|
+
try: () => session.sealedCutoff(),
|
|
169
170
|
catch: (cause) => failure(operation, cause),
|
|
170
171
|
}), (session) => effect_1.Effect.sync(() => session.close()));
|
|
171
172
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,qDAAqD;AACrD,4DAA4D;AAC5D,yCAAoC;AACpC,qCAAqC;AACrC,mCAAuD;AACvD,6DAAmI;AACnI,+DAAyF;AACzF,sEAAgE;AAEhE,2DAAgH;AAChH,6FAA0F;AAC1F,iFAA4G;AAC5G,0EAA8E;AAC9E,wEAAiE;AACjE,8CAA4C;AAC5C,gDAAmF;AACnF,4CAAmD;AAEnD,4CAA8C;AAC9C,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAA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AAC,KAA8C;IAC7D,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;IACrD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK;QACvD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;AACzF,CAAC;AACD,SAAS,UAAU,CAAC,MAAmB;IACnC,OAAO,eAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE;QAC9B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,eAAM,CAAC,IAAI,CAAC,CAAC;YACpB,OAAO,eAAM,CAAC,IAAI,CAAC;QACvB,CAAC;QACD,MAAM,OAAO,GAAG,GAAS,EAAE,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,eAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC;AACY,QAAA,cAAc,GAAgD,MAAM,CAAC,MAAM,CAAC;IACrF,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,wBAAgB;IACzB,GAAG,EAAE,OAAO;CACf,CAAC,CAAC","sourcesContent":["// @concord-file ne-surface-view-cli\n// @concord-implements docs/feature/insight/README.md\n// @concord-implements docs/feature/run-inspection/README.md\nimport { resolve } from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { Effect, Result, Schema, Scope } from \"effect\";\nimport { CliArguments, CliInterruption, CliInvocationFacts, CliOutput, type CliOptionDefinition, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { RunIdSchema } from \"../../record/codec/identifiers.ts\";\nimport type { RunId } from \"../../record/model/identifiers.ts\";\nimport { openHostOwnedRecordReadSession, acquireProjectRecordReadSession, } from \"../../record/sqlite/index.ts\";\nimport { startExternalRecordImport } from \"../../record/sqlite/external-record-import.ts\";\nimport { ProjectConfiguration, type ProjectConfigurationService } from \"../../cli/project-configuration.ts\";\nimport { openCurrentProjectSource } from \"../../inspection/project-source.ts\";\nimport { projectInput } from \"../../inspection/project-input.ts\";\nimport { ViewBrowser } from \"../browser.ts\";\nimport { renderViewLifecycleEvent, VIEW_LIFECYCLE_PROTOCOL } from \"../protocol.ts\";\nimport { buildViewGeneration } from \"../render.ts\";\nimport type { ViewGeneration, ViewTarget } from \"../revision.ts\";\nimport { openViewServer } from \"../server.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const VIEW_CLI_OPTIONS = Object.freeze({\n run: option({ type: \"string\", multiple: true, help: help(\"Select one sealed Run; repeat to select more.\") }),\n \"no-open\": option({ type: \"boolean\", help: help(\"Do not request the OS browser.\") }),\n port: option({ type: \"string\", help: help(\"Listen on this loopback port; 0 chooses one.\") }),\n json: option({ type: \"boolean\", help: help(\"Write View lifecycle events as NDJSON.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print view help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst VIEW_HELP = `niceeval view — open the first-party human View\n\nUsage:\n niceeval view [--run <run-id>...] [--no-open] [--port <port>] [--json]\n`;\ntype Requirements = CliArguments | CliInterruption | CliInvocationFacts | CliOutput | ViewBrowser | ProjectConfiguration | Scope.Scope;\ntype Error = CliFeatureError;\nconst VIEW_RUN_SELECTION_LIMIT = 64;\nconst RECORD_IMPORT_DEADLINE_MS = 30000;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"view\", operation, cause, exitCode: 1 });\n}\nfunction targetFailureReason(cause: unknown): string {\n const underlying = cause instanceof CliFeatureError ? cause.cause : cause;\n const reason = typeof underlying === \"object\" && underlying !== null && \"reason\" in underlying &&\n typeof underlying.reason === \"string\"\n ? underlying.reason\n : underlying instanceof Error ? underlying.message : String(underlying);\n return `${typeof underlying === \"object\" && underlying !== null && \"code\" in underlying &&\n typeof underlying.code === \"string\" ? underlying.code : \"prepare-current-target\"}: ${reason}`.slice(0, 2000);\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message.endsWith(\"\\n\") ? message : `${message}\\n`}`).pipe(Effect.as(1));\n}\nfunction runView(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, VIEW_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", VIEW_HELP);\n return 0;\n }\n if (parsed.positionals.length !== 0)\n return yield* usage(\"niceeval view does not accept positional arguments.\");\n const runIds = parseRunIds(parsed.values.run);\n if (typeof runIds === \"string\")\n return yield* usage(runIds);\n const port = parsePort(parsed.values.port);\n if (typeof port === \"string\")\n return yield* usage(port);\n const facts = yield* invocationFacts();\n const execute = Effect.gen(function* () {\n const json = parsed.values.json === true;\n const sourcePath = resolve(facts.cwd, \".niceeval/record.sqlite\");\n const currentCapable = existsSync(resolve(facts.cwd, \"niceeval.config.ts\"));\n const project = yield* ProjectConfiguration;\n const built = yield* buildRecordGeneration(sourcePath, facts.cwd, project, currentCapable, false);\n const initial = built.generation;\n const scope = yield* Effect.scope;\n const server = yield* openViewServer({\n initial, port, refreshEnabled: true, initialRunIds: runIds,\n refreshSource: {\n cutoffIdentity: () => Effect.runPromise(operationalCutoffAt(facts.cwd).pipe(Effect.map((cutoff) => cutoff.identity))),\n build: () => Effect.runPromise(buildRecordGeneration(sourcePath, facts.cwd, project, currentCapable, true).pipe(Effect.provideService(Scope.Scope, scope), Effect.map((next) => next.generation))),\n },\n }).pipe(Effect.mapError((cause) => failure(\"open loopback View\", cause)));\n yield* write(\"stdout\", json\n ? renderViewLifecycleEvent({ protocol: VIEW_LIFECYCLE_PROTOCOL, event: \"ready\", url: server.readyUrl })\n : `niceeval view — open in a browser:\\n${server.readyUrl}\\n`);\n if (parsed.values[\"no-open\"] !== true) {\n const browser = yield* ViewBrowser;\n yield* browser.open(server.readyUrl).pipe(Effect.catch(() => Effect.succeed(false)));\n }\n const interruption = yield* CliInterruption;\n if (!interruption.enterGracefulDispatch())\n return yield* Effect.interrupt;\n yield* awaitAbort(interruption.invocationSignal);\n yield* server.close;\n if (json)\n yield* write(\"stdout\", renderViewLifecycleEvent({ protocol: VIEW_LIFECYCLE_PROTOCOL, event: \"closed\" }));\n return 0;\n });\n return yield* execute.pipe(Effect.catch((cause) => Effect.fail(cause instanceof CliFeatureError ? cause : failure(\"run View\", cause))));\n });\n}\nfunction buildRecordGeneration(sourcePath: string, cwd: string, project: ProjectConfigurationService, currentCapable: boolean, refresh: boolean): Effect.Effect<{\n readonly generation: ViewGeneration;\n readonly cutoffIdentity: string;\n}, Error, Scope.Scope> {\n return Effect.gen(function* () {\n const importer = yield* Effect.acquireRelease(Effect.try({\n try: () => startExternalRecordImport(sourcePath, Date.now() + RECORD_IMPORT_DEADLINE_MS, \"project-record\"),\n catch: (cause) => failure(\"start Record import\", cause),\n }), (handle) => Effect.promise(() => handle.close().catch(() => undefined)));\n return yield* Effect.gen(function* () {\n const imported = yield* Effect.tryPromise({\n try: (_signal) => importer.result,\n catch: (cause) => failure(\"import Record\", cause),\n });\n let retired = false;\n const retire = async (): Promise<void> => {\n if (retired)\n return;\n retired = true;\n await importer.close();\n };\n const cutoff = yield* importedCutoffAt(imported.path);\n const prepareTarget = Effect.scoped(Effect.gen(function* () {\n const config = yield* (refresh ? project.rebuild(cwd) : project.load(cwd));\n const source = yield* openCurrentProjectSource({ cwd, config, recordPath: imported.path, freshImport: true });\n const frozen = projectInput(source);\n if (frozen === undefined || frozen.cutoffIdentity !== cutoff.identity) {\n return yield* Effect.fail(new Error(\"Current target and imported Record cutoff differ.\"));\n }\n return Object.freeze({ kind: \"current\" as const, identity: frozen.target.identity, input: frozen });\n })).pipe(Effect.mapError((cause) => failure(\"prepare current target\", cause)));\n const target: ViewTarget = !currentCapable\n ? { kind: \"history\" }\n : yield* (refresh ? prepareTarget : prepareTarget.pipe(Effect.catch((cause) => Effect.succeed({ kind: \"unavailable\" as const, reason: targetFailureReason(cause) }))));\n const generation = yield* buildViewGeneration({\n recordPath: imported.path,\n sourceCutoffIdentity: cutoff.identity,\n target,\n retire,\n }).pipe(Effect.mapError((cause) => failure(\"build View revision\", cause)));\n return Object.freeze({ generation, cutoffIdentity: cutoff.identity });\n }).pipe(Effect.catchCause((cause) => Effect.promise(() => importer.close().catch(() => undefined)).pipe(Effect.andThen(Effect.failCause(cause)))));\n });\n}\nfunction operationalCutoffAt(cwd: string) {\n return Effect.scoped(Effect.gen(function* () {\n const session = yield* acquireProjectRecordReadSession(resolve(cwd, \".niceeval\")).pipe(Effect.mapError((cause) => failure(\"open operational sealed cutoff\", cause)));\n return yield* Effect.try({\n try: () => session.readSealedRunSummaryPage(\"\", 1).cutoff,\n catch: (cause) => failure(\"read operational sealed cutoff\", cause),\n });\n }));\n}\nfunction importedCutoffAt(recordPath: string) {\n return withRecordSession(Effect.try({\n try: () => openHostOwnedRecordReadSession(recordPath),\n catch: (cause) => failure(\"open imported Record\", cause),\n }), \"read imported Record cutoff\");\n}\nfunction withRecordSession(acquire: Effect.Effect<ReturnType<typeof openHostOwnedRecordReadSession>, Error>, operation: string) {\n return Effect.acquireUseRelease(acquire, (session) => Effect.try({\n try: () => session.readSealedRunSummaryPage(\"\", 1).cutoff,\n catch: (cause) => failure(operation, cause),\n }), (session) => Effect.sync(() => session.close()));\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction parseRunIds(value: string | boolean | string[] | undefined): readonly RunId[] | string {\n const values = typeof value === \"string\" ? [value] : Array.isArray(value) ? value : [];\n if (values.length > VIEW_RUN_SELECTION_LIMIT)\n return `niceeval view accepts at most ${VIEW_RUN_SELECTION_LIMIT} --run selections.`;\n const output: RunId[] = [];\n for (const candidate of [...new Set(values)]) {\n const decoded = Schema.decodeUnknownResult(RunIdSchema)(candidate);\n if (Result.isFailure(decoded))\n return `Invalid --run value ${JSON.stringify(candidate)}.`;\n output.push(decoded.success);\n }\n return Object.freeze(output);\n}\nfunction parsePort(value: string | boolean | string[] | undefined): number | string {\n const text = typeof value === \"string\" ? value : \"0\";\n const port = Number(text);\n return Number.isInteger(port) && port >= 0 && port <= 65535\n ? port\n : `--port must be an integer from 0 through 65535, got ${JSON.stringify(text)}.`;\n}\nfunction awaitAbort(signal: AbortSignal): Effect.Effect<void> {\n return Effect.callback((resume) => {\n if (signal.aborted) {\n resume(Effect.void);\n return Effect.void;\n }\n const aborted = (): void => resume(Effect.void);\n signal.addEventListener(\"abort\", aborted, { once: true });\n return Effect.sync(() => signal.removeEventListener(\"abort\", aborted));\n });\n}\nexport const viewCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"view\",\n summary: \"open the first-party human View\",\n options: VIEW_CLI_OPTIONS,\n run: runView,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;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AAO,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC;AACY,QAAA,cAAc,GAAgD,MAAM,CAAC,MAAM,CAAC;IACrF,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,wBAAgB;IACzB,GAAG,EAAE,OAAO;CACf,CAAC,CAAC","sourcesContent":["// @concord-file ne-surface-view-cli\n// @concord-implements docs/feature/insight/README.md\n// @concord-implements docs/feature/run-inspection/README.md\nimport { resolve } from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { Effect, Result, Schema, Scope } from \"effect\";\nimport { CliArguments, CliInterruption, CliInvocationFacts, CliOutput, type CliOptionDefinition, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { RunIdSchema } from \"../../record/codec/identifiers.ts\";\nimport type { RunId } from \"../../record/model/identifiers.ts\";\nimport { openHostOwnedRecordReadSession, acquireProjectRecordReadSession, } from \"../../record/sqlite/index.ts\";\nimport { publicationCutoffIdentity } from \"../../run/storage/cutoff.ts\";\nimport { startExternalRecordImport } from \"../../record/sqlite/external-record-import.ts\";\nimport { ProjectConfiguration, type ProjectConfigurationService } from \"../../cli/project-configuration.ts\";\nimport { openCurrentProjectSource } from \"../../inspection/project-source.ts\";\nimport { projectInput } from \"../../inspection/project-input.ts\";\nimport { ViewBrowser } from \"../browser.ts\";\nimport { renderViewLifecycleEvent, VIEW_LIFECYCLE_PROTOCOL } from \"../protocol.ts\";\nimport { buildViewGeneration } from \"../render.ts\";\nimport type { ViewGeneration, ViewTarget } from \"../revision.ts\";\nimport { openViewServer } from \"../server.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const VIEW_CLI_OPTIONS = Object.freeze({\n run: option({ type: \"string\", multiple: true, help: help(\"Select one sealed Run; repeat to select more.\") }),\n \"no-open\": option({ type: \"boolean\", help: help(\"Do not request the OS browser.\") }),\n port: option({ type: \"string\", help: help(\"Listen on this loopback port; 0 chooses one.\") }),\n json: option({ type: \"boolean\", help: help(\"Write View lifecycle events as NDJSON.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print view help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst VIEW_HELP = `niceeval view — open the first-party human View\n\nUsage:\n niceeval view [--run <run-id>...] [--no-open] [--port <port>] [--json]\n`;\ntype Requirements = CliArguments | CliInterruption | CliInvocationFacts | CliOutput | ViewBrowser | ProjectConfiguration | Scope.Scope;\ntype Error = CliFeatureError;\nconst VIEW_RUN_SELECTION_LIMIT = 64;\nconst RECORD_IMPORT_DEADLINE_MS = 30000;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"view\", operation, cause, exitCode: 1 });\n}\nfunction targetFailureReason(cause: unknown): string {\n const underlying = cause instanceof CliFeatureError ? cause.cause : cause;\n const reason = typeof underlying === \"object\" && underlying !== null && \"reason\" in underlying &&\n typeof underlying.reason === \"string\"\n ? underlying.reason\n : underlying instanceof Error ? underlying.message : String(underlying);\n return `${typeof underlying === \"object\" && underlying !== null && \"code\" in underlying &&\n typeof underlying.code === \"string\" ? underlying.code : \"prepare-current-target\"}: ${reason}`.slice(0, 2000);\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message.endsWith(\"\\n\") ? message : `${message}\\n`}`).pipe(Effect.as(1));\n}\nfunction runView(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, VIEW_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", VIEW_HELP);\n return 0;\n }\n if (parsed.positionals.length !== 0)\n return yield* usage(\"niceeval view does not accept positional arguments.\");\n const runIds = parseRunIds(parsed.values.run);\n if (typeof runIds === \"string\")\n return yield* usage(runIds);\n const port = parsePort(parsed.values.port);\n if (typeof port === \"string\")\n return yield* usage(port);\n const facts = yield* invocationFacts();\n const execute = Effect.gen(function* () {\n const json = parsed.values.json === true;\n const sourcePath = resolve(facts.cwd, \".niceeval/record.sqlite\");\n const currentCapable = existsSync(resolve(facts.cwd, \"niceeval.config.ts\"));\n const project = yield* ProjectConfiguration;\n const built = yield* buildRecordGeneration(sourcePath, facts.cwd, project, currentCapable, false);\n const initial = built.generation;\n const scope = yield* Effect.scope;\n const server = yield* openViewServer({\n initial, port, refreshEnabled: true, initialRunIds: runIds,\n refreshSource: {\n cutoffIdentity: () => Effect.runPromise(operationalCutoffAt(facts.cwd).pipe(Effect.map((cutoff) => cutoff.identity))),\n build: () => Effect.runPromise(buildRecordGeneration(sourcePath, facts.cwd, project, currentCapable, true).pipe(Effect.provideService(Scope.Scope, scope), Effect.map((next) => next.generation))),\n },\n }).pipe(Effect.mapError((cause) => failure(\"open loopback View\", cause)));\n yield* write(\"stdout\", json\n ? renderViewLifecycleEvent({ protocol: VIEW_LIFECYCLE_PROTOCOL, event: \"ready\", url: server.readyUrl })\n : `niceeval view — open in a browser:\\n${server.readyUrl}\\n`);\n if (parsed.values[\"no-open\"] !== true) {\n const browser = yield* ViewBrowser;\n yield* browser.open(server.readyUrl).pipe(Effect.catch(() => Effect.succeed(false)));\n }\n const interruption = yield* CliInterruption;\n if (!interruption.enterGracefulDispatch())\n return yield* Effect.interrupt;\n yield* awaitAbort(interruption.invocationSignal);\n yield* server.close;\n if (json)\n yield* write(\"stdout\", renderViewLifecycleEvent({ protocol: VIEW_LIFECYCLE_PROTOCOL, event: \"closed\" }));\n return 0;\n });\n return yield* execute.pipe(Effect.catch((cause) => Effect.fail(cause instanceof CliFeatureError ? cause : failure(\"run View\", cause))));\n });\n}\nfunction buildRecordGeneration(sourcePath: string, cwd: string, project: ProjectConfigurationService, currentCapable: boolean, refresh: boolean): Effect.Effect<{\n readonly generation: ViewGeneration;\n readonly cutoffIdentity: string;\n}, Error, Scope.Scope> {\n return Effect.gen(function* () {\n const importer = yield* Effect.acquireRelease(Effect.try({\n try: () => startExternalRecordImport(sourcePath, Date.now() + RECORD_IMPORT_DEADLINE_MS, \"project-record\"),\n catch: (cause) => failure(\"start Record import\", cause),\n }), (handle) => Effect.promise(() => handle.close().catch(() => undefined)));\n return yield* Effect.gen(function* () {\n const imported = yield* Effect.tryPromise({\n try: (_signal) => importer.result,\n catch: (cause) => failure(\"import Record\", cause),\n });\n let retired = false;\n const retire = async (): Promise<void> => {\n if (retired)\n return;\n retired = true;\n await importer.close();\n };\n const cutoff = yield* importedCutoffAt(imported.path);\n const prepareTarget = Effect.scoped(Effect.gen(function* () {\n const config = yield* (refresh ? project.rebuild(cwd) : project.load(cwd));\n const source = yield* openCurrentProjectSource({ cwd, config, recordPath: imported.path, freshImport: true });\n const frozen = projectInput(source);\n if (frozen === undefined || frozen.cutoffIdentity !== cutoff.identity) {\n return yield* Effect.fail(new Error(\"Current target and imported Record cutoff differ.\"));\n }\n return Object.freeze({ kind: \"current\" as const, identity: frozen.target.identity, input: frozen });\n })).pipe(Effect.mapError((cause) => failure(\"prepare current target\", cause)));\n const target: ViewTarget = !currentCapable\n ? { kind: \"history\" }\n : yield* (refresh ? prepareTarget : prepareTarget.pipe(Effect.catch((cause) => Effect.succeed({ kind: \"unavailable\" as const, reason: targetFailureReason(cause) }))));\n const generation = yield* buildViewGeneration({\n recordPath: imported.path,\n sourceCutoffIdentity: cutoff.identity,\n target,\n retire,\n }).pipe(Effect.mapError((cause) => failure(\"build View revision\", cause)));\n return Object.freeze({ generation, cutoffIdentity: cutoff.identity });\n }).pipe(Effect.catchCause((cause) => Effect.promise(() => importer.close().catch(() => undefined)).pipe(Effect.andThen(Effect.failCause(cause)))));\n });\n}\nfunction operationalCutoffAt(cwd: string) {\n return Effect.scoped(Effect.gen(function* () {\n const session = yield* acquireProjectRecordReadSession(resolve(cwd, \".niceeval\")).pipe(Effect.mapError((cause) => failure(\"open operational sealed cutoff\", cause)));\n return yield* Effect.try({\n try: () => ({ identity: publicationCutoffIdentity(session.publicationCutoff()) }),\n catch: (cause) => failure(\"read operational sealed cutoff\", cause),\n });\n }));\n}\nfunction importedCutoffAt(recordPath: string) {\n return withRecordSession(Effect.try({\n try: () => openHostOwnedRecordReadSession(recordPath),\n catch: (cause) => failure(\"open imported Record\", cause),\n }), \"read imported Record cutoff\");\n}\nfunction withRecordSession(acquire: Effect.Effect<ReturnType<typeof openHostOwnedRecordReadSession>, Error>, operation: string) {\n return Effect.acquireUseRelease(acquire, (session) => Effect.try({\n try: () => session.sealedCutoff(),\n catch: (cause) => failure(operation, cause),\n }), (session) => Effect.sync(() => session.close()));\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction parseRunIds(value: string | boolean | string[] | undefined): readonly RunId[] | string {\n const values = typeof value === \"string\" ? [value] : Array.isArray(value) ? value : [];\n if (values.length > VIEW_RUN_SELECTION_LIMIT)\n return `niceeval view accepts at most ${VIEW_RUN_SELECTION_LIMIT} --run selections.`;\n const output: RunId[] = [];\n for (const candidate of [...new Set(values)]) {\n const decoded = Schema.decodeUnknownResult(RunIdSchema)(candidate);\n if (Result.isFailure(decoded))\n return `Invalid --run value ${JSON.stringify(candidate)}.`;\n output.push(decoded.success);\n }\n return Object.freeze(output);\n}\nfunction parsePort(value: string | boolean | string[] | undefined): number | string {\n const text = typeof value === \"string\" ? value : \"0\";\n const port = Number(text);\n return Number.isInteger(port) && port >= 0 && port <= 65535\n ? port\n : `--port must be an integer from 0 through 65535, got ${JSON.stringify(text)}.`;\n}\nfunction awaitAbort(signal: AbortSignal): Effect.Effect<void> {\n return Effect.callback((resume) => {\n if (signal.aborted) {\n resume(Effect.void);\n return Effect.void;\n }\n const aborted = (): void => resume(Effect.void);\n signal.addEventListener(\"abort\", aborted, { once: true });\n return Effect.sync(() => signal.removeEventListener(\"abort\", aborted));\n });\n}\nexport const viewCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"view\",\n summary: \"open the first-party human View\",\n options: VIEW_CLI_OPTIONS,\n run: runView,\n});\n"]}
|