@plasius/ai-game 0.4.0 → 0.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/CHANGELOG.md +34 -0
- package/README.md +37 -1
- package/dist/index.cjs +450 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +135 -1
- package/dist/index.d.ts +135 -1
- package/dist/index.js +417 -5
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0014-player-system-guidance-cue-contract-boundary.md +43 -0
- package/docs/adrs/adr-0016-observed-event-log-and-gossip-export-contract-boundary.md +52 -0
- package/docs/adrs/index.md +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ADR 0014: Player System guidance cue contract boundary
|
|
2
|
+
|
|
3
|
+
- Status: Accepted
|
|
4
|
+
- Date: 2026-07-11
|
|
5
|
+
- Decision Makers: Plasius engineering
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The Player System guidance shell needs shared contracts for multimodal cues,
|
|
10
|
+
but the site must not invent cue priority, fallback, or delivery-budget
|
|
11
|
+
semantics independently. Missing audio or narration must leave an accessible
|
|
12
|
+
non-audio path, while payload and frequency assumptions must remain bounded for
|
|
13
|
+
client performance planning.
|
|
14
|
+
|
|
15
|
+
## Decision
|
|
16
|
+
|
|
17
|
+
`@plasius/ai-game` owns the portable guidance-cue metadata contract under
|
|
18
|
+
`isekai.player-system.guidance-nfr.enabled`. Cues reuse the existing alert
|
|
19
|
+
priority vocabulary and identify their source, matching fallback behavior,
|
|
20
|
+
maximum payload size, and maximum occurrences per minute. The package exposes
|
|
21
|
+
the three supported fallback mappings for voice, narration, and speech
|
|
22
|
+
capture, and validates source/fallback alignment and budget bounds.
|
|
23
|
+
|
|
24
|
+
The package owns contract vocabulary and validation only. Site/runtime
|
|
25
|
+
repositories own feature-flag evaluation, user-facing translations, live
|
|
26
|
+
telemetry, and actual rendering or speech delivery.
|
|
27
|
+
|
|
28
|
+
## Alternatives considered
|
|
29
|
+
|
|
30
|
+
- Keep cue metadata site-local: rejected because downstream Player System
|
|
31
|
+
consumers would reinterpret fallback and budget semantics independently.
|
|
32
|
+
- Expose raw audio provider details: rejected because provider topology and
|
|
33
|
+
operational details are not portable public contract data.
|
|
34
|
+
- Allow unbounded payload and frequency values: rejected because consumers
|
|
35
|
+
could not enforce predictable shell performance assumptions.
|
|
36
|
+
|
|
37
|
+
## Consequences
|
|
38
|
+
|
|
39
|
+
- Consumers receive a stable, reusable contract for priority, fallback, and
|
|
40
|
+
bounded delivery assumptions.
|
|
41
|
+
- The shared package does not leak runtime topology or account/player data.
|
|
42
|
+
- Site and runtime implementations must keep their symbolic mappings aligned
|
|
43
|
+
with the published fallback identifiers.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# ADR 0016: Observed event log and gossip export contract boundary
|
|
2
|
+
|
|
3
|
+
- Status: Accepted
|
|
4
|
+
- Date: 2026-07-11
|
|
5
|
+
- Decision Makers: Plasius engineering
|
|
6
|
+
- Architecture anchors: ADR 0063, TDR 0031
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
The Player System needs a portable basis for recent player-observed events,
|
|
11
|
+
highlight summaries, and gossip exports. Consumers must be able to share the
|
|
12
|
+
same observation records without treating a derived gossip summary as a new
|
|
13
|
+
source of truth. The public package must also avoid carrying raw player
|
|
14
|
+
telemetry, account identifiers, or host-specific storage details.
|
|
15
|
+
|
|
16
|
+
## Decision
|
|
17
|
+
|
|
18
|
+
`@plasius/ai-game` owns the public contract family under
|
|
19
|
+
`isekai.player-system.logs.enabled`:
|
|
20
|
+
|
|
21
|
+
- `AiGameObservedEvent` is the bounded, privacy-safe observation record.
|
|
22
|
+
- `AiGameObservedEventRecencyWindow` is the time-bounded collection of those
|
|
23
|
+
records and validates that every event falls inside the window.
|
|
24
|
+
- `AiGameObservedEventHighlightSummary` references event IDs from one window
|
|
25
|
+
rather than copying a second event representation.
|
|
26
|
+
- `AiGameGossipExport` contains one recency window and summaries that must
|
|
27
|
+
reference events in that same window.
|
|
28
|
+
|
|
29
|
+
Factories validate vocabulary, timestamps, identifier/text bounds, duplicate
|
|
30
|
+
IDs, window membership, and detached summary references. Returned objects and
|
|
31
|
+
arrays are defensively copied and frozen. Runtime persistence, privacy policy
|
|
32
|
+
enforcement, audience authorization, feature-flag evaluation, and gossip
|
|
33
|
+
generation remain owned by the consuming service.
|
|
34
|
+
|
|
35
|
+
## Alternatives considered
|
|
36
|
+
|
|
37
|
+
- Let each Player System consumer define its own event shape: rejected because
|
|
38
|
+
recency and gossip consumers would drift in field meaning and visibility
|
|
39
|
+
handling.
|
|
40
|
+
- Make gossip summaries self-contained copies of event payloads: rejected
|
|
41
|
+
because duplicated event truth could diverge from the observation log.
|
|
42
|
+
- Publish raw telemetry or account identifiers: rejected because the public
|
|
43
|
+
package must remain privacy-safe and portable across hosts.
|
|
44
|
+
|
|
45
|
+
## Consequences
|
|
46
|
+
|
|
47
|
+
- `ai-game` consumers share one event basis for logs, highlights, and gossip
|
|
48
|
+
transport.
|
|
49
|
+
- A gossip export is traceable to recent observations without exposing host
|
|
50
|
+
storage or private runtime metadata.
|
|
51
|
+
- Consumers must perform audience authorization and feature-flag evaluation
|
|
52
|
+
before presenting or persisting an export.
|
package/docs/adrs/index.md
CHANGED
|
@@ -12,3 +12,6 @@
|
|
|
12
12
|
- [ADR-0010: Training contracts are consumed from @plasius/training](./adr-0010-training-contracts-consumed-from-training-package.md)
|
|
13
13
|
- [ADR-0011: Player System core contract boundary](./adr-0011-player-system-core-contract-boundary.md)
|
|
14
14
|
- [ADR-0012: Identity projection and target-classification contract boundary](./adr-0012-identity-projection-contract-boundary.md)
|
|
15
|
+
- [ADR-0013: Adaptive mission contract boundary](./adr-0013-adaptive-mission-contract-boundary.md)
|
|
16
|
+
- [ADR-0014: Player System guidance cue contract boundary](./adr-0014-player-system-guidance-cue-contract-boundary.md)
|
|
17
|
+
- [ADR-0016: Observed event log and gossip export contract boundary](./adr-0016-observed-event-log-and-gossip-export-contract-boundary.md)
|