Skip to content

refactor(prover): separate outcome evaluation from rendering - #2632

Open
eviehoward wants to merge 1 commit into
NVIDIA:mainfrom
eviehoward:2411-separate-outcome-from-rendering/eviehoward
Open

refactor(prover): separate outcome evaluation from rendering#2632
eviehoward wants to merge 1 commit into
NVIDIA:mainfrom
eviehoward:2411-separate-outcome-from-rendering/eviehoward

Conversation

@eviehoward

Copy link
Copy Markdown
Contributor

Summary

Moves exit-code logic out of the renderers and into prove(), so outcome evaluation happens once in a single place rather than independently in each renderer.

Related Issue

Closes #2411

Changes

  • render_compact and render_report return () instead of i32; all exit-code logic removed from both
  • prove() computes exit code after rendering: i32::from(findings.iter().any(|f| !f.accepted))
  • Call site in prove() drops unused policy_path/credentials_path args from render_compact
  • Both renderer banners gate on active.is_empty() rather than path_count > 0, so terminal output and exit code agree for pathless unaccepted findings
  • Four unit tests added covering: empty findings, all-accepted, unaccepted with paths, pathless unaccepted (the case the old renderers got wrong)

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated - not applicable, no infrastructure, sandbox, or policy changes

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated - not applicable, internal refactor, no behavioral or API change

@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

This pull request has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity.

@github-actions github-actions Bot added the state:stale Inactive item at risk of automatic closure. label Sep 2, 2026
@eviehoward

Copy link
Copy Markdown
Contributor Author

I'm still keeping an eye on this, AFAIK it's still mergeable- please let me know if anything needs changing or if a rebase is needed 🙂

@github-actions github-actions Bot removed the state:stale Inactive item at risk of automatic closure. label Sep 4, 2026
Comment thread crates/openshell-prover/src/lib.rs Outdated
Signed-off-by: Evie Howard <evhoward@redhat.com>
@eviehoward
eviehoward force-pushed the 2411-separate-outcome-from-rendering/eviehoward branch from 5dc783d to b1dbd85 Compare September 8, 2026 09:57
@eviehoward
eviehoward requested a review from sjenning as a code owner September 8, 2026 09:57
@2000krysztof

Copy link
Copy Markdown
Contributor

Thanks for addressing my concerns @eviehoward LGTM

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.

refactor(prover): separate outcome evaluation from rendering

2 participants