Prepare resolved documents and autocorrection rules

This commit is contained in:
2026-11-30 00:31:36 +00:00
parent 5c4ca20b11
commit 4e94b2157b
22 changed files with 197 additions and 335 deletions

View File

@@ -7,8 +7,7 @@ Materialize canonical current-session inputs before processing stages.
## Inputs
- resolved campaign, session, and pipeline configuration
- stable speakers and autocorrect inputs, the canonical party, and optional glossary selections
- optional spell-catalog overlay
- the stable speakers input, inline autocorrection rules, canonical party, and optional glossary selections
- one resolved local or S3 audio source
- enabled configured artifact input requirements for previous-session sources
@@ -22,10 +21,9 @@ Materialize canonical current-session inputs before processing stages.
- `inputs/glossaries/{party,campaign,setting,spells}.yml`
- `inputs/players.yml`
- `inputs/party.yml`
- optional `inputs/spell_catalog.json`
- `audio/*.flac`
- optional `previous/manifest.json`
- optional `previous/artifacts/**`
- optional `inputs/previous/manifest.json`
- optional `inputs/previous/artifacts/**`
- deterministic `manifest.inputs` entries (checksums + provenance)
## Key Behavior
@@ -38,13 +36,12 @@ Materialize canonical current-session inputs before processing stages.
- gives distinct local source paths with the same basename deterministic unique
prepared filenames so neither source is overwritten.
- materializes S3 audio through spool/cache-aware logic.
- materializes a configured spell catalog with checksum and provenance, or
safely removes an obsolete canonical spell catalog and its manifest record
when the effective input is omitted.
- writes effective autocorrection rules as a Seriatim envelope, with checksum,
size, and source provenance, including an empty list when no rules apply.
- renders standalone effective campaign, session, and canonical party documents,
and deterministically generates the prepared players projection.
- scans enabled configured artifact inputs for `narratio.previous_session.artifact.*` requirements.
- clears managed `previous/` state on every invocation, then, when requirements exist:
- clears managed `inputs/previous/` state on every invocation, then, when requirements exist:
- resolves the pointer-selected previous source through the shared resolver;
- downloads previous manifest/artifacts;
- records previous inputs in `manifest.inputs`.
@@ -57,10 +54,10 @@ cache path, then validates the committed checksum, size, and generation.
## Invariants
- only `prepare` hydrates canonical `previous/` cache state.
- managed previous artifacts are stored under `previous/artifacts/**` without
- only `prepare` hydrates canonical `inputs/previous/` state.
- managed previous artifacts are stored under `inputs/previous/artifacts/**` without
duplicate `artifacts/artifacts/` nesting.
- managed `previous/` state represents only the current requirement set.
- managed `inputs/previous/` state represents only the current requirement set.
- `manifest.inputs` ordering is deterministic (`kind`, `path`).
## Resume Evidence

View File

@@ -323,6 +323,13 @@ require Narratio or Audita binaries for catalog validity.
## Stage 8 — Prepare campaign, session, speaker, and autocorrection inputs
**Complete.** Commit: `Prepare resolved documents and autocorrection rules`.
Verification: focused imported standalone-document, empty and populated rule,
checksum/provenance, reuse/invalidation, relocation, and prepared-source tests
passed with Go 1.27.4. The broader stage suite has the previously recorded
publication path failures and one maintained-example failure; the example
migration is assigned to Stage 22.
**Read:** roadmap “Shared acquisition and prepared inputs”;
[Prepare Internals](../internal/stage-prepare.md). Entry points: `prepare.go`,
`prepare_resume.go`, prepared-input identities, config renderers, and semantic contracts.