@plasius/ai-game 0.2.0 → 0.4.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 +31 -0
- package/README.md +50 -2
- package/dist/index.cjs +682 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +323 -1
- package/dist/index.d.ts +323 -1
- package/dist/index.js +628 -6
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0012-identity-projection-contract-boundary.md +55 -0
- package/docs/adrs/adr-0013-adaptive-mission-contract-boundary.md +63 -0
- package/docs/adrs/index.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ADR 0012: Identity projection and target-classification contract boundary
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The Player System needs to expose self-state and line-of-sight target overlays
|
|
10
|
+
without making the UI or `@plasius/ai-game` the authority for identity truth.
|
|
11
|
+
Target knowledge is not uniform: some targets are fully known, some are only
|
|
12
|
+
partially understood, and occluded targets must not leak hidden fields.
|
|
13
|
+
|
|
14
|
+
## Decision
|
|
15
|
+
|
|
16
|
+
`@plasius/ai-game` owns the versioned, dependency-free projection contract
|
|
17
|
+
behind `isekai.player-system.identity.enabled`. The identity-card system remains
|
|
18
|
+
the authority owner and these payloads are projection-only.
|
|
19
|
+
|
|
20
|
+
- Self projections are always `self` / full-read payloads.
|
|
21
|
+
- Target projections use `allied`, `neutral`, `unknown`, and `unfriendly`
|
|
22
|
+
categories.
|
|
23
|
+
- A target receives a full read only when it is in line of sight and its
|
|
24
|
+
knowledge state is full.
|
|
25
|
+
- Partial or unknown knowledge redacts fields to `Unknown`.
|
|
26
|
+
- Missing line of sight marks a target `occluded`, forces a partial read, and
|
|
27
|
+
redacts fields to `Withheld`.
|
|
28
|
+
|
|
29
|
+
Consumers must filter through `selectAiGameVisibleIdentityTargets()` before
|
|
30
|
+
rendering target surfaces. No hidden score, authority mutation, credential, or
|
|
31
|
+
raw identity source data belongs in this boundary.
|
|
32
|
+
|
|
33
|
+
## Alternatives considered
|
|
34
|
+
|
|
35
|
+
1. Reuse the site’s identity-card implementation directly. Rejected because it
|
|
36
|
+
would couple a reusable package to site runtime code and make cross-package
|
|
37
|
+
consumers depend on the authority implementation.
|
|
38
|
+
2. Return all target fields and let consumers redact them. Rejected because
|
|
39
|
+
consumer-side redaction is easy to omit and risks omniscient disclosure.
|
|
40
|
+
3. Collapse partial and occluded targets into one state. Rejected because
|
|
41
|
+
line-of-sight is an independent visibility gate needed by combat-safe UI and
|
|
42
|
+
target selection.
|
|
43
|
+
|
|
44
|
+
## Consequences
|
|
45
|
+
|
|
46
|
+
The runtime, interface, and site can share one vocabulary for self reads,
|
|
47
|
+
target categories, knowledge gates, and line-of-sight semantics. Factories
|
|
48
|
+
fail closed and return immutable snapshots, while authority ownership stays
|
|
49
|
+
outside this package.
|
|
50
|
+
|
|
51
|
+
## Validation
|
|
52
|
+
|
|
53
|
+
Tests cover all category and gate states, full/partial/occluded reads,
|
|
54
|
+
redaction values, visible-target selection, immutability, version checks, and
|
|
55
|
+
malformed input rejection.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# ADR 0013: Adaptive mission contract boundary
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The Player System needs a portable mission surface that can guide bootstrap
|
|
10
|
+
players, learn from mission responses over time, and expose bounded reward
|
|
11
|
+
metadata without making `@plasius/ai-game` the authority for progression truth.
|
|
12
|
+
|
|
13
|
+
ADR 0061 and TDR-0029 require adaptive mission selection, confidence-scored
|
|
14
|
+
player-model learning, MCC focus influence, and reward envelopes that accelerate
|
|
15
|
+
readiness without skipping gates. Those rules must be consumable by multiple
|
|
16
|
+
packages without pulling site runtime code into the shared contract boundary.
|
|
17
|
+
|
|
18
|
+
## Decision
|
|
19
|
+
|
|
20
|
+
`@plasius/ai-game` owns the dependency-free adaptive mission contract boundary
|
|
21
|
+
behind `isekai.player-system.missions.enabled`.
|
|
22
|
+
|
|
23
|
+
- Mission definitions remain distinct from guild quests and other external
|
|
24
|
+
contract systems.
|
|
25
|
+
- Mission definitions carry both audio and visual feedback channels so
|
|
26
|
+
completion and failure outputs stay aligned with the Player System design.
|
|
27
|
+
- Objective-state contracts capture bounded progress snapshots rather than raw
|
|
28
|
+
host runtime internals.
|
|
29
|
+
- Player-response contracts explicitly model acceptance, refusal, ignored or
|
|
30
|
+
declined outcomes, pinning, completion, failure, and abandonment as learning
|
|
31
|
+
signals.
|
|
32
|
+
- Player-model influence inputs carry bounded confidence, evidence metadata,
|
|
33
|
+
repeated-signal handling, MCC focus influence, and readiness or stage-gate
|
|
34
|
+
context.
|
|
35
|
+
- Reward envelopes are progression-safe, accelerant-only payloads with explicit
|
|
36
|
+
minimum, maximum, cap, cap semantic, readiness context, gate references, and
|
|
37
|
+
reason codes describing why a reward cannot skip progression.
|
|
38
|
+
|
|
39
|
+
The contract version is `1.0`. Incompatible changes require a new contract
|
|
40
|
+
version and an explicit ADR.
|
|
41
|
+
|
|
42
|
+
## Alternatives considered
|
|
43
|
+
|
|
44
|
+
1. Keep adaptive mission contracts inside the site repository. Rejected because
|
|
45
|
+
multiple consumers need one stable shared vocabulary.
|
|
46
|
+
2. Allow free-form reward payloads and let consumers enforce fairness.
|
|
47
|
+
Rejected because consumer-side reward policing is easy to bypass and would
|
|
48
|
+
weaken progression safety.
|
|
49
|
+
3. Reuse guild-quest contracts for System missions. Rejected because TDR-0029
|
|
50
|
+
explicitly distinguishes internal System missions from guild-sourced work.
|
|
51
|
+
|
|
52
|
+
## Consequences
|
|
53
|
+
|
|
54
|
+
The Player System runtime, site adapters, and future packages can share one
|
|
55
|
+
validated mission vocabulary for guidance, learning signals, and bounded reward
|
|
56
|
+
metadata. The package still stays out of authority-owned progression writes and
|
|
57
|
+
host-private tuning logic.
|
|
58
|
+
|
|
59
|
+
## Validation
|
|
60
|
+
|
|
61
|
+
Tests cover enum guards, confidence-band derivation, immutable mission
|
|
62
|
+
definitions and responses, dual-channel feedback requirements, bounded reward
|
|
63
|
+
caps, progression-safe reason codes, and malformed mission input rejection.
|
package/docs/adrs/index.md
CHANGED
|
@@ -11,3 +11,4 @@
|
|
|
11
11
|
- [ADR-0009: Protected-main releases use release-prep PRs and reconciled version state](./adr-0009-protected-main-release-preparation-and-version-reconciliation.md)
|
|
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
|
+
- [ADR-0012: Identity projection and target-classification contract boundary](./adr-0012-identity-projection-contract-boundary.md)
|