77 lines
3.6 KiB
Markdown
77 lines
3.6 KiB
Markdown
|
|
# 0002. Assign subprocess content ownership
|
||
|
|
|
||
|
|
## Status
|
||
|
|
|
||
|
|
Proposed
|
||
|
|
|
||
|
|
## Date
|
||
|
|
|
||
|
|
2026-10-03
|
||
|
|
|
||
|
|
## Context
|
||
|
|
|
||
|
|
[ADR 0001](0001-classify-session-content.md) defines content categories and
|
||
|
|
operator-facing directory principles. Narratio also needs an ownership boundary
|
||
|
|
for the applications it invokes. That boundary determines who selects locations,
|
||
|
|
manages retained files, and controls cleanup.
|
||
|
|
|
||
|
|
The current subprocess workflows can execute with fresh working state. Notarius
|
||
|
|
can reuse persistent chunk-plan and checkpoint caches. Narratio maintains its own
|
||
|
|
session progress and recovery records.
|
||
|
|
|
||
|
|
## Decision
|
||
|
|
|
||
|
|
Assign responsibility by content category:
|
||
|
|
|
||
|
|
| Category | Responsibility |
|
||
|
|
| --- | --- |
|
||
|
|
| Inputs | Narratio supplies paths to prepared inputs, transcripts, and artifacts. |
|
||
|
|
| Outputs | Narratio selects destinations and promotes completed products into the output locations defined by ADR 0001. |
|
||
|
|
| Logs | Narratio selects stage-based destinations and captures subprocess output streams. |
|
||
|
|
| Debug | Narratio selects the destination when capture is enabled; the subprocess defines the diagnostic contents. |
|
||
|
|
| Subprocess State | Each application manages its working directory, temporary files, and execution lifecycle through its own configuration and defaults. |
|
||
|
|
| Subprocess Cache | Each application manages its configured persistent cache, including its format, identity, and reuse behavior. |
|
||
|
|
|
||
|
|
Narratio retains ownership of its own State, including the session manifest,
|
||
|
|
recovery bookkeeping, and staging files it manages.
|
||
|
|
|
||
|
|
Recommend a dedicated cache root for each cache-aware application, configurable
|
||
|
|
through that application's supported controls. For system-wide deployments,
|
||
|
|
`/var/cache/<application>` is a suggested location; `/var/cache/notarius` is an
|
||
|
|
example for Notarius. Each application defines its cache configuration, defaults,
|
||
|
|
and internal layout. Operators select locations and retention settings through
|
||
|
|
those controls. Narratio's session cleanup leaves subprocess caches under their
|
||
|
|
separate lifecycle policies.
|
||
|
|
|
||
|
|
Subprocesses retain ownership of their file formats and bundle structures.
|
||
|
|
Narratio can receive a complete result bundle at a selected staging destination
|
||
|
|
and promote the selected products into its canonical output directories.
|
||
|
|
Diagnostic snapshots of subprocess State follow the Debug destination selected
|
||
|
|
by Narratio.
|
||
|
|
|
||
|
|
Narratio's `runs/` directory can hold staging outputs and retained execution
|
||
|
|
evidence. Subprocess working directories follow the application's configuration
|
||
|
|
and may reside elsewhere. Narratio cleanup manages Narratio-owned material;
|
||
|
|
subprocess State and Cache follow their separate lifecycle policies.
|
||
|
|
|
||
|
|
## Alternatives Considered
|
||
|
|
|
||
|
|
- Place all subprocess working files and caches inside each Narratio session.
|
||
|
|
This makes sessions easier to collect as a unit, but couples application
|
||
|
|
internals and cache retention to Narratio's session lifecycle.
|
||
|
|
- Allow subprocesses to choose output, log, and debug destinations independently.
|
||
|
|
This simplifies invocation but scatters the material operators inspect.
|
||
|
|
- Give Narratio control of downstream bundle formats. This simplifies some
|
||
|
|
destination mappings but increases integration coupling. Selecting and
|
||
|
|
promoting products preserves application ownership of those formats.
|
||
|
|
|
||
|
|
## Consequences
|
||
|
|
|
||
|
|
Adapters need supported controls for Narratio-selected output, log, and debug
|
||
|
|
locations. Upstream changes may be needed where those destinations are coupled
|
||
|
|
to application working directories or to one another.
|
||
|
|
|
||
|
|
Workspace layout and file classification can proceed independently of subprocess
|
||
|
|
working-directory conventions. Exact debug placement, retained diagnostic views,
|
||
|
|
and migration steps remain for the workspace design and roadmap.
|