Document prerequisite history and close the audit finding

This commit is contained in:
2026-12-02 14:37:39 +00:00
parent 663e02e21e
commit b82ab47c6c
9 changed files with 59 additions and 32 deletions

View File

@@ -60,8 +60,9 @@ the effective analyze set contains enabled definitions. With `--artifacts`, the
exact named configured definitions become the effective set for that invocation, exact named configured definitions become the effective set for that invocation,
regardless of their `enabled` value. The effective-set resolver itself does not regardless of their `enabled` value. The effective-set resolver itself does not
expand dependencies. Shared domain catalog derivation has materialized the sorted expand dependencies. Shared domain catalog derivation has materialized the sorted
union of explicit ordering edges and configured-artifact input edges, and the analyze union of explicit ordering edges and configured-artifact input edges. The
work planner closes targets over that one concrete prerequisite graph. shared artifact closure orders targets and their prerequisites on that one concrete
graph; the analyze work planner uses that order for its decisions.
Availability is separate from executability. Invocation selection normalizes a Availability is separate from executability. Invocation selection normalizes a
family selection into its concrete generated members before this resolver runs. family selection into its concrete generated members before this resolver runs.
The effective set retains optional family The effective set retains optional family
@@ -166,7 +167,9 @@ Validation by content type:
`CollectPreviousArtifactRequirements`: `CollectPreviousArtifactRequirements`:
- scans the effective configured artifact set; - expands the effective target set to its full configured prerequisite closure,
including disabled prerequisites, independently of artifact reuse;
- scans only definitions in that closure;
- extracts only canonical previous-session sources; - extracts only canonical previous-session sources;
- deduplicates by artifact key; - deduplicates by artifact key;
- merges required and optional references (required wins); - merges required and optional references (required wins);
@@ -294,7 +297,7 @@ physical layout.
`internal/artifacts/current_state_commit.go`, `internal/artifacts/current_state_commit.go`,
- Paths and keys: `internal/artifacts/paths.go`, - Paths and keys: `internal/artifacts/paths.go`,
`internal/artifacts/s3_keys.go` `internal/artifacts/s3_keys.go`
- Previous requirements: `internal/artifacts/previous_requirements.go` - Previous requirements: `internal/artifacts/previous_requirements.go`, `internal/artifacts/dependencies.go`
- Tests: `internal/artifacts/artifact_resolver_test.go`, - Tests: `internal/artifacts/artifact_resolver_test.go`,
`internal/artifacts/catalog_test.go`, `internal/artifacts/catalog_test.go`,
`internal/artifacts/extraction_catalog_test.go`, `internal/artifacts/extraction_catalog_test.go`,

View File

@@ -54,6 +54,8 @@ Planner behavior:
For a non-dry-run restore, planning/classification happens only after acquiring For a non-dry-run restore, planning/classification happens only after acquiring
the workspace lock. Runner manifest/reuse checks acquire that same lock first. the workspace lock. Runner manifest/reuse checks acquire that same lock first.
Restore uses the default enabled targets and their full prerequisite closure to
collect previous requirements as described in [Artifact Internals](artifacts.md#previous-requirement-collection).
Previous-cache readiness is resolved through `previouscache.Resolve` for restore, Previous-cache readiness is resolved through `previouscache.Resolve` for restore,
prepare, status, and validation. Each requirement selects the unique prepare, status, and validation. Each requirement selects the unique
`published_output` for its canonical source in the pointer-selected commit, `published_output` for its canonical source in the pointer-selected commit,

View File

@@ -52,7 +52,8 @@ Supported source families:
- makes a non-executable configured artifact reusable only when its current - makes a non-executable configured artifact reusable only when its current
manifest record and durable output pass the configured-artifact evidence manifest record and durable output pass the configured-artifact evidence
contract; an incidental or stale canonical file is unavailable. contract; an incidental or stale canonical file is unavailable.
- validates selected artifact dependency order (cycle-safe topo ordering). - uses the shared artifact closure and cycle-safe dependency ordering described in
[Artifact Internals](artifacts.md#previous-requirement-collection).
- consumes only the concrete dependency graph derived in the shared domain catalog; - consumes only the concrete dependency graph derived in the shared domain catalog;
planning, prerequisite closure, execution, reuse, invalidation, and semantic planning, prerequisite closure, execution, reuse, invalidation, and semantic
evidence do not infer a second graph from inputs. evidence do not infer a second graph from inputs.
@@ -138,7 +139,8 @@ Supported source families:
order after the complete reconciled collection has been checkpointed; order after the complete reconciled collection has been checkpointed;
unrelated stale records do not make an otherwise successful partial unrelated stale records do not make an otherwise successful partial
invocation fail. invocation fail.
- resolves previous-session sources from local `previous/` cache only. - resolves previous-session sources from manifest-backed local `previous/` cache
only; preparation collects requirements for the selected prerequisite closure.
- runs optional render-debug, then artifact execution. - runs optional render-debug, then artifact execution.
- validates non-empty output files and materializes canonical outputs. - validates non-empty output files and materializes canonical outputs.
- shares effective prompt context and variables with requirements inspection; - shares effective prompt context and variables with requirements inspection;

View File

@@ -9,7 +9,7 @@ Materialize canonical current-session inputs before processing stages.
- resolved campaign, session, and pipeline configuration - resolved campaign, session, and pipeline configuration
- the stable speakers input, inline autocorrection rules, canonical party, and optional glossary selections - the stable speakers input, inline autocorrection rules, canonical party, and optional glossary selections
- one resolved local or S3 audio source - one resolved local or S3 audio source
- enabled configured artifact input requirements for previous-session sources - previous-session input requirements from selected targets and their configured prerequisites
## Outputs ## Outputs
@@ -44,7 +44,9 @@ Materialize canonical current-session inputs before processing stages.
size, and source provenance, including an empty list when no rules apply. size, and source provenance, including an empty list when no rules apply.
- renders standalone effective campaign, session, and canonical party documents, - renders standalone effective campaign, session, and canonical party documents,
and deterministically generates the prepared players projection. and deterministically generates the prepared players projection.
- scans enabled configured artifact inputs for `narratio.previous_session.artifact.*` requirements. - collects `narratio.previous_session.artifact.*` requirements from the selected
targets and their full prerequisite closure, including disabled prerequisites;
see [previous requirement collection](artifacts.md#previous-requirement-collection).
- clears managed `inputs/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; - resolves the pointer-selected previous source through the shared resolver;
- downloads previous manifest/artifacts; - downloads previous manifest/artifacts;

View File

@@ -422,6 +422,8 @@ Selection behavior:
- validates names against the derived concrete catalog and family selections; - validates names against the derived concrete catalog and family selections;
- selects explicit analyze targets and permits their required configured - selects explicit analyze targets and permits their required configured
prerequisites to be reused or rebuilt first; prerequisites to be reused or rebuilt first;
- uses those targets and their full prerequisite closure when preparation
collects previous-session input requirements;
- filters publish rules for `narratio.artifact.<name>` sources only; - filters publish rules for `narratio.artifact.<name>` sources only;
- does not suppress built-in transcript, bounds, or explicitly configured - does not suppress built-in transcript, bounds, or explicitly configured
`narratio.extraction.<name>` publish sources; and `narratio.extraction.<name>` publish sources; and
@@ -657,8 +659,9 @@ Default restore scope:
- the committed session manifest, prepared inputs, and transcript/artifact - the committed session manifest, prepared inputs, and transcript/artifact
objects declared by the selected remote commit objects declared by the selected remote commit
- `inputs/previous/**` when needed by configured previous-session artifact inputs; - `inputs/previous/**` when needed by enabled targets or their configured
each is selected from its exact committed `published_output` declaration prerequisites, including disabled prerequisites; each is selected from its
exact committed `published_output` declaration
Optional: Optional:

View File

@@ -41,10 +41,9 @@ their scope. Unless assigned otherwise, a finding remains independent audit
remediation. Shared code does not make a refactoring a prerequisite or assign remediation. Shared code does not make a refactoring a prerequisite or assign
the whole finding to a roadmap. the whole finding to a roadmap.
Eleven entries are closed by the safety, transfer, audio discovery, and S3 Twelve entries are closed by the safety, transfer, audio discovery, S3
planning work; 32 planning, and prerequisite-history work; 31 remain open. **Planned** identifies
remain open. **Planned** identifies an agreed remedy awaiting an agreed remedy awaiting implementation. **Potentially eliminated** requires verification that the offending
implementation. **Potentially eliminated** requires verification that the offending
lifecycle is removed. **Coordinate** identifies shared changes, not a commitment lifecycle is removed. **Coordinate** identifies shared changes, not a commitment
that the roadmap implements the entire finding. Findings close only after their that the roadmap implements the entire finding. Findings close only after their
relevant behavior or code removal is verified. Original audit reports, finding relevant behavior or code removal is verified. Original audit reports, finding
@@ -326,27 +325,32 @@ Related: [CAT-14](#cat-14--p3-close-temporary-committed-manifest-cleanup-gaps).
### CAT-10 — P2: Hydrate previous inputs for the full analysis prerequisite closure ### CAT-10 — P2: Hydrate previous inputs for the full analysis prerequisite closure
Status: Open Status: Closed
**Disposition / owner.** Coordinate — the [restore roadmap](../session-restore.md#adapt-preparation-and-operator-reporting) **Closure.** The shared closure and prerequisite-inclusive history collector were
changes preparation and previous-session acquisition. The prerequisite-inclusive implemented in [a057ce3](https://forge.maximumdirect.net/eric/narratio/commit/a057ce3)
requirement fix still needs explicit implementation and regression coverage; and [7a25a50](https://forge.maximumdirect.net/eric/narratio/commit/7a25a50).
publication-inventory-only discovery does not supply the missing closure. Preparation-to-analysis and semantic resume regressions landed in
[76f9918](https://forge.maximumdirect.net/eric/narratio/commit/76f9918), with
restore, status, and preflight coverage in
[663e02e](https://forge.maximumdirect.net/eric/narratio/commit/663e02e).
The [restore roadmap](../session-restore.md#adapt-preparation-and-operator-reporting)
retains its separate acquisition and workflow changes.
Original findings: [FC-01](01-correctness.md#fc-01--p2-previous-session-hydration-omits-analysis-prerequisites), Original findings: [FC-01](01-correctness.md#fc-01--p2-previous-session-hydration-omits-analysis-prerequisites),
[TE-03](08-testing.md#te-03--p2-previous-session-hydration-coverage-stops-short-of-dependency-closure). [TE-03](08-testing.md#te-03--p2-previous-session-hydration-coverage-stops-short-of-dependency-closure).
**Issue.** Preparation and previous-cache restore collect history requirements **Original issue.** Preparation and previous-cache restore collected history requirements
from enabled/explicit targets only, while analyze separately schedules from enabled/explicit targets only, while analyze separately scheduled
prerequisites. A prerequisite's required history can remain unavailable despite an prerequisites. A prerequisite's required history could remain unavailable despite an
available remote product; optional history can disappear silently. Existing tests available remote product; optional history could disappear silently. Existing tests
cover these mechanisms separately. covered these mechanisms separately.
**Direction.** Use one prerequisite-inclusive requirements view for preparation, **Implemented direction.** A shared prerequisite-inclusive requirements view feeds
semantic evidence, store composition, and restore. Retain explicit targets preparation, semantic evidence, store composition, and restore. Explicit targets
separately for force/publication policy. Add selected-child/disabled-prerequisite remain separate for force and publication. Regression tests cover selected children
preparation-to-analysis coverage for required and optional history, unrelated-work and disabled prerequisites, required and optional history, unrelated-work exclusion,
exclusion, and restore. and restore.
Related: [CAT-17](#cat-17--p3-centralize-configured-artifact-dependency-queries). Related: [CAT-17](#cat-17--p3-centralize-configured-artifact-dependency-queries).
@@ -505,6 +509,10 @@ uses a fixed stage/output coverage mapping, not this configured-artifact graph.
Do not make graph consolidation a prerequisite; coordinate only where existing Do not make graph consolidation a prerequisite; coordinate only where existing
artifact reconciliation is actually changed. artifact reconciliation is actually changed.
The CAT-10 work moved the existing prerequisite closure, ordering, and dependency
normalization to `internal/artifacts`; broader graph ownership and dependent
queries remain open.
Original findings: [CX-05](03-complexity.md#cx-05--p3-artifact-dependency-semantics-span-several-representations-and-owners), Original findings: [CX-05](03-complexity.md#cx-05--p3-artifact-dependency-semantics-span-several-representations-and-owners),
[EQ-03](10-equivalence.md#eq-03--p3-configured-artifact-dependency-mechanics-have-multiple-owners), [EQ-03](10-equivalence.md#eq-03--p3-configured-artifact-dependency-mechanics-have-multiple-owners),
[BN-05](11-boundaries.md#bn-05--p3-configured-artifact-graph-operations-are-fragmented-across-domain-owners). [BN-05](11-boundaries.md#bn-05--p3-configured-artifact-graph-operations-are-fragmented-across-domain-owners).

View File

@@ -1,6 +1,6 @@
# CAT-10: Prerequisite-History Hydration # CAT-10: Prerequisite-History Hydration
Status: Pending Status: Complete
## Purpose and scope ## Purpose and scope
@@ -214,7 +214,7 @@ are required.
## Stage 5: Document the corrected scope and close CAT-10 ## Stage 5: Document the corrected scope and close CAT-10
Status: Pending Status: Complete
1. Update [Artifact Internals](../internal/artifacts.md#previous-requirement-collection) 1. Update [Artifact Internals](../internal/artifacts.md#previous-requirement-collection)
to define targets versus prerequisite-inclusive requirements and shared to define targets versus prerequisite-inclusive requirements and shared

View File

@@ -294,6 +294,10 @@ and stage-owned resume/checkpoint handling.
### Adapt preparation and operator reporting ### Adapt preparation and operator reporting
The current prerequisite-inclusive previous-input collector is shared by
preparation, restore, status, and storage composition; retain it while changing
previous-session acquisition.
Review unconditional session audio validation, prepare materialization and reuse, Review unconditional session audio validation, prepare materialization and reuse,
and readiness/composition for actual remaining work. Preserve local per-speaker and readiness/composition for actual remaining work. Preserve local per-speaker
and per-artifact retry behavior while allowing restored completion to bypass and per-artifact retry behavior while allowing restored completion to bypass

View File

@@ -76,7 +76,7 @@ func TestPrepareAndAnalyzeHydratesPrerequisiteHistory(t *testing.T) {
} }
if tc.present { if tc.present {
input := findInputByKind(m.Inputs, preparePreviousInputKindArtifact) input := findInputByKind(m.Inputs, preparePreviousInputKindArtifact)
if input == nil || input.Source != "narratio.previous_session.artifact.session_recap" || input.Checksum != preparePreviousSHA256([]byte("history bytes\n")) { if input == nil || input.Source != "narratio.previous_session.artifact.session_recap" || input.Path != filepath.Join(paths.PreviousArtifactsDir, "session_recap.md") || input.Checksum != preparePreviousSHA256([]byte("history bytes\n")) {
t.Fatalf("history record = %#v", input) t.Fatalf("history record = %#v", input)
} }
if !containsString(capture.accessKeys, seed.ArtifactKey) { if !containsString(capture.accessKeys, seed.ArtifactKey) {
@@ -109,6 +109,9 @@ func TestPrepareAndAnalyzeHydratesPrerequisiteHistory(t *testing.T) {
t.Fatalf("history binding = %q, present = %v", path, exists) t.Fatalf("history binding = %q, present = %v", path, exists)
} }
if tc.present { if tc.present {
if path != filepath.Join(paths.PreviousArtifactsDir, "session_recap.md") {
t.Fatalf("history path = %q", path)
}
bytes, err := os.ReadFile(path) bytes, err := os.ReadFile(path)
if err != nil || string(bytes) != "history bytes\n" { if err != nil || string(bytes) != "history bytes\n" {
t.Fatalf("history = %q, error = %v", bytes, err) t.Fatalf("history = %q, error = %v", bytes, err)