@nakafa/aksara-contracts 0.47.2 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graph/identity.js +2 -2
- package/dist/math/arc.js +3 -3
- package/dist/math/base.js +9 -9
- package/dist/math/bounds.d.ts +1 -1
- package/dist/math/bounds.js +13 -12
- package/dist/math/collision.js +21 -23
- package/dist/math/coordinate.js +3 -3
- package/dist/math/extent.js +10 -14
- package/dist/math/plane.js +5 -5
- package/dist/math/precision.js +3 -3
- package/dist/math/proximity.js +15 -12
- package/dist/math/resolution.js +6 -6
- package/dist/math/scene.js +8 -8
- package/dist/math/vector.js +6 -5
- package/dist/math/visual.js +2 -2
- package/dist/preview/target.js +5 -5
- package/dist/program/curriculum.js +3 -3
- package/dist/program/snapshot/digest.js +12 -12
- package/dist/program/spec.js +4 -4
- package/dist/projection/article.js +3 -3
- package/dist/projection/material.js +2 -2
- package/dist/projection/question.js +2 -2
- package/dist/question/answer.js +3 -3
- package/dist/question/identity.js +2 -2
- package/dist/question/item.js +10 -10
- package/dist/question/response.js +12 -12
- package/dist/question/rubric.js +9 -9
- package/dist/quran/attribution.d.ts +12 -4
- package/dist/quran/attribution.js +2 -1
- package/dist/quran/notes.js +24 -17
- package/dist/quran/provenance.js +14 -13
- package/dist/quran/snapshot/digest.js +18 -13
- package/dist/quran/snapshot/row/hash.js +6 -6
- package/dist/quran/snapshot/row.js +3 -3
- package/dist/quran/source.js +10 -10
- package/dist/release/current/evidence.js +2 -2
- package/dist/release/head.js +2 -2
- package/dist/release/policy.js +5 -5
- package/dist/release/rollback/spec.js +4 -5
- package/dist/release/route/page.js +2 -2
- package/dist/release/snapshot/scope.js +3 -3
- package/dist/release/snapshot/spec.js +5 -5
- package/dist/renderer/component.js +2 -2
- package/dist/renderer/contract.js +9 -10
- package/dist/renderer/manifest.js +3 -4
- package/dist/runtime/protected/spec.js +3 -3
- package/dist/runtime/verify.js +2 -2
- package/dist/signature/trusted.js +3 -3
- package/dist/transport/batch.js +3 -3
- package/dist/transport/group.js +2 -2
- package/dist/transport/snapshot.js +2 -2
- package/dist/tryout/closure/accounting.js +2 -2
- package/dist/tryout/hash/catalog.js +5 -5
- package/dist/tryout/identity.js +7 -6
- package/dist/tryout/language.d.ts +1 -1
- package/dist/tryout/language.js +1 -1
- package/dist/tryout/scoring.d.ts +3 -3
- package/dist/tryout/scoring.js +4 -4
- package/dist/tryout/snapshot/hash.js +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, MutableHashMap, MutableHashSet, Option, Schema } from "effect";
|
|
1
|
+
import { Array as Arr, Effect, MutableHashMap, MutableHashSet, Option, Schema, } from "effect";
|
|
2
2
|
import { encodeJsonText } from "#contracts/text/json";
|
|
3
3
|
/** A try-out snapshot is incomplete or inconsistent across app locales. */
|
|
4
4
|
export class TryoutClosureError extends Schema.TaggedError()("TryoutClosureError", {
|
|
@@ -18,7 +18,7 @@ export class TryoutClosureError extends Schema.TaggedError()("TryoutClosureError
|
|
|
18
18
|
}
|
|
19
19
|
/** Serializes locale sets through the active list's signed canonical order. */
|
|
20
20
|
function localeSetIdentity(locales, activeAppLocales) {
|
|
21
|
-
return encodeJsonText(
|
|
21
|
+
return encodeJsonText(Arr.filter(activeAppLocales, (locale) => MutableHashSet.has(locales, locale)));
|
|
22
22
|
}
|
|
23
23
|
/** Adds one active locale to a logical identity without duplicates. */
|
|
24
24
|
export function addLocale(localesByIdentity, activeAppLocales, identity, appLocale) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Array as Arr, Effect } from "effect";
|
|
2
2
|
import { canonicalizeLearningGraphIdentity } from "#contracts/graph/spec";
|
|
3
3
|
import { encodeJsonText } from "#contracts/text/json";
|
|
4
4
|
import { compareCodeUnits } from "#contracts/text/order";
|
|
@@ -18,25 +18,25 @@ export function compareTryoutCatalog(left, right) {
|
|
|
18
18
|
}
|
|
19
19
|
/** Builds one locale-neutral hierarchy identity for closure checks. */
|
|
20
20
|
export function tryoutCatalogLogicalIdentity(row) {
|
|
21
|
-
return [
|
|
21
|
+
return Arr.join([
|
|
22
22
|
row.kind,
|
|
23
23
|
row.countryKey,
|
|
24
24
|
"examKey" in row ? row.examKey : "",
|
|
25
25
|
"trackKey" in row ? row.trackKey : "",
|
|
26
26
|
"setKey" in row ? row.setKey : "",
|
|
27
27
|
"sectionKey" in row ? row.sectionKey : "",
|
|
28
|
-
]
|
|
28
|
+
], "\0");
|
|
29
29
|
}
|
|
30
30
|
/** Builds the locale-neutral catalog identity of one section reference. */
|
|
31
31
|
export function tryoutSectionLogicalIdentity(input) {
|
|
32
|
-
return [
|
|
32
|
+
return Arr.join([
|
|
33
33
|
"section",
|
|
34
34
|
input.countryKey,
|
|
35
35
|
input.examKey,
|
|
36
36
|
input.trackKey,
|
|
37
37
|
input.setKey,
|
|
38
38
|
input.sectionKey,
|
|
39
|
-
]
|
|
39
|
+
], "\0");
|
|
40
40
|
}
|
|
41
41
|
/** Serializes locale-neutral catalog facts for cross-locale closure checks. */
|
|
42
42
|
export function canonicalizeTryoutCatalogFacts(row) {
|
package/dist/tryout/identity.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Array as Arr } from "effect";
|
|
1
2
|
import { compareCodeUnits } from "#contracts/text/order";
|
|
2
3
|
/** Builds one deterministic current node identity before its row is loaded. */
|
|
3
4
|
export function tryoutCatalogNodeIdentity(input) {
|
|
4
|
-
return [
|
|
5
|
+
return Arr.join([
|
|
5
6
|
input.appLocale,
|
|
6
7
|
input.kind,
|
|
7
8
|
input.countryKey,
|
|
@@ -9,7 +10,7 @@ export function tryoutCatalogNodeIdentity(input) {
|
|
|
9
10
|
"trackKey" in input ? input.trackKey : "",
|
|
10
11
|
"setKey" in input ? input.setKey : "",
|
|
11
12
|
"sectionKey" in input ? input.sectionKey : "",
|
|
12
|
-
]
|
|
13
|
+
], "\0");
|
|
13
14
|
}
|
|
14
15
|
/** Builds one deterministic current hierarchy identity from its signed row. */
|
|
15
16
|
export function tryoutCatalogIdentity(row) {
|
|
@@ -17,7 +18,7 @@ export function tryoutCatalogIdentity(row) {
|
|
|
17
18
|
}
|
|
18
19
|
/** Builds the deterministic placement identity across application locales. */
|
|
19
20
|
export function tryoutPlacementIdentity(row) {
|
|
20
|
-
return [
|
|
21
|
+
return Arr.join(Arr.map([
|
|
21
22
|
row.countryKey,
|
|
22
23
|
row.examKey,
|
|
23
24
|
row.trackKey,
|
|
@@ -26,11 +27,11 @@ export function tryoutPlacementIdentity(row) {
|
|
|
26
27
|
row.questionOrder,
|
|
27
28
|
row.questionContentKey,
|
|
28
29
|
row.appLocale,
|
|
29
|
-
]
|
|
30
|
+
], String), "\0");
|
|
30
31
|
}
|
|
31
32
|
/** Builds one locale-neutral placement identity for closure checks. */
|
|
32
33
|
export function tryoutPlacementLogicalIdentity(row) {
|
|
33
|
-
return [
|
|
34
|
+
return Arr.join(Arr.map([
|
|
34
35
|
row.countryKey,
|
|
35
36
|
row.examKey,
|
|
36
37
|
row.trackKey,
|
|
@@ -38,7 +39,7 @@ export function tryoutPlacementLogicalIdentity(row) {
|
|
|
38
39
|
row.sectionKey,
|
|
39
40
|
row.questionOrder,
|
|
40
41
|
row.questionContentKey,
|
|
41
|
-
]
|
|
42
|
+
], String), "\0");
|
|
42
43
|
}
|
|
43
44
|
/** Compares placements in the order used by question-head binding. */
|
|
44
45
|
export function compareTryoutPlacements(left, right) {
|
|
@@ -13,7 +13,7 @@ export declare function deliveryLanguageForPolicy(policy: AssessmentLanguagePoli
|
|
|
13
13
|
/** Resolves the exact immutable question artifact locale for one app locale. */
|
|
14
14
|
export declare function questionArtifactLocaleForPolicy(policy: AssessmentLanguagePolicy, appLocale: AppLocale): ArtifactLocale;
|
|
15
15
|
/** Lists unique prompt and response locales required by one section policy. */
|
|
16
|
-
export declare function questionArtifactLocalesForPolicy(policy: AssessmentLanguagePolicy): readonly
|
|
16
|
+
export declare function questionArtifactLocalesForPolicy(policy: AssessmentLanguagePolicy): readonly ArtifactLocale[];
|
|
17
17
|
/** Returns policy facts in stable field order for signed canonicalizers. */
|
|
18
18
|
export declare function canonicalAssessmentLanguagePolicy(policy: AssessmentLanguagePolicy): {
|
|
19
19
|
kind: "fixed";
|
package/dist/tryout/language.js
CHANGED
|
@@ -20,7 +20,7 @@ export function questionArtifactLocaleForPolicy(policy, appLocale) {
|
|
|
20
20
|
}
|
|
21
21
|
/** Lists unique prompt and response locales required by one section policy. */
|
|
22
22
|
export function questionArtifactLocalesForPolicy(policy) {
|
|
23
|
-
return Object.freeze(Arr.dedupe(
|
|
23
|
+
return Object.freeze(Arr.dedupe(Arr.map(ACTIVE_APP_LOCALES, (appLocale) => questionArtifactLocaleForPolicy(policy, appLocale))));
|
|
24
24
|
}
|
|
25
25
|
/** Returns policy facts in stable field order for signed canonicalizers. */
|
|
26
26
|
export function canonicalAssessmentLanguagePolicy(policy) {
|
package/dist/tryout/scoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, MutableHashMap, Schema } from "effect";
|
|
1
|
+
import { Effect, MutableHashMap, MutableList, Schema } from "effect";
|
|
2
2
|
import type { TryoutCatalogRow, TryoutSection, TryoutSet } from "#contracts/tryout/catalog";
|
|
3
3
|
import type { TryoutPlacement } from "#contracts/tryout/placement";
|
|
4
4
|
import type { TryoutScoring } from "#contracts/tryout/spec";
|
|
@@ -17,7 +17,7 @@ export declare class TryoutScoringError extends TryoutScoringError_base {
|
|
|
17
17
|
/** Creates empty scoring facts for one snapshot verification pass. */
|
|
18
18
|
export declare function makeTryoutScoringFacts(): {
|
|
19
19
|
readonly exams: MutableHashMap.MutableHashMap<string, TryoutScoring>;
|
|
20
|
-
readonly sections: TryoutSection
|
|
20
|
+
readonly sections: MutableList.MutableList<TryoutSection>;
|
|
21
21
|
readonly sets: MutableHashMap.MutableHashMap<string, TryoutSet>;
|
|
22
22
|
};
|
|
23
23
|
/** Exam strategies, sets, and sections gathered while a catalog is read. */
|
|
@@ -30,7 +30,7 @@ export declare function recordTryoutScoringFacts(facts: TryoutScoringFacts, row:
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const validateTryoutScoringFacts: (facts: {
|
|
32
32
|
readonly exams: MutableHashMap.MutableHashMap<string, TryoutScoring>;
|
|
33
|
-
readonly sections: TryoutSection
|
|
33
|
+
readonly sections: MutableList.MutableList<TryoutSection>;
|
|
34
34
|
readonly sets: MutableHashMap.MutableHashMap<string, TryoutSet>;
|
|
35
35
|
}) => Effect.Effect<void, TryoutScoringError, never>;
|
|
36
36
|
/**
|
package/dist/tryout/scoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, MutableHashMap, Option, Schema } from "effect";
|
|
1
|
+
import { Effect, MutableHashMap, MutableList, Option, Schema } from "effect";
|
|
2
2
|
import { tryoutCatalogIdentity, tryoutCatalogNodeIdentity, tryoutPlacementIdentity, } from "#contracts/tryout/identity";
|
|
3
3
|
/**
|
|
4
4
|
* A signed try-out row cannot be scored as published. `strategy` means a set
|
|
@@ -15,7 +15,7 @@ export class TryoutScoringError extends Schema.TaggedError()("TryoutScoringError
|
|
|
15
15
|
export function makeTryoutScoringFacts() {
|
|
16
16
|
return {
|
|
17
17
|
exams: MutableHashMap.empty(),
|
|
18
|
-
sections:
|
|
18
|
+
sections: MutableList.make(),
|
|
19
19
|
sets: MutableHashMap.empty(),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
@@ -28,7 +28,7 @@ export function recordTryoutScoringFacts(facts, row) {
|
|
|
28
28
|
MutableHashMap.set(facts.sets, tryoutCatalogIdentity(row), row);
|
|
29
29
|
}
|
|
30
30
|
if (row.kind === "section") {
|
|
31
|
-
facts.sections
|
|
31
|
+
MutableList.append(facts.sections, row);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
@@ -81,7 +81,7 @@ function validateSectionMarks(facts, row) {
|
|
|
81
81
|
*/
|
|
82
82
|
export const validateTryoutScoringFacts = Effect.fn("AksaraContracts.validateTryoutScoringFacts")(function* (facts) {
|
|
83
83
|
yield* Effect.forEach(MutableHashMap.values(facts.sets), (row) => validateSetStrategy(facts, row), { discard: true });
|
|
84
|
-
yield* Effect.forEach(facts.sections, (row) => validateSectionMarks(facts, row), { discard: true });
|
|
84
|
+
yield* Effect.forEach(MutableList.toArray(facts.sections), (row) => validateSectionMarks(facts, row), { discard: true });
|
|
85
85
|
});
|
|
86
86
|
/**
|
|
87
87
|
* Requires one rubric placement to belong to a raw-scored set, because a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Record as Rec } from "effect";
|
|
1
|
+
import { Array as Arr, Record as Rec } from "effect";
|
|
2
2
|
import { hashTryoutCanonical } from "#contracts/tryout/canonical";
|
|
3
3
|
import { canonicalizeTryoutSnapshot, TRYOUT_SNAPSHOT_DOMAIN, TRYOUT_SNAPSHOT_ROWS_DOMAIN, } from "#contracts/tryout/snapshot/canonical";
|
|
4
4
|
import { TRYOUT_SNAPSHOT_FORMAT, TryoutSnapshotSchema, } from "#contracts/tryout/snapshot/spec";
|
|
@@ -13,7 +13,7 @@ export function makeTryoutSnapshot(input) {
|
|
|
13
13
|
/** Returns exact structured row evidence authenticated by a snapshot. */
|
|
14
14
|
export function tryoutSnapshotRowEvidence(input) {
|
|
15
15
|
return {
|
|
16
|
-
rowCount: Rec.values(input.counts)
|
|
16
|
+
rowCount: Arr.reduce(Rec.values(input.counts), 0, (total, count) => total + count) +
|
|
17
17
|
input.placementCount,
|
|
18
18
|
rowDigest: hashTryoutCanonical(TRYOUT_SNAPSHOT_ROWS_DOMAIN, `${input.catalogDigest}\n${input.placementDigest}`),
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nakafa/aksara-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
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.
|
|
24
|
+
"effect": "4.0.2"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
"./content": {
|