@nakafa/aksara-contracts 0.49.0 → 0.51.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/artifact/integrity.d.ts +15 -2
- package/dist/artifact/integrity.js +3 -15
- package/dist/artifact/limits.js +3 -4
- package/dist/artifact/source.js +4 -8
- package/dist/artifact/spec.d.ts +30 -10
- package/dist/assessment/hash.d.ts +251 -213
- package/dist/assessment/item.d.ts +44 -7
- package/dist/assessment/item.js +19 -9
- package/dist/assessment/joint.d.ts +62 -0
- package/dist/assessment/joint.js +85 -0
- package/dist/assessment/paper.d.ts +22 -2
- package/dist/assessment/profile.d.ts +6 -0
- package/dist/assessment/scoring.d.ts +55 -2
- package/dist/assessment/scoring.js +63 -8
- package/dist/assessment/stimulus.d.ts +3 -3
- package/dist/assessment/stimulus.js +2 -2
- package/dist/errors.d.ts +3 -1
- package/dist/graph/family.d.ts +6 -2
- package/dist/graph/identity.d.ts +3 -1
- package/dist/hash/digest.d.ts +10 -0
- package/dist/hash/digest.js +40 -0
- package/dist/hash/stream.d.ts +12 -0
- package/dist/hash/stream.js +27 -0
- package/dist/hash/text.d.ts +3 -1
- package/dist/hash/text.js +2 -15
- package/dist/locale.d.ts +9 -0
- package/dist/locale.js +25 -1
- package/dist/preview/auth.d.ts +4 -2
- package/dist/preview/auth.js +26 -12
- package/dist/program/snapshot/digest.d.ts +3 -1
- package/dist/program/snapshot/digest.js +14 -22
- package/dist/program/snapshot/hash.d.ts +6 -2
- package/dist/program/snapshot/hash.js +10 -21
- package/dist/projection/digest.d.ts +11 -9
- package/dist/projection/digest.js +23 -32
- package/dist/projection/hash.d.ts +222 -2
- package/dist/projection/hash.js +6 -8
- package/dist/projection/verify.d.ts +16 -6
- package/dist/question/item.d.ts +3 -1
- package/dist/question/item.js +3 -1
- package/dist/quran/notes.d.ts +3 -1
- package/dist/quran/provenance.d.ts +6 -2
- package/dist/quran/provenance.js +8 -15
- package/dist/quran/snapshot/digest.d.ts +9 -5
- package/dist/quran/snapshot/digest.js +33 -41
- package/dist/quran/snapshot/hash.d.ts +3 -1
- package/dist/quran/snapshot/hash.js +9 -15
- package/dist/quran/snapshot/row/hash.d.ts +3 -1
- package/dist/quran/snapshot/row/hash.js +2 -8
- package/dist/release/digest.d.ts +10 -8
- package/dist/release/digest.js +22 -31
- package/dist/release/hash.d.ts +3 -1
- package/dist/release/hash.js +3 -8
- package/dist/release/items.d.ts +25 -9
- package/dist/release/items.js +12 -3
- package/dist/release/policy.d.ts +3 -1
- package/dist/release/result/digest.d.ts +23 -13
- package/dist/release/result/digest.js +20 -29
- package/dist/release/rollback/digest.d.ts +16 -10
- package/dist/release/rollback/digest.js +25 -32
- package/dist/release/route/digest.d.ts +10 -8
- package/dist/release/route/digest.js +22 -31
- package/dist/release/route/verify.d.ts +16 -6
- package/dist/release/route/verify.js +8 -2
- package/dist/release/snapshot/evidence/requirement.d.ts +3 -1
- package/dist/release/snapshot/evidence/tryout.d.ts +1 -1
- package/dist/release/snapshot/evidence/tryout.js +1 -1
- package/dist/release/snapshot/evidence.d.ts +1 -1
- package/dist/release/snapshot/verify.d.ts +19 -7
- package/dist/release/snapshot/verify.js +20 -18
- package/dist/release/verify.d.ts +9 -3
- package/dist/renderer/compatibility.d.ts +6 -2
- package/dist/renderer/compatibility.js +3 -1
- package/dist/renderer/contract.d.ts +9 -3
- package/dist/renderer/contract.js +3 -1
- package/dist/runtime/error.d.ts +3 -1
- package/dist/runtime/protected/verify.d.ts +1 -1
- package/dist/runtime/verify.d.ts +2 -2
- package/dist/runtime/verify.js +2 -1
- package/dist/signature/key.d.ts +21 -0
- package/dist/signature/key.js +104 -0
- package/dist/signature/spec.d.ts +18 -6
- package/dist/signature/spec.js +16 -4
- package/dist/transport/request.d.ts +728 -728
- package/dist/transport/response.d.ts +26 -26
- package/dist/tryout/canonical.d.ts +11 -1
- package/dist/tryout/canonical.js +6 -10
- package/dist/tryout/closure/accounting.d.ts +3 -1
- package/dist/tryout/digest.d.ts +12 -6
- package/dist/tryout/digest.js +21 -14
- package/dist/tryout/hash/catalog.d.ts +228 -3
- package/dist/tryout/hash/catalog.js +5 -7
- package/dist/tryout/hash/content.d.ts +113 -2
- package/dist/tryout/hash/content.js +10 -8
- package/dist/tryout/hash/placement.d.ts +236 -5
- package/dist/tryout/hash/placement.js +7 -8
- package/dist/tryout/runtime/hash.d.ts +3 -1
- package/dist/tryout/runtime/hash.js +3 -1
- package/dist/tryout/runtime/source.d.ts +3 -1
- package/dist/tryout/runtime/verify.d.ts +13 -5
- package/dist/tryout/runtime/verify.js +1 -1
- package/dist/tryout/scoring.d.ts +3 -1
- package/dist/tryout/snapshot/hash.d.ts +45 -4
- package/dist/tryout/snapshot/hash.js +9 -7
- package/package.json +22 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import { Effect, Schema, Stream } from "effect";
|
|
3
|
-
import {
|
|
2
|
+
import { DigestStream } from "#contracts/hash/stream";
|
|
3
|
+
import { ReleaseIdSchema } from "#contracts/ids";
|
|
4
4
|
import { ReleaseCountMismatchFields, ReleaseDigestMismatchFields, } from "#contracts/release/mismatch";
|
|
5
5
|
import { canonicalizeRollbackSnapshotEntry, } from "#contracts/release/rollback/spec";
|
|
6
6
|
const ROLLBACK_SNAPSHOT_DIGEST_DOMAIN = "nakafa.aksara.rollback-snapshot";
|
|
@@ -11,56 +11,49 @@ export class RollbackSnapshotHashError extends Schema.TaggedError()("RollbackSna
|
|
|
11
11
|
export class RollbackSnapshotCountMismatchError extends Schema.TaggedError()("RollbackSnapshotCountMismatchError", { ...ReleaseCountMismatchFields }) {
|
|
12
12
|
}
|
|
13
13
|
/** A replayed rollback snapshot does not match its signed digest. */
|
|
14
|
-
export class RollbackSnapshotDigestMismatchError extends Schema.TaggedError()("RollbackSnapshotDigestMismatchError", {
|
|
14
|
+
export class RollbackSnapshotDigestMismatchError extends Schema.TaggedError()("RollbackSnapshotDigestMismatchError", {
|
|
15
|
+
...ReleaseDigestMismatchFields,
|
|
16
|
+
}) {
|
|
15
17
|
}
|
|
16
|
-
/** Keeps
|
|
18
|
+
/** Keeps the digest stream private behind the incremental digest seam. */
|
|
17
19
|
class RollbackSnapshotDigestState {
|
|
18
|
-
#
|
|
20
|
+
#stream = new DigestStream();
|
|
19
21
|
count = 0;
|
|
20
|
-
/**
|
|
22
|
+
/** Starts one domain-separated rollback snapshot digest. */
|
|
21
23
|
constructor() {
|
|
22
|
-
this.#
|
|
23
|
-
this.#
|
|
24
|
+
this.#stream.add(ROLLBACK_SNAPSHOT_DIGEST_DOMAIN);
|
|
25
|
+
this.#stream.add("\n");
|
|
24
26
|
}
|
|
25
27
|
/** Adds one canonical prior state to the snapshot digest. */
|
|
26
28
|
update(entry) {
|
|
27
|
-
this.#
|
|
28
|
-
this.#
|
|
29
|
+
this.#stream.add(canonicalizeRollbackSnapshotEntry(entry));
|
|
30
|
+
this.#stream.add("\n");
|
|
29
31
|
this.count += 1;
|
|
30
32
|
}
|
|
31
|
-
/**
|
|
33
|
+
/** Digests the complete stream once and returns its branded immutable identity. */
|
|
32
34
|
digest() {
|
|
33
|
-
return
|
|
35
|
+
return this.#stream.digest();
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
/** Creates a fresh domain-separated digest state for one rollback snapshot. */
|
|
37
|
-
export
|
|
38
|
-
return Effect.try({
|
|
39
|
-
catch: () => new RollbackSnapshotHashError({ releaseId }),
|
|
40
|
-
try: () => new RollbackSnapshotDigestState(),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
39
|
+
export const createRollbackSnapshotDigest = Effect.sync(() => new RollbackSnapshotDigestState());
|
|
43
40
|
/** Adds one canonical prior state to an incremental rollback digest. */
|
|
44
|
-
export function updateRollbackSnapshotDigest(
|
|
45
|
-
return Effect.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
state.update(entry);
|
|
49
|
-
return state;
|
|
50
|
-
},
|
|
41
|
+
export function updateRollbackSnapshotDigest(state, entry) {
|
|
42
|
+
return Effect.sync(() => {
|
|
43
|
+
state.update(entry);
|
|
44
|
+
return state;
|
|
51
45
|
});
|
|
52
46
|
}
|
|
53
47
|
/** Finalizes one rollback snapshot digest with a typed hash failure. */
|
|
54
48
|
export function finalizeRollbackSnapshotDigest(releaseId, state) {
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
49
|
+
return state
|
|
50
|
+
.digest()
|
|
51
|
+
.pipe(Effect.mapError(() => new RollbackSnapshotHashError({ releaseId })));
|
|
59
52
|
}
|
|
60
|
-
/** Digests one rollback snapshot stream
|
|
53
|
+
/** Digests one rollback snapshot stream. Its canonical bytes are held until one Web Crypto digest runs. */
|
|
61
54
|
export const digestRollbackSnapshot = Effect.fn("AksaraContracts.digestRollbackSnapshot")(function* (releaseId, entries) {
|
|
62
|
-
const initial = yield* createRollbackSnapshotDigest
|
|
63
|
-
const state = yield* entries.pipe(Stream.runFoldEffect(() => initial, (current, entry) => updateRollbackSnapshotDigest(
|
|
55
|
+
const initial = yield* createRollbackSnapshotDigest;
|
|
56
|
+
const state = yield* entries.pipe(Stream.runFoldEffect(() => initial, (current, entry) => updateRollbackSnapshotDigest(current, entry)));
|
|
64
57
|
const digest = yield* finalizeRollbackSnapshotDigest(releaseId, state);
|
|
65
58
|
return { count: state.count, digest };
|
|
66
59
|
});
|
|
@@ -3,28 +3,30 @@ import { type ReleaseId } from "#contracts/ids";
|
|
|
3
3
|
import { type ContentRouteItem } from "#contracts/release/route/spec";
|
|
4
4
|
declare const RouteHashError_base: Schema.Class<RouteHashError, Schema.TaggedStruct<"RouteHashError", {
|
|
5
5
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
6
|
-
}>, import("effect/Cause").YieldableError
|
|
6
|
+
}>, import("effect/Cause").YieldableError & {
|
|
7
|
+
readonly brand: unique symbol;
|
|
8
|
+
}>;
|
|
7
9
|
/** SHA-256 computation failed before route integrity was established. */
|
|
8
10
|
export declare class RouteHashError extends RouteHashError_base {
|
|
9
11
|
}
|
|
10
|
-
/** Keeps incremental route
|
|
12
|
+
/** Keeps incremental route digest state private to one release preparation. */
|
|
11
13
|
declare class RouteDigestState {
|
|
12
14
|
#private;
|
|
13
15
|
count: number;
|
|
14
|
-
/**
|
|
16
|
+
/** Starts a domain-separated route digest. */
|
|
15
17
|
constructor();
|
|
16
18
|
/** Adds one canonical route item to this invocation-owned digest. */
|
|
17
19
|
update(item: ContentRouteItem): void;
|
|
18
|
-
/**
|
|
19
|
-
digest(): string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
20
|
+
/** Digests the complete route stream once and returns its branded identity. */
|
|
21
|
+
digest(): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, import("effect/PlatformError").PlatformError, never>;
|
|
20
22
|
}
|
|
21
23
|
/** Creates fresh domain-separated route digest state. */
|
|
22
|
-
export declare
|
|
24
|
+
export declare const createRouteDigest: Effect.Effect<RouteDigestState, never, never>;
|
|
23
25
|
/** Adds one canonical route item to an incremental digest. */
|
|
24
|
-
export declare function updateRouteDigest(
|
|
26
|
+
export declare function updateRouteDigest(state: RouteDigestState, item: ContentRouteItem): Effect.Effect<RouteDigestState, never, never>;
|
|
25
27
|
/** Completes one incremental route digest with typed hash failures. */
|
|
26
28
|
export declare function completeRouteDigest(releaseId: ReleaseId, state: RouteDigestState): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, RouteHashError, never>;
|
|
27
|
-
/** Digests a canonical route stream
|
|
29
|
+
/** Digests a canonical route stream. Its canonical bytes are held until one Web Crypto digest runs. */
|
|
28
30
|
export declare const digestRoutes: <E, R>(releaseId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraReleaseId">, routes: Stream.Stream<{
|
|
29
31
|
readonly change: {
|
|
30
32
|
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
@@ -1,59 +1,50 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import { Effect, Schema, Stream } from "effect";
|
|
3
|
-
import {
|
|
2
|
+
import { DigestStream } from "#contracts/hash/stream";
|
|
3
|
+
import { ReleaseIdSchema } from "#contracts/ids";
|
|
4
4
|
import { canonicalizeContentRouteItem, } from "#contracts/release/route/spec";
|
|
5
5
|
const CONTENT_ROUTE_DIGEST_DOMAIN = "nakafa.aksara.content-routes";
|
|
6
6
|
/** SHA-256 computation failed before route integrity was established. */
|
|
7
7
|
export class RouteHashError extends Schema.TaggedError()("RouteHashError", { releaseId: ReleaseIdSchema }) {
|
|
8
8
|
}
|
|
9
|
-
/** Keeps incremental route
|
|
9
|
+
/** Keeps incremental route digest state private to one release preparation. */
|
|
10
10
|
class RouteDigestState {
|
|
11
|
-
#
|
|
11
|
+
#stream = new DigestStream();
|
|
12
12
|
count = 0;
|
|
13
|
-
/**
|
|
13
|
+
/** Starts a domain-separated route digest. */
|
|
14
14
|
constructor() {
|
|
15
|
-
this.#
|
|
16
|
-
this.#
|
|
15
|
+
this.#stream.add(CONTENT_ROUTE_DIGEST_DOMAIN);
|
|
16
|
+
this.#stream.add("\n");
|
|
17
17
|
}
|
|
18
18
|
/** Adds one canonical route item to this invocation-owned digest. */
|
|
19
19
|
update(item) {
|
|
20
|
-
this.#
|
|
21
|
-
this.#
|
|
20
|
+
this.#stream.add(canonicalizeContentRouteItem(item));
|
|
21
|
+
this.#stream.add("\n");
|
|
22
22
|
this.count += 1;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
24
|
+
/** Digests the complete route stream once and returns its branded identity. */
|
|
25
25
|
digest() {
|
|
26
|
-
return
|
|
26
|
+
return this.#stream.digest();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
/** Creates fresh domain-separated route digest state. */
|
|
30
|
-
export
|
|
31
|
-
return Effect.try({
|
|
32
|
-
catch: () => new RouteHashError({ releaseId }),
|
|
33
|
-
try: () => new RouteDigestState(),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
30
|
+
export const createRouteDigest = Effect.sync(() => new RouteDigestState());
|
|
36
31
|
/** Adds one canonical route item to an incremental digest. */
|
|
37
|
-
export function updateRouteDigest(
|
|
38
|
-
return Effect.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
state.update(item);
|
|
42
|
-
return state;
|
|
43
|
-
},
|
|
32
|
+
export function updateRouteDigest(state, item) {
|
|
33
|
+
return Effect.sync(() => {
|
|
34
|
+
state.update(item);
|
|
35
|
+
return state;
|
|
44
36
|
});
|
|
45
37
|
}
|
|
46
38
|
/** Completes one incremental route digest with typed hash failures. */
|
|
47
39
|
export function completeRouteDigest(releaseId, state) {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
40
|
+
return state
|
|
41
|
+
.digest()
|
|
42
|
+
.pipe(Effect.mapError(() => new RouteHashError({ releaseId })));
|
|
52
43
|
}
|
|
53
|
-
/** Digests a canonical route stream
|
|
44
|
+
/** Digests a canonical route stream. Its canonical bytes are held until one Web Crypto digest runs. */
|
|
54
45
|
export const digestRoutes = Effect.fn("AksaraContracts.digestRoutes")(function* (releaseId, routes) {
|
|
55
|
-
const initial = yield* createRouteDigest
|
|
56
|
-
const state = yield* routes.pipe(Stream.runFoldEffect(() => initial, (current, route) => updateRouteDigest(
|
|
46
|
+
const initial = yield* createRouteDigest;
|
|
47
|
+
const state = yield* routes.pipe(Stream.runFoldEffect(() => initial, (current, route) => updateRouteDigest(current, route)));
|
|
57
48
|
const digest = yield* completeRouteDigest(releaseId, state);
|
|
58
49
|
return { count: state.count, digest };
|
|
59
50
|
});
|
|
@@ -2,27 +2,35 @@ import { Effect, Schema, Stream } from "effect";
|
|
|
2
2
|
import type { ContentReleaseManifest } from "#contracts/release/spec";
|
|
3
3
|
declare const RouteDecodeError_base: Schema.Class<RouteDecodeError, Schema.TaggedStruct<"RouteDecodeError", {
|
|
4
4
|
readonly routeOffset: Schema.Finite;
|
|
5
|
-
}>, import("effect/Cause").YieldableError
|
|
5
|
+
}>, import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly brand: unique symbol;
|
|
7
|
+
}>;
|
|
6
8
|
/** One streamed route failed strict wire decoding. */
|
|
7
9
|
export declare class RouteDecodeError extends RouteDecodeError_base {
|
|
8
10
|
}
|
|
9
11
|
declare const RouteIdentityError_base: Schema.Class<RouteIdentityError, Schema.TaggedStruct<"RouteIdentityError", {
|
|
10
12
|
readonly routeOffset: Schema.Finite;
|
|
11
|
-
}>, import("effect/Cause").YieldableError
|
|
13
|
+
}>, import("effect/Cause").YieldableError & {
|
|
14
|
+
readonly brand: unique symbol;
|
|
15
|
+
}>;
|
|
12
16
|
/** One route belongs to another release or sequence position. */
|
|
13
17
|
export declare class RouteIdentityError extends RouteIdentityError_base {
|
|
14
18
|
}
|
|
15
19
|
declare const RouteDuplicateError_base: Schema.Class<RouteDuplicateError, Schema.TaggedStruct<"RouteDuplicateError", {
|
|
16
20
|
readonly firstIndex: Schema.Finite;
|
|
17
21
|
readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
|
|
18
|
-
}>, import("effect/Cause").YieldableError
|
|
22
|
+
}>, import("effect/Cause").YieldableError & {
|
|
23
|
+
readonly brand: unique symbol;
|
|
24
|
+
}>;
|
|
19
25
|
/** Two changes in one release target the same locale-specific route. */
|
|
20
26
|
export declare class RouteDuplicateError extends RouteDuplicateError_base {
|
|
21
27
|
}
|
|
22
28
|
declare const RouteCountError_base: Schema.Class<RouteCountError, Schema.TaggedStruct<"RouteCountError", {
|
|
23
29
|
readonly actualCount: Schema.Finite;
|
|
24
30
|
readonly expectedCount: Schema.Finite;
|
|
25
|
-
}>, import("effect/Cause").YieldableError
|
|
31
|
+
}>, import("effect/Cause").YieldableError & {
|
|
32
|
+
readonly brand: unique symbol;
|
|
33
|
+
}>;
|
|
26
34
|
/** The streamed route count differs from its signed manifest. */
|
|
27
35
|
export declare class RouteCountError extends RouteCountError_base {
|
|
28
36
|
}
|
|
@@ -30,14 +38,16 @@ declare const RouteDigestError_base: Schema.Class<RouteDigestError, Schema.Tagge
|
|
|
30
38
|
readonly actualDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
31
39
|
readonly expectedDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
32
40
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
33
|
-
}>, import("effect/Cause").YieldableError
|
|
41
|
+
}>, import("effect/Cause").YieldableError & {
|
|
42
|
+
readonly brand: unique symbol;
|
|
43
|
+
}>;
|
|
34
44
|
/** The streamed route digest differs from its signed manifest. */
|
|
35
45
|
export declare class RouteDigestError extends RouteDigestError_base {
|
|
36
46
|
}
|
|
37
47
|
declare const VerifiedContentRoutesSchema: Schema.Struct<{
|
|
38
48
|
readonly count: Schema.Finite;
|
|
39
49
|
}>;
|
|
40
|
-
/** Count authenticated
|
|
50
|
+
/** Count authenticated against the signed manifest. The digest holds every canonical byte until its one final call, so its memory grows with the stream. */
|
|
41
51
|
export type VerifiedContentRoutes = typeof VerifiedContentRoutesSchema.Type;
|
|
42
52
|
/** Strictly decodes one replayable canonical route stream. */
|
|
43
53
|
export declare function decodeContentRoutes<E, R>(input: {
|
|
@@ -12,10 +12,16 @@ export class RouteDecodeError extends Schema.TaggedError()("RouteDecodeError", {
|
|
|
12
12
|
export class RouteIdentityError extends Schema.TaggedError()("RouteIdentityError", { routeOffset: ReleaseCountSchema }) {
|
|
13
13
|
}
|
|
14
14
|
/** Two changes in one release target the same locale-specific route. */
|
|
15
|
-
export class RouteDuplicateError extends Schema.TaggedError()("RouteDuplicateError", {
|
|
15
|
+
export class RouteDuplicateError extends Schema.TaggedError()("RouteDuplicateError", {
|
|
16
|
+
firstIndex: ReleaseCountSchema,
|
|
17
|
+
publicPath: PublicPathSchema,
|
|
18
|
+
}) {
|
|
16
19
|
}
|
|
17
20
|
/** The streamed route count differs from its signed manifest. */
|
|
18
|
-
export class RouteCountError extends Schema.TaggedError()("RouteCountError", {
|
|
21
|
+
export class RouteCountError extends Schema.TaggedError()("RouteCountError", {
|
|
22
|
+
actualCount: ReleaseCountSchema,
|
|
23
|
+
expectedCount: ReleaseCountSchema,
|
|
24
|
+
}) {
|
|
19
25
|
}
|
|
20
26
|
/** The streamed route digest differs from its signed manifest. */
|
|
21
27
|
export class RouteDigestError extends Schema.TaggedError()("RouteDigestError", { ...ReleaseDigestMismatchFields }) {
|
|
@@ -7,7 +7,9 @@ declare const SnapshotEvidenceError_base: Schema.Class<SnapshotEvidenceError, Sc
|
|
|
7
7
|
readonly expected: Schema.String;
|
|
8
8
|
readonly family: Schema.Literals<readonly ["program", "quran", "tryout"]>;
|
|
9
9
|
readonly field: Schema.String;
|
|
10
|
-
}>, import("effect/Cause").YieldableError
|
|
10
|
+
}>, import("effect/Cause").YieldableError & {
|
|
11
|
+
readonly brand: unique symbol;
|
|
12
|
+
}>;
|
|
11
13
|
/** Signed snapshot evidence differs from its authenticated row stream. */
|
|
12
14
|
export declare class SnapshotEvidenceError extends SnapshotEvidenceError_base {
|
|
13
15
|
}
|
|
@@ -19,4 +19,4 @@ export declare const verifyTryoutSnapshotRows: <E, R>(snapshot: {
|
|
|
19
19
|
readonly format: "localized-tryout-snapshot";
|
|
20
20
|
readonly snapshotId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
21
21
|
};
|
|
22
|
-
}, rows: SnapshotRowSource<E, R>) => Effect.Effect<number, E | import("#contracts/release/snapshot/evidence/requirement").SnapshotEvidenceError | import("../../../tryout/closure/accounting.js").TryoutClosureError | import("../../../tryout/digest.js").TryoutDigestError | import("../../../tryout/scoring.js").TryoutScoringError, R>;
|
|
22
|
+
}, rows: SnapshotRowSource<E, R>) => Effect.Effect<number, E | import("effect/PlatformError").PlatformError | import("#contracts/release/snapshot/evidence/requirement").SnapshotEvidenceError | import("../../../tryout/canonical.js").TryoutCanonicalHashError | import("../../../tryout/closure/accounting.js").TryoutClosureError | import("../../../tryout/digest.js").TryoutDigestError | import("../../../tryout/scoring.js").TryoutScoringError, R>;
|
|
@@ -80,7 +80,7 @@ export const verifyTryoutSnapshotRows = Effect.fn("AksaraContracts.verifyTryoutS
|
|
|
80
80
|
field: "routeCount",
|
|
81
81
|
});
|
|
82
82
|
const { format: _format, snapshotId, ...facts } = snapshot.manifest;
|
|
83
|
-
const actualId = makeTryoutSnapshot(facts).snapshotId;
|
|
83
|
+
const actualId = (yield* makeTryoutSnapshot(facts)).snapshotId;
|
|
84
84
|
yield* requireSnapshotEvidence({
|
|
85
85
|
actual: actualId,
|
|
86
86
|
expected: snapshotId,
|
|
@@ -55,4 +55,4 @@ export declare const verifySnapshotRows: <E, R>(snapshot: {
|
|
|
55
55
|
readonly format: "localized-tryout-snapshot";
|
|
56
56
|
readonly snapshotId: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
57
57
|
};
|
|
58
|
-
}, rows: SnapshotRowSource<E, R>) => Effect.Effect<number, E | import("../../program/snapshot/digest.js").ProgramDigestError | import("../../program/snapshot/hash.js").ProgramRowHashError | import("../../program/snapshot/hash.js").ProgramSnapshotHashError | import("../../quran/snapshot/row/hash.js").QuranRowHashError | import("../../quran/snapshot/digest.js").QuranRowIntegrityError | import("../../quran/snapshot/digest.js").QuranRowOrderError | import("../../quran/snapshot/hash.js").QuranSnapshotHashError | import("#contracts/release/snapshot/evidence/requirement").SnapshotEvidenceError | import("../../tryout/closure/accounting.js").TryoutClosureError | import("../../tryout/digest.js").TryoutDigestError | import("../../tryout/scoring.js").TryoutScoringError, R>;
|
|
58
|
+
}, rows: SnapshotRowSource<E, R>) => Effect.Effect<number, E | import("effect/PlatformError").PlatformError | import("../../program/snapshot/digest.js").ProgramDigestError | import("../../program/snapshot/hash.js").ProgramRowHashError | import("../../program/snapshot/hash.js").ProgramSnapshotHashError | import("../../quran/snapshot/row/hash.js").QuranRowHashError | import("../../quran/snapshot/digest.js").QuranRowIntegrityError | import("../../quran/snapshot/digest.js").QuranRowOrderError | import("../../quran/snapshot/hash.js").QuranSnapshotHashError | import("#contracts/release/snapshot/evidence/requirement").SnapshotEvidenceError | import("../../tryout/canonical.js").TryoutCanonicalHashError | import("../../tryout/closure/accounting.js").TryoutClosureError | import("../../tryout/digest.js").TryoutDigestError | import("../../tryout/scoring.js").TryoutScoringError, R>;
|
|
@@ -2,7 +2,9 @@ import { Effect, Schema, Stream } from "effect";
|
|
|
2
2
|
import { type ContentSnapshotSet } from "#contracts/release/snapshot/spec";
|
|
3
3
|
declare const SnapshotManifestDecodeError_base: Schema.Class<SnapshotManifestDecodeError, Schema.TaggedStruct<"SnapshotManifestDecodeError", {
|
|
4
4
|
readonly manifestIndex: Schema.Int;
|
|
5
|
-
}>, import("effect/Cause").YieldableError
|
|
5
|
+
}>, import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly brand: unique symbol;
|
|
7
|
+
}>;
|
|
6
8
|
/** One replacement manifest failed strict wire decoding. */
|
|
7
9
|
export declare class SnapshotManifestDecodeError extends SnapshotManifestDecodeError_base {
|
|
8
10
|
}
|
|
@@ -10,26 +12,34 @@ declare const SnapshotManifestOrderError_base: Schema.Class<SnapshotManifestOrde
|
|
|
10
12
|
readonly actualFamily: Schema.Literals<readonly ["program", "quran", "tryout"]>;
|
|
11
13
|
readonly manifestIndex: Schema.Int;
|
|
12
14
|
readonly previousFamily: Schema.Literals<readonly ["program", "quran", "tryout"]>;
|
|
13
|
-
}>, import("effect/Cause").YieldableError
|
|
15
|
+
}>, import("effect/Cause").YieldableError & {
|
|
16
|
+
readonly brand: unique symbol;
|
|
17
|
+
}>;
|
|
14
18
|
/** Replacement manifests are duplicated or outside canonical family order. */
|
|
15
19
|
export declare class SnapshotManifestOrderError extends SnapshotManifestOrderError_base {
|
|
16
20
|
}
|
|
17
21
|
declare const SnapshotRowDecodeError_base: Schema.Class<SnapshotRowDecodeError, Schema.TaggedStruct<"SnapshotRowDecodeError", {
|
|
18
22
|
readonly rowIndex: Schema.Int;
|
|
19
|
-
}>, import("effect/Cause").YieldableError
|
|
23
|
+
}>, import("effect/Cause").YieldableError & {
|
|
24
|
+
readonly brand: unique symbol;
|
|
25
|
+
}>;
|
|
20
26
|
/** One structured snapshot row failed strict wire decoding. */
|
|
21
27
|
export declare class SnapshotRowDecodeError extends SnapshotRowDecodeError_base {
|
|
22
28
|
}
|
|
23
29
|
declare const SnapshotRowFamilyError_base: Schema.Class<SnapshotRowFamilyError, Schema.TaggedStruct<"SnapshotRowFamilyError", {
|
|
24
30
|
readonly family: Schema.Literals<readonly ["program", "quran", "tryout"]>;
|
|
25
31
|
readonly rowIndex: Schema.Int;
|
|
26
|
-
}>, import("effect/Cause").YieldableError
|
|
32
|
+
}>, import("effect/Cause").YieldableError & {
|
|
33
|
+
readonly brand: unique symbol;
|
|
34
|
+
}>;
|
|
27
35
|
/** A staged row belongs to a family this release does not replace. */
|
|
28
36
|
export declare class SnapshotRowFamilyError extends SnapshotRowFamilyError_base {
|
|
29
37
|
}
|
|
30
38
|
declare const SnapshotTransitionError_base: Schema.Class<SnapshotTransitionError, Schema.TaggedStruct<"SnapshotTransitionError", {
|
|
31
39
|
readonly family: Schema.Literals<readonly ["program", "quran", "tryout"]>;
|
|
32
|
-
}>, import("effect/Cause").YieldableError
|
|
40
|
+
}>, import("effect/Cause").YieldableError & {
|
|
41
|
+
readonly brand: unique symbol;
|
|
42
|
+
}>;
|
|
33
43
|
/** A replacement manifest cannot form a coherent forward transition. */
|
|
34
44
|
export declare class SnapshotTransitionError extends SnapshotTransitionError_base {
|
|
35
45
|
}
|
|
@@ -37,7 +47,9 @@ declare const SnapshotStagedCountError_base: Schema.Class<SnapshotStagedCountErr
|
|
|
37
47
|
readonly actualCount: Schema.Int;
|
|
38
48
|
readonly expectedCount: Schema.Int;
|
|
39
49
|
readonly verifiedCount: Schema.Int;
|
|
40
|
-
}>, import("effect/Cause").YieldableError
|
|
50
|
+
}>, import("effect/Cause").YieldableError & {
|
|
51
|
+
readonly brand: unique symbol;
|
|
52
|
+
}>;
|
|
41
53
|
/** The staged row stream count differs from all signed family evidence. */
|
|
42
54
|
export declare class SnapshotStagedCountError extends SnapshotStagedCountError_base {
|
|
43
55
|
}
|
|
@@ -730,5 +742,5 @@ export declare const verifyContentSnapshots: <ManifestError, ManifestContext, Ro
|
|
|
730
742
|
};
|
|
731
743
|
};
|
|
732
744
|
stagedRows: number;
|
|
733
|
-
}, ManifestError | RowError | import("../../program/snapshot/digest.js").ProgramDigestError | import("../../program/snapshot/hash.js").ProgramRowHashError | import("../../program/snapshot/hash.js").ProgramSnapshotHashError | import("../../quran/snapshot/row/hash.js").QuranRowHashError | import("../../quran/snapshot/digest.js").QuranRowIntegrityError | import("../../quran/snapshot/digest.js").QuranRowOrderError | import("../../quran/snapshot/hash.js").QuranSnapshotHashError | import("./evidence/requirement.js").SnapshotEvidenceError | SnapshotManifestDecodeError | SnapshotManifestOrderError | SnapshotRowDecodeError | SnapshotRowFamilyError | SnapshotStagedCountError | SnapshotTransitionError | import("../../tryout/closure/accounting.js").TryoutClosureError | import("../../tryout/digest.js").TryoutDigestError | import("../../tryout/scoring.js").TryoutScoringError, ManifestContext | RowContext>;
|
|
745
|
+
}, ManifestError | RowError | import("effect/PlatformError").PlatformError | import("../../program/snapshot/digest.js").ProgramDigestError | import("../../program/snapshot/hash.js").ProgramRowHashError | import("../../program/snapshot/hash.js").ProgramSnapshotHashError | import("../../quran/snapshot/row/hash.js").QuranRowHashError | import("../../quran/snapshot/digest.js").QuranRowIntegrityError | import("../../quran/snapshot/digest.js").QuranRowOrderError | import("../../quran/snapshot/hash.js").QuranSnapshotHashError | import("./evidence/requirement.js").SnapshotEvidenceError | SnapshotManifestDecodeError | SnapshotManifestOrderError | SnapshotRowDecodeError | SnapshotRowFamilyError | SnapshotStagedCountError | SnapshotTransitionError | import("../../tryout/canonical.js").TryoutCanonicalHashError | import("../../tryout/closure/accounting.js").TryoutClosureError | import("../../tryout/digest.js").TryoutDigestError | import("../../tryout/scoring.js").TryoutScoringError, ManifestContext | RowContext>;
|
|
734
746
|
export {};
|
|
@@ -46,16 +46,16 @@ const familyOrder = {
|
|
|
46
46
|
/** Derives one replacement's aggregate row evidence in its owning runtime. */
|
|
47
47
|
function snapshotRowEvidence(snapshot) {
|
|
48
48
|
if (snapshot.family === "program") {
|
|
49
|
-
return {
|
|
49
|
+
return Effect.succeed({
|
|
50
50
|
rowCount: snapshot.manifest.rowCount,
|
|
51
51
|
rowDigest: snapshot.manifest.rowDigest,
|
|
52
|
-
};
|
|
52
|
+
});
|
|
53
53
|
}
|
|
54
54
|
if (snapshot.family === "quran") {
|
|
55
|
-
return {
|
|
55
|
+
return Effect.succeed({
|
|
56
56
|
rowCount: snapshot.manifest.projectionCount,
|
|
57
57
|
rowDigest: snapshot.manifest.projectionDigest,
|
|
58
|
-
};
|
|
58
|
+
});
|
|
59
59
|
}
|
|
60
60
|
return tryoutSnapshotRowEvidence(snapshot.manifest);
|
|
61
61
|
}
|
|
@@ -92,20 +92,22 @@ export function decodeContentSnapshotRows(rows) {
|
|
|
92
92
|
}
|
|
93
93
|
/** Replaces one inherited family state without weakening schema filters. */
|
|
94
94
|
function replaceSnapshotState(snapshots, snapshot) {
|
|
95
|
-
return Effect.
|
|
96
|
-
|
|
97
|
-
try
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
return Effect.gen(function* () {
|
|
96
|
+
const evidence = yield* snapshotRowEvidence(snapshot);
|
|
97
|
+
return yield* Effect.try({
|
|
98
|
+
catch: () => new SnapshotTransitionError({ family: snapshot.family }),
|
|
99
|
+
try: () => {
|
|
100
|
+
const baseSnapshotId = snapshots[snapshot.family].resultSnapshotId;
|
|
101
|
+
return ContentSnapshotSetSchema.make({
|
|
102
|
+
...snapshots,
|
|
103
|
+
[snapshot.family]: replaceContentSnapshot({
|
|
104
|
+
baseSnapshotId,
|
|
105
|
+
resultSnapshotId: snapshot.manifest.snapshotId,
|
|
106
|
+
...evidence,
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
});
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
/** Derives all fixed family states from prior results and replacements. */
|
package/dist/release/verify.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { Effect, Schema } from "effect";
|
|
|
2
2
|
import { type ContentReleaseBundle, type RollbackContentReleaseBundle } from "#contracts/release/lifecycle";
|
|
3
3
|
declare const ReleaseVerificationDecodeError_base: Schema.Class<ReleaseVerificationDecodeError, Schema.TaggedStruct<"ReleaseVerificationDecodeError", {
|
|
4
4
|
readonly message: Schema.Literal<"Release verification input does not satisfy its exact wire contract.">;
|
|
5
|
-
}>, import("effect/Cause").YieldableError
|
|
5
|
+
}>, import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly brand: unique symbol;
|
|
7
|
+
}>;
|
|
6
8
|
/** Unknown release input did not exactly satisfy its signed wire contract. */
|
|
7
9
|
export declare class ReleaseVerificationDecodeError extends ReleaseVerificationDecodeError_base {
|
|
8
10
|
}
|
|
@@ -10,13 +12,17 @@ declare const ReleaseManifestHashMismatchError_base: Schema.Class<ReleaseManifes
|
|
|
10
12
|
readonly actualHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
11
13
|
readonly expectedHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
12
14
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
13
|
-
}>, import("effect/Cause").YieldableError
|
|
15
|
+
}>, import("effect/Cause").YieldableError & {
|
|
16
|
+
readonly brand: unique symbol;
|
|
17
|
+
}>;
|
|
14
18
|
/** The envelope hash does not identify its complete canonical manifest. */
|
|
15
19
|
export declare class ReleaseManifestHashMismatchError extends ReleaseManifestHashMismatchError_base {
|
|
16
20
|
}
|
|
17
21
|
declare const ReleaseBundleVerificationDecodeError_base: Schema.Class<ReleaseBundleVerificationDecodeError, Schema.TaggedStruct<"ReleaseBundleVerificationDecodeError", {
|
|
18
22
|
readonly message: Schema.Literal<"Release bundle verification input does not satisfy its exact wire contract.">;
|
|
19
|
-
}>, import("effect/Cause").YieldableError
|
|
23
|
+
}>, import("effect/Cause").YieldableError & {
|
|
24
|
+
readonly brand: unique symbol;
|
|
25
|
+
}>;
|
|
20
26
|
/** Stored release recovery input does not satisfy its exact bundle contract. */
|
|
21
27
|
export declare class ReleaseBundleVerificationDecodeError extends ReleaseBundleVerificationDecodeError_base {
|
|
22
28
|
}
|
|
@@ -4,14 +4,18 @@ import type { CompiledContentPayload } from "#contracts/content";
|
|
|
4
4
|
import { type RendererManifestEnvelope } from "#contracts/renderer/contract";
|
|
5
5
|
declare const RendererManifestDomainUnpublishedError_base: Schema.Class<RendererManifestDomainUnpublishedError, Schema.TaggedStruct<"RendererManifestDomainUnpublishedError", {
|
|
6
6
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
7
|
-
}>, import("effect/Cause").YieldableError
|
|
7
|
+
}>, import("effect/Cause").YieldableError & {
|
|
8
|
+
readonly brand: unique symbol;
|
|
9
|
+
}>;
|
|
8
10
|
/** A live renderer no longer publishes one domain frozen by a signed release. */
|
|
9
11
|
export declare class RendererManifestDomainUnpublishedError extends RendererManifestDomainUnpublishedError_base {
|
|
10
12
|
}
|
|
11
13
|
declare const RendererManifestComponentUnsupportedError_base: Schema.Class<RendererManifestComponentUnsupportedError, Schema.TaggedStruct<"RendererManifestComponentUnsupportedError", {
|
|
12
14
|
readonly componentName: Schema.String;
|
|
13
15
|
readonly rendererScope: Schema.Union<readonly [Schema.Literal<"base">, Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>]>;
|
|
14
|
-
}>, import("effect/Cause").YieldableError
|
|
16
|
+
}>, import("effect/Cause").YieldableError & {
|
|
17
|
+
readonly brand: unique symbol;
|
|
18
|
+
}>;
|
|
15
19
|
/** A live renderer no longer supports one required frozen renderer name. */
|
|
16
20
|
export declare class RendererManifestComponentUnsupportedError extends RendererManifestComponentUnsupportedError_base {
|
|
17
21
|
}
|
|
@@ -9,7 +9,9 @@ const RendererCapabilityScopeSchema = Schema.Union([
|
|
|
9
9
|
RendererDomainSchema,
|
|
10
10
|
]);
|
|
11
11
|
/** A live renderer no longer publishes one domain frozen by a signed release. */
|
|
12
|
-
export class RendererManifestDomainUnpublishedError extends Schema.TaggedError()("RendererManifestDomainUnpublishedError", {
|
|
12
|
+
export class RendererManifestDomainUnpublishedError extends Schema.TaggedError()("RendererManifestDomainUnpublishedError", {
|
|
13
|
+
rendererDomain: RendererDomainSchema,
|
|
14
|
+
}) {
|
|
13
15
|
}
|
|
14
16
|
/** A live renderer no longer supports one required frozen renderer name. */
|
|
15
17
|
export class RendererManifestComponentUnsupportedError extends Schema.TaggedError()("RendererManifestComponentUnsupportedError", {
|
|
@@ -32,7 +32,9 @@ export declare const RendererManifestEnvelopeSchema: Schema.Struct<{
|
|
|
32
32
|
export type RendererManifestEnvelope = typeof RendererManifestEnvelopeSchema.Type;
|
|
33
33
|
declare const RendererDomainCapabilityMissingError_base: Schema.Class<RendererDomainCapabilityMissingError, Schema.TaggedStruct<"RendererDomainCapabilityMissingError", {
|
|
34
34
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
35
|
-
}>, import("effect/Cause").YieldableError
|
|
35
|
+
}>, import("effect/Cause").YieldableError & {
|
|
36
|
+
readonly brand: unique symbol;
|
|
37
|
+
}>;
|
|
36
38
|
/** A persisted renderer envelope does not carry the requested domain. */
|
|
37
39
|
export declare class RendererDomainCapabilityMissingError extends RendererDomainCapabilityMissingError_base {
|
|
38
40
|
}
|
|
@@ -52,14 +54,18 @@ export declare const selectRendererDomainCapability: (manifest: {
|
|
|
52
54
|
}, RendererDomainCapabilityMissingError, never>;
|
|
53
55
|
declare const RendererManifestHashComputeError_base: Schema.Class<RendererManifestHashComputeError, Schema.TaggedStruct<"RendererManifestHashComputeError", {
|
|
54
56
|
readonly cause: Schema.Unknown;
|
|
55
|
-
}>, import("effect/Cause").YieldableError
|
|
57
|
+
}>, import("effect/Cause").YieldableError & {
|
|
58
|
+
readonly brand: unique symbol;
|
|
59
|
+
}>;
|
|
56
60
|
/** SHA-256 could not be calculated for the renderer contract bytes. */
|
|
57
61
|
export declare class RendererManifestHashComputeError extends RendererManifestHashComputeError_base {
|
|
58
62
|
}
|
|
59
63
|
declare const RendererManifestHashMismatchError_base: Schema.Class<RendererManifestHashMismatchError, Schema.TaggedStruct<"RendererManifestHashMismatchError", {
|
|
60
64
|
readonly actualHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
61
65
|
readonly expectedHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
62
|
-
}>, import("effect/Cause").YieldableError
|
|
66
|
+
}>, import("effect/Cause").YieldableError & {
|
|
67
|
+
readonly brand: unique symbol;
|
|
68
|
+
}>;
|
|
63
69
|
/** The renderer envelope hash does not authenticate its canonical tuple. */
|
|
64
70
|
export declare class RendererManifestHashMismatchError extends RendererManifestHashMismatchError_base {
|
|
65
71
|
}
|
|
@@ -52,7 +52,9 @@ export const RendererManifestEnvelopeSchema = Schema.Struct({
|
|
|
52
52
|
message: "Expected base and route-domain component names to be disjoint.",
|
|
53
53
|
})));
|
|
54
54
|
/** A persisted renderer envelope does not carry the requested domain. */
|
|
55
|
-
export class RendererDomainCapabilityMissingError extends Schema.TaggedError()("RendererDomainCapabilityMissingError", {
|
|
55
|
+
export class RendererDomainCapabilityMissingError extends Schema.TaggedError()("RendererDomainCapabilityMissingError", {
|
|
56
|
+
rendererDomain: RendererDomainSchema,
|
|
57
|
+
}) {
|
|
56
58
|
}
|
|
57
59
|
/** Selects the one physical route registry authorized for a document. */
|
|
58
60
|
export const selectRendererDomainCapability = Effect.fn("AksaraContracts.selectRendererDomainCapability")(function* (manifest, rendererDomain) {
|
package/dist/runtime/error.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
declare const ContentRuntimeMismatchError_base: Schema.Class<ContentRuntimeMismatchError, Schema.TaggedStruct<"ContentRuntimeMismatchError", {
|
|
3
3
|
readonly reason: Schema.Literals<readonly ["activeManifestHash", "activeReleaseId", "artifactHash", "bundleHash", "contentKey", "delivery", "locale", "projectionHash", "publicPath", "rendererManifest", "selectorCount", "snapshotId", "sourcePath"]>;
|
|
4
|
-
}>, import("effect/Cause").YieldableError
|
|
4
|
+
}>, import("effect/Cause").YieldableError & {
|
|
5
|
+
readonly brand: unique symbol;
|
|
6
|
+
}>;
|
|
5
7
|
/** A decoded runtime response does not belong to its initiating request. */
|
|
6
8
|
export declare class ContentRuntimeMismatchError extends ContentRuntimeMismatchError_base {
|
|
7
9
|
}
|
|
@@ -74,4 +74,4 @@ export declare const verifyProtectedContentRuntimeExchange: (input: {
|
|
|
74
74
|
} | {
|
|
75
75
|
readonly code: "CONTENT_RUNTIME_INTERNAL" | "CONTENT_RUNTIME_INVALID" | "CONTENT_RUNTIME_RESPONSE_TOO_LARGE" | "CONTENT_RUNTIME_UNAUTHORIZED";
|
|
76
76
|
readonly kind: "failure";
|
|
77
|
-
}, import("../../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../../artifact/spec.js").ArtifactHashComputationError | import("../../artifact/spec.js").ArtifactHashMismatchError | import("../../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../../artifact/spec.js").ArtifactRendererComponentMissingError | import("../../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../../artifact/spec.js").ArtifactSourceHashComputationError | import("../../artifact/spec.js").ArtifactSourceHashMismatchError | import("../../artifact/spec.js").ArtifactVerificationByteLimitError | import("../../artifact/spec.js").ArtifactVerificationDecodeError | ContentRuntimeMismatchError | import("../../errors.js").ContractDecodeError | import("../../signature/spec.js").PublicKeyParseError | import("../../signature/spec.js").PublicKeyTypeError | import("#contracts/renderer/contract").RendererDomainCapabilityMissingError | import("#contracts/renderer/contract").RendererManifestHashComputeError | import("#contracts/renderer/contract").RendererManifestHashMismatchError | import("../../signature/spec.js").SignatureCheckError | import("../../signature/spec.js").SignatureInvalidError | import("../../signature/spec.js").SigningKeyNotFoundError | import("../../signature/spec.js").SigningKeyResolutionError | import("../../tryout/runtime/hash.js").TryoutRuntimeBundleHashComputationError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleHashMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleRendererMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleSnapshotMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleVerificationDecodeError, import("../../signature/spec.js").ContentVerificationKeyResolver>;
|
|
77
|
+
}, import("../../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../../artifact/spec.js").ArtifactHashComputationError | import("../../artifact/spec.js").ArtifactHashMismatchError | import("../../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../../artifact/spec.js").ArtifactRendererComponentMissingError | import("../../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../../artifact/spec.js").ArtifactSourceHashComputationError | import("../../artifact/spec.js").ArtifactSourceHashMismatchError | import("../../artifact/spec.js").ArtifactVerificationByteLimitError | import("../../artifact/spec.js").ArtifactVerificationDecodeError | ContentRuntimeMismatchError | import("../../errors.js").ContractDecodeError | import("../../signature/spec.js").PublicKeyParseError | import("../../signature/spec.js").PublicKeyTypeError | import("#contracts/renderer/contract").RendererDomainCapabilityMissingError | import("#contracts/renderer/contract").RendererManifestHashComputeError | import("#contracts/renderer/contract").RendererManifestHashMismatchError | import("../../signature/spec.js").SignatureCheckError | import("../../signature/spec.js").SignatureInvalidError | import("../../signature/spec.js").SigningKeyNotFoundError | import("../../signature/spec.js").SigningKeyResolutionError | import("../../tryout/canonical.js").TryoutCanonicalHashError | import("../../tryout/runtime/hash.js").TryoutRuntimeBundleHashComputationError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleHashMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleRendererMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleSnapshotMismatchError | import("#contracts/tryout/runtime/verify").TryoutRuntimeBundleVerificationDecodeError, import("../../signature/spec.js").ContentVerificationKeyResolver>;
|