Repository navigation
Semantic Output, first phase: test and build readings in their blocks (#386) - #415
Merged
Merged
Conversation
…#386) A completed block whose output a recognizer is sure of gets one overview row with the counts the tool printed and, when it listed failures or diagnostics, a details row that opens them (verbatim lines, at most 20 plus a count). Recognizers: Node's test runner (spec, TAP), Jest, Vitest, pytest, cargo test, go test, TypeScript, Rust and GCC/Clang diagnostics (diagnostics only from build commands or failed ones). Short passing output gets nothing. Readings are derived per record, never stored: the transcript lines, raw folding, find, selection and plain /copy are unchanged, and derived rows are skipped by find and selection. Details start open when the raw output is folded; a click on the details row or Actions -> Show or hide details toggles them. /copy --semantic and --both copy the reading (raw once for an output without one, said in the note). Settings -> Transcript -> Semantic Output.
A security review found patterns that could backtrack quadratically on crafted output (trailing-whitespace stripping, the Jest summary, TAP directives, GCC/TypeScript location prefixes), and recognition runs when a block is first drawn. Lines over 2,048 characters are no longer read, trailing whitespace is removed with trimEnd, and those formats are parsed with string operations and end-anchored bounded patterns. A test runs eight adversarial outputs (up to 2 MB each) and bounds each one's time; behavior is unchanged.
This was referenced Oct 18, 2026
Semantic Output: adaptive overview and detail, raw-preserving folding, providers and copy modes
#386
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #414 (
/edit) → #413 → #412 → #411. Merge in order.What
Deterministic, post-completion readings of recognized output (
src/output/semantic.ts). Each recognizer accepts only its own unmistakable evidence and fails closed; counts are the ones the tool printed, and items are verbatim lines (at most 20, plus a count).ℹ tests/pass/failor TAP# tests/pass/fail; failures from the failing-tests section ornot ok(TODO/SKIP excluded)●/FAIL/FAILEDitemscargo testtest result:lines, summed per binarygo testgo test;ok/FAILpackage lines and--- FAIL:testsrg erroris never read as a buildPresentation (
semanticRows.ts, derived rows like fold hints)✔ node --test · 1,772 passed · 0 failed · 25 skipped. Safe glyphs+/x, and readable withNO_COLOR./copy. Derived rows are skipped by find and selection. Readings are cached per record and never persisted; a resumed transcript reads them again lazily.Copy
/copy --raw(default),--semanticand--both. These are mutually exclusive, not allowed with--reportorui, and combine with every selector.--semanticand--bothcopy directly; without a selection they take the latest output.--bothputs the raw output and the reading under labelled── NMSh · … ──separators.Settings
Settings → Transcript → Semantic Output (On by default). It is also reachable from Setup's Transcript section.
Not in this phase
jc,delta).These are recorded in the design doc.
Tests
semanticOutput.test.ts(10 tests):/copyflag parsing, and the semantic and both payloads.semanticOutputLive.test.ts: a real PTY draws the overview and the listing in the block;/copy --semanticcopies the reading and/copy latestthe raw output, through a stand-in clipboard.Not verified
Physical terminal checks:
docs/testing/v021-physical-qa.md, section 4, not run.Refs #386, #410