Add Phase 9 LLM scheduler, config resolution, diagnostics primitives

This commit is contained in:
2026-05-11 20:09:34 -05:00
parent 0b17a6fbeb
commit 426864eedb
8 changed files with 555 additions and 15 deletions

View File

@@ -23,6 +23,9 @@ Implemented today:
- Deterministic validator-chain execution in the runner with cardinality enforcement.
- Module-level validator decision/rejection reporting.
- Internal structured LLM client contract plus an `instructor-go`-backed adapter package.
- Bounded LLM scheduler/semaphore infrastructure with context-aware permit handling.
- Runtime primary/validation LLM effective-config resolution helpers with validation inheritance.
- Generic JSON prompt/response diagnostics writer primitives with secret redaction.
Not implemented in CLI runtime path today:
- Real module execution pipeline (`glossary`, `homophones`, `spoken_word`, `grammar`).
@@ -32,7 +35,8 @@ Not implemented in CLI runtime path today:
- End-to-end transcript polishing with real module behavior.
Phase sequencing note:
- structured LLM client infrastructure is implemented, but scheduler and runtime wiring remain Phase 9 follow-up work;
- structured LLM client, scheduler, config-resolution helpers, and diagnostics primitives are implemented;
- runtime wiring from modules/validators/runner into this LLM infrastructure remains Phase 9 follow-up work;
- LLM-backed validators remain Phase 10 work.
## Actual Go package layout
@@ -92,6 +96,9 @@ internal/framework/validators/
internal/framework/llm/
instructor_client.go
scheduler.go
effective_config.go
diagnostics.go
```
## Current CLI behavior
@@ -189,6 +196,11 @@ Current runtime boundary:
- the CLI/runner runtime path does not instantiate this adapter yet;
- no production LLM requests are performed by `audita process`.
`internal/framework/llm` also provides:
- a bounded `Scheduler` for controlled concurrent LLM calls with reliable permit release;
- primary/validation effective-config resolution helpers, including validation inheritance fallback to primary settings;
- generic interaction diagnostics primitives that write machine-readable JSON artifacts for request metadata, request payload, response payload, and optional error payload with secret redaction.
## Implemented normalization behavior
Normalization (`internal/core/normalization`) currently:
- sorts by segment start time;