Files
narratio/docs/internal/adapters.md

50 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2026-05-19 08:47:45 -05:00
# Internal: Adapters
## Purpose
Define external integration boundaries and default adapter wiring used by app/stage orchestration.
2026-05-19 08:47:45 -05:00
## Adapter Boundaries
Narratio stage logic depends on adapter interfaces, not transport-specific details.
2026-05-19 08:47:45 -05:00
Primary adapters:
2026-05-19 08:47:45 -05:00
- `whisperx.Client`
- `seriatim.Runner`
- `audita.Runner`
- `scriptorium.Runner`
- `storage.ObjectStore`
- `notify.Sender`
## Ownership
Adapters own:
- HTTP/subprocess/SDK argument and transport details.
- Backend-specific request/response mapping.
2026-05-19 08:47:45 -05:00
Adapters do not own:
- stage ordering/skip/force logic;
- manifest transitions;
- canonical path policy.
2026-05-19 08:47:45 -05:00
## Default Wiring
`internal/app/runner.go` initializes default adapters when not injected:
- WhisperX HTTP client from pipeline config.
- Seriatim subprocess runner.
- Audita subprocess runner.
- Scriptorium subprocess runner.
- Noop notifier (`notify.NoopSender`).
- Object store only when required by selected stages/config.
2026-05-19 08:47:45 -05:00
Object-store construction goes through `newCommandObjectStore`, which loads configured filesystem secrets before adapter initialization.
2026-05-19 08:47:45 -05:00
## Failure Semantics
- Constructor errors fail stage execution setup early.
- Runtime adapter errors propagate to stage code and then manifest failure handling.
- Subprocess adapters persist stage logs/generated configs through stage-managed paths.
2026-05-19 08:47:45 -05:00
## Test Surfaces
2026-05-19 08:47:45 -05:00
- `internal/adapters/whisperx/http_test.go`
- `internal/adapters/seriatim/subprocess_test.go`
- `internal/adapters/audita/subprocess_test.go`
- `internal/adapters/scriptorium/subprocess_test.go`
- `internal/adapters/storage/*_test.go`
- `internal/app/runner_test.go`