@nakafa/aksara-contracts 0.48.6 → 0.48.8

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.
@@ -43,22 +43,20 @@ export class ArtifactPayloadFieldByteLimitError extends Schema.TaggedError()("Ar
43
43
  /** SHA-256 computation failed before authenticity could be established. */
44
44
  export class ArtifactHashComputationError extends Schema.TaggedError()("ArtifactHashComputationError", { contentKey: ContentKeySchema }) {
45
45
  }
46
- /** The signed artifact hash does not identify its canonical payload. */
47
- export class ArtifactHashMismatchError extends Schema.TaggedError()("ArtifactHashMismatchError", {
46
+ /** Fields that name one content hash, its content key, and the hash that failed. */
47
+ const ContentHashMismatchFields = {
48
48
  actualHash: Sha256HashSchema,
49
49
  contentKey: ContentKeySchema,
50
50
  expectedHash: Sha256HashSchema,
51
- }) {
51
+ };
52
+ /** The signed artifact hash does not identify its canonical payload. */
53
+ export class ArtifactHashMismatchError extends Schema.TaggedError()("ArtifactHashMismatchError", { ...ContentHashMismatchFields }) {
52
54
  }
53
55
  /** SHA-256 could not be calculated for the authenticated authored source. */
54
56
  export class ArtifactSourceHashComputationError extends Schema.TaggedError()("ArtifactSourceHashComputationError", { contentKey: ContentKeySchema }) {
55
57
  }
56
58
  /** The authenticated source hash does not identify the complete raw MDX. */
57
- export class ArtifactSourceHashMismatchError extends Schema.TaggedError()("ArtifactSourceHashMismatchError", {
58
- actualHash: Sha256HashSchema,
59
- contentKey: ContentKeySchema,
60
- expectedHash: Sha256HashSchema,
61
- }) {
59
+ export class ArtifactSourceHashMismatchError extends Schema.TaggedError()("ArtifactSourceHashMismatchError", { ...ContentHashMismatchFields }) {
62
60
  }
63
61
  /** A custom component required by the artifact is absent from the renderer. */
64
62
  export class ArtifactRendererComponentMissingError extends Schema.TaggedError()("ArtifactRendererComponentMissingError", {
package/dist/errors.d.ts CHANGED
@@ -7,4 +7,9 @@ declare const ContractDecodeError_base: Schema.Class<ContractDecodeError, Schema
7
7
  /** Describes a wire value that failed its named Effect Schema contract. */
8
8
  export declare class ContractDecodeError extends ContractDecodeError_base {
9
9
  }
10
+ /** Fields that name one SHA-256 hash and the recomputed SHA-256 that failed. */
11
+ export declare const Sha256MismatchFields: {
12
+ actualHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
13
+ expectedHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
14
+ };
10
15
  export {};
package/dist/errors.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { Sha256HashSchema } from "#contracts/ids";
2
3
  /** Describes a wire value that failed its named Effect Schema contract. */
3
4
  export class ContractDecodeError extends Schema.TaggedError()("ContractDecodeError", {
4
5
  cause: Schema.Unknown,
@@ -6,3 +7,8 @@ export class ContractDecodeError extends Schema.TaggedError()("ContractDecodeErr
6
7
  message: Schema.Trimmed.check(Schema.isNonEmpty()),
7
8
  }) {
8
9
  }
10
+ /** Fields that name one SHA-256 hash and the recomputed SHA-256 that failed. */
11
+ export const Sha256MismatchFields = {
12
+ actualHash: Sha256HashSchema,
13
+ expectedHash: Sha256HashSchema,
14
+ };
@@ -1,4 +1,9 @@
1
1
  import { Schema } from "effect";
2
+ /** Locale and public route that name one page. Route errors and previews share them. */
3
+ export declare const PublicRouteFields: {
4
+ readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
5
+ readonly publicPath: Schema.brand<Schema.String, "@NakafaAI/AksaraPublicPath">;
6
+ };
2
7
  /** Locale and existing public route refreshed by one preview update. */
3
8
  export declare const PreviewRouteSchema: Schema.Struct<{
4
9
  readonly appLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">;
@@ -3,11 +3,13 @@ import { PublicPathSchema } from "#contracts/ids";
3
3
  import { AppLocaleSchema } from "#contracts/locale";
4
4
  import { TryoutExamSchema, TryoutSectionSchema, TryoutSetSchema, TryoutTrackSchema, } from "#contracts/tryout/catalog";
5
5
  import { TryoutPlacementSourceSchema } from "#contracts/tryout/placement";
6
- /** Locale and existing public route refreshed by one preview update. */
7
- export const PreviewRouteSchema = Schema.Struct({
6
+ /** Locale and public route that name one page. Route errors and previews share them. */
7
+ export const PublicRouteFields = {
8
8
  appLocale: AppLocaleSchema,
9
9
  publicPath: PublicPathSchema,
10
- });
10
+ };
11
+ /** Locale and existing public route refreshed by one preview update. */
12
+ export const PreviewRouteSchema = Schema.Struct(PublicRouteFields);
11
13
  /**
12
14
  * Placement identity needed to select one preview body.
13
15
  * Responses remain owned by the canonical question registry and projections.
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema, Stream } from "effect";
2
- import { type ContentReleaseManifest } from "#contracts/release/spec";
2
+ import type { ContentReleaseManifest } from "#contracts/release/spec";
3
3
  declare const ProjectionDecodeError_base: Schema.Class<ProjectionDecodeError, Schema.TaggedStruct<"ProjectionDecodeError", {
4
4
  readonly projectionIndex: Schema.Finite;
5
5
  }>, import("effect/Cause").YieldableError>;
@@ -43,6 +43,90 @@ declare const VerifiedContentProjectionsSchema: Schema.Struct<{
43
43
  export type VerifiedContentProjections = typeof VerifiedContentProjectionsSchema.Type;
44
44
  /** Strictly decodes a replayable canonical content projection stream. */
45
45
  export declare function decodeContentProjections<E, R>(projections: Stream.Stream<unknown, E, R>): Stream.Stream<{
46
+ readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
47
+ readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
48
+ readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
49
+ readonly graph: {
50
+ readonly alignmentId: string;
51
+ readonly assetId: string;
52
+ readonly conceptId: string;
53
+ readonly learningObjectId: string;
54
+ readonly lensId: string;
55
+ };
56
+ readonly materialKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">;
57
+ readonly order: number;
58
+ readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
59
+ readonly sectionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialSection">;
60
+ readonly kind: "subject-lesson";
61
+ readonly metadata: {
62
+ readonly dateModified?: string;
63
+ readonly datePublished: string;
64
+ readonly authors: readonly {
65
+ readonly name: string;
66
+ }[];
67
+ readonly description?: string | undefined;
68
+ readonly searchTitle?: string;
69
+ readonly subject?: string | undefined;
70
+ readonly title: string;
71
+ };
72
+ readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
73
+ readonly sitemap: true;
74
+ readonly topicTitle: string;
75
+ } | {
76
+ readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
77
+ readonly articleRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
78
+ readonly articleSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleSlug">;
79
+ readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
80
+ readonly category: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleCategory">;
81
+ readonly categoryRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
82
+ readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
83
+ readonly graph: {
84
+ readonly alignmentId: string;
85
+ readonly assetId: string;
86
+ readonly conceptId: string;
87
+ readonly learningObjectId: string;
88
+ readonly lensId: string;
89
+ };
90
+ readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
91
+ readonly categoryTitle: string;
92
+ readonly kind: "article";
93
+ readonly metadata: {
94
+ readonly dateModified?: string;
95
+ readonly datePublished: string;
96
+ readonly authors: readonly {
97
+ readonly name: string;
98
+ }[];
99
+ readonly description?: string | undefined;
100
+ readonly title: string;
101
+ };
102
+ readonly official: boolean;
103
+ readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
104
+ readonly references: readonly {
105
+ readonly authors: string;
106
+ readonly citation?: string | undefined;
107
+ readonly details?: string | undefined;
108
+ readonly publication?: string | undefined;
109
+ readonly title: string;
110
+ readonly url?: string | undefined;
111
+ readonly year: number;
112
+ }[];
113
+ readonly sitemap: true;
114
+ } | {
115
+ readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
116
+ readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
117
+ readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
118
+ readonly pageKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPageKey">;
119
+ readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
120
+ readonly kind: "public-page";
121
+ readonly metadata: {
122
+ readonly dateModified?: string;
123
+ readonly datePublished: string;
124
+ readonly description: string;
125
+ readonly title: string;
126
+ };
127
+ readonly sitemap: true;
128
+ readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
129
+ } | {
46
130
  readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
47
131
  readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
48
132
  readonly peerContentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
@@ -66,6 +150,35 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
66
150
  };
67
151
  readonly stimulusKey?: string;
68
152
  readonly response: {
153
+ readonly categories: readonly {
154
+ readonly categoryKey: string;
155
+ readonly label: string;
156
+ readonly order: number;
157
+ }[];
158
+ readonly kind: "category";
159
+ readonly statements: readonly {
160
+ readonly correctCategoryKey: string;
161
+ readonly label: string;
162
+ readonly order: number;
163
+ readonly statementKey: string;
164
+ }[];
165
+ } | {
166
+ readonly kind: "multiple-choice";
167
+ readonly options: readonly {
168
+ readonly isCorrect: boolean;
169
+ readonly label: string;
170
+ readonly optionKey: string;
171
+ readonly order: number;
172
+ }[];
173
+ } | {
174
+ readonly kind: "single-choice";
175
+ readonly options: readonly {
176
+ readonly isCorrect: boolean;
177
+ readonly label: string;
178
+ readonly optionKey: string;
179
+ readonly order: number;
180
+ }[];
181
+ } | {
69
182
  readonly criteria: readonly {
70
183
  readonly criterionKey: string;
71
184
  readonly finalAnswer?: {
@@ -100,35 +213,6 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
100
213
  }[];
101
214
  }[];
102
215
  readonly kind: "rubric";
103
- } | {
104
- readonly categories: readonly {
105
- readonly categoryKey: string;
106
- readonly label: string;
107
- readonly order: number;
108
- }[];
109
- readonly kind: "category";
110
- readonly statements: readonly {
111
- readonly correctCategoryKey: string;
112
- readonly label: string;
113
- readonly order: number;
114
- readonly statementKey: string;
115
- }[];
116
- } | {
117
- readonly kind: "multiple-choice";
118
- readonly options: readonly {
119
- readonly isCorrect: boolean;
120
- readonly label: string;
121
- readonly optionKey: string;
122
- readonly order: number;
123
- }[];
124
- } | {
125
- readonly kind: "single-choice";
126
- readonly options: readonly {
127
- readonly isCorrect: boolean;
128
- readonly label: string;
129
- readonly optionKey: string;
130
- readonly order: number;
131
- }[];
132
216
  } | {
133
217
  readonly key: {
134
218
  readonly acceptsFractions: boolean;
@@ -169,90 +253,6 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
169
253
  readonly title: string;
170
254
  };
171
255
  readonly stimulusKey?: string;
172
- } | {
173
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
174
- readonly articleRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
175
- readonly articleSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleSlug">;
176
- readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
177
- readonly category: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleCategory">;
178
- readonly categoryRouteSlug: string & import("effect/Brand").Brand<"@NakafaAI/AksaraArticleRouteSlug">;
179
- readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
180
- readonly graph: {
181
- readonly alignmentId: string;
182
- readonly assetId: string;
183
- readonly conceptId: string;
184
- readonly learningObjectId: string;
185
- readonly lensId: string;
186
- };
187
- readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
188
- readonly categoryTitle: string;
189
- readonly kind: "article";
190
- readonly metadata: {
191
- readonly dateModified?: string;
192
- readonly datePublished: string;
193
- readonly authors: readonly {
194
- readonly name: string;
195
- }[];
196
- readonly description?: string | undefined;
197
- readonly title: string;
198
- };
199
- readonly official: boolean;
200
- readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
201
- readonly references: readonly {
202
- readonly authors: string;
203
- readonly citation?: string | undefined;
204
- readonly details?: string | undefined;
205
- readonly publication?: string | undefined;
206
- readonly title: string;
207
- readonly url?: string | undefined;
208
- readonly year: number;
209
- }[];
210
- readonly sitemap: true;
211
- } | {
212
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
213
- readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
214
- readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
215
- readonly graph: {
216
- readonly alignmentId: string;
217
- readonly assetId: string;
218
- readonly conceptId: string;
219
- readonly learningObjectId: string;
220
- readonly lensId: string;
221
- };
222
- readonly materialKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">;
223
- readonly order: number;
224
- readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
225
- readonly sectionKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialSection">;
226
- readonly kind: "subject-lesson";
227
- readonly metadata: {
228
- readonly dateModified?: string;
229
- readonly datePublished: string;
230
- readonly authors: readonly {
231
- readonly name: string;
232
- }[];
233
- readonly description?: string | undefined;
234
- readonly searchTitle?: string;
235
- readonly subject?: string | undefined;
236
- readonly title: string;
237
- };
238
- readonly parentPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
239
- readonly sitemap: true;
240
- readonly topicTitle: string;
241
- } | {
242
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
243
- readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
244
- readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
245
- readonly pageKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPageKey">;
246
- readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
247
- readonly kind: "public-page";
248
- readonly metadata: {
249
- readonly dateModified?: string;
250
- readonly datePublished: string;
251
- readonly description: string;
252
- readonly title: string;
253
- };
254
- readonly sitemap: true;
255
- readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
256
256
  }, E | ProjectionDecodeError | ProjectionOrderError | ProjectionRouteError, R>;
257
257
  /** Authenticates a replayable projection stream against its signed manifest. */
258
258
  export declare const verifyContentProjections: <E, R>(input: {
@@ -3,8 +3,8 @@ import { compareContentHeads, routeIdentity } from "#contracts/content";
3
3
  import { PublicPathSchema } from "#contracts/ids";
4
4
  import { digestProjections } from "#contracts/projection/digest";
5
5
  import { ContentProjectionSchema, } from "#contracts/projection/spec";
6
+ import { ReleaseCountSchema } from "#contracts/release/count";
6
7
  import { ReleaseCountMismatchFields, ReleaseDigestMismatchFields, } from "#contracts/release/mismatch";
7
- import { ReleaseCountSchema, } from "#contracts/release/spec";
8
8
  /** One streamed projection failed strict schema decoding. */
9
9
  export class ProjectionDecodeError extends Schema.TaggedError()("ProjectionDecodeError", { projectionIndex: ReleaseCountSchema }) {
10
10
  }
@@ -0,0 +1,3 @@
1
+ import { Schema } from "effect";
2
+ /** Nonnegative release inventory count authenticated by one manifest. */
3
+ export declare const ReleaseCountSchema: Schema.Finite;
@@ -0,0 +1,3 @@
1
+ import { Schema } from "effect";
2
+ /** Nonnegative release inventory count authenticated by one manifest. */
3
+ export const ReleaseCountSchema = Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThanOrEqualTo(0)));
@@ -77,15 +77,11 @@ export declare const ActiveContentReleaseSchema: Schema.Struct<{
77
77
  readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
78
78
  }>;
79
79
  readonly receipt: Schema.Struct<{
80
- readonly activatedHeads: Schema.Finite;
81
80
  readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
82
- readonly deletedHeads: Schema.Finite;
83
81
  readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
84
- readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
85
82
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
86
83
  readonly resultCount: Schema.Finite;
87
84
  readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
88
- readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
89
85
  readonly snapshots: Schema.Struct<{
90
86
  readonly program: Schema.Struct<{
91
87
  readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
@@ -109,6 +105,10 @@ export declare const ActiveContentReleaseSchema: Schema.Struct<{
109
105
  readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
110
106
  }>;
111
107
  }>;
108
+ readonly activatedHeads: Schema.Finite;
109
+ readonly deletedHeads: Schema.Finite;
110
+ readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
111
+ readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
112
112
  readonly stagedArtifacts: Schema.Finite;
113
113
  readonly stagedItems: Schema.Finite;
114
114
  readonly stagedProjections: Schema.Finite;
@@ -194,15 +194,11 @@ export declare const ActiveRollbackContentReleaseSchema: Schema.refine<ActiveRol
194
194
  readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
195
195
  }>;
196
196
  readonly receipt: Schema.Struct<{
197
- readonly activatedHeads: Schema.Finite;
198
197
  readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
199
- readonly deletedHeads: Schema.Finite;
200
198
  readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
201
- readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
202
199
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
203
200
  readonly resultCount: Schema.Finite;
204
201
  readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
205
- readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
206
202
  readonly snapshots: Schema.Struct<{
207
203
  readonly program: Schema.Struct<{
208
204
  readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
@@ -226,6 +222,10 @@ export declare const ActiveRollbackContentReleaseSchema: Schema.refine<ActiveRol
226
222
  readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
227
223
  }>;
228
224
  }>;
225
+ readonly activatedHeads: Schema.Finite;
226
+ readonly deletedHeads: Schema.Finite;
227
+ readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
228
+ readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
229
229
  readonly stagedArtifacts: Schema.Finite;
230
230
  readonly stagedItems: Schema.Finite;
231
231
  readonly stagedProjections: Schema.Finite;
@@ -312,15 +312,11 @@ export declare const RecoveryLookupSchema: Schema.Union<readonly [Schema.Struct<
312
312
  readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
313
313
  }>;
314
314
  readonly receipt: Schema.Struct<{
315
- readonly activatedHeads: Schema.Finite;
316
315
  readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
317
- readonly deletedHeads: Schema.Finite;
318
316
  readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
319
- readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
320
317
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
321
318
  readonly resultCount: Schema.Finite;
322
319
  readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
323
- readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
324
320
  readonly snapshots: Schema.Struct<{
325
321
  readonly program: Schema.Struct<{
326
322
  readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
@@ -344,6 +340,10 @@ export declare const RecoveryLookupSchema: Schema.Union<readonly [Schema.Struct<
344
340
  readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
345
341
  }>;
346
342
  }>;
343
+ readonly activatedHeads: Schema.Finite;
344
+ readonly deletedHeads: Schema.Finite;
345
+ readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
346
+ readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
347
347
  readonly stagedArtifacts: Schema.Finite;
348
348
  readonly stagedItems: Schema.Finite;
349
349
  readonly stagedProjections: Schema.Finite;
@@ -231,15 +231,11 @@ export declare const ContentReleaseCurrentSchema: Schema.Struct<{
231
231
  readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
232
232
  }>;
233
233
  readonly receipt: Schema.Struct<{
234
- readonly activatedHeads: Schema.Finite;
235
234
  readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
236
- readonly deletedHeads: Schema.Finite;
237
235
  readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
238
- readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
239
236
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
240
237
  readonly resultCount: Schema.Finite;
241
238
  readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
242
- readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
243
239
  readonly snapshots: Schema.Struct<{
244
240
  readonly program: Schema.Struct<{
245
241
  readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
@@ -263,6 +259,10 @@ export declare const ContentReleaseCurrentSchema: Schema.Struct<{
263
259
  readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
264
260
  }>;
265
261
  }>;
262
+ readonly activatedHeads: Schema.Finite;
263
+ readonly deletedHeads: Schema.Finite;
264
+ readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
265
+ readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
266
266
  readonly stagedArtifacts: Schema.Finite;
267
267
  readonly stagedItems: Schema.Finite;
268
268
  readonly stagedProjections: Schema.Finite;
@@ -0,0 +1,33 @@
1
+ import { Schema } from "effect";
2
+ /** Immutable identity of the active content catalog that one release builds on or replaces. */
3
+ export declare const ActiveCatalogIdentitySchema: Schema.Struct<{
4
+ readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
5
+ readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
6
+ readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
7
+ readonly resultCount: Schema.Finite;
8
+ readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
9
+ readonly snapshots: Schema.Struct<{
10
+ readonly program: Schema.Struct<{
11
+ readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
12
+ readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
13
+ readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
14
+ readonly rowCount: Schema.Int;
15
+ readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
16
+ }>;
17
+ readonly quran: Schema.Struct<{
18
+ readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
19
+ readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
20
+ readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
21
+ readonly rowCount: Schema.Int;
22
+ readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
23
+ }>;
24
+ readonly tryout: Schema.Struct<{
25
+ readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
26
+ readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
27
+ readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
28
+ readonly rowCount: Schema.Int;
29
+ readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
30
+ }>;
31
+ }>;
32
+ }>;
33
+ export type ActiveCatalogIdentity = typeof ActiveCatalogIdentitySchema.Type;
@@ -0,0 +1,14 @@
1
+ import { Schema } from "effect";
2
+ import { ReleaseIdSchema, Sha256HashSchema } from "#contracts/ids";
3
+ import { ActiveAppLocaleListSchema } from "#contracts/locale";
4
+ import { ReleaseCountSchema } from "#contracts/release/count";
5
+ import { ContentSnapshotSetSchema } from "#contracts/release/snapshot/spec";
6
+ /** Immutable identity of the active content catalog that one release builds on or replaces. */
7
+ export const ActiveCatalogIdentitySchema = Schema.Struct({
8
+ activeAppLocales: ActiveAppLocaleListSchema,
9
+ manifestHash: Sha256HashSchema,
10
+ releaseId: ReleaseIdSchema,
11
+ resultCount: ReleaseCountSchema,
12
+ resultDigest: Sha256HashSchema,
13
+ snapshots: ContentSnapshotSetSchema,
14
+ });
@@ -1,9 +1,10 @@
1
1
  import { Array as Arr, Effect, MutableRef, Option, Schema, Stream, } from "effect";
2
2
  import { compareContentHeads } from "#contracts/content";
3
3
  import { ReleaseIdSchema } from "#contracts/ids";
4
+ import { ReleaseCountSchema } from "#contracts/release/count";
4
5
  import { digestItems } from "#contracts/release/digest";
5
6
  import { ReleaseDigestMismatchFields } from "#contracts/release/mismatch";
6
- import { ContentReleaseItemSchema, ReleaseCountSchema, } from "#contracts/release/spec";
7
+ import { ContentReleaseItemSchema, } from "#contracts/release/spec";
7
8
  /** One release item failed strict wire decoding. */
8
9
  export class ReleaseItemDecodeError extends Schema.TaggedError()("ReleaseItemDecodeError", { itemOffset: ReleaseCountSchema }) {
9
10
  }
@@ -239,15 +239,11 @@ export declare const ContentReleaseStatusSchema: Schema.Union<readonly [Schema.S
239
239
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
240
240
  readonly phase: Schema.Literal<"completed">;
241
241
  readonly receipt: Schema.Struct<{
242
- readonly activatedHeads: Schema.Finite;
243
242
  readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
244
- readonly deletedHeads: Schema.Finite;
245
243
  readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
246
- readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
247
244
  readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
248
245
  readonly resultCount: Schema.Finite;
249
246
  readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
250
- readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
251
247
  readonly snapshots: Schema.Struct<{
252
248
  readonly program: Schema.Struct<{
253
249
  readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
@@ -271,6 +267,10 @@ export declare const ContentReleaseStatusSchema: Schema.Union<readonly [Schema.S
271
267
  readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
272
268
  }>;
273
269
  }>;
270
+ readonly activatedHeads: Schema.Finite;
271
+ readonly deletedHeads: Schema.Finite;
272
+ readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
273
+ readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
274
274
  readonly stagedArtifacts: Schema.Finite;
275
275
  readonly stagedItems: Schema.Finite;
276
276
  readonly stagedProjections: Schema.Finite;
@@ -10,3 +10,9 @@ export declare const ReleaseCountMismatchFields: {
10
10
  expectedCount: import("effect/Schema").Finite;
11
11
  releaseId: import("effect/Schema").brand<import("effect/Schema").String, "@NakafaAI/AksaraReleaseId">;
12
12
  };
13
+ /** Fields that name one signed release manifest hash and the recomputed hash that failed. */
14
+ export declare const ReleaseHashMismatchFields: {
15
+ actualHash: import("effect/Schema").brand<import("effect/Schema").String, "@NakafaAI/AksaraSha256Hash">;
16
+ expectedHash: import("effect/Schema").brand<import("effect/Schema").String, "@NakafaAI/AksaraSha256Hash">;
17
+ releaseId: import("effect/Schema").brand<import("effect/Schema").String, "@NakafaAI/AksaraReleaseId">;
18
+ };
@@ -1,5 +1,6 @@
1
+ import { Sha256MismatchFields } from "#contracts/errors";
1
2
  import { ReleaseIdSchema, Sha256HashSchema } from "#contracts/ids";
2
- import { ReleaseCountSchema } from "#contracts/release/spec";
3
+ import { ReleaseCountSchema } from "#contracts/release/count";
3
4
  /** Fields that name one signed release digest and the replayed digest that failed. */
4
5
  export const ReleaseDigestMismatchFields = {
5
6
  actualDigest: Sha256HashSchema,
@@ -12,3 +13,8 @@ export const ReleaseCountMismatchFields = {
12
13
  expectedCount: ReleaseCountSchema,
13
14
  releaseId: ReleaseIdSchema,
14
15
  };
16
+ /** Fields that name one signed release manifest hash and the recomputed hash that failed. */
17
+ export const ReleaseHashMismatchFields = {
18
+ ...Sha256MismatchFields,
19
+ releaseId: ReleaseIdSchema,
20
+ };
@@ -1,6 +1,7 @@
1
1
  import { Array as Arr, Effect, Schema } from "effect";
2
2
  import { ContentFamilySchema } from "#contracts/content";
3
3
  import { ActiveAppLocaleListSchema } from "#contracts/locale";
4
+ import { hasSameAppLocales } from "#contracts/release/current/evidence";
4
5
  import { ContentSnapshotKindSchema, } from "#contracts/release/snapshot/scope";
5
6
  const ClosureFieldSchema = Schema.Literals([
6
7
  "activeAppLocales",
@@ -21,14 +22,9 @@ export class ReleasePolicyClosureError extends Schema.TaggedError()("ReleasePoli
21
22
  field: ClosureFieldSchema,
22
23
  }) {
23
24
  }
24
- /** Compares locale lists without exchanging their branded element roles. */
25
- function hasSameLocaleCodes(left, right) {
26
- return (left.length === right.length &&
27
- Arr.every(left, (locale, index) => locale === right[index]));
28
- }
29
25
  /** Returns whether two release policies have the same signed identity. */
30
26
  function hasSamePolicy(left, right) {
31
- return hasSameLocaleCodes(left.activeAppLocales, right.activeAppLocales);
27
+ return hasSameAppLocales(left.activeAppLocales, right.activeAppLocales);
32
28
  }
33
29
  /** Fails with one exact structured-scope policy mismatch. */
34
30
  function failClosure(input) {
@@ -36,7 +32,7 @@ function failClosure(input) {
36
32
  }
37
33
  /** Verifies one replacement snapshot against the new release policy. */
38
34
  function verifyManifestPolicy(manifest, policy) {
39
- if (!hasSameLocaleCodes(manifest.manifest.activeAppLocales, policy.activeAppLocales)) {
35
+ if (!hasSameAppLocales(manifest.manifest.activeAppLocales, policy.activeAppLocales)) {
40
36
  return failClosure({
41
37
  actual: Arr.join(manifest.manifest.activeAppLocales, ","),
42
38
  expected: Arr.join(policy.activeAppLocales, ","),