Document shared glossaries and downstream preflight

This commit is contained in:
2026-11-27 17:09:21 +00:00
parent 8b9c0e664b
commit 0de73ba25f
22 changed files with 297 additions and 300 deletions

View File

@@ -1,58 +1,23 @@
# Stage: polish
## Purpose
Polish resolves the base transcript from verified merge evidence and all four
prepared glossary documents from manifest-backed input records. It invokes the
Audita adapter with those paths and configured downstream selectors, then
validates the returned transcript before promoting `transcripts/polished.json`.
The transcript is the only canonical output. Available ordinary reports,
stdout/stderr, and the generated invocation record are run-local diagnostics;
Audita's work directory is separately selected. The [Audita contract](../integrations/audita.md)
owns invocation and diagnostic behavior.
Run Audita polishing on base transcript and produce polished transcript.
Polish records the prepared glossary identities as resume evidence alongside
semantic configuration. Changes to effective glossary content require new
polish work through ordinary prepare invalidation. Credentials, executable,
timeout, and diagnostics are operational. Narratio does not fingerprint the
contents of Audita-owned configuration or profiles: force polish after changing
those files behind unchanged selectors. Older evidence is reconsidered when
polish is selected; a downstream-only invocation does not eagerly run it.
## Inputs
- `transcripts/base.json`
- `inputs/glossary.yml`
## Outputs
- `transcripts/polished.json`
The transcript is the only canonical output. Available `errors.yml`,
`recoveries.yml`, and `report.md` remain beside the run-local transcript and
are recorded as diagnostics, not artifact outputs.
## Key Behavior
- resolves base transcript only from verified merge manifest output evidence.
- invokes an Audita v2 runner with external configuration selectors and
explicitly forwarded provider credentials; the invocation supplies paths.
- validates processed transcript structure (`segments` array required).
- validates reported diagnostic paths against the three fixed adjacent names.
- materializes only the canonical transcript; records available reports with
stdout/stderr logs, generated invocation, and safe adapter metadata.
## Invariants
- polished transcript schema validation is mandatory.
- reports are optional diagnostics; Audita's external configuration may disable
them. A failed invocation never promotes an incidental transcript.
## Resume Semantics
Version 2 semantic evidence covers Audita's config path, downstream overlay,
proposal and validation profile selectors, ordered module selection (including
the distinction between omission and an explicit empty list), transcript
description, output schema, and canonical polished-transcript identity.
Credentials, executable path, timeout, and diagnostics are operational and do
not invalidate a successful result. Public credential reference names may
participate in configuration provenance but never expose resolved values.
Narratio fingerprints selections, not the contents of Audita-owned config or
profiles. Force `polish` after changing those files behind unchanged selections.
When polish is selected, older semantic evidence is reconsidered and the stage
reruns; a downstream-only invocation does not eagerly run polish.
## Related Contracts And Tests
- [Audita](../integrations/audita.md) owns subprocess, validation, and failure
semantics.
- [Configuration](../config.md#pipeline) owns operator-selected Audita values.
- Implementation and tests: `internal/stage/polish.go`,
`internal/stage/polish_test.go`,
`internal/stage/semantic_contracts_refinement.go`
A failed invocation does not promote an incidental output. Preflight is an
invocation check after preparation, not a successful polish record. See
[preflight internals](preflight.md), `internal/stage/polish.go`,
`internal/stage/polish_resume.go`, and their focused tests.