Add Phase 2 fixtures and compatibility tests

This commit is contained in:
2026-05-11 00:21:19 +00:00
parent 14e51698c2
commit d847168ecd
18 changed files with 792 additions and 35 deletions

View File

@@ -551,20 +551,64 @@ Before accepting a phase implementation, check:
- Does `go test ./...` pass?
- Is the code idiomatic Go rather than Python-shaped Go?
## Red flags during the rewrite
## Phase 2 Status (Go Implementation)
Watch for:
The Go rewrite has completed Phase 2 with the following capabilities:
- module stages running concurrently and changing pipeline semantics;
- prompt wording changes mixed into infrastructure commits;
- validators silently ignoring malformed LLM output;
- proposal application mutating text without report entries;
- report data printed to stdout unexpectedly;
- API keys appearing in diagnostics;
- global mutable LLM clients that make tests order-dependent;
- unbounded goroutine creation;
- filesystem paths hard-coded outside config defaults;
- tests that require a real LLM when a fake LLM would be better.
### Implemented Features:
1. **Typed Schema Validation**:
- Transcript validation supports both bare segment arrays and objects with `segments` field
- Glossary validation matches the existing YAML format
- Comprehensive field validation and error reporting
2. **Deterministic Normalization**:
- Chronological sorting of segments
- Same-speaker adjacent segment merging with configurable gap thresholds
- Ellipsis insertion for gaps above the ellipsis threshold
- Configurable maximum segment duration and token limits
- Sequential ID reassignment starting at 1
- Category preservation during merging
3. **Process Output**:
- Output is normalized transcript JSON (not raw passthrough)
- Canonical transcript shape as specified in architecture docs
- Proper stdout/stderr discipline preserved from Phase 1
4. **Enhanced Reporting**:
- Success reports include normalization statistics
- Failure reports include error phase and concise messages
- No secrets leaked to reports
5. **Minimal Diagnostics**:
- Per-run work directories with unique timestamps
- Source transcript artifacts (raw and parsed)
- Normalized transcript artifacts
- Normalization summary artifacts
- Authoritative report.json in run directory
- Error logs on failure
- Basic retention policy implementation
### Not Yet Implemented (Future Phases):
- Chunking and token-bounded section building
- LLM proposal generation and structured output
- Validator chains and decision logging
- Module execution pipeline
- Full diagnostics retention policy
- Skipped correction detection for auto retention
- Real module implementations (glossary, homophones, spoken_word, grammar)
### Compatibility Notes:
The Go implementation maintains the public CLI contract from the Python implementation:
- `audita process transcript.json --glossary glossary.yaml --output corrected.json`
- stdout contains transcript JSON when --output is omitted
- stderr contains logs and errors only
- --report-json writes machine-readable reports
- Nonzero exit codes on failure
The normalization behavior is deterministic and matches the architectural specifications, but may differ from Python-era behavior in edge cases until full module implementation is complete.
## When to consider an HTTP API