@plasius/ai-game 0.6.2 → 0.6.4

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,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.
@@ -0,0 +1,49 @@
1
+ # ADR 0019: Guild-quest synchronization and authority boundary
2
+
3
+ - Status: Accepted
4
+ - Date: 2026-07-11
5
+ - Decision Makers: Plasius engineering
6
+
7
+ ## Context
8
+
9
+ The Player System needs to show guild-issued quests, progress, failure state,
10
+ and reward expectations without becoming the source of guild contract truth.
11
+ The same quest can be displayed alongside internal System missions, so
12
+ advisory recommendations must not be confused with guild-owned status,
13
+ consequences, rank gates, or rewards.
14
+
15
+ ## Decision
16
+
17
+ `@plasius/ai-game` owns the portable guild-quest contract boundary under
18
+ `isekai.player-system.guild-quests.enabled`. Each quest separates
19
+ `guildTruth` from `systemAnnotations`. Guild truth contains the guild contract
20
+ identity, revisioned status, objective progress, failure details, and a
21
+ preview-only reward model. System annotations contain only advisory
22
+ recommendations, synergy codes, linked mission identifiers, and reason codes.
23
+
24
+ Synchronizations carry a guild authority revision, quest upserts, and explicit
25
+ removed-quest tombstones. A reward preview is never a grant; the guild remains
26
+ the authority for eligibility, reward resolution, rank gates, and consequences.
27
+
28
+ The package validates and freezes public payloads. Runtime repositories own
29
+ feature-flag evaluation, authorization, persistence, conflict resolution, and
30
+ actual guild operations.
31
+
32
+ ## Alternatives considered
33
+
34
+ - Put guild-quest models in the site: rejected because package consumers would
35
+ duplicate authority and synchronization semantics.
36
+ - Merge System recommendations into guild status: rejected because advisory
37
+ metadata could be mistaken for authoritative state.
38
+ - Treat an empty quest list as a full synchronization: rejected because a
39
+ partial or failed sync could delete valid quests; tombstones make removals
40
+ explicit.
41
+
42
+ ## Consequences
43
+
44
+ - Guilds remain the source of truth while Player System consumers receive a
45
+ stable, portable read contract.
46
+ - Consumers can recompute or discard System annotations without mutating guild
47
+ state.
48
+ - Runtime adapters must preserve authority revisions and must not turn reward
49
+ previews into client-side grants.
@@ -15,5 +15,7 @@
15
15
  - [ADR-0013: Adaptive mission contract boundary](./adr-0013-adaptive-mission-contract-boundary.md)
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
+ - [ADR-0019: Guild-quest synchronization and authority boundary](./adr-0019-guild-quest-synchronization-and-authority-boundary.md)
18
19
  - [ADR-0016: Observed event log and gossip export contract boundary](./adr-0016-observed-event-log-and-gossip-export-contract-boundary.md)
19
20
  - [ADR-0017: Tutorial contract boundary](./adr-0017-tutorial-contract-boundary.md)
21
+ - [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.2",
3
+ "version": "0.6.4",
4
4
  "description": "Game-domain AI contracts for player action validation, NPC actions, gossip, and feedback.",
5
5
  "type": "module",
6
6
  "sideEffects": false,