2026-05-18 22:03:59 -05:00
|
|
|
# Stage: polish
|
|
|
|
|
|
|
|
|
|
## Purpose
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
Run Audita polishing on base transcript and produce polished transcript.
|
2026-05-18 22:03:59 -05:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Inputs
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-22 19:05:23 -05:00
|
|
|
- `transcripts/base.json`
|
2026-05-18 22:03:59 -05:00
|
|
|
- `inputs/glossary.yml`
|
|
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Outputs
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-22 19:05:23 -05:00
|
|
|
- `transcripts/polished.json`
|
2026-09-25 15:51:18 +00:00
|
|
|
|
|
|
|
|
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.
|
2026-05-23 12:57:59 +00:00
|
|
|
|
|
|
|
|
## Key Behavior
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-09-02 14:18:51 +00:00
|
|
|
- resolves base transcript only from verified merge manifest output evidence.
|
2026-09-25 15:51:18 +00:00
|
|
|
- invokes an Audita v2 runner with external configuration selectors and
|
|
|
|
|
explicitly forwarded provider credentials; the invocation supplies paths.
|
2026-05-23 12:57:59 +00:00
|
|
|
- validates processed transcript structure (`segments` array required).
|
2026-09-25 15:51:18 +00:00
|
|
|
- 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.
|
2026-05-23 12:57:59 +00:00
|
|
|
|
|
|
|
|
## Invariants
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
- polished transcript schema validation is mandatory.
|
2026-09-25 15:51:18 +00:00
|
|
|
- reports are optional diagnostics; Audita's external configuration may disable
|
|
|
|
|
them. A failed invocation never promotes an incidental transcript.
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-08-30 13:03:13 +00:00
|
|
|
## Resume Semantics
|
|
|
|
|
|
2026-09-25 15:55:38 +00:00
|
|
|
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.
|
2026-08-30 13:03:13 +00:00
|
|
|
|
2026-08-09 21:50:21 +00:00
|
|
|
## 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`,
|
2026-08-30 13:03:13 +00:00
|
|
|
`internal/stage/polish_test.go`,
|
|
|
|
|
`internal/stage/semantic_contracts_refinement.go`
|