@sharpee/core 4.3.0 → 4.6.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/events/system-event.d.ts +2 -0
- package/events/system-event.d.ts.map +1 -1
- package/events/system-event.js +2 -0
- package/events/system-event.js.map +1 -1
- package/metadata/story-metadata.d.ts +11 -2
- package/metadata/story-metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/random/choice-point.d.ts +52 -0
- package/random/choice-point.d.ts.map +1 -0
- package/random/choice-point.js +79 -0
- package/random/choice-point.js.map +1 -0
- package/random/force.d.ts +76 -0
- package/random/force.d.ts.map +1 -0
- package/random/force.js +69 -0
- package/random/force.js.map +1 -0
- package/random/index.d.ts +5 -0
- package/random/index.d.ts.map +1 -1
- package/random/index.js +14 -1
- package/random/index.js.map +1 -1
- package/random/random-service.d.ts +53 -0
- package/random/random-service.d.ts.map +1 -0
- package/random/random-service.js +12 -0
- package/random/random-service.js.map +1 -0
- package/random/seed-derivation.d.ts +36 -0
- package/random/seed-derivation.d.ts.map +1 -0
- package/random/seed-derivation.js +54 -0
- package/random/seed-derivation.js.map +1 -0
- package/random/trace.d.ts +41 -0
- package/random/trace.d.ts.map +1 -0
- package/random/trace.js +13 -0
- package/random/trace.js.map +1 -0
- package/types/save-data.d.ts +13 -0
- package/types/save-data.d.ts.map +1 -1
package/events/system-event.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export declare const Subsystems: {
|
|
|
46
46
|
readonly TEXT_SERVICE: "text-service";
|
|
47
47
|
readonly EVENT_PROCESSOR: "event-processor";
|
|
48
48
|
readonly RULE_ENGINE: "rule-engine";
|
|
49
|
+
/** The randomness subsystem — per-draw trace records (ADR-293 D16, Phase C). */
|
|
50
|
+
readonly RANDOM: "random";
|
|
49
51
|
};
|
|
50
52
|
export type SubsystemType = typeof Subsystems[keyof typeof Subsystems];
|
|
51
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-event.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/events/system-event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAElD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;
|
|
1
|
+
{"version":3,"file":"system-event.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/events/system-event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAElD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;IAQrB,gFAAgF;;CAExE,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEvE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA,YAAY,CASd;AAWD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,YAAY,CAU/D"}
|
package/events/system-event.js
CHANGED
|
@@ -18,6 +18,8 @@ exports.Subsystems = {
|
|
|
18
18
|
TEXT_SERVICE: 'text-service',
|
|
19
19
|
EVENT_PROCESSOR: 'event-processor',
|
|
20
20
|
RULE_ENGINE: 'rule-engine',
|
|
21
|
+
/** The randomness subsystem — per-draw trace records (ADR-293 D16, Phase C). */
|
|
22
|
+
RANDOM: 'random',
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Helper to create a system event with common fields
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-event.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/events/system-event.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"system-event.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/events/system-event.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA8DH,8CAiBC;AAcD,sCAUC;AA7DD;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,gFAAgF;IAChF,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,SAAiB,EACjB,IAAY,EACZ,IAAa,EACb,OAGC;IAED,OAAO;QACL,EAAE,EAAE,eAAe,EAAE;QACrB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,SAAS;QACT,IAAI;QACJ,IAAI;QACJ,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,SAAS,eAAe;IACtB,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,GAAY;IACxC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,IAAI,IAAI,GAAG;QACX,WAAW,IAAI,GAAG;QAClB,WAAW,IAAI,GAAG;QAClB,MAAM,IAAI,GAAG;QACb,MAAM,IAAI,GAAG,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -7,7 +7,12 @@ export interface StoryMetadata {
|
|
|
7
7
|
ifid: string;
|
|
8
8
|
/** Story title */
|
|
9
9
|
title: string;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Author name(s), joined into one string. Intentionally singular
|
|
12
|
+
* (diverges from `StoryConfig.authors: string[]`, ADR-298): this type
|
|
13
|
+
* mirrors the Treaty of Babel iFiction record, whose `<author>` is a
|
|
14
|
+
* single string by external spec — the join happens at record generation.
|
|
15
|
+
*/
|
|
11
16
|
author: string;
|
|
12
17
|
/** Year of first publication (e.g., "2025") */
|
|
13
18
|
firstPublished?: string;
|
|
@@ -34,7 +39,11 @@ export interface SharpeeConfig {
|
|
|
34
39
|
ifid: string;
|
|
35
40
|
/** Story title */
|
|
36
41
|
title: string;
|
|
37
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Author name(s), joined into one string. Intentionally singular — an
|
|
44
|
+
* external-spec adapter like `StoryMetadata.author` (Treaty of Babel),
|
|
45
|
+
* not the in-repo plural `StoryConfig.authors` (ADR-298).
|
|
46
|
+
*/
|
|
38
47
|
author: string;
|
|
39
48
|
/** Year of first publication */
|
|
40
49
|
firstPublished?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story-metadata.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/metadata/story-metadata.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd
|
|
1
|
+
{"version":3,"file":"story-metadata.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/metadata/story-metadata.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choice points — declared draw sites and the process-global catalog (ADR-293 D2, D4).
|
|
3
|
+
*
|
|
4
|
+
* Public interface: `ChoicePoint<C>`, `definePoint(name, opts?)`, `getRegisteredPoints()`,
|
|
5
|
+
* `getPoint(name)`.
|
|
6
|
+
* Owner context: @sharpee/core random substrate. Core holds static metadata only —
|
|
7
|
+
* no state that draws lives here (D5); stream state is per-engine, per-session.
|
|
8
|
+
*
|
|
9
|
+
* The catalog is process-global BY DESIGN (D2, amended A1): entries are immutable,
|
|
10
|
+
* idempotent metadata holding no stream, which is what makes import-time registration
|
|
11
|
+
* safe where D6 kills module-scope *streams*. In a multi-story process (zifmia) the
|
|
12
|
+
* catalog holds the union; consumers filter by story id / package prefix, which works
|
|
13
|
+
* because entries retain their D2 name prefix.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A declared draw site. With `classes` it is a choice point (traced, counted in
|
|
17
|
+
* coverage, forceable); without, it is a plain draw (seeded and traced only) — D4.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChoicePoint<C extends string = string> {
|
|
20
|
+
/** Dotted, first segment is the story/package id, no abbreviations (D2): 'dungeo.melee.blow.hero' */
|
|
21
|
+
readonly name: string;
|
|
22
|
+
/** Outcome classes; absent ⇒ plain draw (D4) */
|
|
23
|
+
readonly classes?: readonly C[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Declare a choice point (or, with no classes, a plain draw) and register it in the
|
|
27
|
+
* process-global catalog. The draw API accepts only the returned handle (D2).
|
|
28
|
+
*
|
|
29
|
+
* Idempotent: redeclaring the same name with identical classes returns the original
|
|
30
|
+
* handle. Immutable: redeclaring with different classes throws — the catalog never
|
|
31
|
+
* mutates an entry.
|
|
32
|
+
*
|
|
33
|
+
* @param name - dotted point name; first segment is the story or package id (D2)
|
|
34
|
+
* @param opts - `classes`: the point's outcome classes; omit for a plain draw (D4)
|
|
35
|
+
* @returns the frozen, catalog-registered handle
|
|
36
|
+
* @throws Error if `name` is empty, or already registered with different classes
|
|
37
|
+
*/
|
|
38
|
+
export declare function definePoint<C extends string>(name: string, opts?: {
|
|
39
|
+
classes: readonly C[];
|
|
40
|
+
}): ChoicePoint<C>;
|
|
41
|
+
/**
|
|
42
|
+
* Snapshot of every registered point, for engine's story-start snapshot and
|
|
43
|
+
* `catalog − fired` coverage. Returns a fresh array; the entries themselves are frozen.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getRegisteredPoints(): readonly ChoicePoint[];
|
|
46
|
+
/**
|
|
47
|
+
* Look up a registered point by name.
|
|
48
|
+
*
|
|
49
|
+
* @returns the handle, or undefined if no point with that name is declared
|
|
50
|
+
*/
|
|
51
|
+
export declare function getPoint(name: string): ChoicePoint | undefined;
|
|
52
|
+
//# sourceMappingURL=choice-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice-point.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/choice-point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACpD,qGAAqG;IACrG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;CACjC;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;CAAE,GAC/B,WAAW,CAAC,CAAC,CAAC,CAoBhB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,WAAW,EAAE,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE9D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Choice points — declared draw sites and the process-global catalog (ADR-293 D2, D4).
|
|
4
|
+
*
|
|
5
|
+
* Public interface: `ChoicePoint<C>`, `definePoint(name, opts?)`, `getRegisteredPoints()`,
|
|
6
|
+
* `getPoint(name)`.
|
|
7
|
+
* Owner context: @sharpee/core random substrate. Core holds static metadata only —
|
|
8
|
+
* no state that draws lives here (D5); stream state is per-engine, per-session.
|
|
9
|
+
*
|
|
10
|
+
* The catalog is process-global BY DESIGN (D2, amended A1): entries are immutable,
|
|
11
|
+
* idempotent metadata holding no stream, which is what makes import-time registration
|
|
12
|
+
* safe where D6 kills module-scope *streams*. In a multi-story process (zifmia) the
|
|
13
|
+
* catalog holds the union; consumers filter by story id / package prefix, which works
|
|
14
|
+
* because entries retain their D2 name prefix.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.definePoint = definePoint;
|
|
18
|
+
exports.getRegisteredPoints = getRegisteredPoints;
|
|
19
|
+
exports.getPoint = getPoint;
|
|
20
|
+
// Anchored on globalThis so the catalog stays one-per-process even if this module
|
|
21
|
+
// is loaded more than once (CJS + ESM builds of core in the same process).
|
|
22
|
+
const CATALOG_KEY = Symbol.for('sharpee.core.random.catalog');
|
|
23
|
+
function catalog() {
|
|
24
|
+
const host = globalThis;
|
|
25
|
+
return (host[CATALOG_KEY] ??= new Map());
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Declare a choice point (or, with no classes, a plain draw) and register it in the
|
|
29
|
+
* process-global catalog. The draw API accepts only the returned handle (D2).
|
|
30
|
+
*
|
|
31
|
+
* Idempotent: redeclaring the same name with identical classes returns the original
|
|
32
|
+
* handle. Immutable: redeclaring with different classes throws — the catalog never
|
|
33
|
+
* mutates an entry.
|
|
34
|
+
*
|
|
35
|
+
* @param name - dotted point name; first segment is the story or package id (D2)
|
|
36
|
+
* @param opts - `classes`: the point's outcome classes; omit for a plain draw (D4)
|
|
37
|
+
* @returns the frozen, catalog-registered handle
|
|
38
|
+
* @throws Error if `name` is empty, or already registered with different classes
|
|
39
|
+
*/
|
|
40
|
+
function definePoint(name, opts) {
|
|
41
|
+
if (name.length === 0) {
|
|
42
|
+
throw new Error('definePoint: name must be non-empty');
|
|
43
|
+
}
|
|
44
|
+
const existing = catalog().get(name);
|
|
45
|
+
if (existing) {
|
|
46
|
+
if (sameClasses(existing.classes, opts?.classes)) {
|
|
47
|
+
return existing;
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`definePoint: '${name}' is already registered with classes ` +
|
|
50
|
+
`[${(existing.classes ?? []).join(', ')}]; the catalog is immutable (ADR-293 D2)`);
|
|
51
|
+
}
|
|
52
|
+
const point = Object.freeze({
|
|
53
|
+
name,
|
|
54
|
+
...(opts ? { classes: Object.freeze([...opts.classes]) } : {}),
|
|
55
|
+
});
|
|
56
|
+
catalog().set(name, point);
|
|
57
|
+
return point;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Snapshot of every registered point, for engine's story-start snapshot and
|
|
61
|
+
* `catalog − fired` coverage. Returns a fresh array; the entries themselves are frozen.
|
|
62
|
+
*/
|
|
63
|
+
function getRegisteredPoints() {
|
|
64
|
+
return [...catalog().values()];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Look up a registered point by name.
|
|
68
|
+
*
|
|
69
|
+
* @returns the handle, or undefined if no point with that name is declared
|
|
70
|
+
*/
|
|
71
|
+
function getPoint(name) {
|
|
72
|
+
return catalog().get(name);
|
|
73
|
+
}
|
|
74
|
+
function sameClasses(a, b) {
|
|
75
|
+
if (a === undefined || b === undefined)
|
|
76
|
+
return a === b;
|
|
77
|
+
return a.length === b.length && a.every((cls, i) => cls === b[i]);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=choice-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice-point.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/choice-point.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAqCH,kCAuBC;AAMD,kDAEC;AAOD,4BAEC;AAhED,kFAAkF;AAClF,2EAA2E;AAC3E,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAI9D,SAAS,OAAO;IACd,MAAM,IAAI,GAAG,UAAyC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,WAAW,CACzB,IAAY,EACZ,IAAgC;IAEhC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,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G,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Force types — outcome forcing over declared classes (ADR-293 D8, D9).
|
|
3
|
+
*
|
|
4
|
+
* Public interface: `RandomForceMode`, `RandomForceSpec`, `RandomForceStatus`,
|
|
5
|
+
* `forceKey`, and the typed load errors (`RandomForceLoadError` base;
|
|
6
|
+
* `DuplicateForceKeyError`, `UnknownForcePointError`,
|
|
7
|
+
* `UndeclaredForceClassError`).
|
|
8
|
+
* Owner context: @sharpee/core random substrate. Core owns the types (D5);
|
|
9
|
+
* engine's `RandomService` implementation owns the force table itself. Forces
|
|
10
|
+
* are session state, never save state (D9). The load errors are typed so the
|
|
11
|
+
* transcript-tester layer can catch and report them with file/line context
|
|
12
|
+
* (AC-13's three FORCE-specific rejection clauses).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* How a force applies across a session (D9): `once` must fire exactly once
|
|
16
|
+
* (transcript default — zero firings by end of run is an error the consumer
|
|
17
|
+
* enforces from `RandomForceStatus`); `sticky` applies on every reach,
|
|
18
|
+
* zero-to-many firings, count reported (play default).
|
|
19
|
+
*/
|
|
20
|
+
export type RandomForceMode = 'once' | 'sticky';
|
|
21
|
+
/**
|
|
22
|
+
* One force: replace a point's outcome with a declared class (D8 rule 1 —
|
|
23
|
+
* classes, never draw indices or seeds). Keyed by point name plus optional
|
|
24
|
+
* 1-based occurrence index (D9): an indexed force applies only at that firing;
|
|
25
|
+
* an unindexed force applies per its mode.
|
|
26
|
+
*/
|
|
27
|
+
export interface RandomForceSpec {
|
|
28
|
+
/** The point's dotted name (D2). */
|
|
29
|
+
readonly point: string;
|
|
30
|
+
/** 1-based firing index this force targets; absent ⇒ applies per mode. */
|
|
31
|
+
readonly occurrence?: number;
|
|
32
|
+
/** The declared outcome class to substitute. */
|
|
33
|
+
readonly cls: string;
|
|
34
|
+
/** How the force applies across the session (D9). */
|
|
35
|
+
readonly mode: RandomForceMode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* End-of-session status of one loaded force, surfaced as data for the
|
|
39
|
+
* consumer's report (D9: unfired `once` forces are a hard error in
|
|
40
|
+
* transcripts and a report line in play; `sticky` counts are reported).
|
|
41
|
+
*/
|
|
42
|
+
export interface RandomForceStatus {
|
|
43
|
+
readonly spec: RandomForceSpec;
|
|
44
|
+
/** Number of firings this force replaced. */
|
|
45
|
+
readonly fireCount: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Canonical table-key identity for a force: `point` or `point#occurrence`.
|
|
49
|
+
* Duplicate keys within one load are a load error, not last-wins (D9).
|
|
50
|
+
*/
|
|
51
|
+
export declare function forceKey(spec: Pick<RandomForceSpec, 'point' | 'occurrence'>): string;
|
|
52
|
+
/**
|
|
53
|
+
* Base class for force-table load rejections (AC-13) — catchable as one
|
|
54
|
+
* family by the transcript-tester layer.
|
|
55
|
+
*/
|
|
56
|
+
export declare class RandomForceLoadError extends Error {
|
|
57
|
+
constructor(message: string);
|
|
58
|
+
}
|
|
59
|
+
/** The same `point[#occurrence]` key declared twice in one load (D9: a load error, not last-wins). */
|
|
60
|
+
export declare class DuplicateForceKeyError extends RandomForceLoadError {
|
|
61
|
+
readonly key: string;
|
|
62
|
+
constructor(key: string);
|
|
63
|
+
}
|
|
64
|
+
/** A force naming a point that is not in the catalog — a name is either a declared point or it does not exist (D2). */
|
|
65
|
+
export declare class UnknownForcePointError extends RandomForceLoadError {
|
|
66
|
+
readonly point: string;
|
|
67
|
+
constructor(point: string);
|
|
68
|
+
}
|
|
69
|
+
/** A force naming a class the point does not declare (or a plain draw, which declares none — D4). */
|
|
70
|
+
export declare class UndeclaredForceClassError extends RandomForceLoadError {
|
|
71
|
+
readonly point: string;
|
|
72
|
+
readonly cls: string;
|
|
73
|
+
readonly declared: readonly string[];
|
|
74
|
+
constructor(point: string, cls: string, declared: readonly string[]);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=force.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/force.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,YAAY,CAAC,GAAG,MAAM,CAEpF;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,sGAAsG;AACtG,qBAAa,sBAAuB,SAAQ,oBAAoB;IAClD,QAAQ,CAAC,GAAG,EAAE,MAAM;gBAAX,GAAG,EAAE,MAAM;CAGjC;AAED,uHAAuH;AACvH,qBAAa,sBAAuB,SAAQ,oBAAoB;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAGnC;AAED,qGAAqG;AACrG,qBAAa,yBAA0B,SAAQ,oBAAoB;IAE/D,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE;gBAF3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,MAAM,EAAE;CAQvC"}
|
package/random/force.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Force types — outcome forcing over declared classes (ADR-293 D8, D9).
|
|
4
|
+
*
|
|
5
|
+
* Public interface: `RandomForceMode`, `RandomForceSpec`, `RandomForceStatus`,
|
|
6
|
+
* `forceKey`, and the typed load errors (`RandomForceLoadError` base;
|
|
7
|
+
* `DuplicateForceKeyError`, `UnknownForcePointError`,
|
|
8
|
+
* `UndeclaredForceClassError`).
|
|
9
|
+
* Owner context: @sharpee/core random substrate. Core owns the types (D5);
|
|
10
|
+
* engine's `RandomService` implementation owns the force table itself. Forces
|
|
11
|
+
* are session state, never save state (D9). The load errors are typed so the
|
|
12
|
+
* transcript-tester layer can catch and report them with file/line context
|
|
13
|
+
* (AC-13's three FORCE-specific rejection clauses).
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.UndeclaredForceClassError = exports.UnknownForcePointError = exports.DuplicateForceKeyError = exports.RandomForceLoadError = void 0;
|
|
17
|
+
exports.forceKey = forceKey;
|
|
18
|
+
/**
|
|
19
|
+
* Canonical table-key identity for a force: `point` or `point#occurrence`.
|
|
20
|
+
* Duplicate keys within one load are a load error, not last-wins (D9).
|
|
21
|
+
*/
|
|
22
|
+
function forceKey(spec) {
|
|
23
|
+
return spec.occurrence === undefined ? spec.point : `${spec.point}#${spec.occurrence}`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Base class for force-table load rejections (AC-13) — catchable as one
|
|
27
|
+
* family by the transcript-tester layer.
|
|
28
|
+
*/
|
|
29
|
+
class RandomForceLoadError extends Error {
|
|
30
|
+
constructor(message) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = new.target.name;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RandomForceLoadError = RandomForceLoadError;
|
|
36
|
+
/** The same `point[#occurrence]` key declared twice in one load (D9: a load error, not last-wins). */
|
|
37
|
+
class DuplicateForceKeyError extends RandomForceLoadError {
|
|
38
|
+
key;
|
|
39
|
+
constructor(key) {
|
|
40
|
+
super(`duplicate force key '${key}' — duplicate keys are a load error, not last-wins (ADR-293 D9)`);
|
|
41
|
+
this.key = key;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.DuplicateForceKeyError = DuplicateForceKeyError;
|
|
45
|
+
/** A force naming a point that is not in the catalog — a name is either a declared point or it does not exist (D2). */
|
|
46
|
+
class UnknownForcePointError extends RandomForceLoadError {
|
|
47
|
+
point;
|
|
48
|
+
constructor(point) {
|
|
49
|
+
super(`force names unknown point '${point}' — no such point is declared (ADR-293 D2)`);
|
|
50
|
+
this.point = point;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.UnknownForcePointError = UnknownForcePointError;
|
|
54
|
+
/** A force naming a class the point does not declare (or a plain draw, which declares none — D4). */
|
|
55
|
+
class UndeclaredForceClassError extends RandomForceLoadError {
|
|
56
|
+
point;
|
|
57
|
+
cls;
|
|
58
|
+
declared;
|
|
59
|
+
constructor(point, cls, declared) {
|
|
60
|
+
super(declared.length === 0
|
|
61
|
+
? `force on '${point}' names class '${cls}', but the point is a plain draw and declares no classes (ADR-293 D4)`
|
|
62
|
+
: `force on '${point}' names undeclared class '${cls}' (declared: ${declared.join(', ')})`);
|
|
63
|
+
this.point = point;
|
|
64
|
+
this.cls = cls;
|
|
65
|
+
this.declared = declared;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.UndeclaredForceClassError = UndeclaredForceClassError;
|
|
69
|
+
//# sourceMappingURL=force.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/force.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AA0CH,4BAEC;AAND;;;GAGG;AACH,SAAgB,QAAQ,CAAC,IAAmD;IAC1E,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;AACzF,CAAC;AAED;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AALD,oDAKC;AAED,sGAAsG;AACtG,MAAa,sBAAuB,SAAQ,oBAAoB;IACzC;IAArB,YAAqB,GAAW;QAC9B,KAAK,CAAC,wBAAwB,GAAG,iEAAiE,CAAC,CAAC;QADjF,QAAG,GAAH,GAAG,CAAQ;IAEhC,CAAC;CACF;AAJD,wDAIC;AAED,uHAAuH;AACvH,MAAa,sBAAuB,SAAQ,oBAAoB;IACzC;IAArB,YAAqB,KAAa;QAChC,KAAK,CAAC,8BAA8B,KAAK,4CAA4C,CAAC,CAAC;QADpE,UAAK,GAAL,KAAK,CAAQ;IAElC,CAAC;CACF;AAJD,wDAIC;AAED,qGAAqG;AACrG,MAAa,yBAA0B,SAAQ,oBAAoB;IAEtD;IACA;IACA;IAHX,YACW,KAAa,EACb,GAAW,EACX,QAA2B;QAEpC,KAAK,CACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACnB,CAAC,CAAC,aAAa,KAAK,kBAAkB,GAAG,uEAAuE;YAChH,CAAC,CAAC,aAAa,KAAK,6BAA6B,GAAG,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC7F,CAAC;QARO,UAAK,GAAL,KAAK,CAAQ;QACb,QAAG,GAAH,GAAG,CAAQ;QACX,aAAQ,GAAR,QAAQ,CAAmB;IAOtC,CAAC;CACF;AAZD,8DAYC"}
|
package/random/index.d.ts
CHANGED
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
* Random utilities exports
|
|
3
3
|
*/
|
|
4
4
|
export { SeededRandom, createSeededRandom } from './seeded-random.js';
|
|
5
|
+
export { ChoicePoint, definePoint, getRegisteredPoints, getPoint } from './choice-point.js';
|
|
6
|
+
export { RandomService } from './random-service.js';
|
|
7
|
+
export { SEED_DERIVATION_VERSION, deriveStreamSeed } from './seed-derivation.js';
|
|
8
|
+
export { RandomForceMode, RandomForceSpec, RandomForceStatus, forceKey, RandomForceLoadError, DuplicateForceKeyError, UnknownForcePointError, UndeclaredForceClassError } from './force.js';
|
|
9
|
+
export { IRandomTraceData, RandomTraceSink } from './trace.js';
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
package/random/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/random/index.js
CHANGED
|
@@ -3,7 +3,20 @@
|
|
|
3
3
|
* Random utilities exports
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createSeededRandom = void 0;
|
|
6
|
+
exports.UndeclaredForceClassError = exports.UnknownForcePointError = exports.DuplicateForceKeyError = exports.RandomForceLoadError = exports.forceKey = exports.deriveStreamSeed = exports.SEED_DERIVATION_VERSION = exports.getPoint = exports.getRegisteredPoints = exports.definePoint = exports.createSeededRandom = void 0;
|
|
7
7
|
var seeded_random_js_1 = require("./seeded-random.js");
|
|
8
8
|
Object.defineProperty(exports, "createSeededRandom", { enumerable: true, get: function () { return seeded_random_js_1.createSeededRandom; } });
|
|
9
|
+
var choice_point_js_1 = require("./choice-point.js");
|
|
10
|
+
Object.defineProperty(exports, "definePoint", { enumerable: true, get: function () { return choice_point_js_1.definePoint; } });
|
|
11
|
+
Object.defineProperty(exports, "getRegisteredPoints", { enumerable: true, get: function () { return choice_point_js_1.getRegisteredPoints; } });
|
|
12
|
+
Object.defineProperty(exports, "getPoint", { enumerable: true, get: function () { return choice_point_js_1.getPoint; } });
|
|
13
|
+
var seed_derivation_js_1 = require("./seed-derivation.js");
|
|
14
|
+
Object.defineProperty(exports, "SEED_DERIVATION_VERSION", { enumerable: true, get: function () { return seed_derivation_js_1.SEED_DERIVATION_VERSION; } });
|
|
15
|
+
Object.defineProperty(exports, "deriveStreamSeed", { enumerable: true, get: function () { return seed_derivation_js_1.deriveStreamSeed; } });
|
|
16
|
+
var force_js_1 = require("./force.js");
|
|
17
|
+
Object.defineProperty(exports, "forceKey", { enumerable: true, get: function () { return force_js_1.forceKey; } });
|
|
18
|
+
Object.defineProperty(exports, "RandomForceLoadError", { enumerable: true, get: function () { return force_js_1.RandomForceLoadError; } });
|
|
19
|
+
Object.defineProperty(exports, "DuplicateForceKeyError", { enumerable: true, get: function () { return force_js_1.DuplicateForceKeyError; } });
|
|
20
|
+
Object.defineProperty(exports, "UnknownForcePointError", { enumerable: true, get: function () { return force_js_1.UnknownForcePointError; } });
|
|
21
|
+
Object.defineProperty(exports, "UndeclaredForceClassError", { enumerable: true, get: function () { return force_js_1.UndeclaredForceClassError; } });
|
|
9
22
|
//# sourceMappingURL=index.js.map
|
package/random/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAsE;AAA/C,sHAAA,kBAAkB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAsE;AAA/C,sHAAA,kBAAkB,OAAA;AACzC,qDAA4F;AAAtE,8GAAA,WAAW,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAEhE,2DAAiF;AAAxE,6HAAA,uBAAuB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAClD,uCASoB;AALlB,oGAAA,QAAQ,OAAA;AACR,gHAAA,oBAAoB,OAAA;AACpB,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AACtB,qHAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RandomService — the handle-only draw interface (ADR-293 D2, D5; API per Implementation).
|
|
3
|
+
*
|
|
4
|
+
* Public interface: `RandomService`.
|
|
5
|
+
* Owner context: @sharpee/core random substrate. Core owns the interface; engine owns
|
|
6
|
+
* the sole implementation (stream derivation/cache, force lookup, trace, persistence).
|
|
7
|
+
* Gameplay code draws exclusively through `ChoicePoint` handles — the one sanctioned
|
|
8
|
+
* route to a bare `SeededRandom` is a point's own `sample` callback inside `resolve()`.
|
|
9
|
+
*/
|
|
10
|
+
import type { ChoicePoint } from './choice-point.js';
|
|
11
|
+
import type { SeededRandom } from './seeded-random.js';
|
|
12
|
+
/**
|
|
13
|
+
* Draw API over declared points. Every draw is on the named point's own stream,
|
|
14
|
+
* derived from the master seed and the point name (D3) — no draw exists without
|
|
15
|
+
* a declaration (D2).
|
|
16
|
+
*/
|
|
17
|
+
export interface RandomService {
|
|
18
|
+
/**
|
|
19
|
+
* True with the given probability. One draw on `p`'s stream.
|
|
20
|
+
* @param p - a yes/no choice point
|
|
21
|
+
* @param probability - chance of `true`, in [0, 1]
|
|
22
|
+
*/
|
|
23
|
+
chance(p: ChoicePoint<'yes' | 'no'>, probability: number): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Integer in [min, max] inclusive. One draw on `p`'s stream.
|
|
26
|
+
*/
|
|
27
|
+
int(p: ChoicePoint, min: number, max: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Pick one element. One draw on `p`'s stream.
|
|
30
|
+
* @param label - optional class label for the picked item (trace/coverage, Phase C)
|
|
31
|
+
*/
|
|
32
|
+
pick<T>(p: ChoicePoint, items: readonly T[], label?: (t: T) => string): T;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a multi-draw point to a classed outcome.
|
|
35
|
+
*
|
|
36
|
+
* Real path: `sample` receives the point's own stream and performs its N internal
|
|
37
|
+
* draws (the one sanctioned bare-`SeededRandom` route, D2). Forced path (Phase C):
|
|
38
|
+
* `materialize` builds the outcome for a forced class with zero draws (D8) —
|
|
39
|
+
* typed now per A1 ruling 5, unused until forcing lands.
|
|
40
|
+
*
|
|
41
|
+
* @param p - a class-bearing choice point
|
|
42
|
+
* @param sample - draws from the point's stream and returns the classed outcome
|
|
43
|
+
* @param materialize - builds the outcome for a forced class without drawing
|
|
44
|
+
*/
|
|
45
|
+
resolve<C extends string, R>(p: ChoicePoint<C>, sample: (draw: SeededRandom) => {
|
|
46
|
+
cls: C;
|
|
47
|
+
value: R;
|
|
48
|
+
}, materialize: (forced: C) => R): {
|
|
49
|
+
cls: C;
|
|
50
|
+
value: R;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=random-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-service.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/random-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAEnE;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtD;;;OAGG;IACH,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC;IAE1E;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EACzB,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EACjB,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK;QAAE,GAAG,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,EACpD,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAC5B;QAAE,GAAG,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,CAAC;CACzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* RandomService — the handle-only draw interface (ADR-293 D2, D5; API per Implementation).
|
|
4
|
+
*
|
|
5
|
+
* Public interface: `RandomService`.
|
|
6
|
+
* Owner context: @sharpee/core random substrate. Core owns the interface; engine owns
|
|
7
|
+
* the sole implementation (stream derivation/cache, force lookup, trace, persistence).
|
|
8
|
+
* Gameplay code draws exclusively through `ChoicePoint` handles — the one sanctioned
|
|
9
|
+
* route to a bare `SeededRandom` is a point's own `sample` callback inside `resolve()`.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//# sourceMappingURL=random-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-service.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/random-service.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seed derivation — per-point stream seeds from the master seed (ADR-293 D3).
|
|
3
|
+
*
|
|
4
|
+
* Public interface: `SEED_DERIVATION_VERSION`, `deriveStreamSeed(masterSeed, pointName)`.
|
|
5
|
+
* Owner context: @sharpee/core random substrate; engine's RandomService implementation
|
|
6
|
+
* is the intended caller.
|
|
7
|
+
*
|
|
8
|
+
* This is a COMPATIBILITY SURFACE: saves persist stream states derived through this
|
|
9
|
+
* function, so its output for a given (masterSeed, pointName) pair must never change
|
|
10
|
+
* within a `SEED_DERIVATION_VERSION`. A pinned-value test guards it; any algorithm
|
|
11
|
+
* change requires bumping the version constant.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Version of the seed-derivation algorithm. Bump on ANY change to
|
|
15
|
+
* `deriveStreamSeed`'s output for existing inputs (ADR-293 D3).
|
|
16
|
+
*/
|
|
17
|
+
export declare const SEED_DERIVATION_VERSION = 1;
|
|
18
|
+
/**
|
|
19
|
+
* Derive a point's stream seed from the master seed and the point's name.
|
|
20
|
+
*
|
|
21
|
+
* FNV-1a (32-bit) over the point name's UTF-16 code units, then folded over the
|
|
22
|
+
* four bytes of the master seed (little-endian byte order). Point names are
|
|
23
|
+
* dotted ASCII by convention (ADR-293 D2), so code units and bytes coincide.
|
|
24
|
+
*
|
|
25
|
+
* Properties (both load-bearing, ADR-293 D3):
|
|
26
|
+
* - Order-independent: a pure function of (masterSeed, pointName) — never of
|
|
27
|
+
* registration or first-draw order.
|
|
28
|
+
* - Decorrelated: nearby names and nearby master seeds produce unrelated seeds,
|
|
29
|
+
* unlike ordinal/additive derivation over the core LCG.
|
|
30
|
+
*
|
|
31
|
+
* @param masterSeed - the session's master seed (treated as unsigned 32-bit)
|
|
32
|
+
* @param pointName - the declared point name, e.g. 'dungeo.melee.blow.hero'
|
|
33
|
+
* @returns an unsigned 32-bit seed for the point's stream
|
|
34
|
+
*/
|
|
35
|
+
export declare function deriveStreamSeed(masterSeed: number, pointName: string): number;
|
|
36
|
+
//# sourceMappingURL=seed-derivation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-derivation.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/seed-derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAKzC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAY9E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Seed derivation — per-point stream seeds from the master seed (ADR-293 D3).
|
|
4
|
+
*
|
|
5
|
+
* Public interface: `SEED_DERIVATION_VERSION`, `deriveStreamSeed(masterSeed, pointName)`.
|
|
6
|
+
* Owner context: @sharpee/core random substrate; engine's RandomService implementation
|
|
7
|
+
* is the intended caller.
|
|
8
|
+
*
|
|
9
|
+
* This is a COMPATIBILITY SURFACE: saves persist stream states derived through this
|
|
10
|
+
* function, so its output for a given (masterSeed, pointName) pair must never change
|
|
11
|
+
* within a `SEED_DERIVATION_VERSION`. A pinned-value test guards it; any algorithm
|
|
12
|
+
* change requires bumping the version constant.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SEED_DERIVATION_VERSION = void 0;
|
|
16
|
+
exports.deriveStreamSeed = deriveStreamSeed;
|
|
17
|
+
/**
|
|
18
|
+
* Version of the seed-derivation algorithm. Bump on ANY change to
|
|
19
|
+
* `deriveStreamSeed`'s output for existing inputs (ADR-293 D3).
|
|
20
|
+
*/
|
|
21
|
+
exports.SEED_DERIVATION_VERSION = 1;
|
|
22
|
+
const FNV_OFFSET_BASIS = 0x811c9dc5;
|
|
23
|
+
const FNV_PRIME = 0x01000193;
|
|
24
|
+
/**
|
|
25
|
+
* Derive a point's stream seed from the master seed and the point's name.
|
|
26
|
+
*
|
|
27
|
+
* FNV-1a (32-bit) over the point name's UTF-16 code units, then folded over the
|
|
28
|
+
* four bytes of the master seed (little-endian byte order). Point names are
|
|
29
|
+
* dotted ASCII by convention (ADR-293 D2), so code units and bytes coincide.
|
|
30
|
+
*
|
|
31
|
+
* Properties (both load-bearing, ADR-293 D3):
|
|
32
|
+
* - Order-independent: a pure function of (masterSeed, pointName) — never of
|
|
33
|
+
* registration or first-draw order.
|
|
34
|
+
* - Decorrelated: nearby names and nearby master seeds produce unrelated seeds,
|
|
35
|
+
* unlike ordinal/additive derivation over the core LCG.
|
|
36
|
+
*
|
|
37
|
+
* @param masterSeed - the session's master seed (treated as unsigned 32-bit)
|
|
38
|
+
* @param pointName - the declared point name, e.g. 'dungeo.melee.blow.hero'
|
|
39
|
+
* @returns an unsigned 32-bit seed for the point's stream
|
|
40
|
+
*/
|
|
41
|
+
function deriveStreamSeed(masterSeed, pointName) {
|
|
42
|
+
let hash = FNV_OFFSET_BASIS;
|
|
43
|
+
for (let i = 0; i < pointName.length; i++) {
|
|
44
|
+
hash ^= pointName.charCodeAt(i);
|
|
45
|
+
hash = Math.imul(hash, FNV_PRIME) >>> 0;
|
|
46
|
+
}
|
|
47
|
+
const seed = masterSeed >>> 0;
|
|
48
|
+
for (let byte = 0; byte < 4; byte++) {
|
|
49
|
+
hash ^= (seed >>> (byte * 8)) & 0xff;
|
|
50
|
+
hash = Math.imul(hash, FNV_PRIME) >>> 0;
|
|
51
|
+
}
|
|
52
|
+
return hash >>> 0;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=seed-derivation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-derivation.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/seed-derivation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AA4BH,4CAYC;AAtCD;;;GAGG;AACU,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAEzC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,gBAAgB,CAAC,UAAkB,EAAE,SAAiB;IACpE,IAAI,IAAI,GAAG,gBAAgB,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,IAAI,GAAG,UAAU,KAAK,CAAC,CAAC;IAC9B,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;QACpC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACrC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random trace types — the per-firing trace record and sink (ADR-293 D16).
|
|
3
|
+
*
|
|
4
|
+
* Public interface: `IRandomTraceData`, `RandomTraceSink`.
|
|
5
|
+
* Owner context: @sharpee/core random substrate. Core owns the trace/coverage
|
|
6
|
+
* types (D5); engine's `RandomService` implementation produces the records and
|
|
7
|
+
* emits them as `ISystemEvent`s (`subsystem: Subsystems.RANDOM`, severity
|
|
8
|
+
* 'debug') when a sink is installed. Emission is off by default and a published
|
|
9
|
+
* game emits none (D16).
|
|
10
|
+
*/
|
|
11
|
+
import type { RandomForceMode } from './force.js';
|
|
12
|
+
/**
|
|
13
|
+
* One firing of a declared point — drawn or forced (D16's logical record:
|
|
14
|
+
* point, class, value, provenance, draws-consumed, plus the occurrence index
|
|
15
|
+
* and, for forced firings, the matched force's mode and key index).
|
|
16
|
+
*/
|
|
17
|
+
export interface IRandomTraceData {
|
|
18
|
+
/** The point's dotted name (D2). */
|
|
19
|
+
readonly point: string;
|
|
20
|
+
/** 1-based firing index of this point within the session (D9's occurrence). */
|
|
21
|
+
readonly occurrence: number;
|
|
22
|
+
/** Outcome class — present for classed firings (`chance`/`resolve`), absent for class-less draws (`int`/`pick`). */
|
|
23
|
+
readonly cls?: string;
|
|
24
|
+
/** The produced value: the drawn/materialized result, or the pick's label when one was declared. */
|
|
25
|
+
readonly value: unknown;
|
|
26
|
+
/** Whether the outcome was drawn on the point's stream or substituted by a force (D8). */
|
|
27
|
+
readonly provenance: 'drawn' | 'forced';
|
|
28
|
+
/** Stream draws consumed by this firing — always 0 when forced (D8 rule 2). */
|
|
29
|
+
readonly drawsConsumed: number;
|
|
30
|
+
/** Mode of the matched force; present only when `provenance` is 'forced'. */
|
|
31
|
+
readonly forceMode?: RandomForceMode;
|
|
32
|
+
/** Occurrence index the matched force key carried, if it was indexed (`point#N`). */
|
|
33
|
+
readonly forceOccurrence?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Receiver for trace records. Installed on the engine's `RandomService`
|
|
37
|
+
* implementation by opted-in surfaces (transcript runner, `--play`, IDE);
|
|
38
|
+
* absent by default, in which case no record is built at all.
|
|
39
|
+
*/
|
|
40
|
+
export type RandomTraceSink = (record: IRandomTraceData) => void;
|
|
41
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oHAAoH;IACpH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC,qFAAqF;IACrF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC"}
|
package/random/trace.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Random trace types — the per-firing trace record and sink (ADR-293 D16).
|
|
4
|
+
*
|
|
5
|
+
* Public interface: `IRandomTraceData`, `RandomTraceSink`.
|
|
6
|
+
* Owner context: @sharpee/core random substrate. Core owns the trace/coverage
|
|
7
|
+
* types (D5); engine's `RandomService` implementation produces the records and
|
|
8
|
+
* emits them as `ISystemEvent`s (`subsystem: Subsystems.RANDOM`, severity
|
|
9
|
+
* 'debug') when a sink is installed. Emission is off by default and a published
|
|
10
|
+
* game emits none (D16).
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/random/trace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG"}
|
package/types/save-data.d.ts
CHANGED
|
@@ -70,8 +70,21 @@ export interface IEngineState {
|
|
|
70
70
|
* message-variant picks) deterministic with an unbroken run. Saves
|
|
71
71
|
* written before this field existed restore fine — the engine reseeds
|
|
72
72
|
* the stream time-based when the field is absent.
|
|
73
|
+
*
|
|
74
|
+
* Folds into `streamStates` when `ActionContext.random` moves onto the
|
|
75
|
+
* per-point RandomService (ADR-293 Phase A).
|
|
73
76
|
*/
|
|
74
77
|
actionRngSeed?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Optional: unified per-point stream state map (ADR-293 D7), added in
|
|
80
|
+
* save format `3.0.0`. Keyed by declared point name; values are LCG
|
|
81
|
+
* stream states (the seed IS the state). Contains only points that
|
|
82
|
+
* have drawn. On restore, named points continue exactly where they
|
|
83
|
+
* left off and every other point reseeds from the master seed. Point
|
|
84
|
+
* names are persistent identifiers — renaming one orphans its saved
|
|
85
|
+
* stream state (same class of change as a trait schema change).
|
|
86
|
+
*/
|
|
87
|
+
streamStates?: Record<string, number>;
|
|
75
88
|
}
|
|
76
89
|
/**
|
|
77
90
|
* Serialized scheduler state for save/load
|
package/types/save-data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-data.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/save-data.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,QAAQ,EAAE,aAAa,CAAC;IAExB,4BAA4B;IAC5B,WAAW,EAAE,YAAY,CAAC;IAE1B,yCAAyC;IACzC,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IAErB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAElB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAEhC;;;;;;;;;;;;;;OAcG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,iCAAiC;IACjC,WAAW,EAAE,eAAe,EAAE,CAAC;IAE/B,uCAAuC;IACvC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAErC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3C,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC
|
|
1
|
+
{"version":3,"file":"save-data.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/save-data.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAEhB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,QAAQ,EAAE,aAAa,CAAC;IAExB,4BAA4B;IAC5B,WAAW,EAAE,YAAY,CAAC;IAE1B,yCAAyC;IACzC,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IAErB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAElB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAEhC;;;;;;;;;;;;;;OAcG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,iCAAiC;IACjC,WAAW,EAAE,eAAe,EAAE,CAAC;IAE/B,uCAAuC;IACvC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAErC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3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