Files
narratio/docs/roadmap/remediation.md

250 lines
15 KiB
Markdown
Raw Normal View History

2026-11-30 03:11:48 +00:00
# Shared pipeline cutover review findings
Reviewed Narratio commit `2ec43305da6c47709909d5cee167c7be0358b311`
against all 23 stages in [implementation.md](implementation.md) and the target
in [pipeline.md](pipeline.md). The catalog migration and controlled consumer
boundaries were included. This document records required remediations; it does
not implement them or change the agreed operator contract.
## 1. Preserve available producer files after failed extraction
**Priority:** P2
**Status:** Pending
**Stages:** 11–12; failure-evidence and workspace requirements in 16 and 21–23.
**Evidence:** [extract.go](../../internal/stage/extract.go),
`extractStage.Run`, lines 154–164. Its deferred cleanup removes the entire
`notarius-output` root whenever `accepted` remains false. That includes a
subprocess failure, malformed completion, required-file failure, or failed
promotion after Notarius has already written files.
The roadmap's Notarius completion section explicitly accounts for report/capture
failure after artifact publication and requires retaining available files and
diagnostics without recovering success from them. The current cleanup discards
those producer files before an operator can inspect them. Separate stdout/stderr
logs and debug captures can survive, but they do not replace the discarded lane
payloads and optional domain evidence. This is a target-state gap, not a request
to treat partial results as successful extraction.
**Reproduction:** a temporary Go-overlay test used the existing
`nativeExtractFixture`, returned an adapter error representing failed completion
delivery, and checked an existing producer lane after `extractStage.Run` failed.
The lane was gone (`no such file or directory`). The test added no repository
file and made no model call.
**Required change:** retain the producing attempt's Notarius output tree on
failure, under its existing run-local destination. Keep the failure result and
existing canonical-promotion checks. Continue removing Narratio-owned temporary
product copies where appropriate. Failed producer output remains attempt
evidence subject to the ordinary run lifecycle; it gains neither automatic
success/reuse authority nor a new permanent-retention guarantee.
**Verification:** add a durable regression at the extraction stage boundary for
producer files present when report delivery fails, and for successful subprocess
completion followed by missing/invalid required lanes. Confirm files remain
inspectable, the stage fails, and no incidental output becomes available as a
successful extraction. Preserve prior canonical files where failure occurs
before promotion, as the existing staging test already requires.
## 2. Limit cleanup's managed-view validation to the views it owns
**Priority:** P2
**Status:** Pending
**Stages:** 15 and 20; requirement-strengthening review in 21–23.
**Evidence:** [attempt_views.go](../../internal/fileops/attempt_views.go),
`ManagedAttemptTargets`, especially lines 179–188;
[cleanup_retained_bundle.go](../../internal/stage/cleanup_retained_bundle.go),
lines 36–39. Cleanup enumerates every entry in the session's `logs/` and
`debug/` roots and passes each to `existingManagedView`. A regular file or
ordinary directory causes an error even when unrelated to a stage view or to
the run being cleaned.
For example, an operator's `logs/README.txt` blocks both cleanup execution and
cleanup resume checks with a managed-view conflict. Finder metadata or other
unrelated entries can have the same effect. This introduces an undocumented
requirement that those directory roots contain exclusively valid managed
symlinks. The selected contract requires protecting Narratio's latest-attempt
targets and rejecting conflicts at a view being installed; it does not require
rejecting unrelated operator content across the entire directory.
**Reproduction:** a temporary Go-overlay test created a valid extraction result
and managed attempt views, added `logs/README.txt`, and evaluated
`cleanRunWithRetainedBundle(..., false)`. It failed with
`managed logs view "README.txt" conflicts with existing content`, before any
deletion. The test changed no repository files.
**Required change:** identify and validate Narratio-managed views narrowly when
computing protected run targets. Leave unrelated entries untouched and do not
make them prerequisites for cleanup. Preserve confinement, avoid following
arbitrary links, and retain conflict rejection when an actual managed stage view
is created or replaced. Do not fix this by documenting or enforcing a new
exclusive-directory prohibition.
**Verification:** cover unrelated regular files/directories in both roots,
correct protection of valid latest links, and unchanged rejection of unsafe or
conflicting owned views. Exercise cleanup and its resume check; unrelated files
must remain untouched and eligible run cleanup must still complete.
## 3. Replace obsolete commands in runtime recovery guidance
**Priority:** P2
**Status:** Pending
**Stages:** 9, 12, 16, and the integration/documentation reconciliation in 21–23.
**Evidence:** [extract_references.go](../../internal/stage/extract_references.go),
line 278; [analyze_input_identity.go](../../internal/stage/analyze_input_identity.go),
lines 131, 137, 187, and 193; the built-in source recovery helpers in
[analyze.go](../../internal/stage/analyze.go) and
[render.go](../../internal/stage/render.go).
Missing or invalid prepared inputs, extraction outputs, and transcript inputs
still produce commands of the form `narratio run-stage prepare SESSION --force`.
The native CLI has no `run-stage` route. Running that recommended command exits
with status 2; running it without the flag confirms the unknown-command error.
The current CLI reference correctly documents `run SESSION --stage STAGE`.
This guidance predates the sprint, but remains active in the newly integrated
prepared-reference, analysis, and render workflows. Several existing tests assert
the obsolete command substring, so the green suite perpetuates the mismatch.
This is an inherited operator-recovery gap, not a regression introduced by the
Notarius protocol migration.
**Required change:** use `narratio run SESSION --stage STAGE --force` in active
recovery messages and reconcile the corresponding tests. Preserve useful source
and stage context. Historical release notes and migration tables may correctly
name retired commands and should not be rewritten. No compatibility alias is
needed.
**Verification:** exercise missing/corrupt prepared references, required analysis
inputs, and render inputs, and check that the suggested command has a supported
native route and flags. Test semantic recovery guidance rather than snapshotting
whole diagnostic strings. No generation or paid provider is needed to establish
CLI syntax compatibility.
## 4. Reconcile accepted absolute analysis destinations with artifact identity
**Priority:** P2
**Status:** Pending
**Stages:** 10 and 16; analysis reuse and lifecycle integration in 18–19 and 21.
**Evidence:** [product_destinations.go](../../internal/config/product_destinations.go),
`validateProductDestinations`, lines 19–35 and 63–65, accepts an absolute
destination directly under the selected session's `artifacts/` directory.
[analyze_fingerprint.go](../../internal/stage/analyze_fingerprint.go),
`normalizedAnalyzeOutputIdentity`, lines 251–260, instead passes the configured
value to a relative-only normalizer. Analysis checkpoint creation uses that same
helper. [analyze_evidence.go](../../internal/artifacts/analyze_evidence.go),
`InspectAnalyzeEvidence`, lines 77–82, independently rejects the absolute form.
An operator can therefore supply a valid flat destination, pass configuration
validation, and then fail analysis with `relative path must not be absolute`.
Selecting the equivalent absolute path for an already completed artifact also
makes it non-resumable. Catalog hydration consequently cannot advertise that
artifact as current for dependent analysis or publication. This is an existing
relative-only assumption left unreconciled with the Stage 10 decision to retain
both absolute and relative syntax for valid canonical destinations, rather than
a new regression in the fingerprint helper itself.
**Reproduction:** temporary Go-overlay tests confirmed that concrete-artifact
and product-destination validation accept an absolute canonical path. Separate
tests using `currentAnalyzeFixture` confirmed that changing only
`artifacts/session_recap.md` to its absolute equivalent makes resume return
non-resumable and makes forced analysis fail during fingerprint computation.
The probes changed no repository code and used no real subprocess or provider.
**Required change:** derive one consistent session-relative product identity
from either supported syntax using the selected session root, and use it for
analysis fingerprints, checkpoint records, and evidence/catalog resolution.
Keep the ConfigKit result unchanged and retain the existing flat-placement and
confinement rules. Reconcile publication and restore consumers of configured
output paths as necessary. Do not resolve the mismatch by imposing a new ban
on valid absolute destinations.
**Verification:** cover successful analysis and unchanged resume for equivalent
absolute/relative canonical paths, current artifact resolution and dependent
inputs, and publication/restore with that configuration. Manifest product
identities remain portable and session-relative; paths outside the permitted
product directory remain invalid under the existing placement contract.
2026-11-30 03:11:48 +00:00
## Review coverage and verification
| Implementation stages | Inspected boundaries |
| --- | --- |
| 1–3 | Offline schema compilation/resources, new-state rejection before execution/restore, and canonical workspace paths. |
| 4–6 | Shared roster profile and forwarding, campaign/session resolution and presence semantics, native inspection, initialization and template selection. |
| 7 | Catalog source migration, local validator/CI, schema provenance, and independent validation. |
| 8–10 | Standalone inputs and autocorrection, four individual and combined envelopes, reference snapshots, output naming/collisions and native controls. |
| 11–14 | Native completion/required products, fallback/reuse evidence, Audita inputs/destinations, and shared pipeline-aware readiness. |
| 15–17 | Managed views, producer log/debug/product routing, and single-copy audio acquisition. |
| 18–20 | Publication declarations, canonical restore/previous inputs and diagnostics, role-aware cleanup/retention. |
| 21–23 | Reuse and bounded workflows, maintained examples, controlled real consumers, canonical documentation, and attribution. |
Passing checks during review used Go 1.27.4:
- Narratio: `go test ./...`, `go test -race ./...`, `go vet ./...`, and
`go build ./...`; CGO-disabled CLI cross-builds for Linux amd64/arm64 and
darwin arm64. The macOS result establishes compilation, not native execution.
- Catalog: `go test ./...` and `go run ./cmd/validate`.
- The catalog compatibility script against the pinned Audita v4.3.0 and
Notarius v0.10.0 source builds with local HTTP provider fixtures. All ten
Notarius lanes passed; initial, cached, and forced runs used 9, 0, and 9
provider calls respectively. No paid provider was used.
- All six vendored schema/semantic files matched the released schema checkout
byte for byte. Consumer binary VCS revisions matched the roadmap baselines.
The two temporary regression probes reproduced findings 1 and 2 despite the
green existing suites. Finding 3 was confirmed against the built native CLI
and its existing diagnostic assertions. These expose coverage gaps, not flaky
default tests. No further required remediation was identified in the initial
reviewed scope.
### Integration follow-up
A second review used Narratio commit
`d3d7728f1f3809d65ab8256cd6973700bca31d93` (the implementation source is unchanged
from the reviewed commit above), following the implementation stages in order.
It examined new behavior against existing consumers and lifecycle machinery:
| Stage | Integration boundary reviewed |
| --- | --- |
| 1 | Shared structural/semantic validation consumes native resolved values; schema loading stays offline. |
| 2 | The v2 marker flows through local execution, remote discovery, previous-session acquisition, and restore. |
| 3 | Canonical path changes flow into stage staging, prepared references, previous inputs, and manifest resolution. |
| 4 | Shared roster acquisition and forwarding agree with the existing players projection and character-family derivation. |
| 5 | Campaign defaults and session clearing/replacement preserve independent field and resource-origin semantics. |
| 6 | Native acquisition/inspection and session initialization retain separate configuration results and template precedence. |
| 7 | The catalog's indexed shared sources retain consumer selectors and pass its independent validation. |
| 8 | Prepared snapshots and generated autocorrection feed existing Seriatim inputs and prepare resume checks. |
| 9 | Individual/combined vocabulary, prepared-source IDs, verified references, and content-change evidence agree. |
| 10 | Flat destination validation was compared with existing analysis identity code; finding 4 records the mismatch. |
| 11 | Native completion parsing retains exit-status authority and shares runtime argument construction with readiness. |
| 12 | Canonical extraction evidence feeds catalog, analysis, and reuse independently of the retained bundle; finding 1 still applies. |
| 13 | Audita execution/readiness use the same saved inputs and preserve existing transcript/report acceptance. |
| 14 | Selected-work projection controls readiness, real/synthetic input choice, lazy adapters, and isolated probe diagnostics. |
| 15 | Attempt transitions, failed attempts, self-skips, reuse, and latest-view ownership agree with runner lifecycle. |
| 16 | Transcript/product promotion and producer diagnostic routing remain distinct; finding 4 also affects analysis execution. |
| 17 | Audio acquisition and restore retain one verified copy while per-speaker checkpoints remain manifest-backed. |
| 18 | Prepared-file enumeration, product discovery, immutable declarations, lock carry, and current-run diagnostics preserve their roles. |
| 19 | Committed product mapping, rebased session references, previous inputs, audio verification, and restore conflict/recovery paths were inspected. |
| 20 | Cleanup authorization and role-based retention preserve latest targets and durable bundles; finding 2 still applies. |
| 21 | Semantic resume, bounded selection, artifact evidence, and operator recovery were checked; findings 3–4 remain applicable. |
| 22 | Assembled campaign/consumer workflows and controlled compatibility evidence were checked against the pinned releases. |
| 23 | Canonical documents, examples, recorded verification, and scope/ownership boundaries were reconciled with the implemented interfaces. |
The follow-up reran `go test ./...`, `go vet ./...`, `go build ./...`, documentation
checks, and focused configuration, stage, application, and managed-view
regressions with Go 1.27.4. Catalog `go test ./...` and `go run ./cmd/validate`
also passed at `016473fd16b15847f3e913670c423faa7c35720b`. Existing tests passed;
the temporary absolute-path probes exposed finding 4. Findings 1–3 remain
pending. No fixes, compatibility shims, new product restrictions, or upstream
changes were made.