6.9 KiB
Roadmap: Legacy Config Cleanup
Status: Implemented
Problem
Narratio's current pipeline config schema still accepts fields that predate the current storage, artifact, and previous-session models:
pipeline.storage.bucketpipeline.storage.prefixpipeline.analyzer.*previous_session_artifact
These names make the config reference harder to trust because they suggest supported behavior that operators should no longer use. The modern interface is:
pipeline.storage.s3.*for remote storage.- Scriptorium configured artifacts under
pipeline.scriptorium.artifacts. - Canonical artifact source IDs such as
narratio.artifact.<configured_artifact_key>. - Canonical previous-session artifact sources such as
narratio.previous_session.artifact.<configured_artifact_key>.
Strict YAML decoding should reject removed legacy fields once this cleanup lands.
Current State
pipeline.storage.bucket and pipeline.storage.prefix were inert compatibility fields and have been removed:
- They are no longer present on
config.StorageConfig. - Strict decoding rejects them.
- Runtime S3 behavior uses
pipeline.storage.s3.bucketandpipeline.storage.s3.root_prefix. - No current code reads the top-level storage bucket or prefix fields.
pipeline.analyzer.* was legacy code surface and has been removed:
config.PipelineConfigno longer includes analyzer config.- Strict decoding rejects
pipeline.analyzer. stage.Envno longer exposes an analyzer runner, andinternal/adapters/analyzerhas been deleted.- Modern analyze execution is Scriptorium-backed; the analyzer adapter is not used by current stage execution.
previous_session_artifact was a live legacy behavior and has been removed:
- Config validation rejects it as an unsupported Scriptorium input source.
- The analyze stage no longer has path-based previous-artifact resolution through
inputs.<name>.path. - Tests cover canonical previous-session sources and the rejection of the legacy source.
- The canonical replacement is
narratio.previous_session.artifact.<configured_artifact_key>, resolved through the previous-session cache/catalog model.
Target Model
The pipeline config schema should expose only current behavior:
- Remote storage is configured only through
pipeline.storage.s3.*. - Generated artifacts are configured only through
pipeline.scriptorium.artifacts. - Scriptorium artifact inputs use canonical source IDs.
- Previous-session artifact inputs use
narratio.previous_session.artifact.<configured_artifact_key>. - Unknown legacy fields fail strict YAML decoding.
No compatibility aliases should remain unless a future migration requirement explicitly reintroduces them.
Cleanup Order
Stage 1: Remove Inert Storage Compatibility Fields
Status: Implemented
Remove pipeline.storage.bucket and pipeline.storage.prefix.
Implementation requirements:
- Delete
StorageConfig.BucketandStorageConfig.Prefix. - Keep
StorageConfig.BackendandStorageConfig.S3. - Confirm all runtime storage paths continue to use
storage.s3.bucketandstorage.s3.root_prefix. - Update examples and docs to remove top-level storage
bucketandprefix. - Add or update strict-decode tests proving
pipeline.storage.bucketandpipeline.storage.prefixare rejected.
Acceptance criteria:
- Existing S3 workflows still pass with
pipeline.storage.s3.bucket. - Pipeline configs containing top-level
storage.bucketorstorage.prefixfail to load. - No docs or examples present those fields as available.
Stage 2: Remove Legacy Analyzer Schema and Adapter Surface
Status: Implemented
Remove the unused analyzer configuration and adapter contract.
Implementation requirements:
- Delete
PipelineConfig.Analyzer. - Delete
AnalyzerConfigandArtifactSettings. - Remove analyzer timeout validation.
- Remove
stage.Env.Analyzer. - Delete
internal/adapters/analyzerif no remaining code imports it. - Remove
pipeline.analyzer.*from tests, examples, and docs. - Add or update strict-decode tests proving
pipeline.analyzeris rejected.
Acceptance criteria:
- Analyze behavior remains fully Scriptorium-backed.
- No runtime code imports
internal/adapters/analyzer. - Pipeline configs containing
pipeline.analyzerfail to load. - Contributor and internal adapter docs no longer list the analyzer adapter.
Stage 3: Remove Path-Based Previous Session Artifact Source
Status: Implemented
Remove previous_session_artifact and require canonical previous-session artifact sources.
Implementation requirements:
- Remove
previous_session_artifactfrom supported Scriptorium input sources. - Remove analyze-stage special-case handling that resolves
inputs.<name>.pathfor previous artifacts. - Keep canonical handling for
narratio.previous_session.artifact.<configured_artifact_key>. - Rewrite tests that use
previous_session_artifactto use canonical sources and prepared previous-cache fixtures. - Add validation tests proving
previous_session_artifactis rejected. - Update docs to remove the legacy path-based source and document only canonical previous-session sources.
Acceptance criteria:
pipeline.scriptorium.artifacts.*.inputs.*.source: previous_session_artifactfails validation.- Canonical previous-session sources continue to work for required and optional inputs.
- Prepare/restore previous-cache behavior remains unchanged.
- No docs or examples mention
previous_session_artifactas supported.
Test Guidance
Run focused tests after each stage:
go test ./internal/config -vgo test ./internal/stage -run Analyze -vgo test ./internal/app -vgo test ./...
For Stage 1, focus on config load/strict-decode and S3 workflow regression tests.
For Stage 2, focus on compile-time removal, config strict-decode tests, and full app/stage tests to catch stale adapter references.
For Stage 3, focus on Scriptorium config validation, analyze-stage input resolution, previous-cache behavior, and restore/analyze workflows.
Documentation Updates
Update current-behavior docs only after the corresponding code removal lands:
docs/config.mddocs/cli.md, only if command behavior text references removed fields.docs/operations.md, only if operator workflow text references removed fields.docs/internal/stage-analyze.mddocs/internal/adapters.mdexamples/pipeline.full.annotated.ymlexamples/pipeline.production.yml
Do not preserve removed fields in examples as compatibility notes. The goal is to make strict config behavior and documentation line up.
Assumptions
- This is a hard cleanup; no backward-compatible aliases are retained.
- Current production configs can be migrated to
storage.s3.*, Scriptorium artifacts, and canonical previous-session sources before this lands. - Removing the unused analyzer adapter does not block any active stage behavior.
- The cleanup should be implemented in the listed order so inert schema removal is separated from behavior removal.