Files
narratio/docs/roadmap/remediation.md

153 lines
7.7 KiB
Markdown
Raw Normal View History

# Published Product Import Review
Reviewed commit: `e5d91cb19be27ec25380a6b1306eee49ab9c0977`.
Scope: the thirteen completed stages in [implementation.md](implementation.md)
against the [session-restore roadmap](session-restore.md). The inventory-only
publication/import boundary, durable supplied records, transcript coverage,
render selection, local merge, and ordinary local checkpoints are implemented.
The following gaps remain. This document records review findings, not additional
product requirements or an implementation plan.
## 1. P2: Stop dependency work at accepted supplied analysis products
Status: Complete
Resolution: the analysis planner closes the active work graph at accepted
supplied products, except explicit forced targets. Behavioral regressions cover
preview and execution for a supplied target and a new child, with absent
historical inputs, plus forced replacement. Verified with
`go test ./internal/stage ./internal/artifacts ./internal/manifest`.
Affected stages: 4, 5, and 12.
Evidence: `internal/stage/analyze_plan.go:66` expands the entire target dependency
closure before considering supplied products. Its scheduling loop skips a
supplied target itself but still schedules missing historical prerequisites.
`internal/stage/analyze_fingerprint.go:113` skips fingerprints for supplied
products, while historical prerequisites remain candidates for generation.
A focused diagnostic supplied `session_recap`, selected only that artifact, and
gave its current definition a missing `historical` prerequisite whose input was
an unavailable base transcript. Analysis failed with
`compute execution fingerprint for artifact "historical"` and
`required built-in source "narratio.transcript.base" is unavailable`.
If those old inputs exist, the prerequisite can instead cause unnecessary
generation. The accepted target already satisfies the selected work.
Required remediation: derive actual work with accepted supplied products as
reuse boundaries. Apply that boundary consistently to planning, input checking,
and execution. Preserve prerequisites needed by genuinely executable targets,
explicit-target force behavior, and ordinary local freshness checks. Keep the
existing prerequisite-history collector's separate responsibilities explicit.
Regression coverage: selecting a supplied target with absent historical inputs
reuses it without generation; generating a new child from a supplied prerequisite
does not rebuild that prerequisite's own history; explicitly forcing replacement
still requires the actual generation inputs.
Requirement assessment: the current traversal effectively requires historical
inputs for independent supplied products, contrary to the agreed import model.
## 2. P2: Permit downstream continuation without a supplied transcript
Status: Complete
Resolution: bounded import continuation checks actual consumer inputs rather
than requiring transcript-producer statuses. Reference-only acquisition and
reuse exclude audio checks and collect history for projected generation work.
The import context survives replacement of its last supplied product by a local
checkpoint. Regressions cover configured and extraction inputs, required
references, absent real inputs, historical-input exclusion, and local reuse
after an actual import/replacement. Verified with
`go test ./internal/app ./internal/stage ./internal/artifacts ./internal/config`.
Affected stages: 5, 7, and 12.
Evidence: `internal/app/bounded_prerequisites.go:17` relaxes missing prefix
statuses only when supplied coverage includes transcription.
`internal/app/reference_preparation.go:18` likewise gates reference-only
preparation on a supplied transcript.
A focused diagnostic recorded a valid supplied configured parent artifact,
selected a new child whose only input was that parent, and omitted audio and
transcripts. Bounded analysis failed before execution with
`prerequisite stage "prepare" has unusable status "absent"`.
The selected work consumed no transcript. Partial extraction and configured
product imports must be usable according to their actual consumer inputs.
Required remediation: determine bounded eligibility and necessary preparation
from the selected work and available products. Make needed references available
without requiring an unrelated transcript or producer-stage history. Preserve
actual missing-input errors and normal raw-audio workflow checks. Keep planning
and execution aligned without fabricating prefix execution records.
Regression coverage: import a configured product without any transcript/audio,
generate a child that consumes only that product, and verify plan/execution
agreement. Cover the equivalent extraction-input case and a missing actual
required input. Retain the existing transcript-import workflow tests.
Requirement assessment: a supplied transcript has become an unintended mandatory
entry ticket for otherwise valid artifact-only continuation.
## 3. P3: Include supplied built-ins in local artifact inspection
Status: Complete
Resolution: built-in inspection reports canonical supplied records as recorded
with supplied-product provenance, retaining its payload-free evidence view.
A command-level regression checks both status and artifact inspection after an
actual import, alongside local rendering evidence and absent intermediate
products, and verifies that inspection leaves the manifest unchanged. Verified
with `go test ./internal/app ./internal/doccheck`.
Affected stages: 3, 5, and 13.
Evidence: `internal/app/session_state_command.go:154` replaces built-in catalog
availability with `builtinArtifactInspectionState`, which checks only successful
producer-stage output records (`:244`). Fresh imports deliberately have supplied
records rather than fabricated producer executions.
A focused diagnostic resolved a valid supplied final-trimmed transcript through
the normal resolver, then inspected the same saved manifest. Inspection reported
`narratio.transcript.final_trimmed` as `unavailable`. Both `session artifacts` and
`session status` use this path, so operators receive conflicting availability
information after a successful import.
Required remediation: recognize supplied-product evidence in the local inspection
view. Preserve its lightweight inspection contract and distinguish accepted
products from locally executed producer evidence. Coverage must not make absent
intermediate products appear available.
Regression coverage: inspect a fresh supplied transcript baseline and verify that
the actual imported transcript is reported as recorded/available, while absent
earlier transcript products remain unavailable. Preserve ordinary local-output
inspection behavior.
## 4. P3: Remove retired execution-snapshot APIs from internal documentation
Status: Open
Affected stages: 8, 9, and 13.
Evidence: [Artifact Internals](../internal/artifacts.md), in its current-state
helper list, still names deleted `LoadCurrentState` and
`ValidateCurrentStateIdentity` APIs and describes pointer/manifest run-ID
consistency. Current readers use `LoadCurrentInventory` and publication inventory
identity without fetching a session execution snapshot.
Required remediation: update that focused API/identity description to the
implemented inventory-only reader. Retain the existing publication identity and
transfer checks; this is documentation cleanup, not a protocol change.
Validation: compare the revised names and behavior against current reader code
and run `go test ./internal/doccheck`.
## Review Validation
The existing uncached full test suite, vet, and build passed with Go 1.27.4.
Separate temporary Go overlay tests reproduced findings 1–3 using real internal
collaborators and fake external boundaries. They were diagnostic review probes;
the repository test suite currently lacks these cases. The remediation should
add durable regressions at the relevant behavioral boundaries.