Skip to content

feat(shell): classified runner output opens with a [clean] or [errors] verdict - #893

Open
santhreal wants to merge 20 commits into
mainfrom
feat/result-contract
Open

feat(shell): classified runner output opens with a [clean] or [errors] verdict#893
santhreal wants to merge 20 commits into
mainfrom
feat/result-contract

Conversation

@santhreal

@santhreal santhreal commented Aug 23, 2026

Copy link
Copy Markdown
Owner

What

Classified runner output now opens with a result-contract header:

  • [clean] <command>
  • [errors] <command>
  • [errors N] <command>

The header is the verdict. The body contains only retained diagnostics and summaries. Unclassified commands and explicitly machine-readable output remain passthrough.

The grammar and replay checks are defined in crates/veyyon-shell/src/minimizer/contract.rs. Cargo, bun checks and tests, Go test/build/vet, ctest/gtest, dotnet build/test/restore/format, clippy, golangci-lint, Gradle lint, pytest, and the tsc/eslint-family emit the contract on their classified paths.

A conditional tool-policy statement tells models to trust the verdict, avoid searching a result blob, and avoid rerunning the same command to rediscover failures.

Correctness audit

The final audit tightened the contract at every boundary:

  • A header-shaped line printed by a command cannot turn a failed process into [clean] or a successful process into [errors]. Replayed minimizer output is accepted only when its status agrees with the process exit; direct contract application requires the complete computed verdict to match.
  • Timeouts and incomplete bun workspace checks are [errors], never a qualified clean result.
  • Already-compact Jest, Vitest, and Playwright output still receives a verdict instead of bypassing classification.
  • Failed Cargo and pytest summaries override a contradictory zero exit rather than rendering clean.
  • Go test failures, quiet Go build/vet successes, non-JSON golangci-lint output, dotnet warning-bearing successes, dotnet test/format output, and Gradle lint failures now retain their diagnostics beneath an explicit verdict.
  • The result-policy instruction has one source in the conditional statement registry; duplicate bash-tool prose and its prompt-budget increase were removed.
  • Package and generated root changelog entries are under Unreleased.

Verification

  • cargo test -p veyyon-shell --lib minimizer:: — 793 passed.
  • Result-contract integration suites passed, including live Cargo output, annotation recognition, replay idempotence, lint replay, and forged-header rejection.
  • Prompt policy/cache/budget suites passed in scripts/test-sandbox/run.sh — 66 passed.
  • bun run check passed TypeScript and Rust checks.
  • bun run check:tools passed.
  • CHANGELOG_BASE=origin/main bun run changelog:check passed.
  • bun run changelog:root:check passed.
  • Mutation gate: restoring the pre-fix “trust any header-shaped first line” behavior made the forged-clean-header regression test fail for the intended reason; the script restored the source and verified the worktree diff was byte-equivalent.

The full cargo test -p veyyon-shell run reached 887 passing tests; its only unrelated failure was the host-sensitive CPU-budget test starting at kernel nice 19 with no remaining headroom. The complete minimizer unit suite and affected integration suites were then run separately and passed.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31dfe22c-8fcd-46cb-a713-b455b59d5035


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

/devin review

@santhreal
santhreal force-pushed the feat/result-contract branch 5 times, most recently from 5a91072 to 290bdee Compare August 23, 2026 11:29
…] verdict

The minimizer already dropped passing noise, but the leftover blob still
looked like something to grep or re-run. A shared result-contract header
is now the verdict for cargo, bun, go, ctest, dotnet, clippy,
golangci-lint, gradle, pytest, and tsc/eslint-family. The prompt names
that header and tells the model not to search the command result.
CI rustfmt wraps long string literals. Keep the tests formatted so
check:rs stays green.
A successful cargo build the filter empties is `[clean] cargo build`, not
a synthetic OK. A failed cargo build the filter empties is
`[errors] cargo build`, not a blank blob.
-D warnings wants `?` on the `[errors N]` parse, collapsible let-chains
on cargo/lint/node_tests counts, unwrap_or_else on pytest, and is_ok_and
on the live cargo probe.
Native CI still expected the pre-contract first line on biome, pytest,
dotnet, and tsc captures. The body is unchanged; only the verdict prefix
is now part of the settled text.
The newline-invariant suite still expected the old `ctest: ok` summary.
Classified runner output adds a [clean]/[errors] header to bash and the
cached prefix. The tool-block ceiling and block-0 digest are the places
that cost is written down, so they move with the prose rather than
absorbing it as leftover slack.
The HUD polish on main draws pending tasks with status.shadowed, not the
phase checkbox. This assertion was left on checkbox.unchecked and fails
any GitHub merge that includes that polish.
@santhreal
santhreal force-pushed the feat/result-contract branch from f646e7a to 0609e0f Compare August 23, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant