@sanity/ailf 2.8.0 → 3.0.0
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/_vendor/ailf-core/artifact-capture/association.d.ts +35 -0
- package/dist/_vendor/ailf-core/artifact-capture/association.js +28 -0
- package/dist/_vendor/ailf-core/artifact-registry.d.ts +124 -23
- package/dist/_vendor/ailf-core/artifact-registry.js +708 -64
- package/dist/_vendor/ailf-core/batch-signing.d.ts +64 -0
- package/dist/_vendor/ailf-core/batch-signing.js +23 -0
- package/dist/_vendor/ailf-core/index.d.ts +3 -2
- package/dist/_vendor/ailf-core/index.js +3 -2
- package/dist/_vendor/ailf-core/ports/artifact-writer.d.ts +59 -20
- package/dist/_vendor/ailf-core/ports/artifact-writer.js +33 -10
- package/dist/_vendor/ailf-core/ports/context.d.ts +20 -17
- package/dist/_vendor/ailf-core/ports/index.d.ts +0 -2
- package/dist/_vendor/ailf-core/schemas/pipeline.d.ts +6 -6
- package/dist/_vendor/ailf-core/services/index.d.ts +1 -0
- package/dist/_vendor/ailf-core/services/index.js +1 -0
- package/dist/_vendor/ailf-core/services/slim-report-summary.d.ts +31 -0
- package/dist/_vendor/ailf-core/services/slim-report-summary.js +217 -0
- package/dist/_vendor/ailf-core/types/branded-ids.d.ts +33 -0
- package/dist/_vendor/ailf-core/types/index.d.ts +202 -23
- package/dist/adapters/config-sources/file-config-adapter.js +0 -4
- package/dist/artifact-capture/accumulating-artifact-writer.d.ts +50 -0
- package/dist/artifact-capture/accumulating-artifact-writer.js +111 -0
- package/dist/artifact-capture/api-gateway-artifact-writer.d.ts +17 -4
- package/dist/artifact-capture/api-gateway-artifact-writer.js +58 -7
- package/dist/artifact-capture/emit-file.d.ts +28 -0
- package/dist/artifact-capture/emit-file.js +56 -0
- package/dist/artifact-capture/fanout-artifact-writer.d.ts +39 -0
- package/dist/artifact-capture/fanout-artifact-writer.js +76 -0
- package/dist/artifact-capture/gcs-artifact-writer.d.ts +40 -3
- package/dist/artifact-capture/gcs-artifact-writer.js +238 -14
- package/dist/artifact-capture/local-fs-artifact-writer.d.ts +71 -0
- package/dist/artifact-capture/local-fs-artifact-writer.js +273 -0
- package/dist/artifact-capture/redact-artifact.d.ts +3 -5
- package/dist/artifact-capture/redact-artifact.js +3 -5
- package/dist/cli.js +56 -2
- package/dist/commands/explain-handler.js +4 -4
- package/dist/commands/pipeline-action.d.ts +5 -4
- package/dist/commands/pipeline-action.js +33 -16
- package/dist/commands/pipeline.d.ts +4 -4
- package/dist/commands/pipeline.js +4 -4
- package/dist/commands/publish.js +4 -1
- package/dist/commands/runs.d.ts +18 -0
- package/dist/commands/runs.js +71 -0
- package/dist/composition-root.d.ts +13 -10
- package/dist/composition-root.js +74 -46
- package/dist/orchestration/build-app-context.js +4 -7
- package/dist/orchestration/pipeline-orchestrator.d.ts +1 -1
- package/dist/orchestration/pipeline-orchestrator.js +37 -46
- package/dist/orchestration/steps/calculate-scores-step.d.ts +1 -1
- package/dist/orchestration/steps/calculate-scores-step.js +19 -19
- package/dist/orchestration/steps/callback-step.d.ts +1 -1
- package/dist/orchestration/steps/callback-step.js +6 -4
- package/dist/orchestration/steps/compare-step.d.ts +1 -1
- package/dist/orchestration/steps/compare-step.js +4 -2
- package/dist/orchestration/steps/discovery-report-step.d.ts +1 -1
- package/dist/orchestration/steps/discovery-report-step.js +4 -1
- package/dist/orchestration/steps/fetch-docs-step.js +9 -15
- package/dist/orchestration/steps/finalize-run-step.js +21 -7
- package/dist/orchestration/steps/gap-analysis-step.js +34 -6
- package/dist/orchestration/steps/generate-configs-step.d.ts +1 -1
- package/dist/orchestration/steps/generate-configs-step.js +11 -11
- package/dist/orchestration/steps/publish-report-step.d.ts +1 -1
- package/dist/orchestration/steps/publish-report-step.js +24 -19
- package/dist/orchestration/steps/readiness-step.d.ts +1 -1
- package/dist/orchestration/steps/readiness-step.js +4 -1
- package/dist/orchestration/steps/report-step.d.ts +1 -1
- package/dist/orchestration/steps/report-step.js +6 -3
- package/dist/orchestration/steps/run-eval-step.js +14 -9
- package/dist/pipeline/compare.d.ts +2 -2
- package/dist/pipeline/emit-eval-results.d.ts +38 -0
- package/dist/pipeline/emit-eval-results.js +100 -0
- package/dist/pipeline/map-request-to-config.js +0 -4
- package/package.json +1 -1
- package/dist/_vendor/ailf-core/artifact-capture/noop-collector.d.ts +0 -14
- package/dist/_vendor/ailf-core/artifact-capture/noop-collector.js +0 -25
- package/dist/_vendor/ailf-core/ports/artifact-collector.d.ts +0 -94
- package/dist/_vendor/ailf-core/ports/artifact-collector.js +0 -13
- package/dist/_vendor/ailf-core/ports/capture-comparator.d.ts +0 -138
- package/dist/_vendor/ailf-core/ports/capture-comparator.js +0 -10
- package/dist/artifact-capture/comparator.d.ts +0 -22
- package/dist/artifact-capture/comparator.js +0 -493
- package/dist/artifact-capture/filesystem-collector.d.ts +0 -42
- package/dist/artifact-capture/filesystem-collector.js +0 -237
- package/dist/artifact-capture/gcs-collector.d.ts +0 -55
- package/dist/artifact-capture/gcs-collector.js +0 -117
- package/dist/commands/capture-compare.d.ts +0 -15
- package/dist/commands/capture-compare.js +0 -253
- package/dist/commands/capture-list.d.ts +0 -12
- package/dist/commands/capture-list.js +0 -150
- package/dist/commands/capture.d.ts +0 -9
- package/dist/commands/capture.js +0 -16
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch signed-URL types (D0033 / W0052 M3).
|
|
3
|
+
*
|
|
4
|
+
* Contract shared between the API Gateway and Studio for the two batch
|
|
5
|
+
* endpoints that amortise signing over many artifacts in a single round-trip:
|
|
6
|
+
*
|
|
7
|
+
* POST /v1/runs/:runId/artifacts/batch/read-urls
|
|
8
|
+
* POST /v1/runs/:runId/artifacts/batch/upload-urls
|
|
9
|
+
*
|
|
10
|
+
* The batch shape is intentionally symmetric: request carries the set of
|
|
11
|
+
* artifact types and (for per-entry layouts) the entry keys; response carries
|
|
12
|
+
* signed URLs keyed by type and entry key. For bulk layouts the response key
|
|
13
|
+
* is the empty string, since bulk artifacts have no entry dimension.
|
|
14
|
+
*
|
|
15
|
+
* Validation is all-or-nothing per AC 4 — a single malformed entry key, an
|
|
16
|
+
* unknown artifact type, or a missing keys list for a per-entry type causes
|
|
17
|
+
* the whole request to 400 with zero signed URLs emitted.
|
|
18
|
+
*
|
|
19
|
+
* @see docs/design-docs/unified-run-artifacts.md § M3
|
|
20
|
+
* @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md
|
|
21
|
+
*/
|
|
22
|
+
import type { ArtifactType } from "./artifact-registry.js";
|
|
23
|
+
/** The empty entry-key sentinel used for bulk responses. */
|
|
24
|
+
export declare const BULK_ENTRY_KEY: "";
|
|
25
|
+
/**
|
|
26
|
+
* Batch request body.
|
|
27
|
+
*
|
|
28
|
+
* - `types` — the artifact types to sign. Must be non-empty. Unknown types
|
|
29
|
+
* cause a 400.
|
|
30
|
+
* - `keys` — per-type arrays of entry keys. Required for per-entry layouts;
|
|
31
|
+
* omitted (or an empty array) for bulk layouts. Extra keys for a bulk type
|
|
32
|
+
* are rejected; missing keys for a per-entry type are rejected.
|
|
33
|
+
*/
|
|
34
|
+
export interface BatchSignRequest {
|
|
35
|
+
readonly types: readonly ArtifactType[];
|
|
36
|
+
readonly keys?: Partial<Record<ArtifactType, readonly string[]>>;
|
|
37
|
+
}
|
|
38
|
+
/** One signed read URL in a batch read response. */
|
|
39
|
+
export interface BatchSignedReadUrl {
|
|
40
|
+
readonly url: string;
|
|
41
|
+
readonly path: string;
|
|
42
|
+
readonly expiresIn: number;
|
|
43
|
+
}
|
|
44
|
+
/** One signed upload URL in a batch upload response. */
|
|
45
|
+
export interface BatchSignedUploadUrl {
|
|
46
|
+
readonly url: string;
|
|
47
|
+
readonly method: "PUT";
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly expiresIn: number;
|
|
50
|
+
readonly requiredHeaders: Readonly<Record<string, string>>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Batch response. Outer map is keyed by artifact type; inner map is keyed by
|
|
54
|
+
* entry key (empty string for bulk layouts). All types requested in the
|
|
55
|
+
* request body are present in the response, even when `keys[type]` was empty.
|
|
56
|
+
*/
|
|
57
|
+
export interface BatchSignReadResponse {
|
|
58
|
+
readonly bucket: string;
|
|
59
|
+
readonly urls: Partial<Record<ArtifactType, Readonly<Record<string, BatchSignedReadUrl>>>>;
|
|
60
|
+
}
|
|
61
|
+
export interface BatchSignUploadResponse {
|
|
62
|
+
readonly bucket: string;
|
|
63
|
+
readonly urls: Partial<Record<ArtifactType, Readonly<Record<string, BatchSignedUploadUrl>>>>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch signed-URL types (D0033 / W0052 M3).
|
|
3
|
+
*
|
|
4
|
+
* Contract shared between the API Gateway and Studio for the two batch
|
|
5
|
+
* endpoints that amortise signing over many artifacts in a single round-trip:
|
|
6
|
+
*
|
|
7
|
+
* POST /v1/runs/:runId/artifacts/batch/read-urls
|
|
8
|
+
* POST /v1/runs/:runId/artifacts/batch/upload-urls
|
|
9
|
+
*
|
|
10
|
+
* The batch shape is intentionally symmetric: request carries the set of
|
|
11
|
+
* artifact types and (for per-entry layouts) the entry keys; response carries
|
|
12
|
+
* signed URLs keyed by type and entry key. For bulk layouts the response key
|
|
13
|
+
* is the empty string, since bulk artifacts have no entry dimension.
|
|
14
|
+
*
|
|
15
|
+
* Validation is all-or-nothing per AC 4 — a single malformed entry key, an
|
|
16
|
+
* unknown artifact type, or a missing keys list for a per-entry type causes
|
|
17
|
+
* the whole request to 400 with zero signed URLs emitted.
|
|
18
|
+
*
|
|
19
|
+
* @see docs/design-docs/unified-run-artifacts.md § M3
|
|
20
|
+
* @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md
|
|
21
|
+
*/
|
|
22
|
+
/** The empty entry-key sentinel used for bulk responses. */
|
|
23
|
+
export const BULK_ENTRY_KEY = "";
|
|
@@ -16,8 +16,9 @@ export * from "./ports/index.js";
|
|
|
16
16
|
export * from "./services/index.js";
|
|
17
17
|
export * from "./examples/index.js";
|
|
18
18
|
export * from "./artifact-registry.js";
|
|
19
|
+
export * from "./batch-signing.js";
|
|
19
20
|
export { defineConfig, defineFeatures, defineModeBase, defineModels, definePricingTable, definePreset, definePrompts, defineRubrics, defineSchedules, defineSinks, defineSources, defineTask, defineThresholds, } from "./config-helpers.js";
|
|
20
21
|
export type { PricingEntry, PromptEntry, SourceEntry, } from "./config-helpers.js";
|
|
21
22
|
export { env } from "./env-helper.js";
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
23
|
+
export { NoOpArtifactWriter, NotImplementedError, } from "./ports/artifact-writer.js";
|
|
24
|
+
export { assoc, type AssocContext } from "./artifact-capture/association.js";
|
|
@@ -16,10 +16,11 @@ export * from "./ports/index.js";
|
|
|
16
16
|
export * from "./services/index.js";
|
|
17
17
|
export * from "./examples/index.js";
|
|
18
18
|
export * from "./artifact-registry.js";
|
|
19
|
+
export * from "./batch-signing.js";
|
|
19
20
|
// ---------------------------------------------------------------------------
|
|
20
21
|
// Architecture overhaul — Phase 0 helpers
|
|
21
22
|
// ---------------------------------------------------------------------------
|
|
22
23
|
export { defineConfig, defineFeatures, defineModeBase, defineModels, definePricingTable, definePreset, definePrompts, defineRubrics, defineSchedules, defineSinks, defineSources, defineTask, defineThresholds, } from "./config-helpers.js";
|
|
23
24
|
export { env } from "./env-helper.js";
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
25
|
+
export { NoOpArtifactWriter, NotImplementedError, } from "./ports/artifact-writer.js";
|
|
26
|
+
export { assoc } from "./artifact-capture/association.js";
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Port: ArtifactWriter — writes run artifacts + the run manifest to external storage.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* - Paths anchor to `RunId` (not `ReportId`) via the registry's `objectPath`.
|
|
6
|
-
* - Supports both `"bulk"` and `"per-entry"` layouts.
|
|
7
|
-
* - A dedicated `writeManifest()` method for the run manifest at
|
|
8
|
-
* `runs/{runId}/manifest.json`.
|
|
4
|
+
* D0033 / W0049 unifies the writer API around a single caller-facing method:
|
|
9
5
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* - `emit(type, association, payload)` — the canonical write. Dispatch on
|
|
7
|
+
* `descriptor.layout` is internal; callers never pick a shape.
|
|
8
|
+
* - `appendNdjson(type, association, rows)` — streaming-append variant used
|
|
9
|
+
* only by the `traces` artifact. Semantics differ from `emit` (repeated
|
|
10
|
+
* append vs. single-shot write) so it gets its own method rather than an
|
|
11
|
+
* overload.
|
|
12
|
+
* - `writeManifest(runId, manifest)` — writes the run manifest at
|
|
13
|
+
* `runs/{runId}/manifest.json`.
|
|
14
|
+
* - `writeBulk` / `writePerEntry` — @deprecated legacy surface retained for
|
|
15
|
+
* producer code that has not migrated to `emit`. Removal scheduled for
|
|
16
|
+
* W0052 (see `docs/decisions/D0033-unified-run-anchored-artifact-capture.md`).
|
|
13
17
|
*
|
|
14
18
|
* @see docs/decisions/D0032-run-anchored-artifact-store.md
|
|
19
|
+
* @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md
|
|
15
20
|
* @see packages/core/src/artifact-registry.ts
|
|
16
21
|
*/
|
|
17
22
|
import type { ArtifactType } from "../artifact-registry.js";
|
|
18
|
-
import type { RunId } from "../types/branded-ids.js";
|
|
23
|
+
import type { AssociationValues, RunId } from "../types/branded-ids.js";
|
|
19
24
|
import type { ArtifactRef, RunManifest } from "../types/index.js";
|
|
20
25
|
/**
|
|
21
26
|
* An entry in a per-entry upload. The `key` is the wire-format identifier
|
|
22
27
|
* (e.g. `{taskId}::{modelId}` for testOutputs); the writer sanitizes it into
|
|
23
|
-
* the filename using the registry's `parseEntryKey
|
|
28
|
+
* the filename using the registry's `parseEntryKey` or direct path building.
|
|
29
|
+
*
|
|
30
|
+
* @deprecated Use `ArtifactWriter.emit()` with `AssociationValues` instead.
|
|
31
|
+
* This type is retained for producers still on the legacy
|
|
32
|
+
* `writeBulk`/`writePerEntry` path; removal scheduled for W0052.
|
|
24
33
|
*/
|
|
25
34
|
export interface ArtifactEntry<TData = unknown> {
|
|
26
35
|
key: string;
|
|
@@ -28,29 +37,59 @@ export interface ArtifactEntry<TData = unknown> {
|
|
|
28
37
|
}
|
|
29
38
|
export interface ArtifactWriter {
|
|
30
39
|
/**
|
|
31
|
-
* Write a
|
|
40
|
+
* Write a single artifact. The descriptor's `layout` determines whether
|
|
41
|
+
* this produces a bulk object (`runs/{runId}/{slug}.{ext}`) or a per-entry
|
|
42
|
+
* object (`runs/{runId}/{slug}/{entryKey}.{ext}`).
|
|
32
43
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
44
|
+
* For per-entry descriptors, `association` must carry the axis values the
|
|
45
|
+
* descriptor's `formatEntryKey` consumes. For bulk descriptors, only `run`
|
|
46
|
+
* is required.
|
|
47
|
+
*
|
|
48
|
+
* @returns `ArtifactRef` on success, or `null` when upload is skipped or
|
|
49
|
+
* fails (P5: non-blocking).
|
|
35
50
|
*/
|
|
36
|
-
|
|
51
|
+
emit<T extends ArtifactType>(type: T, association: AssociationValues, payload: unknown): Promise<ArtifactRef | null>;
|
|
37
52
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
53
|
+
* Append NDJSON rows to a per-entry artifact. Used only by `traces`, whose
|
|
54
|
+
* per-entry payload is itself unbounded during production. The writer
|
|
55
|
+
* buffers rows keyed on (type, entryKey) and flushes to numbered part
|
|
56
|
+
* objects; the backend composes parts into the final object at trial
|
|
57
|
+
* completion.
|
|
40
58
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
59
|
+
* @throws NotImplementedError on writers that don't support streaming
|
|
60
|
+
* appends (e.g. the API-gateway-backed writer; see W0052).
|
|
43
61
|
*/
|
|
44
|
-
|
|
62
|
+
appendNdjson<T extends ArtifactType>(type: T, association: AssociationValues, rows: readonly unknown[]): Promise<ArtifactRef | null>;
|
|
45
63
|
/**
|
|
46
64
|
* Write the run manifest to `runs/{runId}/manifest.json`. Single-writer
|
|
47
65
|
* per run; subsequent publishes may rewrite to append `reportIds[]`.
|
|
48
66
|
*/
|
|
49
67
|
writeManifest(runId: RunId, manifest: RunManifest): Promise<ArtifactRef | null>;
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Use `emit()` with `AssociationValues` instead. Retained for
|
|
70
|
+
* producers still on the legacy path; removal scheduled for W0052.
|
|
71
|
+
*/
|
|
72
|
+
writeBulk(type: ArtifactType, runId: RunId, data: unknown): Promise<ArtifactRef | null>;
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated Use `emit()` per entry instead. Retained for producers still
|
|
75
|
+
* on the legacy path; removal scheduled for W0052.
|
|
76
|
+
*/
|
|
77
|
+
writePerEntry(type: ArtifactType, runId: RunId, entries: readonly ArtifactEntry[]): Promise<ArtifactRef | null>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Thrown by writers that can't satisfy a method — e.g. an
|
|
81
|
+
* `ApiGatewayArtifactWriter` cannot implement `appendNdjson` until the batch
|
|
82
|
+
* signing endpoint (W0052) lands. Callers should treat this as an explicit
|
|
83
|
+
* failure rather than a silent no-op so the gap surfaces in logs.
|
|
84
|
+
*/
|
|
85
|
+
export declare class NotImplementedError extends Error {
|
|
86
|
+
constructor(message: string);
|
|
50
87
|
}
|
|
51
88
|
/** No-op writer — every method returns null. Used when no storage is configured. */
|
|
52
89
|
export declare class NoOpArtifactWriter implements ArtifactWriter {
|
|
90
|
+
emit(): Promise<null>;
|
|
91
|
+
appendNdjson(): Promise<null>;
|
|
92
|
+
writeManifest(): Promise<null>;
|
|
53
93
|
writeBulk(): Promise<null>;
|
|
54
94
|
writePerEntry(): Promise<null>;
|
|
55
|
-
writeManifest(): Promise<null>;
|
|
56
95
|
}
|
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Port: ArtifactWriter — writes run artifacts + the run manifest to external storage.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* - Paths anchor to `RunId` (not `ReportId`) via the registry's `objectPath`.
|
|
6
|
-
* - Supports both `"bulk"` and `"per-entry"` layouts.
|
|
7
|
-
* - A dedicated `writeManifest()` method for the run manifest at
|
|
8
|
-
* `runs/{runId}/manifest.json`.
|
|
4
|
+
* D0033 / W0049 unifies the writer API around a single caller-facing method:
|
|
9
5
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* - `emit(type, association, payload)` — the canonical write. Dispatch on
|
|
7
|
+
* `descriptor.layout` is internal; callers never pick a shape.
|
|
8
|
+
* - `appendNdjson(type, association, rows)` — streaming-append variant used
|
|
9
|
+
* only by the `traces` artifact. Semantics differ from `emit` (repeated
|
|
10
|
+
* append vs. single-shot write) so it gets its own method rather than an
|
|
11
|
+
* overload.
|
|
12
|
+
* - `writeManifest(runId, manifest)` — writes the run manifest at
|
|
13
|
+
* `runs/{runId}/manifest.json`.
|
|
14
|
+
* - `writeBulk` / `writePerEntry` — @deprecated legacy surface retained for
|
|
15
|
+
* producer code that has not migrated to `emit`. Removal scheduled for
|
|
16
|
+
* W0052 (see `docs/decisions/D0033-unified-run-anchored-artifact-capture.md`).
|
|
13
17
|
*
|
|
14
18
|
* @see docs/decisions/D0032-run-anchored-artifact-store.md
|
|
19
|
+
* @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md
|
|
15
20
|
* @see packages/core/src/artifact-registry.ts
|
|
16
21
|
*/
|
|
22
|
+
/**
|
|
23
|
+
* Thrown by writers that can't satisfy a method — e.g. an
|
|
24
|
+
* `ApiGatewayArtifactWriter` cannot implement `appendNdjson` until the batch
|
|
25
|
+
* signing endpoint (W0052) lands. Callers should treat this as an explicit
|
|
26
|
+
* failure rather than a silent no-op so the gap surfaces in logs.
|
|
27
|
+
*/
|
|
28
|
+
export class NotImplementedError extends Error {
|
|
29
|
+
constructor(message) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.name = "NotImplementedError";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
17
34
|
/** No-op writer — every method returns null. Used when no storage is configured. */
|
|
18
35
|
export class NoOpArtifactWriter {
|
|
19
|
-
async
|
|
36
|
+
async emit() {
|
|
20
37
|
return null;
|
|
21
38
|
}
|
|
22
|
-
async
|
|
39
|
+
async appendNdjson() {
|
|
23
40
|
return null;
|
|
24
41
|
}
|
|
25
42
|
async writeManifest() {
|
|
26
43
|
return null;
|
|
27
44
|
}
|
|
45
|
+
async writeBulk() {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
async writePerEntry() {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
28
51
|
}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { RunId } from "../types/branded-ids.js";
|
|
15
15
|
import type { DebugOptions, EvalMode, PluginRegistry } from "../types/index.js";
|
|
16
|
-
import type { ArtifactCollector } from "./artifact-collector.js";
|
|
17
16
|
import type { ArtifactWriter } from "./artifact-writer.js";
|
|
18
17
|
import type { CacheStore } from "./cache-store.js";
|
|
19
18
|
import type { DocFetcher } from "./doc-fetcher.js";
|
|
@@ -153,18 +152,19 @@ export interface ResolvedConfig {
|
|
|
153
152
|
apiKey?: string;
|
|
154
153
|
/** External preset file paths or npm package names to load */
|
|
155
154
|
presets?: string[];
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
155
|
+
/**
|
|
156
|
+
* D0033 unified artifact surface. Consumed by the writer factory to
|
|
157
|
+
* decide whether to attach a writer at all, where it writes to, and
|
|
158
|
+
* what to skip. Legacy `capture*` fields were retired in W0052.
|
|
159
|
+
*/
|
|
160
|
+
/** Disables all artifact writers — `--no-artifacts`. */
|
|
161
|
+
artifactsDisabled?: boolean;
|
|
162
|
+
/** Root directory for local artifact output — `--artifacts-dir`. */
|
|
163
|
+
artifactsDir?: string;
|
|
164
|
+
/** Run writers in dry-run mode — `--artifacts-dry-run`. */
|
|
165
|
+
artifactsDryRun?: boolean;
|
|
166
|
+
/** Comma-separated artifact types to skip — `--artifacts-exclude`. */
|
|
167
|
+
artifactsExclude?: readonly string[];
|
|
168
168
|
/**
|
|
169
169
|
* GCS bucket for report artifact uploads. Defaults to "ailf-artifacts"
|
|
170
170
|
* at the composition root — only set this to override (e.g., self-hosted
|
|
@@ -198,12 +198,15 @@ export interface ResolvedConfig {
|
|
|
198
198
|
* Created per-test by createTestContext().
|
|
199
199
|
*/
|
|
200
200
|
export interface AppContext {
|
|
201
|
-
/**
|
|
202
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Artifact writer — writes run artifacts + manifest to local fs (D0033
|
|
203
|
+
* M4: always on) and optionally to GCS (D0032, layered via
|
|
204
|
+
* FanoutArtifactWriter). Required post-W0050 — the composition root
|
|
205
|
+
* always provides a writer (NoOpArtifactWriter when `--no-artifacts`).
|
|
206
|
+
*/
|
|
207
|
+
readonly artifactWriter: ArtifactWriter;
|
|
203
208
|
/** Evaluation caching (filesystem + optional Content Lake fallback) */
|
|
204
209
|
readonly cache?: CacheStore;
|
|
205
|
-
/** Artifact capture collector (no-op when --capture is not set) */
|
|
206
|
-
readonly collector: ArtifactCollector;
|
|
207
210
|
/** Resolved pipeline configuration */
|
|
208
211
|
readonly config: ResolvedConfig;
|
|
209
212
|
/** Documentation context fetcher */
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* Ports define the contracts between the domain kernel and the outside world.
|
|
5
5
|
* Adapters (in packages/eval) implement these interfaces.
|
|
6
6
|
*/
|
|
7
|
-
export type { ArtifactCollector, CaptureFlushResult, CaptureManifest, CaptureManifestEntry, } from "./artifact-collector.js";
|
|
8
7
|
export type { ArtifactEntry, ArtifactWriter } from "./artifact-writer.js";
|
|
9
8
|
export { NoOpArtifactWriter } from "./artifact-writer.js";
|
|
10
|
-
export type { ArtifactContentDiff, CaptureDiffReport, ComparisonMode, ComparisonOptions, InventoryDiff, JsonDiffEntry, MetadataComparison, ScoreComparison, SecurityScan, TimingComparison, } from "./capture-comparator.js";
|
|
11
9
|
export type { CacheEntryMetadata, CacheKey, CacheLookupResult, CacheRecordInput, CacheStore, } from "./cache-store.js";
|
|
12
10
|
export type { ConfigSource } from "./config-source.js";
|
|
13
11
|
export type { AppContext, ReportSinkPort, ReportStorePort, ResolvedConfig, } from "./context.js";
|
|
@@ -67,10 +67,10 @@ export declare const FeatureSchema: z.ZodObject<{
|
|
|
67
67
|
id: z.ZodString;
|
|
68
68
|
name: z.ZodString;
|
|
69
69
|
priority: z.ZodEnum<{
|
|
70
|
-
critical: "critical";
|
|
71
|
-
high: "high";
|
|
72
|
-
medium: "medium";
|
|
73
70
|
low: "low";
|
|
71
|
+
medium: "medium";
|
|
72
|
+
high: "high";
|
|
73
|
+
critical: "critical";
|
|
74
74
|
}>;
|
|
75
75
|
sections: z.ZodArray<z.ZodString>;
|
|
76
76
|
status: z.ZodEnum<{
|
|
@@ -91,10 +91,10 @@ export declare const FeatureRegistrySchema: z.ZodObject<{
|
|
|
91
91
|
id: z.ZodString;
|
|
92
92
|
name: z.ZodString;
|
|
93
93
|
priority: z.ZodEnum<{
|
|
94
|
-
critical: "critical";
|
|
95
|
-
high: "high";
|
|
96
|
-
medium: "medium";
|
|
97
94
|
low: "low";
|
|
95
|
+
medium: "medium";
|
|
96
|
+
high: "high";
|
|
97
|
+
critical: "critical";
|
|
98
98
|
}>;
|
|
99
99
|
sections: z.ZodArray<z.ZodString>;
|
|
100
100
|
status: z.ZodEnum<{
|
|
@@ -11,3 +11,4 @@ export { classifyRubric, detectFeatureArea, extractDimensions, extractUrlMetadat
|
|
|
11
11
|
export { formatComparisonMarkdown, formatComparisonTable, } from "./comparison-formatters.js";
|
|
12
12
|
export { aggregateAreas, aggregateDimensions, computeEnsembleScore, computeTaskScore, normalizeScore, type AggregationStrategy, type AreaScore, type AssertionScore, type DimensionScore, type EnsembleGradingConfig, type GraderTransitionConfig, type TaskScore, type TaskScoreOptions, } from "./scoring-engine.js";
|
|
13
13
|
export { extractModelName, extractProvider, mergeConfig, modelMatchesMode, resolveModelVariants, } from "./config-helpers.js";
|
|
14
|
+
export { buildSlimReportSummary } from "./slim-report-summary.js";
|
|
@@ -11,3 +11,4 @@ export { classifyRubric, detectFeatureArea, extractDimensions, extractUrlMetadat
|
|
|
11
11
|
export { formatComparisonMarkdown, formatComparisonTable, } from "./comparison-formatters.js";
|
|
12
12
|
export { aggregateAreas, aggregateDimensions, computeEnsembleScore, computeTaskScore, normalizeScore, } from "./scoring-engine.js";
|
|
13
13
|
export { extractModelName, extractProvider, mergeConfig, modelMatchesMode, resolveModelVariants, } from "./config-helpers.js";
|
|
14
|
+
export { buildSlimReportSummary } from "./slim-report-summary.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* slim-report-summary.ts
|
|
3
|
+
*
|
|
4
|
+
* Pure transformer: a full `ScoreSummary` (the shape of `score-summary.json`)
|
|
5
|
+
* into the slim `ReportSummary` that Phase C of D0033 publishes on the
|
|
6
|
+
* Report Content-Lake document. Inlined prose and long arrays are replaced
|
|
7
|
+
* with `id` references to external artifacts (graderJudgments, failureModes,
|
|
8
|
+
* gapReport, traces).
|
|
9
|
+
*
|
|
10
|
+
* **The `id` principle**: every slim reference carries the manifest entry
|
|
11
|
+
* key of the external artifact it points at, produced by the descriptor's
|
|
12
|
+
* own `formatEntryKey(axes)`. Studio looks the id up in `Report.artifactManifest`
|
|
13
|
+
* to get the preview, and hydrates the full payload on drill-down.
|
|
14
|
+
*
|
|
15
|
+
* @see docs/decisions/D0033-unified-run-anchored-artifact-capture.md (§ M7)
|
|
16
|
+
* @see docs/work-items/W0051-report-slim-down-manifest-preview-hooks.json
|
|
17
|
+
*/
|
|
18
|
+
import type { ReportSummary, ScoreSummary } from "../types/index.js";
|
|
19
|
+
/**
|
|
20
|
+
* Transform a full pipeline `ScoreSummary` into its slim Report counterpart.
|
|
21
|
+
*
|
|
22
|
+
* Each of the four heavy fields is reshaped independently; everything else
|
|
23
|
+
* flows through untouched via structural spread. Pure function — the input
|
|
24
|
+
* summary is not mutated.
|
|
25
|
+
*
|
|
26
|
+
* @param mode The evaluation mode (used to populate the `mode` axis on slim
|
|
27
|
+
* judgment / failure-mode ids). `score-summary.json` carries
|
|
28
|
+
* the mode in `evaluationMode` but the publisher supplies it
|
|
29
|
+
* explicitly to keep the helper independent of that field.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildSlimReportSummary(summary: ScoreSummary, mode: string): ReportSummary;
|