Adopt the shared party roster contract

This commit is contained in:
2026-11-30 00:03:54 +00:00
parent f923d75562
commit d1bf1fbfff
30 changed files with 233 additions and 238 deletions

View File

@@ -1,71 +1,27 @@
# Canonical Party Input
`party.yml` is a campaign-owned roster input. Its main document must declare
`narratio.party.v1` when Narratio resolves the roster. Local party files may
import fragments; fragments need no version header.
`party.yml` is a campaign-owned roster conforming to the [shared RPG party
contract](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/rpg/party/v0.2.0/semantics.md).
ConfigKit resolves native imports before Narratio validates the complete roster.
Shared extensions and the authored null or empty `aliases` values survive in the
prepared party document and native inspection.
```yaml
schema_version: narratio.party.v1
Narratio additionally requires a nonempty roster, stable character IDs using the
configured-artifact key grammar, player and character names, and at least one
class per character. Names, aliases, and class names must be nonempty, trimmed
strings without control characters. Character names and aliases cannot be
ambiguous under case-insensitive comparison; class names cannot repeat within
one character. Player names may repeat. A supplied class level must be positive.
characters:
arannis:
player:
name: Eric
character:
name: Arannis
alias:
- Ari
- The Grey Owl
classes:
- name: wizard
level: 8
```
`characters` is a non-empty mapping. Each key is a stable character ID using
the configured-artifact key grammar: a lowercase ASCII letter followed by zero
or more lowercase ASCII letters, digits, or underscores. Character order is
preserved where roster order matters.
Every entry has `player.name`, `character.name`, and a non-empty
`character.classes` list. Class entries require a non-empty `name` and may
include a positive integer `level`. The optional, intentionally singular
`character.alias` field is a list. Names, aliases, and class names must be
non-empty, trimmed display strings without control characters. Character names
and aliases must be unique across the full roster under Unicode-aware
case-insensitive comparison; player names may repeat.
The document has exactly one YAML document and accepts no unknown fields.
`schema_version` is required: a missing, wrong, or malformed value is an error.
## Migration
Unversioned party inputs are rejected. Replace each legacy party document with
the versioned structure above, move each roster entry under `characters`, and
remove separate player and session-party settings: those keys are unsupported.
The configuration rules and source-relative path behavior are defined in the
[Configuration Reference](../config.md).
The maintained [party example](../../examples/campaigns/sample-campaign/party.yml)
shows the shared marker and plural `aliases` field. The configuration reference
owns party selection and source-relative paths.
## Derived players document
During `prepare`, Narratio renders the effective roster as standalone canonical
`inputs/party.yml` and writes this deterministic players-only projection to
`inputs/players.yml`:
```yaml
schema_version: narratio.players.v1
players:
- name: Eric
character:
id: arannis
name: Arannis
alias:
- Ari
- The Grey Owl
```
There is one entry per character, sorted by stable character ID. Repeated
player names remain separate entries. The optional `alias` list retains its
declared order and is omitted when empty. The projection carries no class
data. Its prepared manifest record is marked `derived_from_party`; it is not a
separate user-provided `players_file`.
During preparation, Narratio writes the resolved shared roster to
`inputs/party.yml` and derives `inputs/players.yml`. The projection uses
`narratio.players.v1`, contains one entry per character sorted by stable ID,
and keeps its existing singular `alias` field. It contains player and character
names and aliases, but no class data. Repeated player names remain separate
entries. Its manifest source is `derived_from_party`.

View File

@@ -157,8 +157,9 @@ runner and restore entry points, not just the version comparison function.
Verification: focused path-model, layout, reference-snapshot, and run-local tests
passed with Go 1.27.4. The broader `internal/stage` test run still has two
publication failures because previous-session publication enumeration uses the
old path; its migration belongs to Stage 18. Root reports/config paths remain
temporarily in use by producers until their routing changes in later stages.
old path; its migration belongs to Stage 18. Restore tests also retain old
previous-session paths and are assigned to Stage 19. Root reports/config paths
remain temporarily in use by producers until their routing changes later.
**Read:** roadmap “Final layout and ownership”; [Workspace Internals](../internal/workspace.md).
Entry points: `internal/artifacts/paths.go`, layout creation in its local store,
@@ -182,6 +183,11 @@ configurable root. This stage defines paths; producer routing follows later.
## Stage 4 — Adopt the shared roster with Narratio-wide validation
**Complete.** Commit: `Adopt the shared party roster contract`.
Verification: `go test ./internal/config ./internal/domaininput ./internal/doccheck`
and focused party/roster stage tests passed with Go 1.27.4. A broader app/stage
run has the previously recorded publication and restore path transitions only.
**Read:** roadmap “Narratio-wide roster requirements”; shared party semantics;
[Party Contract](../integrations/party.md). Entry points: `internal/config/party.go`,
party acquisition/rendering, `artifact_families.go`, and native party inspection.

View File

@@ -91,12 +91,12 @@ Symptom:
Likely cause:
- the campaign party main document is unversioned, or names a
schema other than `narratio.party.v1`.
schema other than `maximumdirect.rpg.party.v1`.
Safe fix:
- replace the main file with a versioned
[`narratio.party.v1` party](./integrations/party.md); do not add a version
[`maximumdirect.rpg.party.v1` party](./integrations/party.md); do not add a version
marker to an otherwise incompatible legacy structure. The versioned party is
the only configured roster authority.