@plasius/ai-game 0.6.1 → 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.
@@ -0,0 +1,65 @@
1
+ # ADR 0017: Tutorial contract boundary
2
+
3
+ - Status: Accepted
4
+ - Date: 2026-07-11
5
+ - Decision Makers: Plasius engineering
6
+
7
+ ## Context
8
+
9
+ The Player System needs portable tutorial contracts for first-contact
10
+ onboarding, contextual coaching, advanced progression gates, and replay. The
11
+ Tutorial System must teach per-action capabilities without becoming a permanent
12
+ foreground layer or overwhelming active combat. The rollout is controlled by
13
+ `isekai.player-system.tutorial.enabled`.
14
+
15
+ ## Decision
16
+
17
+ `@plasius/ai-game` owns immutable, versioned contracts for tutorial steps,
18
+ progression state, prerequisite markers, contextual triggers, and tutorial
19
+ tracks. The public model:
20
+
21
+ - uses the five-stage evolution ladder from Stage 1 onboarding through Stage 5
22
+ divine-dominion surfaces;
23
+ - supports awakening, first-action, explicit-request, and progression-gated
24
+ triggers;
25
+ - keeps combat safety explicit per step and trigger so active combat can use
26
+ reduced coaching only;
27
+ - represents `not-started`, `active`, `dormant`, `completed`, and `declined`
28
+ progression states;
29
+ - records replayability, replay count, trigger timestamps, and completed step
30
+ IDs; and
31
+ - models school, apprenticeship, academy, guild, divine, and spellcraft
32
+ prerequisite markers without owning their authority.
33
+
34
+ Factories validate supported values, immutable nested arrays, positive sequence
35
+ numbers, non-negative counters, ISO timestamps, collection bounds, unique IDs,
36
+ and all step/prerequisite/trigger/progression references.
37
+
38
+ ## Alternatives considered
39
+
40
+ - A monolithic linear tutorial payload: rejected because the TDR requires
41
+ per-action and per-capability coaching with contextual resurfacing.
42
+ - Permanent foreground guidance: rejected because it would dominate the play
43
+ experience and conflict with combat readability.
44
+ - Site-local tutorial state: rejected because Player System consumers need one
45
+ portable progression and replay vocabulary.
46
+
47
+ ## Consequences
48
+
49
+ Hosts can implement dormant contextual coaching and replay without inventing
50
+ their own progression or gating semantics. Institutional and progression
51
+ systems remain authoritative for prerequisite satisfaction; this package only
52
+ transports bounded markers and consumer-facing state. Incompatible payload
53
+ changes require a new contract version and ADR.
54
+
55
+ ## Validation
56
+
57
+ Unit tests cover stage and trigger guards, prerequisite markers, combat-safe
58
+ steps, dormant/replay state, malformed metadata, reference integrity,
59
+ immutability, and collection bounds. Package lint, typecheck, coverage, build,
60
+ pack, audit, CI, and CD remain release gates.
61
+
62
+ ## Related decisions
63
+
64
+ - ADR 0065: Tutorial Mode Operates as a Dormant Contextual Coach
65
+ - TDR-0033: Tutorial System Contextual Coaching and Combat Limits
@@ -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.
@@ -16,3 +16,5 @@
16
16
  - [ADR-0014: Player System guidance cue contract boundary](./adr-0014-player-system-guidance-cue-contract-boundary.md)
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
+ - [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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasius/ai-game",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Game-domain AI contracts for player action validation, NPC actions, gossip, and feedback.",
5
5
  "type": "module",
6
6
  "sideEffects": false,