Skip to content

fix(main): unbreak three gates — clone-on-Copy clippy, event.rs and deck_render.rs file-size overruns - #1874

Closed
macanderson wants to merge 1 commit into
mainfrom
unbreak-1813-gates
Closed

fix(main): unbreak three gates — clone-on-Copy clippy, event.rs and deck_render.rs file-size overruns#1874
macanderson wants to merge 1 commit into
mainfrom
unbreak-1813-gates

Conversation

@macanderson

@macanderson macanderson commented Aug 6, 2026

Copy link
Copy Markdown
Owner

main is red

Three gate failures on origin/main, from two merges:

  1. clippy -D warnings: clippy::clone_on_copy on GenerationParams in apply_role_shaping (crates/stella-pipeline/src/pipeline/witness_stage.rs) — fix(stella-pipeline,stella-cli): verification follow-ups round 2 — role tuning parity, policy reach, cache-stable witness prompt, scoped goal verifier #1813's auto-merge landed its pre-rebase head while the fmt+clippy+test job was still running; the fix existed on the branch but arrived after the merge.
  2. file-size: crates/stella-protocol/src/event.rs at 2964 over its 2962 ceiling — same pre-rebase head; the StageKind::Witness doc-comment rewrite is condensed to fit, and docs/wire/ is regenerated for the reworded description (wire-schema green).
  3. file-size: crates/stella-tui/src/deck_render.rs at 1531 over its 1528 ceiling (+3, from fix(stella-cli): record a deliberate stop distinctly from a crash in the session registry #1828). Stopped joins Cancelled's match arm — same theme value, no behavior change, and the grouping states what the deleted comment said. cargo test -p stella-tui green (golden frames unchanged — same rendered color).

Verified locally: check-file-size green, check-wire-schema green, cargo clippy -p stella-pipeline --all-targets -- -D warnings green, cargo test -p stella-tui green.

Process note: this is the second time a PR auto-merged with its gate job still pending (#1798 did the same). The window between push and required-check completion is mergeable because the required check reports late; worth a look at whether auto-merge should wait on the run in progress rather than only registered checks.

Summary by Sourcery

Address gate failures on main by fixing a clippy warning, reducing file sizes in protocol and TUI code, and regenerating wire schemas.

Bug Fixes:

  • Fix clone-on-Copy clippy lint in witness stage role shaping configuration.
  • Reduce StageKind::Witness documentation length to satisfy event.rs file size limits.
  • Consolidate Cancelled and Stopped phase color handling to keep deck_render.rs within file size constraints.

Documentation:

  • Condense StageKind::Witness doc comment while preserving its conceptual meaning.
  • Regenerate wire schema JSON files to reflect the updated event documentation.

…d — clippy clone-on-Copy, two file-size overruns

PR #1813 merged its pre-rebase head while its fmt+clippy+test job was
still running, landing a clippy::clone_on_copy on GenerationParams in
apply_role_shaping and a StageKind::Witness doc comment that put
event.rs 2 lines over its god-file ceiling (the wire schema is
regenerated for the reworded comment). #1828 separately grew
deck_render.rs 3 lines past its ceiling; Stopped joins Cancelled's match
arm — same theme value, and the grouping states what the comment said.

Verified: check-file-size green, check-wire-schema green, clippy
-D warnings green on stella-pipeline, cargo test -p stella-tui green.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stella-cli-docs Ignored Ignored Aug 6, 2026 11:06am

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fixes three broken gates on main: resolves a clippy clone-on-Copy warning in witness_stage, brings event.rs back under the file-size limit by tightening the Witness doc comment and regenerating wire schemas, and reduces deck_render.rs size by consolidating color selection for Stopped and Cancelled without changing behavior.

File-Level Changes

Change Details Files
Resolve clippy clone-on-Copy warning in witness-stage role shaping logic.
  • Change params override handling to move GenerationParams instead of cloning it from a reference
  • Keep apply_role_shaping configuration update semantics identical aside from avoiding unnecessary clone
crates/stella-pipeline/src/pipeline/witness_stage.rs
Condense StageKind::Witness documentation to satisfy event.rs file-size gate and keep wire schema in sync.
  • Rewrite Witness stage doc comment to a shorter but equivalent description that fits under the size ceiling
  • Regenerate agentevent and serveframe wire schema JSON artifacts to reflect the updated documentation
crates/stella-protocol/src/event.rs
docs/wire/agentevent.schema.json
docs/wire/serveframe.schema.json
Reduce deck_render.rs size by grouping similar session phases under a single color mapping.
  • Combine SessionPhase::Cancelled and SessionPhase::Stopped into a single match arm using the same theme color
  • Remove the explanatory comment about Stopped matching Cancelled, replacing it with the grouped arm while preserving visual behavior
crates/stella-tui/src/deck_render.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@macanderson

Copy link
Copy Markdown
Owner Author

Closing as a duplicate: #1859 (both witness_stage clippy failures — including the masked field_reassign_with_default mine didn't catch, since cargo stops at the first error) plus #1845 (the two file-size overruns, resolved as parallel-merge skew via baseline regen) jointly cover all three failures, and both predate this PR. One note for the record: this branch resolved the two file-size overruns by trimming instead of raising — condensing the StageKind::Witness comment (−2, wire regenerated) and folding Stopped into Cancelled's match arm (−3, same theme value). If the split-over-raise direction is preferred after #1845, the trims are on branch unbreak-1813-gates.

@macanderson macanderson closed this Aug 6, 2026
macanderson added a commit that referenced this pull request Aug 6, 2026
…the fallback, budget stops degrade, arming symptoms recorded (#1890)

## What this is

Round 3 of the verification-role work (#1798, #1813 were rounds 1–2):
three decision-gated issues from the audit backlog, decided with the
reasoning recorded in code, each with a witness test.

## The decisions

1. **A verifier outage is not a refutation** (`Closes #1788`).
`heuristic_fallback` now passes on an observed fail→pass flip, not only
on green touched tests. The asymmetry it closes: `Unverifiable` abstains
when the *evidence* is absent, but a missing *checker* drove a
flip-verified candidate (diff over budget → ModelVerdict → provider
down) to `VerificationFailed` — the checker's absence treated as the
work's failure. With nothing deterministic positive the fallback still
fails closed. This deliberately inverts the "even a flip doesn't rescue
an unconfirmed suite" pin; the test now states why.

2. **The scaffolding's budget must not discard the work** (`Refs #1789`
— the reclassification + de-panic half). A budget stop during witness
authoring/repair was `rejected`, aborting a candidate whose worker
change was already complete. It degrades now: the budget guard still
gates every later paid call (no overspend is possible), and what
degrading buys is the deterministically-resolvable endings — a warranted
waiver, an abstention — that need no further spend. The stage's two
`expect`s on workspaces became degradable aborts, per its own
produce-vs-trust contract. The issue stays open for the end-to-end
complete-without-further-spend scenario.

3. **A build-failure baseline is recorded, never refused** (`Closes
#1790`). Resolved per the on-issue analysis: refusing
`SymptomClass::BuildFailure` baselines (the issue's original framing)
would reject the most common Rust witness shape — a missing-API test
fails to compile on the old code *by design*. Instead the arming
failure's class is recorded (`witness_baseline=build_failure` in the
verifier's trusted evidence, plus a run warning), so a compile-armed
flip is visible to the verdict and to anyone reading the evidence — the
honest treatment for a shape that is legitimate for missing-API goals
and identical to two-tree environment drift.

4. **The cache-minimum measurement is a stated fact** (`Closes #1786` —
the split landed in #1813). The management-prompt module doc records the
measured prefix sizes: no fixed instruction block clears Anthropic's
1024-token minimum alone (verdict ~520, witness author ~620); the raw
calls cache only with an `agents.<role>.prompt` override padding the
prefix, while the witness author's engine turn crosses the minimum
within its first tool round-trip — which is exactly where #1813's split
pays.

## Witness tests

`heuristic_fallback_passes_only_on_confirmed_green_tests` (inverted pin
+ new no-evidence case),
`a_build_failure_baseline_is_recorded_and_an_assertion_one_is_not`. Both
fail on main.

## CI note

Until #1859 (witness_stage clippy, merged with #1813's premature
auto-merge) and #1845 (file-size baseline skew: `deck_render.rs` +3)
land, the required job is red on those pre-existing steps — none are in
hunks this PR touches. I'll update-branch after they merge.
Coordination: my #1795 implementation was dropped from this round in
favor of the more complete open #1867; my duplicate unbreak #1874 was
closed in favor of #1859/#1845.

## Still tracked

#1787 (structured verdict output, per-candidate degradation records),
#1789 (the e2e half), #1793 (FlipHalt — gated on a loop-bench
measurement), #1794 (semantic witness review — needs its design pass;
recommendation on the issue is extending the mutation audit to
flip-corroborated ModelVerdict passes).

Closes #1788
Closes #1790
Closes #1786
Refs #1789

## Summary by Sourcery

Adjust verification pipeline behavior to treat verifier outages, budget
stops, and build-failure witnesses as recorded, degradable conditions
rather than hard rejections, and document cache minimum measurements for
management prompts.

Bug Fixes:
- Allow heuristic fallback verdicts to pass when a confirmed fail→pass
flip exists even if the verifier is unavailable.
- Prevent witness authoring and repair stages from discarding completed
work on budget stops or missing workspaces by degrading the run instead
of rejecting or panicking.
- Record build-failure baselines for witnesses in pipeline state and
evidence summaries instead of refusing them, ensuring missing-API
compile errors are treated as legitimate but weaker evidence.

Enhancements:
- Expose the authored witness baseline symptom class in candidate state
and evidence output so verifiers can distinguish build failures from
assertion failures.
- Clarify management prompt documentation with measured token-prefix
sizes and their implications for provider cache behavior.

Tests:
- Extend heuristic fallback tests to cover verifier outage behavior and
no-positive-evidence failure cases.
- Add a witness-stage unit test to assert that build-failure baselines
are recorded while assertion-based baselines are not.

Co-authored-by: Stella Test <test@stella.local>
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