Remove unnecessary output restrictions and simplify report tests

This commit is contained in:
2026-09-25 00:36:44 +00:00
parent efaefdbf3d
commit 0b6cd98262
13 changed files with 330 additions and 105 deletions

View File

@@ -74,7 +74,7 @@ matrices. Rows show every initial chunk with 1-based chunk number and initial
segment range; columns follow configured module-instance order, including
repeats. Completed error cells are `0` or `1`; recovery cells are operation
counts. `—` means not started and `n*` means interrupted with n facts recorded.
An empty stage or chunk set says “No work units.” Short reason breakdowns count
An empty stage or chunk set is identified as having no work units. Short reason breakdowns count
records containing each reason; a recovery can have several reasons, so those
counts need not sum to the recovery total. The report refers to both YAML
files. It does not include transcript excerpts or correction lists.

View File

@@ -17,7 +17,11 @@ and boolean values retain their types. Ordinary reports omit raw causes,
transcript text, complete decisions, and token/timing payloads.
`internal/core/diagnostics.OutputSession` owns active destination checks,
transcript preflight, report initialization, and per-file final replacement.
transcript preflight, report initialization, regular-file replacement, and direct
stream publication. Transcript input is protected from early report writes but
may be the final transcript destination. The LLM runtime records successful reads
through PromptKit's profile filesystem and supplies those source paths to CLI;
no second filename-based discovery rule is used.
CLI composes it after configuration/profile inspection and before reading
inputs or dispatching model work. It does not create ordinary report parents.
On a final write error it attempts other enabled reports and one failed-status

View File

@@ -23,13 +23,22 @@ overridden by `--report-dir`. `--reporting=false` suppresses all three reports
and removes their path requirements. It does not suppress the stderr summary or
fatal errors. Stdout contains only transcript JSON; file output leaves it empty.
Existing report directories and transcript-output parents must be writable.
Audita checks active destinations against input, configuration, and selected
profile files before model dispatch. It preflights file transcript output
without truncating an existing file. With reporting enabled, all three reports
are initialized as `in_progress` before input processing. Output is encoded
fully before publication. Each file is replaced through a temporary file on
its destination filesystem: transcript first, then `errors.yml`,
Existing report directories and parents for regular transcript files must be
writable. Audita prevents report writes from overwriting transcript, glossary,
loaded configuration, or loaded profile sources, and rejects conflicting output
destinations. The final transcript may intentionally replace its own input after
successful processing; other input/configuration/profile sources remain protected.
Preparation never truncates an existing transcript. Device and pipe destinations
(such as `/dev/null` and named pipes) receive ordinary writes at publication time;
they are not opened during preflight or replaced with regular files. A pipe write
can wait for its reader, and stream write errors are fatal. With reporting enabled,
reports still use the output path's parent; disable reporting when that placement
is unsuitable for a stream destination.
With reporting enabled, all three reports are initialized as `in_progress` before
input processing. Output is encoded fully before publication. Each regular output
file is replaced through a temporary file on its destination filesystem:
transcript first, then `errors.yml`,
`recoveries.yml`, and `report.md`. This is per-file replacement, not a
multi-file transaction. New files honor the process umask; replacing an existing
file preserves its permission bits. A late report error may leave the transcript

View File

@@ -5,6 +5,12 @@
**Status:** Implemented. All stages below are complete; completion notes record
the checks performed for each unit of work.
**Post-implementation revisions:** [Remediation R11–R14](remediation.md) supersedes
the original blanket transcript/input collision prohibition, inferred profile
filenames, regular-file-only transcript handling, and whole-document Markdown
golden requirements below. These stages and completion notes are historical;
[operations](../operations.md) describes current output behavior.
## Scope and Execution Instructions
Implement the target in [resilience.md](resilience.md). User intent and product

View File

@@ -5,8 +5,8 @@
invariants, contracts, guarantees, and test requirements, compared with
[resilience.md](resilience.md), [implementation.md](implementation.md), and the
[agent policy](../policy/agents.md).
**Status:** R11–R14 remain open. This document records required follow-up work;
no application behavior has changed as part of this review.
**Status:** R11–R14 addressed. The findings below describe the reviewed source;
see the resolution record for the implemented changes and verification.
The earlier findings R1–R10 have been addressed. Their findings and resolution
records remain in Git history; R6–R10 were resolved in `ec78b5a`.
@@ -134,7 +134,7 @@ Harmless prose or whitespace edits outside the required layout no longer require
updating a whole-document fixture and overlapping assertions. Retain meaningful
agreement checks between YAML, Markdown, and CLI totals.
## Verification and Review Limits
## Original Review Verification and Limits
- This was a source and contract review; no application changes or new runtime
reproductions were made during this pass.
@@ -148,3 +148,40 @@ agreement checks between YAML, Markdown, and CLI totals.
subsequent edit solely because they were used there.
- Application fixes, upstream changes, deferred feature work, and release
publication remain outside this document update.
## Resolution Record
- **R11:** Output selection distinguishes the transcript input from other protected
sources. Final transcript publication may replace its input; early report writes
still cannot overwrite it, and other source/output collisions remain checked.
`TestSubprocessInPlaceTranscript` proves corrected output replaces the source on
success and an invalid source remains untouched on failure. Output-session tests
cover direct and alias acceptance, nontruncating preparation, and rejection of
report/input aliases and conflicting output destinations.
- **R12:** The runtime records successful reads through PromptKit's existing profile
filesystem and supplies actual loaded paths to CLI. It no longer guesses two
filenames per profile ID. `TestSubprocessProfileSources` proves an unused
alternate filename is allowed and a loaded profile with a different filename
remains protected from report initialization. Configuration sources continue to
come from ConfigKit's source records.
- **R13:** Regular transcript files retain per-file replacement. Existing device
and pipe destinations receive ordinary writes during finalization and are not
opened during preflight. `TestTranscriptStreamDestinations` verifies `/dev/null`
and named-pipe delivery without replacing either destination, including pipe
preparation before opening its reader. `TestTranscriptStreamWriteFailure`
checks a real stream write failure using `/dev/full` where available. Existing
directory, parent, permission, cleanup, and late-report-failure tests remain.
- **R14:** Removed the whole-document Markdown golden fixture and overlapping
matrix assertions. Tests compare complete ordered table rows, summary quantities,
reason counts, escaping/redaction, and YAML/CLI count agreement. Summary prose is
not snapshotted, and empty-work handling no longer requires an exact sentence.
No renderer or output schema changed.
Current operations and internal documentation describe the revised boundaries.
The completed implementation plan explicitly identifies its superseded choices.
Validation: `go test ./...` and `go vet ./...` passed, as did focused race checks
for the LLM runtime, diagnostics/output, and CLI subprocess packages. The refined
Markdown assertions passed their package tests. Changed-document links and
`git diff --check` passed. No live provider, dependency change, tag, or publication
was involved.