3.5 KiB
Audita Operations
Scope
This document covers operational behavior for audita process as currently implemented:
- run lifecycle;
- output and report files;
- diagnostics artifacts;
- run-directory retention behavior;
- failure inspection and recovery.
For command syntax, see docs/cli.md.
Process Run Lifecycle
A process run performs these high-level steps:
- load effective config (defaults + optional file + env + CLI);
- create a per-run diagnostics directory;
- load transcript JSON and glossary YAML;
- parse/validate input schemas;
- normalize transcript and compute chunking;
- run configured modules/validators;
- serialize output schema and write transcript output;
- build and write process report;
- apply run-directory retention.
If a failure happens after diagnostics initialization, the run writes failure details and returns nonzero.
Output Files
Transcript output:
- when
--output <path>is set, corrected transcript JSON is written to that file; - when
--outputis omitted, corrected transcript JSON is written to stdout.
Report output:
- when
--report-json <path>is set, Audita writes a process report JSON file; - the run directory also writes its own
report.jsonartifact.
On success with --output, stdout is expected to be empty.
Diagnostics Directory
By default, runs use work_dir from effective config (default /tmp/audita).
Each run directory is created under the work dir using a generated ID like run-<unix-nanos>.
Top-level diagnostics artifacts:
source-transcript.jsonsource-transcript-parsed.jsonnormalized-transcript.jsonnormalization-summary.jsonchunking-summary.jsonutilization-diagnostics.jsoncorrection-ledger.jsoninvocation.jsoneffective-config.json(redacted)report.jsonerror.log(failure runs)
Report diagnostics metadata includes resolved paths to these artifacts.
Correction Ledger and Utilization Diagnostics
correction-ledger.json records correction dispositions:
appliedskippedrejectedfailed
utilization-diagnostics.json records effective concurrency and execution timing summaries for run/module/validator activity.
Retention Behavior
Retention is controlled by work_dir_retention (auto|always|never).
Current behavior:
- failed runs are always retained;
always: successful runs are retained;auto: successful runs are retained only when skipped/rejected corrections occurred; clean successful runs are removed;never: successful runs are currently retained (same net retention outcome asalwaysin current implementation).
Even when a successful run directory is removed under auto, an explicit --report-json file is still preserved at its target path.
Failure Inspection
For failed runs:
- read stderr for the top-level failure and diagnostics path;
- open
error.login the reported run directory; - inspect run
report.json(status,error_phase,error_message); - inspect related artifacts referenced by report diagnostics metadata.
Typical error_phase values include:
transcript_readglossary_readtranscript_schemaglossary_schemachunkingrunner_setuprunner_executionoutput_schemaserializationoutput_writestdout_write
Recovery Guidance
Safe recovery pattern:
- correct the immediate input/config/output-path problem;
- rerun with
--work-dir-retention alwaysduring debugging; - once stable, restore your normal retention mode.
Not implemented:
- resume/checkpoint APIs
- remote diagnostics/report storage