@plasius/ai-game 0.6.2 → 0.6.3
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 +16 -0
- package/README.md +23 -0
- package/dist/index.cjs +278 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -1
- package/dist/index.d.ts +119 -1
- package/dist/index.js +263 -0
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0018-apprenticeship-handoff-contract-boundary.md +58 -0
- package/docs/adrs/index.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# ADR 0018: Apprenticeship handoff contract boundary
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The Player System needs to route an apprentice from sponsorship and supervised
|
|
10
|
+
practice into spellcraft, item-crafting, or dungeon-crafting workflows. Training
|
|
11
|
+
authority belongs to `@plasius/training`, and execution authority belongs to the
|
|
12
|
+
destination system. A Player System contract must therefore carry enough
|
|
13
|
+
evidence to start a downstream request without becoming a second source of
|
|
14
|
+
truth or approving the requested work.
|
|
15
|
+
|
|
16
|
+
## Decision
|
|
17
|
+
|
|
18
|
+
`@plasius/ai-game` publishes versioned apprenticeship bridge contracts under
|
|
19
|
+
`isekai.training.apprenticeship.enabled`:
|
|
20
|
+
|
|
21
|
+
- sponsorship records identify the pseudonymous apprentice, sponsor, institution,
|
|
22
|
+
discipline, and limited scope;
|
|
23
|
+
- supervision records identify the active supervisor and checkpoint model;
|
|
24
|
+
- readiness records carry trust, track, prerequisites, and the fail-closed state;
|
|
25
|
+
- handoff envelopes are request-only and target exactly one authoritative system:
|
|
26
|
+
`spellcraft-system`, `item-crafting-system`, or `dungeon-crafting-system`.
|
|
27
|
+
|
|
28
|
+
Handoffs contain correlation/request IDs, opaque subject IDs, and downstream-facing
|
|
29
|
+
intent. They do not contain secrets, hidden System state, authority decisions, or
|
|
30
|
+
execution results. The receiving system remains responsible for validation,
|
|
31
|
+
authorization, mutation, and final outcome.
|
|
32
|
+
|
|
33
|
+
## Alternatives considered
|
|
34
|
+
|
|
35
|
+
1. Put the full apprenticeship model in `@plasius/ai-game` — rejected because
|
|
36
|
+
`@plasius/training` already owns institutional progression and trust.
|
|
37
|
+
2. Let the Player System call each crafting system with bespoke payloads —
|
|
38
|
+
rejected because it would duplicate boundary and rollout semantics across
|
|
39
|
+
consumers.
|
|
40
|
+
3. Publish a generic untyped map — rejected because downstream contracts need
|
|
41
|
+
stable, validated target-specific fields and explicit authority ownership.
|
|
42
|
+
|
|
43
|
+
## Consequences
|
|
44
|
+
|
|
45
|
+
- Consumers get one stable bridge surface and one inherited rollout key.
|
|
46
|
+
- Downstream systems can evolve their authoritative schemas without making
|
|
47
|
+
`@plasius/ai-game` an execution dependency.
|
|
48
|
+
- Opaque subject identifiers and bounded arrays make the public payload suitable
|
|
49
|
+
for privacy-safe routing and replay diagnostics.
|
|
50
|
+
- Each destination package still needs its own authoritative implementation and
|
|
51
|
+
release before a handoff is executable in production.
|
|
52
|
+
|
|
53
|
+
## Validation and rollback
|
|
54
|
+
|
|
55
|
+
Factory tests validate version, identifiers, timestamps, enums, readiness gates,
|
|
56
|
+
immutability, and target routing. Disabling
|
|
57
|
+
`isekai.training.apprenticeship.enabled` is the rollback path; consumers must
|
|
58
|
+
fail closed and keep their authority-side state unchanged.
|
package/docs/adrs/index.md
CHANGED
|
@@ -17,3 +17,4 @@
|
|
|
17
17
|
- [ADR-0015: MCC guidance contract boundary](./adr-0015-mcc-guidance-contract-boundary.md)
|
|
18
18
|
- [ADR-0016: Observed event log and gossip export contract boundary](./adr-0016-observed-event-log-and-gossip-export-contract-boundary.md)
|
|
19
19
|
- [ADR-0017: Tutorial contract boundary](./adr-0017-tutorial-contract-boundary.md)
|
|
20
|
+
- [ADR-0018: Apprenticeship handoff contract boundary](./adr-0018-apprenticeship-handoff-contract-boundary.md)
|