@plasius/ai-game 0.1.13 → 0.3.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 +39 -0
- package/dist/index.cjs +621 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +205 -1
- package/dist/index.d.ts +205 -1
- package/dist/index.js +575 -6
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0011-player-system-core-contract-boundary.md +56 -0
- package/docs/adrs/adr-0012-identity-projection-contract-boundary.md +55 -0
- package/docs/adrs/index.md +2 -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.
|
package/docs/adrs/index.md
CHANGED
|
@@ -10,3 +10,5 @@
|
|
|
10
10
|
- [ADR-0008: Quiet Measure public contracts and hidden runtime boundary](./adr-0008-quiet-measure-public-contracts-and-hidden-runtime-boundary.md)
|
|
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
|
+
- [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)
|