niceeval 0.16.3-canary.99 → 0.17.1
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/cli/bootstrap.cjs +7 -1
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/project-configuration.cjs +8 -11
- package/dist/cli/project-configuration.cjs.map +1 -1
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +2 -1
- package/dist/expect/index.d.mts +2 -1
- package/dist/expect/index.d.ts +2 -1
- package/dist/experiment/host/cli/contribution.cjs +6 -11
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +0 -16
- package/dist/experiment/host/cli/contribution.d.mts +0 -16
- package/dist/experiment/host/cli/contribution.d.ts +0 -16
- package/dist/experiment/host/operations.cjs +3 -3
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +0 -4
- package/dist/experiment/host/types.d.mts +0 -4
- package/dist/experiment/host/types.d.ts +0 -4
- package/dist/fresh-import.cjs +2 -2
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/fresh-import.d.cts +3 -3
- package/dist/fresh-import.d.mts +3 -3
- package/dist/fresh-import.d.ts +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/inspection/codec.cjs.map +1 -1
- package/dist/inspection/codec.d.cts +1 -1
- package/dist/inspection/codec.d.mts +1 -1
- package/dist/inspection/codec.d.ts +1 -1
- package/dist/inspection/facts.cjs +66 -9
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/facts.d.cts +4 -0
- package/dist/inspection/facts.d.mts +4 -0
- package/dist/inspection/facts.d.ts +4 -0
- package/dist/inspection/facts.js +4 -2
- package/dist/inspection/index.cjs +1 -3
- package/dist/inspection/index.cjs.map +1 -1
- package/dist/inspection/index.d.cts +1 -1
- package/dist/inspection/index.d.mts +1 -1
- package/dist/inspection/index.d.ts +1 -1
- package/dist/inspection/index.js +44 -48
- package/dist/inspection/limits.cjs +3 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +2 -0
- package/dist/inspection/limits.d.mts +2 -0
- package/dist/inspection/limits.d.ts +2 -0
- package/dist/inspection/limits.js +6 -4
- package/dist/inspection/project-source.cjs +4 -1
- package/dist/inspection/project-source.cjs.map +1 -1
- package/dist/inspection/protocol.cjs +10 -18
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +111 -173
- package/dist/inspection/protocol.d.mts +111 -173
- package/dist/inspection/protocol.d.ts +111 -173
- package/dist/inspection/public.mjs +73 -109
- package/dist/inspection/results.cjs +12 -48
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +124 -122
- package/dist/inspection/results.d.mts +124 -122
- package/dist/inspection/results.d.ts +124 -122
- package/dist/inspection/results.js +16 -20
- package/dist/inspection/select.cjs +80 -117
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +14 -15
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/source.d.cts +6 -3
- package/dist/inspection/source.d.mts +6 -3
- package/dist/inspection/source.d.ts +6 -3
- package/dist/inspection/trace.cjs +1 -1
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/load-config.cjs +17 -11
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +3 -2
- package/dist/load-config.d.mts +3 -2
- package/dist/load-config.d.ts +3 -2
- package/dist/o11y/adapter-usage-projection.cjs +5 -1
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
- package/dist/o11y/adapter-usage-projection.d.cts +109 -1
- package/dist/o11y/adapter-usage-projection.d.mts +109 -1
- package/dist/o11y/adapter-usage-projection.d.ts +109 -1
- package/dist/o11y/cache-read.cjs +113 -0
- package/dist/o11y/cache-read.cjs.map +1 -0
- package/dist/o11y/cache-read.d.cts +80 -0
- package/dist/o11y/cache-read.d.mts +80 -0
- package/dist/o11y/cache-read.d.ts +80 -0
- package/dist/o11y/cache-read.js +8 -0
- package/dist/o11y/cache-read.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +22 -1
- package/dist/o11y/eval-usage.cjs.map +1 -1
- package/dist/o11y/eval-usage.d.cts +9 -1
- package/dist/o11y/eval-usage.d.mts +9 -1
- package/dist/o11y/eval-usage.d.ts +9 -1
- package/dist/record/host/sqlite-host.cjs +188 -53
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/sqlite-host.d.cts +37 -1
- package/dist/record/host/sqlite-host.d.mts +37 -1
- package/dist/record/host/sqlite-host.d.ts +37 -1
- package/dist/record/host/sqlite-host.js +16 -8
- package/dist/record/maintenance/runtime.cjs +3 -3
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/sqlite/admission-repository.cjs +18 -18
- package/dist/record/sqlite/admission-repository.cjs.map +1 -1
- package/dist/record/sqlite/case-repository.cjs +6 -6
- package/dist/record/sqlite/case-repository.cjs.map +1 -1
- package/dist/record/sqlite/coordination-repository.cjs +25 -25
- package/dist/record/sqlite/coordination-repository.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.cjs +115 -111
- package/dist/record/sqlite/current-schema.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.d.cts +3 -3
- package/dist/record/sqlite/current-schema.d.mts +3 -3
- package/dist/record/sqlite/current-schema.d.ts +3 -3
- package/dist/record/sqlite/database.cjs +56 -53
- package/dist/record/sqlite/database.cjs.map +1 -1
- package/dist/record/sqlite/index.cjs +3 -1
- package/dist/record/sqlite/index.cjs.map +1 -1
- package/dist/record/sqlite/index.d.cts +5 -2
- package/dist/record/sqlite/index.d.mts +5 -2
- package/dist/record/sqlite/index.d.ts +5 -2
- package/dist/record/sqlite/legacy-schema-018.cjs +443 -0
- package/dist/record/sqlite/legacy-schema-018.cjs.map +1 -0
- package/dist/record/sqlite/legacy-schema-018.d.cts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.mts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.ts +6 -0
- package/dist/record/sqlite/legacy-schema-018.js +6 -0
- package/dist/record/sqlite/legacy-schema-018.js.map +1 -0
- package/dist/record/sqlite/migration.cjs +105 -46
- package/dist/record/sqlite/migration.cjs.map +1 -1
- package/dist/record/sqlite/migration.d.cts +2 -1
- package/dist/record/sqlite/migration.d.mts +2 -1
- package/dist/record/sqlite/migration.d.ts +2 -1
- package/dist/record/sqlite/portable-capture.cjs +13 -13
- package/dist/record/sqlite/portable-capture.cjs.map +1 -1
- package/dist/record/sqlite/registry-repository.cjs +22 -22
- package/dist/record/sqlite/registry-repository.cjs.map +1 -1
- package/dist/record/sqlite/schema.cjs +10 -2
- package/dist/record/sqlite/schema.cjs.map +1 -1
- package/dist/record/sqlite/schema.d.cts +4 -1
- package/dist/record/sqlite/schema.d.mts +4 -1
- package/dist/record/sqlite/schema.d.ts +4 -1
- package/dist/record/sqlite/schema.js +20 -14
- package/dist/record/sqlite/storage-worker.cjs +1 -1
- package/dist/record/sqlite/storage-worker.cjs.map +1 -1
- package/dist/record/sqlite/storage.cjs +316 -232
- package/dist/record/sqlite/storage.cjs.map +1 -1
- package/dist/record/sqlite/storage.d.cts +10 -2
- package/dist/record/sqlite/storage.d.mts +10 -2
- package/dist/record/sqlite/storage.d.ts +10 -2
- package/dist/record/sqlite/storage.js +54 -50
- package/dist/record/sqlite/types.cjs +1 -1
- package/dist/record/sqlite/types.cjs.map +1 -1
- package/dist/record/sqlite/types.d.cts +13 -1
- package/dist/record/sqlite/types.d.mts +13 -1
- package/dist/record/sqlite/types.d.ts +13 -1
- package/dist/run/cli/contribution.cjs +17 -12
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/lifecycle-adapter.cjs +1 -1
- package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
- package/dist/run/storage/owner-identity.cjs +78 -16
- package/dist/run/storage/owner-identity.cjs.map +1 -1
- package/dist/run/storage/owner-identity.d.cts +2 -1
- package/dist/run/storage/owner-identity.d.mts +2 -1
- package/dist/run/storage/owner-identity.d.ts +2 -1
- package/dist/run/storage/sqlite.cjs +55 -55
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/accept.cjs +12 -42
- package/dist/runner/accept.cjs.map +1 -1
- package/dist/runner/accept.d.cts +2 -3
- package/dist/runner/accept.d.mts +2 -3
- package/dist/runner/accept.d.ts +2 -3
- package/dist/runner/adapter-usage.cjs +2 -2
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adoption.cjs +14 -26
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/adoption.d.cts +5 -13
- package/dist/runner/adoption.d.mts +5 -13
- package/dist/runner/adoption.d.ts +5 -13
- package/dist/runner/adoption.js +2 -4
- package/dist/runner/record.cjs +24 -18
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/rename-experiment.cjs +5 -7
- package/dist/runner/rename-experiment.cjs.map +1 -1
- package/dist/runner/reuse-plan.cjs +37 -18
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +4 -1
- package/dist/runner/reuse-plan.d.mts +4 -1
- package/dist/runner/reuse-plan.d.ts +4 -1
- package/dist/runner/setup-prefix-plan.cjs +17 -12
- package/dist/runner/setup-prefix-plan.cjs.map +1 -1
- package/dist/runner/setup-prefix-plan.d.cts +0 -2
- package/dist/runner/setup-prefix-plan.d.mts +0 -2
- package/dist/runner/setup-prefix-plan.d.ts +0 -2
- package/dist/runner/setup-prefix-plan.js +8 -12
- package/dist/sandbox/backend.cjs +10 -1
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +16 -8
- package/dist/sandbox/backend.d.mts +16 -8
- package/dist/sandbox/backend.d.ts +16 -8
- package/dist/sandbox/backend.js +28 -26
- package/dist/sandbox/docker.cjs +7 -1
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.cjs +13 -3
- package/dist/sandbox/e2b-cache-repository.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.d.cts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.mts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.ts +3 -0
- package/dist/sandbox/e2b-cache-repository.js +16 -12
- package/dist/sandbox/e2b.cjs +2 -2
- package/dist/sandbox/e2b.cjs.map +1 -1
- package/dist/sandbox/incus/materialize.cjs +1 -1
- package/dist/sandbox/incus/materialize.cjs.map +1 -1
- package/dist/show/contribution.cjs +3 -3
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/model.cjs +14 -13
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +7 -7
- package/dist/show/model.d.mts +7 -7
- package/dist/show/model.d.ts +7 -7
- package/dist/show/render.cjs +14 -0
- package/dist/show/render.cjs.map +1 -1
- package/dist/user-database/storage-worker.cjs +13 -3
- package/dist/user-database/storage-worker.cjs.map +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-CmVoXbwG.js → index-B3ijZRph.js} +17 -17
- package/dist/view/app-dist/assets/{quality-cost-scatter-BuLISaH4.js → quality-cost-scatter-B--DfJ9s.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/application-runtime.cjs +8 -0
- package/dist/view/application-runtime.cjs.map +1 -0
- package/dist/view/application-runtime.d.cts +9 -0
- package/dist/view/application-runtime.d.mts +9 -0
- package/dist/view/application-runtime.d.ts +9 -0
- package/dist/view/application-runtime.js +6 -0
- package/dist/view/application-runtime.js.map +1 -0
- package/dist/view/cli/contribution.cjs +5 -2
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +1019 -456
- package/dist/view/http-protocol.d.cts +1 -9
- package/dist/view/http-protocol.d.mts +1 -9
- package/dist/view/http-protocol.d.ts +1 -9
- package/dist/view/inspection-host.cjs +39 -30
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/inspection-host.d.cts +7545 -2
- package/dist/view/inspection-host.d.mts +7545 -2
- package/dist/view/inspection-host.d.ts +7545 -2
- package/dist/view/server.cjs +8 -5
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +4 -2
- package/dist/view/server.d.mts +4 -2
- package/dist/view/server.d.ts +4 -2
- package/docs-site/zh/reference/cli.mdx +1 -2
- package/docs-site/zh/tutorials/control-run-cost.mdx +61 -0
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +21 -0
- 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 SealedRunCutoff, 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, type SourceBarrierRequest, type SourceBarrierCandidate } 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[];
|
|
@@ -34,6 +34,14 @@ export declare function readSealedRunSummary(connection: RecordDatabase, runId:
|
|
|
34
34
|
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
35
|
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
36
|
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findSourceBarrierCandidate(connection: RecordDatabase, request: SourceBarrierRequest, cutoffRevision: number): SourceBarrierCandidate | undefined;
|
|
38
|
+
/** Locate adoption proofs for one exact Attempt without scanning Run Core. */
|
|
39
|
+
export declare function findAcceptedAttemptRunIds(connection: RecordDatabase, request: {
|
|
40
|
+
readonly experimentId: string;
|
|
41
|
+
readonly originRunId: string;
|
|
42
|
+
readonly attemptId: string;
|
|
43
|
+
readonly bindingRevision: number;
|
|
44
|
+
}, cutoffRevision: number): readonly string[];
|
|
37
45
|
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
38
46
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
39
47
|
/**
|
|
@@ -42,7 +50,7 @@ export declare function listSealedRunSummaries(connection: RecordDatabase, after
|
|
|
42
50
|
*/
|
|
43
51
|
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
44
52
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
45
|
-
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
53
|
+
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number, includeTargets?: boolean): AttemptLocatorCandidates;
|
|
46
54
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
47
55
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
48
56
|
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
@@ -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 SealedRunCutoff, 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, type SourceBarrierRequest, type SourceBarrierCandidate } 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[];
|
|
@@ -34,6 +34,14 @@ export declare function readSealedRunSummary(connection: RecordDatabase, runId:
|
|
|
34
34
|
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
35
|
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
36
|
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findSourceBarrierCandidate(connection: RecordDatabase, request: SourceBarrierRequest, cutoffRevision: number): SourceBarrierCandidate | undefined;
|
|
38
|
+
/** Locate adoption proofs for one exact Attempt without scanning Run Core. */
|
|
39
|
+
export declare function findAcceptedAttemptRunIds(connection: RecordDatabase, request: {
|
|
40
|
+
readonly experimentId: string;
|
|
41
|
+
readonly originRunId: string;
|
|
42
|
+
readonly attemptId: string;
|
|
43
|
+
readonly bindingRevision: number;
|
|
44
|
+
}, cutoffRevision: number): readonly string[];
|
|
37
45
|
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
38
46
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
39
47
|
/**
|
|
@@ -42,7 +50,7 @@ export declare function listSealedRunSummaries(connection: RecordDatabase, after
|
|
|
42
50
|
*/
|
|
43
51
|
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
44
52
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
45
|
-
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
53
|
+
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number, includeTargets?: boolean): AttemptLocatorCandidates;
|
|
46
54
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
47
55
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
48
56
|
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
@@ -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 SealedRunCutoff, 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, type SourceBarrierRequest, type SourceBarrierCandidate } 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[];
|
|
@@ -34,6 +34,14 @@ export declare function readSealedRunSummary(connection: RecordDatabase, runId:
|
|
|
34
34
|
/** Pinned publication identity, plus a metadata-only count; no Seal hashing. */
|
|
35
35
|
export declare function readSealedRunCutoff(connection: RecordDatabase, identity: string): SealedRunCutoff;
|
|
36
36
|
/** Filter lightweight Run metadata before loading any selected Core or payload. */
|
|
37
|
+
export declare function findSourceBarrierCandidate(connection: RecordDatabase, request: SourceBarrierRequest, cutoffRevision: number): SourceBarrierCandidate | undefined;
|
|
38
|
+
/** Locate adoption proofs for one exact Attempt without scanning Run Core. */
|
|
39
|
+
export declare function findAcceptedAttemptRunIds(connection: RecordDatabase, request: {
|
|
40
|
+
readonly experimentId: string;
|
|
41
|
+
readonly originRunId: string;
|
|
42
|
+
readonly attemptId: string;
|
|
43
|
+
readonly bindingRevision: number;
|
|
44
|
+
}, cutoffRevision: number): readonly string[];
|
|
37
45
|
export declare function findExperimentRunIds(connection: RecordDatabase, experimentId: string): readonly string[];
|
|
38
46
|
export declare function listSealedRunSummaries(connection: RecordDatabase, afterRunId?: string, pageSize?: number): readonly SealedRunSummary[];
|
|
39
47
|
/**
|
|
@@ -42,7 +50,7 @@ export declare function listSealedRunSummaries(connection: RecordDatabase, after
|
|
|
42
50
|
*/
|
|
43
51
|
export declare function readSealedRunSummaryPage(connection: RecordDatabase, afterRunId?: string, pageSize?: number, expectedCutoffIdentity?: string, deadlineEpochMs?: number, pinnedCutoff?: SealedRunCutoff): SealedRunSummaryPage;
|
|
44
52
|
/** Indexed, bounded locator projection. No Core or attachment payload is selected. */
|
|
45
|
-
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number): AttemptLocatorCandidates;
|
|
53
|
+
export declare function findAttemptLocatorCandidates(connection: RecordDatabase, locator: string, maximumCandidateRuns: number, includeTargets?: boolean): AttemptLocatorCandidates;
|
|
46
54
|
export declare function readCollectionItemPage(connection: RecordDatabase, attachmentId: string, afterOrdinal: number, pageSize: number): CollectionItemPage;
|
|
47
55
|
/** Bounded sealed Core projection. Collection item bytes and Content chunk bytes are never selected. */
|
|
48
56
|
type DeferredRecordRead = <A>(read: () => A) => A;
|
|
@@ -19,54 +19,58 @@ const __niceevalExport7 = __niceevalCanonical["fenceRunFinalization"];
|
|
|
19
19
|
export { __niceevalExport7 as fenceRunFinalization };
|
|
20
20
|
const __niceevalExport8 = __niceevalCanonical["finalizeRun"];
|
|
21
21
|
export { __niceevalExport8 as finalizeRun };
|
|
22
|
-
const __niceevalExport9 = __niceevalCanonical["
|
|
23
|
-
export { __niceevalExport9 as
|
|
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
|
|
68
|
-
const __niceevalExport32 = __niceevalCanonical["
|
|
69
|
-
export { __niceevalExport32 as
|
|
70
|
-
const __niceevalExport33 = __niceevalCanonical["
|
|
71
|
-
export { __niceevalExport33 as
|
|
22
|
+
const __niceevalExport9 = __niceevalCanonical["findAcceptedAttemptRunIds"];
|
|
23
|
+
export { __niceevalExport9 as findAcceptedAttemptRunIds };
|
|
24
|
+
const __niceevalExport10 = __niceevalCanonical["findAttemptLocatorCandidates"];
|
|
25
|
+
export { __niceevalExport10 as findAttemptLocatorCandidates };
|
|
26
|
+
const __niceevalExport11 = __niceevalCanonical["findExperimentRunIds"];
|
|
27
|
+
export { __niceevalExport11 as findExperimentRunIds };
|
|
28
|
+
const __niceevalExport12 = __niceevalCanonical["findSourceBarrierCandidate"];
|
|
29
|
+
export { __niceevalExport12 as findSourceBarrierCandidate };
|
|
30
|
+
const __niceevalExport13 = __niceevalCanonical["listSealedRunSummaries"];
|
|
31
|
+
export { __niceevalExport13 as listSealedRunSummaries };
|
|
32
|
+
const __niceevalExport14 = __niceevalCanonical["logicalSealIdentity"];
|
|
33
|
+
export { __niceevalExport14 as logicalSealIdentity };
|
|
34
|
+
const __niceevalExport15 = __niceevalCanonical["persistSealedRun"];
|
|
35
|
+
export { __niceevalExport15 as persistSealedRun };
|
|
36
|
+
const __niceevalExport16 = __niceevalCanonical["prepareRunFinalization"];
|
|
37
|
+
export { __niceevalExport16 as prepareRunFinalization };
|
|
38
|
+
const __niceevalExport17 = __niceevalCanonical["publishRunSeal"];
|
|
39
|
+
export { __niceevalExport17 as publishRunSeal };
|
|
40
|
+
const __niceevalExport18 = __niceevalCanonical["readCollectionItemPage"];
|
|
41
|
+
export { __niceevalExport18 as readCollectionItemPage };
|
|
42
|
+
const __niceevalExport19 = __niceevalCanonical["readContentChunkPage"];
|
|
43
|
+
export { __niceevalExport19 as readContentChunkPage };
|
|
44
|
+
const __niceevalExport20 = __niceevalCanonical["readPublishedSealedRun"];
|
|
45
|
+
export { __niceevalExport20 as readPublishedSealedRun };
|
|
46
|
+
const __niceevalExport21 = __niceevalCanonical["readRecordCore"];
|
|
47
|
+
export { __niceevalExport21 as readRecordCore };
|
|
48
|
+
const __niceevalExport22 = __niceevalCanonical["readSealedRunCore"];
|
|
49
|
+
export { __niceevalExport22 as readSealedRunCore };
|
|
50
|
+
const __niceevalExport23 = __niceevalCanonical["readSealedRunCutoff"];
|
|
51
|
+
export { __niceevalExport23 as readSealedRunCutoff };
|
|
52
|
+
const __niceevalExport24 = __niceevalCanonical["readSealedRunDocument"];
|
|
53
|
+
export { __niceevalExport24 as readSealedRunDocument };
|
|
54
|
+
const __niceevalExport25 = __niceevalCanonical["readSealedRunSummary"];
|
|
55
|
+
export { __niceevalExport25 as readSealedRunSummary };
|
|
56
|
+
const __niceevalExport26 = __niceevalCanonical["readSealedRunSummaryPage"];
|
|
57
|
+
export { __niceevalExport26 as readSealedRunSummaryPage };
|
|
58
|
+
const __niceevalExport27 = __niceevalCanonical["sealRun"];
|
|
59
|
+
export { __niceevalExport27 as sealRun };
|
|
60
|
+
const __niceevalExport28 = __niceevalCanonical["stageAttachmentMetadata"];
|
|
61
|
+
export { __niceevalExport28 as stageAttachmentMetadata };
|
|
62
|
+
const __niceevalExport29 = __niceevalCanonical["stageAttachmentReferences"];
|
|
63
|
+
export { __niceevalExport29 as stageAttachmentReferences };
|
|
64
|
+
const __niceevalExport30 = __niceevalCanonical["stageCollectionItems"];
|
|
65
|
+
export { __niceevalExport30 as stageCollectionItems };
|
|
66
|
+
const __niceevalExport31 = __niceevalCanonical["stageRunCore"];
|
|
67
|
+
export { __niceevalExport31 as stageRunCore };
|
|
68
|
+
const __niceevalExport32 = __niceevalCanonical["stageRunFinalMetadata"];
|
|
69
|
+
export { __niceevalExport32 as stageRunFinalMetadata };
|
|
70
|
+
const __niceevalExport33 = __niceevalCanonical["stageRunPublicationMetadata"];
|
|
71
|
+
export { __niceevalExport33 as stageRunPublicationMetadata };
|
|
72
|
+
const __niceevalExport34 = __niceevalCanonical["stageSealEntries"];
|
|
73
|
+
export { __niceevalExport34 as stageSealEntries };
|
|
74
|
+
const __niceevalExport35 = __niceevalCanonical["verifyAllSealedRuns"];
|
|
75
|
+
export { __niceevalExport35 as verifyAllSealedRuns };
|
|
72
76
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RECORD_SQLITE_VALIDATION_DEADLINE_MS = exports.RECORD_SQLITE_MAX_VALIDATION_ROWS = exports.RECORD_SQLITE_MAX_VALIDATION_RUNS = exports.RECORD_SQLITE_MAX_PAGE_BYTES = exports.RECORD_SQLITE_MAX_PAGE_ROWS = exports.RECORD_SQLITE_MAX_ROW_BYTES = exports.RECORD_SQLITE_MAX_PUBLISH_BYTES = exports.RECORD_SQLITE_MAX_PUBLISH_ROWS = exports.RECORD_SQLITE_CHUNK_BYTES = exports.RECORD_SQLITE_STORAGE_REVISION = exports.RECORD_SQLITE_FORMAT = void 0;
|
|
4
|
-
exports.RECORD_SQLITE_FORMAT = "niceeval.project-database/0.
|
|
4
|
+
exports.RECORD_SQLITE_FORMAT = "niceeval.project-database/0.19";
|
|
5
5
|
exports.RECORD_SQLITE_STORAGE_REVISION = 1;
|
|
6
6
|
exports.RECORD_SQLITE_CHUNK_BYTES = 256 * 1024;
|
|
7
7
|
exports.RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;
|
|
@@ -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 /** 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"]}
|
|
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.19\";\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}\n/** One logical position; the current execution Run is not its own source. */\nexport interface SourceBarrierRequest {\n readonly experimentId: string;\n readonly evalId: string;\n readonly attemptOrdinal: number;\n readonly excludeRunId?: string;\n}\nexport interface SourceBarrierCandidate {\n readonly runId: string;\n readonly createdRevision: number;\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 experimentId: string;\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,4 +1,4 @@
|
|
|
1
|
-
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.
|
|
1
|
+
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.19";
|
|
2
2
|
export declare const RECORD_SQLITE_STORAGE_REVISION = 1;
|
|
3
3
|
export declare const RECORD_SQLITE_CHUNK_BYTES: number;
|
|
4
4
|
export declare const RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;
|
|
@@ -146,6 +146,17 @@ export interface AttemptLocatorCandidates {
|
|
|
146
146
|
readonly ambiguous: boolean;
|
|
147
147
|
readonly candidates: readonly AttemptLocatorCandidateRun[];
|
|
148
148
|
}
|
|
149
|
+
/** One logical position; the current execution Run is not its own source. */
|
|
150
|
+
export interface SourceBarrierRequest {
|
|
151
|
+
readonly experimentId: string;
|
|
152
|
+
readonly evalId: string;
|
|
153
|
+
readonly attemptOrdinal: number;
|
|
154
|
+
readonly excludeRunId?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SourceBarrierCandidate {
|
|
157
|
+
readonly runId: string;
|
|
158
|
+
readonly createdRevision: number;
|
|
159
|
+
}
|
|
149
160
|
export interface ContentChunkPage {
|
|
150
161
|
readonly contentId: string;
|
|
151
162
|
readonly afterOrdinal: number;
|
|
@@ -181,6 +192,7 @@ export interface StageRunCoreInput {
|
|
|
181
192
|
}
|
|
182
193
|
export type FinalizeRunInput = StageRunCoreInput;
|
|
183
194
|
export interface BeginRunInput {
|
|
195
|
+
readonly experimentId: string;
|
|
184
196
|
readonly runId: string;
|
|
185
197
|
readonly writerGeneration: string;
|
|
186
198
|
readonly startedAt: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.
|
|
1
|
+
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.19";
|
|
2
2
|
export declare const RECORD_SQLITE_STORAGE_REVISION = 1;
|
|
3
3
|
export declare const RECORD_SQLITE_CHUNK_BYTES: number;
|
|
4
4
|
export declare const RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;
|
|
@@ -146,6 +146,17 @@ export interface AttemptLocatorCandidates {
|
|
|
146
146
|
readonly ambiguous: boolean;
|
|
147
147
|
readonly candidates: readonly AttemptLocatorCandidateRun[];
|
|
148
148
|
}
|
|
149
|
+
/** One logical position; the current execution Run is not its own source. */
|
|
150
|
+
export interface SourceBarrierRequest {
|
|
151
|
+
readonly experimentId: string;
|
|
152
|
+
readonly evalId: string;
|
|
153
|
+
readonly attemptOrdinal: number;
|
|
154
|
+
readonly excludeRunId?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SourceBarrierCandidate {
|
|
157
|
+
readonly runId: string;
|
|
158
|
+
readonly createdRevision: number;
|
|
159
|
+
}
|
|
149
160
|
export interface ContentChunkPage {
|
|
150
161
|
readonly contentId: string;
|
|
151
162
|
readonly afterOrdinal: number;
|
|
@@ -181,6 +192,7 @@ export interface StageRunCoreInput {
|
|
|
181
192
|
}
|
|
182
193
|
export type FinalizeRunInput = StageRunCoreInput;
|
|
183
194
|
export interface BeginRunInput {
|
|
195
|
+
readonly experimentId: string;
|
|
184
196
|
readonly runId: string;
|
|
185
197
|
readonly writerGeneration: string;
|
|
186
198
|
readonly startedAt: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.
|
|
1
|
+
export declare const RECORD_SQLITE_FORMAT = "niceeval.project-database/0.19";
|
|
2
2
|
export declare const RECORD_SQLITE_STORAGE_REVISION = 1;
|
|
3
3
|
export declare const RECORD_SQLITE_CHUNK_BYTES: number;
|
|
4
4
|
export declare const RECORD_SQLITE_MAX_PUBLISH_ROWS = 4096;
|
|
@@ -146,6 +146,17 @@ export interface AttemptLocatorCandidates {
|
|
|
146
146
|
readonly ambiguous: boolean;
|
|
147
147
|
readonly candidates: readonly AttemptLocatorCandidateRun[];
|
|
148
148
|
}
|
|
149
|
+
/** One logical position; the current execution Run is not its own source. */
|
|
150
|
+
export interface SourceBarrierRequest {
|
|
151
|
+
readonly experimentId: string;
|
|
152
|
+
readonly evalId: string;
|
|
153
|
+
readonly attemptOrdinal: number;
|
|
154
|
+
readonly excludeRunId?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SourceBarrierCandidate {
|
|
157
|
+
readonly runId: string;
|
|
158
|
+
readonly createdRevision: number;
|
|
159
|
+
}
|
|
149
160
|
export interface ContentChunkPage {
|
|
150
161
|
readonly contentId: string;
|
|
151
162
|
readonly afterOrdinal: number;
|
|
@@ -181,6 +192,7 @@ export interface StageRunCoreInput {
|
|
|
181
192
|
}
|
|
182
193
|
export type FinalizeRunInput = StageRunCoreInput;
|
|
183
194
|
export interface BeginRunInput {
|
|
195
|
+
readonly experimentId: string;
|
|
184
196
|
readonly runId: string;
|
|
185
197
|
readonly writerGeneration: string;
|
|
186
198
|
readonly startedAt: string;
|
|
@@ -5,6 +5,8 @@ const effect_1 = require("effect");
|
|
|
5
5
|
const application_ts_1 = require("../../cli/application.cjs");
|
|
6
6
|
const contribution_ts_1 = require("../../cli/contribution.cjs");
|
|
7
7
|
const index_ts_1 = require("../../inspection/index.cjs");
|
|
8
|
+
const model_ts_1 = require("../../show/model.cjs");
|
|
9
|
+
const render_ts_1 = require("../../show/render.cjs");
|
|
8
10
|
const runtime_ts_1 = require("../host/runtime.cjs");
|
|
9
11
|
const protocol_ts_1 = require("../protocol.cjs");
|
|
10
12
|
const help = (summary) => Object.freeze({ summary, visibility: "public" });
|
|
@@ -118,21 +120,24 @@ Usage:
|
|
|
118
120
|
const unsupported = unsupportedOption(parsed, ["json"]);
|
|
119
121
|
if (unsupported !== undefined)
|
|
120
122
|
return yield* usage(`--${unsupported} is not valid with niceeval run show.`);
|
|
121
|
-
const
|
|
123
|
+
const decoded = (0, index_ts_1.decodeInspectionOperation)({ kind: "run.get", runId });
|
|
124
|
+
if (effect_1.Result.isFailure(decoded))
|
|
125
|
+
return yield* effect_1.Effect.fail(failure("show", decoded.failure));
|
|
126
|
+
const operation = decoded.success;
|
|
127
|
+
if (operation.kind !== "run.get")
|
|
128
|
+
return yield* effect_1.Effect.fail(failure("show", new Error("Invalid Run operation.")));
|
|
129
|
+
const shown = yield* effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
|
|
130
|
+
const source = yield* (0, index_ts_1.openInspectionSource)((0, index_ts_1.operationalInspectionSource)(facts.cwd));
|
|
131
|
+
return yield* effect_1.Effect.try({
|
|
132
|
+
try: () => (0, index_ts_1.selectInspectionOperation)(source, operation),
|
|
133
|
+
catch: (cause) => cause,
|
|
134
|
+
});
|
|
135
|
+
})).pipe(effect_1.Effect.mapError((cause) => failure("show", cause)));
|
|
122
136
|
if (json) {
|
|
123
|
-
yield* writeJson(
|
|
124
|
-
protocol: protocol_ts_1.RUN_PROTOCOL,
|
|
125
|
-
operation: "run.get",
|
|
126
|
-
run: shown.run,
|
|
127
|
-
}));
|
|
137
|
+
yield* writeJson(shown);
|
|
128
138
|
}
|
|
129
139
|
else {
|
|
130
|
-
yield* write("stdout",
|
|
131
|
-
`started: ${new Date(shown.run.startedAt).toISOString()}\n` +
|
|
132
|
-
(shown.run.completedAt === undefined
|
|
133
|
-
? ""
|
|
134
|
-
: `completed: ${new Date(shown.run.completedAt).toISOString()}\n`) +
|
|
135
|
-
`coverage: ${shown.run.coverage.published}/${shown.run.coverage.expected}\n`);
|
|
140
|
+
yield* write("stdout", (0, render_ts_1.renderRun)((0, model_ts_1.projectRun)(shown)));
|
|
136
141
|
}
|
|
137
142
|
return 0;
|
|
138
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,6DAAwI;AACxI,+DAA0F;AAC1F,wDAA+D;AAC/D,mDAAgD;AAChD,gDAA0F;AAE1F,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAuB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5E,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IAAI,CAAC,kDAAkD,CAAC;KACjE,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,8BAA8B,CAAC,EAAE,CAAC;IAC7E,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,EAAE,CAAC;IAC1E,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GA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e;IACxB,GAAG,EAAE,UAAU;CAClB,CAAC,CAAC","sourcesContent":["import { Effect, Result } from \"effect\";\nimport type { ProjectStateDatabase } from \"../../record/sqlite/project-state-database.ts\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, type CliParsedTokens, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution, } from \"../../cli/contribution.ts\";\nimport { canonicalJsonValue } from \"../../inspection/index.ts\";\nimport { rawRunHost } from \"../host/runtime.ts\";\nimport { RUN_PROTOCOL, type RunGetDocument, type RunListDocument, } from \"../protocol.ts\";\nimport type { RunDeleteError, RunReadError, RunRecoverError, } from \"../host/index.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const RUN_CLI_OPTIONS = Object.freeze({\n invocation: option({\n type: \"string\",\n help: help(\"Filter Run discovery by one exact Invocation ID.\"),\n }),\n json: option({ type: \"boolean\", help: help(\"Print machine-readable JSON.\") }),\n yes: option({ type: \"boolean\", help: help(\"Confirm delete or recover.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print Run help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectStateDatabase;\ntype Error = CliFeatureError;\ntype HostFailure = RunReadError | RunDeleteError | RunRecoverError;\nfunction failure(operation: string, cause: unknown): Error {\n const hostFailure = isHostFailure(cause) ? cause : undefined;\n return new CliFeatureError({\n feature: \"run\",\n operation,\n cause,\n exitCode: 1,\n ...(hostFailure === undefined\n ? {}\n : { display: `${hostFailure.code}: ${hostFailure.message}\\n` }),\n });\n}\nfunction isHostFailure(value: unknown): value is HostFailure {\n return typeof value === \"object\" && value !== null &&\n [\"RunReadError\", \"RunDeleteError\", \"RunRecoverError\"].includes(String(Reflect.get(value, \"_tag\")));\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 invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction writeJson(value: unknown) {\n const encoded = canonicalJsonValue(value);\n return Result.isFailure(encoded)\n ? Effect.fail(failure(\"encode JSON\", encoded.failure))\n : write(\"stdout\", encoded.success);\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message}\\n`).pipe(Effect.as(1));\n}\nfunction unsupportedOption(parsed: CliParsedTokens, allowed: readonly string[]): string | undefined {\n const permitted = new Set([...allowed, \"help\"]);\n return Object.entries(parsed.values).find(([name, value]) => value !== undefined && !permitted.has(name))?.[0];\n}\nfunction runCommand(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, RUN_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", `niceeval run — inspect and manage Run lifecycle\n\nUsage:\n niceeval run list [--invocation <invocation-id>] [--json]\n niceeval run show <run-id> [--json]\n niceeval run delete <run-id> [--yes] [--json]\n niceeval run recover <run-id> [--yes] [--json]\n`);\n return 0;\n }\n const action = parsed.positionals[0];\n if (action === undefined || ![\"list\", \"show\", \"delete\", \"recover\"].includes(action)) {\n return yield* usage(`niceeval run expects exactly one of list, show, delete, or recover.\n`.trimEnd());\n }\n const facts = yield* invocationFacts();\n const json = parsed.values.json === true;\n if (action === \"list\") {\n if (parsed.positionals.length !== 1) {\n return yield* usage(\"niceeval run list does not accept positional selectors.\");\n }\n const unsupported = unsupportedOption(parsed, [\"invocation\", \"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run list.`);\n const listed = yield* rawRunHost.list({\n cwd: facts.cwd,\n ...(typeof parsed.values.invocation === \"string\"\n ? { invocationId: parsed.values.invocation }\n : {}),\n }).pipe(Effect.mapError((cause) => failure(\"list\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.list\",\n runs: listed.runs,\n ...(listed.continuation === undefined\n ? {}\n : { continuation: listed.continuation }),\n }) satisfies RunListDocument);\n return 0;\n }\n if (listed.runs.length === 0) {\n yield* write(\"stdout\", `No Runs found.\n`);\n return 0;\n }\n yield* write(\"stdout\", `${listed.runs.map((run) => `${run.runId} ${run.state} ${run.experimentId} ${run.coverage.published}/${run.coverage.expected} ${new Date(run.startedAt).toISOString()}`).join(\"\\n\")}\\n`);\n return 0;\n }\n if (parsed.positionals.length !== 2) {\n return yield* usage(`niceeval run ${action} requires one exact Run ID.`);\n }\n const runId = parsed.positionals[1]!;\n if (action === \"show\") {\n const unsupported = unsupportedOption(parsed, [\"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run show.`);\n const shown = yield* rawRunHost.get({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"show\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.get\",\n run: shown.run,\n }) satisfies RunGetDocument);\n }\n else {\n yield* write(\"stdout\", `${shown.run.runId} ${shown.run.state} ${shown.run.experimentId}\\n` +\n `started: ${new Date(shown.run.startedAt).toISOString()}\\n` +\n (shown.run.completedAt === undefined\n ? \"\"\n : `completed: ${new Date(shown.run.completedAt).toISOString()}\\n`) +\n `coverage: ${shown.run.coverage.published}/${shown.run.coverage.expected}\\n`);\n }\n return 0;\n }\n const unsupported = unsupportedOption(parsed, [\"json\", \"yes\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run ${action}.`);\n if (parsed.values.yes !== true) {\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: `run.${action}`,\n outcome: \"confirmation-required\",\n runId,\n }));\n }\n else {\n yield* write(\"stderr\", `Run ${runId} is selected for ${action}. Review it, then rerun with --yes.\n`);\n }\n return 1;\n }\n if (action === \"delete\") {\n const receipt = yield* rawRunHost.delete({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"delete\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.delete\", ...receipt }));\n else\n yield* write(\"stdout\", `Deleted Run ${receipt.runId}.\n`);\n return 0;\n }\n const receipt = yield* rawRunHost.recover({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"recover\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.recover\", ...receipt }));\n else\n yield* write(\"stdout\", `Recovered Run ${receipt.runId} as interrupted.\n`);\n return 0;\n });\n}\nexport const runCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"run\",\n summary: \"inspect and manage Run lifecycle\",\n options: RUN_CLI_OPTIONS,\n run: runCommand,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,6DAAwI;AACxI,+DAA0F;AAC1F,wDAAyK;AACzK,kDAAiD;AACjD,oDAAiD;AACjD,mDAAgD;AAChD,gDAAqE;AAErE,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAuB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5E,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,I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AC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACjI,IAAI,IAAI;YACJ,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,0BAAY,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;;YAElG,KAAK,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,OAAO,CAAC,KAAK;CAChE,CAAC,CAAC;QACK,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACP,CAAC;AACY,QAAA,aAAa,GAAgD,MAAM,CAAC,MAAM,CAAC;IACpF,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,uBAAe;IACxB,GAAG,EAAE,UAAU;CAClB,CAAC,CAAC","sourcesContent":["import { Effect, Result } from \"effect\";\nimport type { ProjectStateDatabase } from \"../../record/sqlite/project-state-database.ts\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, type CliParsedTokens, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution, } from \"../../cli/contribution.ts\";\nimport { canonicalJsonValue, decodeInspectionOperation, openInspectionSource, operationalInspectionSource, selectInspectionOperation, } from \"../../inspection/index.ts\";\nimport { projectRun } from \"../../show/model.ts\";\nimport { renderRun } from \"../../show/render.ts\";\nimport { rawRunHost } from \"../host/runtime.ts\";\nimport { RUN_PROTOCOL, type RunListDocument, } from \"../protocol.ts\";\nimport type { RunDeleteError, RunReadError, RunRecoverError, } from \"../host/index.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const RUN_CLI_OPTIONS = Object.freeze({\n invocation: option({\n type: \"string\",\n help: help(\"Filter Run discovery by one exact Invocation ID.\"),\n }),\n json: option({ type: \"boolean\", help: help(\"Print machine-readable JSON.\") }),\n yes: option({ type: \"boolean\", help: help(\"Confirm delete or recover.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print Run help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectStateDatabase;\ntype Error = CliFeatureError;\ntype HostFailure = RunReadError | RunDeleteError | RunRecoverError;\nfunction failure(operation: string, cause: unknown): Error {\n const hostFailure = isHostFailure(cause) ? cause : undefined;\n return new CliFeatureError({\n feature: \"run\",\n operation,\n cause,\n exitCode: 1,\n ...(hostFailure === undefined\n ? {}\n : { display: `${hostFailure.code}: ${hostFailure.message}\\n` }),\n });\n}\nfunction isHostFailure(value: unknown): value is HostFailure {\n return typeof value === \"object\" && value !== null &&\n [\"RunReadError\", \"RunDeleteError\", \"RunRecoverError\"].includes(String(Reflect.get(value, \"_tag\")));\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 invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction writeJson(value: unknown) {\n const encoded = canonicalJsonValue(value);\n return Result.isFailure(encoded)\n ? Effect.fail(failure(\"encode JSON\", encoded.failure))\n : write(\"stdout\", encoded.success);\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message}\\n`).pipe(Effect.as(1));\n}\nfunction unsupportedOption(parsed: CliParsedTokens, allowed: readonly string[]): string | undefined {\n const permitted = new Set([...allowed, \"help\"]);\n return Object.entries(parsed.values).find(([name, value]) => value !== undefined && !permitted.has(name))?.[0];\n}\nfunction runCommand(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, RUN_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", `niceeval run — inspect and manage Run lifecycle\n\nUsage:\n niceeval run list [--invocation <invocation-id>] [--json]\n niceeval run show <run-id> [--json]\n niceeval run delete <run-id> [--yes] [--json]\n niceeval run recover <run-id> [--yes] [--json]\n`);\n return 0;\n }\n const action = parsed.positionals[0];\n if (action === undefined || ![\"list\", \"show\", \"delete\", \"recover\"].includes(action)) {\n return yield* usage(`niceeval run expects exactly one of list, show, delete, or recover.\n`.trimEnd());\n }\n const facts = yield* invocationFacts();\n const json = parsed.values.json === true;\n if (action === \"list\") {\n if (parsed.positionals.length !== 1) {\n return yield* usage(\"niceeval run list does not accept positional selectors.\");\n }\n const unsupported = unsupportedOption(parsed, [\"invocation\", \"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run list.`);\n const listed = yield* rawRunHost.list({\n cwd: facts.cwd,\n ...(typeof parsed.values.invocation === \"string\"\n ? { invocationId: parsed.values.invocation }\n : {}),\n }).pipe(Effect.mapError((cause) => failure(\"list\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.list\",\n runs: listed.runs,\n ...(listed.continuation === undefined\n ? {}\n : { continuation: listed.continuation }),\n }) satisfies RunListDocument);\n return 0;\n }\n if (listed.runs.length === 0) {\n yield* write(\"stdout\", `No Runs found.\n`);\n return 0;\n }\n yield* write(\"stdout\", `${listed.runs.map((run) => `${run.runId} ${run.state} ${run.experimentId} ${run.coverage.published}/${run.coverage.expected} ${new Date(run.startedAt).toISOString()}`).join(\"\\n\")}\\n`);\n return 0;\n }\n if (parsed.positionals.length !== 2) {\n return yield* usage(`niceeval run ${action} requires one exact Run ID.`);\n }\n const runId = parsed.positionals[1]!;\n if (action === \"show\") {\n const unsupported = unsupportedOption(parsed, [\"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run show.`);\n const decoded = decodeInspectionOperation({ kind: \"run.get\", runId });\n if (Result.isFailure(decoded))\n return yield* Effect.fail(failure(\"show\", decoded.failure));\n const operation = decoded.success;\n if (operation.kind !== \"run.get\")\n return yield* Effect.fail(failure(\"show\", new Error(\"Invalid Run operation.\")));\n const shown = yield* Effect.scoped(Effect.gen(function* () {\n const source = yield* openInspectionSource(operationalInspectionSource(facts.cwd));\n return yield* Effect.try({\n try: () => selectInspectionOperation(source, operation),\n catch: (cause) => cause,\n });\n })).pipe(Effect.mapError((cause) => failure(\"show\", cause)));\n if (json) {\n yield* writeJson(shown);\n }\n else {\n yield* write(\"stdout\", renderRun(projectRun(shown)));\n }\n return 0;\n }\n const unsupported = unsupportedOption(parsed, [\"json\", \"yes\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run ${action}.`);\n if (parsed.values.yes !== true) {\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: `run.${action}`,\n outcome: \"confirmation-required\",\n runId,\n }));\n }\n else {\n yield* write(\"stderr\", `Run ${runId} is selected for ${action}. Review it, then rerun with --yes.\n`);\n }\n return 1;\n }\n if (action === \"delete\") {\n const receipt = yield* rawRunHost.delete({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"delete\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.delete\", ...receipt }));\n else\n yield* write(\"stdout\", `Deleted Run ${receipt.runId}.\n`);\n return 0;\n }\n const receipt = yield* rawRunHost.recover({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"recover\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.recover\", ...receipt }));\n else\n yield* write(\"stdout\", `Recovered Run ${receipt.runId} as interrupted.\n`);\n return 0;\n });\n}\nexport const runCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"run\",\n summary: \"inspect and manage Run lifecycle\",\n options: RUN_CLI_OPTIONS,\n run: runCommand,\n});\n"]}
|
|
@@ -166,7 +166,7 @@ exports.sqliteRunLifecycleAdapter = Object.freeze({
|
|
|
166
166
|
recoveryWriterGeneration: `recovery-v1:${(0, node_crypto_1.randomUUID)()}`,
|
|
167
167
|
completedAt: effect_1.DateTime.formatIso(now),
|
|
168
168
|
evidence: {
|
|
169
|
-
kind:
|
|
169
|
+
kind: observation.evidenceKind,
|
|
170
170
|
identity: observation.evidenceIdentity,
|
|
171
171
|
observedAt: effect_1.DateTime.formatIso(now),
|
|
172
172
|
},
|