@nakafa/aksara-contracts 0.42.0 → 0.44.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.
Files changed (77) hide show
  1. package/README.md +20 -1
  2. package/dist/math/resolution.js +1 -1
  3. package/dist/math/scene.js +1 -1
  4. package/dist/preview/artifact.d.ts +44 -0
  5. package/dist/preview/document.d.ts +36 -12
  6. package/dist/preview/spec.d.ts +196 -36
  7. package/dist/preview/target.d.ts +10 -3
  8. package/dist/program/snapshot/digest.d.ts +1 -1
  9. package/dist/program/snapshot/digest.js +1 -1
  10. package/dist/program/snapshot/hash.d.ts +153 -0
  11. package/dist/program/snapshot/hash.js +31 -0
  12. package/dist/projection/digest.d.ts +74 -22
  13. package/dist/projection/material.d.ts +10 -0
  14. package/dist/projection/material.js +15 -0
  15. package/dist/projection/question.d.ts +188 -0
  16. package/dist/projection/spec.d.ts +45 -0
  17. package/dist/projection/verify.d.ts +127 -75
  18. package/dist/question/answer.d.ts +141 -0
  19. package/dist/question/answer.js +238 -0
  20. package/dist/question/item.d.ts +276 -1
  21. package/dist/question/item.js +63 -38
  22. package/dist/question/label.d.ts +3 -0
  23. package/dist/question/label.js +3 -0
  24. package/dist/question/points.d.ts +18 -0
  25. package/dist/question/points.js +22 -0
  26. package/dist/question/response.d.ts +187 -5
  27. package/dist/question/response.js +41 -4
  28. package/dist/question/rubric.d.ts +234 -0
  29. package/dist/question/rubric.js +182 -0
  30. package/dist/release/rollback/spec.d.ts +264 -0
  31. package/dist/release/snapshot/data.d.ts +52 -3
  32. package/dist/release/snapshot/{program-evidence.d.ts → evidence/program.d.ts} +2 -2
  33. package/dist/release/snapshot/{program-evidence.js → evidence/program.js} +1 -1
  34. package/dist/release/snapshot/{quran-evidence.d.ts → evidence/quran.d.ts} +2 -2
  35. package/dist/release/snapshot/{quran-evidence.js → evidence/quran.js} +1 -1
  36. package/dist/release/snapshot/{tryout-evidence.d.ts → evidence/tryout.d.ts} +2 -2
  37. package/dist/release/snapshot/{tryout-evidence.js → evidence/tryout.js} +4 -4
  38. package/dist/release/snapshot/evidence.d.ts +2 -2
  39. package/dist/release/snapshot/evidence.js +3 -3
  40. package/dist/release/snapshot/verify.d.ts +88 -31
  41. package/dist/runtime/spec.d.ts +25 -22
  42. package/dist/runtime/verify.d.ts +46 -44
  43. package/dist/transport/batch.d.ts +88 -0
  44. package/dist/transport/group.d.ts +288 -9
  45. package/dist/transport/request.d.ts +1858 -1018
  46. package/dist/transport/response.d.ts +499 -131
  47. package/dist/transport/snapshot.d.ts +104 -6
  48. package/dist/tryout/catalog.d.ts +28 -10
  49. package/dist/tryout/catalog.js +6 -2
  50. package/dist/tryout/closure/accounting.d.ts +16 -0
  51. package/dist/tryout/closure/accounting.js +68 -0
  52. package/dist/tryout/closure/locale.d.ts +14 -0
  53. package/dist/tryout/{locale-closure.js → closure/locale.js} +13 -72
  54. package/dist/tryout/{placement-closure.js → closure/placement.js} +1 -0
  55. package/dist/tryout/{catalog-hash.d.ts → hash/catalog.d.ts} +25 -20
  56. package/dist/tryout/{catalog-hash.js → hash/catalog.js} +8 -1
  57. package/dist/tryout/{content-hash.d.ts → hash/content.d.ts} +43 -0
  58. package/dist/tryout/{placement-hash.d.ts → hash/placement.d.ts} +1 -1
  59. package/dist/tryout/{placement-hash.js → hash/placement.js} +2 -1
  60. package/dist/tryout/placement.d.ts +136 -1
  61. package/dist/tryout/placement.js +16 -2
  62. package/dist/tryout/scoring.d.ts +37 -0
  63. package/dist/tryout/scoring.js +89 -0
  64. package/dist/tryout/spec.d.ts +32 -4
  65. package/dist/tryout/spec.js +35 -4
  66. package/package.json +29 -21
  67. package/dist/program/snapshot/row-hash.d.ts +0 -155
  68. package/dist/program/snapshot/row-hash.js +0 -34
  69. package/dist/tryout/locale-closure.d.ts +0 -20
  70. /package/dist/math/{arc-precision.d.ts → arc.d.ts} +0 -0
  71. /package/dist/math/{arc-precision.js → arc.js} +0 -0
  72. /package/dist/release/snapshot/{evidence-requirement.d.ts → evidence/requirement.d.ts} +0 -0
  73. /package/dist/release/snapshot/{evidence-requirement.js → evidence/requirement.js} +0 -0
  74. /package/dist/tryout/{placement-closure.d.ts → closure/placement.d.ts} +0 -0
  75. /package/dist/tryout/{row-hash.d.ts → digest.d.ts} +0 -0
  76. /package/dist/tryout/{row-hash.js → digest.js} +0 -0
  77. /package/dist/tryout/{content-hash.js → hash/content.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakafa/aksara-contracts",
3
- "version": "0.42.0",
3
+ "version": "0.44.0",
4
4
  "description": "Schemas and verification contracts for Nakafa content releases.",
5
5
  "homepage": "https://github.com/nakafaai/aksara#readme",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -21,7 +21,7 @@
21
21
  "directory": "packages/contracts"
22
22
  },
23
23
  "peerDependencies": {
24
- "effect": "4.0.0-rc.117"
24
+ "effect": "4.0.0-rc.118"
25
25
  },
26
26
  "exports": {
27
27
  "./content": {
@@ -132,6 +132,10 @@
132
132
  "types": "./dist/projection/verify.d.ts",
133
133
  "node": "./dist/projection/verify.js"
134
134
  },
135
+ "./question/answer": {
136
+ "types": "./dist/question/answer.d.ts",
137
+ "import": "./dist/question/answer.js"
138
+ },
135
139
  "./question/identity": {
136
140
  "types": "./dist/question/identity.d.ts",
137
141
  "import": "./dist/question/identity.js"
@@ -140,10 +144,18 @@
140
144
  "types": "./dist/question/item.d.ts",
141
145
  "import": "./dist/question/item.js"
142
146
  },
147
+ "./question/points": {
148
+ "types": "./dist/question/points.d.ts",
149
+ "import": "./dist/question/points.js"
150
+ },
143
151
  "./question/response": {
144
152
  "types": "./dist/question/response.d.ts",
145
153
  "import": "./dist/question/response.js"
146
154
  },
155
+ "./question/rubric": {
156
+ "types": "./dist/question/rubric.d.ts",
157
+ "import": "./dist/question/rubric.js"
158
+ },
147
159
  "./quran/snapshot/row": {
148
160
  "types": "./dist/quran/snapshot/row.d.ts",
149
161
  "import": "./dist/quran/snapshot/row.js"
@@ -220,10 +232,6 @@
220
232
  "types": "./dist/program/snapshot/row.d.ts",
221
233
  "import": "./dist/program/snapshot/row.js"
222
234
  },
223
- "./program/snapshot/row-hash": {
224
- "types": "./dist/program/snapshot/row-hash.d.ts",
225
- "node": "./dist/program/snapshot/row-hash.js"
226
- },
227
235
  "./program/snapshot/digest": {
228
236
  "types": "./dist/program/snapshot/digest.d.ts",
229
237
  "node": "./dist/program/snapshot/digest.js"
@@ -428,17 +436,17 @@
428
436
  "types": "./dist/text/syntax.d.ts",
429
437
  "import": "./dist/text/syntax.js"
430
438
  },
431
- "./tryout/content-hash": {
432
- "types": "./dist/tryout/content-hash.d.ts",
433
- "node": "./dist/tryout/content-hash.js"
439
+ "./tryout/hash/content": {
440
+ "types": "./dist/tryout/hash/content.d.ts",
441
+ "node": "./dist/tryout/hash/content.js"
434
442
  },
435
443
  "./tryout/catalog": {
436
444
  "types": "./dist/tryout/catalog.d.ts",
437
445
  "import": "./dist/tryout/catalog.js"
438
446
  },
439
- "./tryout/catalog-hash": {
440
- "types": "./dist/tryout/catalog-hash.d.ts",
441
- "node": "./dist/tryout/catalog-hash.js"
447
+ "./tryout/hash/catalog": {
448
+ "types": "./dist/tryout/hash/catalog.d.ts",
449
+ "node": "./dist/tryout/hash/catalog.js"
442
450
  },
443
451
  "./tryout/identity": {
444
452
  "types": "./dist/tryout/identity.d.ts",
@@ -452,21 +460,21 @@
452
460
  "types": "./dist/tryout/language.d.ts",
453
461
  "import": "./dist/tryout/language.js"
454
462
  },
455
- "./tryout/locale-closure": {
456
- "types": "./dist/tryout/locale-closure.d.ts",
457
- "node": "./dist/tryout/locale-closure.js"
463
+ "./tryout/closure/locale": {
464
+ "types": "./dist/tryout/closure/locale.d.ts",
465
+ "node": "./dist/tryout/closure/locale.js"
458
466
  },
459
467
  "./tryout/placement": {
460
468
  "types": "./dist/tryout/placement.d.ts",
461
469
  "import": "./dist/tryout/placement.js"
462
470
  },
463
- "./tryout/placement-hash": {
464
- "types": "./dist/tryout/placement-hash.d.ts",
465
- "node": "./dist/tryout/placement-hash.js"
471
+ "./tryout/hash/placement": {
472
+ "types": "./dist/tryout/hash/placement.d.ts",
473
+ "node": "./dist/tryout/hash/placement.js"
466
474
  },
467
- "./tryout/row-hash": {
468
- "types": "./dist/tryout/row-hash.d.ts",
469
- "node": "./dist/tryout/row-hash.js"
475
+ "./tryout/digest": {
476
+ "types": "./dist/tryout/digest.d.ts",
477
+ "node": "./dist/tryout/digest.js"
470
478
  },
471
479
  "./tryout/snapshot/hash": {
472
480
  "types": "./dist/tryout/snapshot/hash.d.ts",
@@ -1,155 +0,0 @@
1
- import { Effect, Schema } from "effect";
2
- import { type ProgramSnapshotRow } from "#contracts/program/snapshot/row";
3
- declare const ProgramRowHashError_base: Schema.Class<ProgramRowHashError, Schema.TaggedStruct<"ProgramRowHashError", {
4
- readonly scope: Schema.Literals<readonly ["digest", "row"]>;
5
- }>, import("effect/Cause").YieldableError>;
6
- /** Node could not compute one deterministic program row identity. */
7
- export declare class ProgramRowHashError extends ProgramRowHashError_base {
8
- }
9
- /** Creates one authenticated current program record. */
10
- export declare const makeProgramSnapshotRow: (row: {
11
- readonly defaultCoverageStatus: "archived" | "available" | "hidden" | "partial" | "planned";
12
- readonly displayOrder: number;
13
- readonly iconKey: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state";
14
- readonly key: string & import("effect/Brand").Brand<"@NakafaAI/AksaraLearningProgramKey">;
15
- readonly kind: "admission-exam" | "assessment" | "custom-program" | "institution-program" | "school-curriculum";
16
- readonly navigation: {
17
- readonly levels: readonly ["class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit", ...("class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit")[]];
18
- readonly model: "course-unit-lesson" | "curriculum-tree" | "exam-domain-set" | "track-topic";
19
- };
20
- readonly provider: {
21
- readonly homeCountry?: string | undefined;
22
- readonly kind: "institution" | "learner" | "nakafa" | "official";
23
- readonly name: string;
24
- };
25
- readonly recommendedCountry?: string | undefined;
26
- readonly sources: readonly [{
27
- readonly label: string;
28
- readonly retrievedAt: string;
29
- readonly reviewAfter?: string | undefined;
30
- readonly type: "institution-document" | "nakafa-editorial" | "official-blueprint" | "official-policy" | "official-portal";
31
- readonly url: string;
32
- }, ...{
33
- readonly label: string;
34
- readonly retrievedAt: string;
35
- readonly reviewAfter?: string | undefined;
36
- readonly type: "institution-document" | "nakafa-editorial" | "official-blueprint" | "official-policy" | "official-portal";
37
- readonly url: string;
38
- }[]];
39
- readonly translations: readonly [{
40
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
41
- readonly publicSlug: string;
42
- readonly title: string;
43
- }, ...{
44
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
45
- readonly publicSlug: string;
46
- readonly title: string;
47
- }[]];
48
- readonly version: {
49
- readonly endsAt?: string | undefined;
50
- readonly label: string;
51
- readonly startsAt?: string | undefined;
52
- };
53
- }) => Effect.Effect<{
54
- readonly kind: "program";
55
- readonly row: {
56
- readonly defaultCoverageStatus: "archived" | "available" | "hidden" | "partial" | "planned";
57
- readonly displayOrder: number;
58
- readonly iconKey: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state";
59
- readonly key: string & import("effect/Brand").Brand<"@NakafaAI/AksaraLearningProgramKey">;
60
- readonly kind: "admission-exam" | "assessment" | "custom-program" | "institution-program" | "school-curriculum";
61
- readonly navigation: {
62
- readonly levels: readonly ["class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit", ...("class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit")[]];
63
- readonly model: "course-unit-lesson" | "curriculum-tree" | "exam-domain-set" | "track-topic";
64
- };
65
- readonly provider: {
66
- readonly homeCountry?: string | undefined;
67
- readonly kind: "institution" | "learner" | "nakafa" | "official";
68
- readonly name: string;
69
- };
70
- readonly recommendedCountry?: string | undefined;
71
- readonly sources: readonly [{
72
- readonly label: string;
73
- readonly retrievedAt: string;
74
- readonly reviewAfter?: string | undefined;
75
- readonly type: "institution-document" | "nakafa-editorial" | "official-blueprint" | "official-policy" | "official-portal";
76
- readonly url: string;
77
- }, ...{
78
- readonly label: string;
79
- readonly retrievedAt: string;
80
- readonly reviewAfter?: string | undefined;
81
- readonly type: "institution-document" | "nakafa-editorial" | "official-blueprint" | "official-policy" | "official-portal";
82
- readonly url: string;
83
- }[]];
84
- readonly translations: readonly [{
85
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
86
- readonly publicSlug: string;
87
- readonly title: string;
88
- }, ...{
89
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
90
- readonly publicSlug: string;
91
- readonly title: string;
92
- }[]];
93
- readonly version: {
94
- readonly endsAt?: string | undefined;
95
- readonly label: string;
96
- readonly startsAt?: string | undefined;
97
- };
98
- };
99
- readonly rowHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
100
- }, ProgramRowHashError, never>;
101
- /** Creates one authenticated current curriculum record. */
102
- export declare const makeCurriculumSnapshotRow: (row: {
103
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
104
- readonly canonicalPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
105
- readonly displayGroupIconKey?: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state" | undefined;
106
- readonly displayGroupTitle?: string | undefined;
107
- readonly iconKey: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state";
108
- readonly kind: "curriculum-context";
109
- readonly level: "class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit";
110
- readonly materialCardDescription?: string | undefined;
111
- readonly materialCardTitle?: string | undefined;
112
- readonly materialContextNodeKey?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraCurriculumNodeKey">) | undefined;
113
- readonly materialContextParentPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
114
- readonly materialContextPublicPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
115
- readonly materialDomain?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialDomain">) | undefined;
116
- readonly materialKey?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">) | undefined;
117
- readonly nodeKey: string;
118
- readonly order: number;
119
- readonly parentPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
120
- readonly programKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraLearningProgramKey">;
121
- readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
122
- readonly sitemap: boolean;
123
- readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
124
- readonly title: string;
125
- }) => Effect.Effect<{
126
- readonly kind: "curriculum";
127
- readonly row: {
128
- readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
129
- readonly canonicalPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
130
- readonly displayGroupIconKey?: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state" | undefined;
131
- readonly displayGroupTitle?: string | undefined;
132
- readonly iconKey: "advanced" | "assessment" | "certificate" | "course" | "diploma" | "early-years" | "global-education" | "grade-1" | "grade-10" | "grade-11" | "grade-12" | "grade-2" | "grade-3" | "grade-4" | "grade-5" | "grade-6" | "grade-7" | "grade-8" | "grade-9" | "high-school" | "mathematics" | "middle-school" | "primary-school" | "school" | "science" | "standards" | "state";
133
- readonly kind: "curriculum-context";
134
- readonly level: "class" | "course" | "domain" | "lesson" | "phase" | "section" | "set" | "stage" | "subject" | "topic" | "track" | "unit";
135
- readonly materialCardDescription?: string | undefined;
136
- readonly materialCardTitle?: string | undefined;
137
- readonly materialContextNodeKey?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraCurriculumNodeKey">) | undefined;
138
- readonly materialContextParentPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
139
- readonly materialContextPublicPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
140
- readonly materialDomain?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialDomain">) | undefined;
141
- readonly materialKey?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraMaterialKey">) | undefined;
142
- readonly nodeKey: string;
143
- readonly order: number;
144
- readonly parentPath?: (string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">) | undefined;
145
- readonly programKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraLearningProgramKey">;
146
- readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
147
- readonly sitemap: boolean;
148
- readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
149
- readonly title: string;
150
- };
151
- readonly rowHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
152
- }, ProgramRowHashError, never>;
153
- /** Recomputes one current row identity for streamed integrity checks. */
154
- export declare function verifyProgramSnapshotRowHash(record: ProgramSnapshotRow): Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, ProgramRowHashError, never>;
155
- export {};
@@ -1,34 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { Effect, Schema } from "effect";
3
- import { Sha256HashSchema } from "#contracts/ids";
4
- import { CurriculumRouteRecordSchema, canonicalizeProgramSnapshotRow, LearningProgramRecordSchema, } from "#contracts/program/snapshot/row";
5
- const ROW_DOMAIN = "nakafa.aksara.program-row";
6
- /** Node could not compute one deterministic program row identity. */
7
- export class ProgramRowHashError extends Schema.TaggedError()("ProgramRowHashError", { scope: Schema.Literals(["digest", "row"]) }) {
8
- }
9
- /** Hashes one current program or curriculum row. */
10
- function hashProgramRow(record) {
11
- return Effect.try({
12
- catch: () => new ProgramRowHashError({ scope: "row" }),
13
- try: () => Sha256HashSchema.make(`sha256:${createHash("sha256")
14
- .update(`${ROW_DOMAIN}\n${canonicalizeProgramSnapshotRow(record)}`)
15
- .digest("hex")}`),
16
- });
17
- }
18
- /** Creates one authenticated current program record. */
19
- export const makeProgramSnapshotRow = Effect.fn("AksaraContracts.makeProgramSnapshotRow")(function* (row) {
20
- const input = { kind: "program", row };
21
- const rowHash = yield* hashProgramRow(input);
22
- return LearningProgramRecordSchema.make({ ...input, rowHash });
23
- });
24
- /** Creates one authenticated current curriculum record. */
25
- export const makeCurriculumSnapshotRow = Effect.fn("AksaraContracts.makeCurriculumSnapshotRow")(function* (row) {
26
- const input = { kind: "curriculum", row };
27
- const rowHash = yield* hashProgramRow(input);
28
- return CurriculumRouteRecordSchema.make({ ...input, rowHash });
29
- });
30
- /** Recomputes one current row identity for streamed integrity checks. */
31
- export function verifyProgramSnapshotRowHash(record) {
32
- const { rowHash: _rowHash, ...input } = record;
33
- return hashProgramRow(input);
34
- }
@@ -1,20 +0,0 @@
1
- import { Effect, Schema, Stream } from "effect";
2
- import type { ActiveAppLocaleList } from "#contracts/locale";
3
- import type { TryoutCatalogRecord } from "#contracts/tryout/catalog";
4
- import type { TryoutPlacementRecord } from "#contracts/tryout/placement";
5
- declare const TryoutClosureError_base: Schema.Class<TryoutClosureError, Schema.TaggedStruct<"TryoutClosureError", {
6
- readonly actual: Schema.String;
7
- readonly code: Schema.Literals<readonly ["assessed-language", "duplicate-locale", "fact-mismatch", "inactive-locale", "missing-locale", "missing-section", "question-count"]>;
8
- readonly expected: Schema.String;
9
- readonly identity: Schema.String;
10
- }>, import("effect/Cause").YieldableError>;
11
- /** A try-out snapshot is incomplete or inconsistent across app locales. */
12
- export declare class TryoutClosureError extends TryoutClosureError_base {
13
- }
14
- /** Verifies catalog facts, language policy, and inventory across app locales. */
15
- export declare const verifyTryoutLocaleClosure: <CatalogError, CatalogContext, PlacementError, PlacementContext>(input: {
16
- readonly activeAppLocales: ActiveAppLocaleList;
17
- readonly catalog: Stream.Stream<TryoutCatalogRecord, CatalogError, CatalogContext>;
18
- readonly placements: Stream.Stream<TryoutPlacementRecord, PlacementError, PlacementContext>;
19
- }) => Effect.Effect<void, CatalogError | PlacementError | TryoutClosureError, CatalogContext | PlacementContext>;
20
- export {};
File without changes
File without changes
File without changes
File without changes