refactor(prover): separate outcome evaluation from rendering
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Description
Determine the prover pass/fail outcome once after accepted risks are applied, and make the full and compact renderers presentation-only.
Today, render_compact() and render_report() independently derive the return value from the number of active finding paths. This duplicates domain logic and can classify an unaccepted pathless finding as passing even though the prover contract says any unaccepted finding fails.
Context
Identified while reviewing #2395.
Relevant code:
crates/openshell-prover/src/lib.rscrates/openshell-prover/src/report.rscrates/openshell-prover/src/accepted_risks.rs
The public prove() -> Result<i32> contract can remain unchanged. The cleanup should move outcome evaluation out of rendering and remove the unused path arguments from render_compact().
Definition of Done
- Pass/fail is derived in one place after accepted risks are applied.
- Both renderers are presentation-only and do not determine exit status.
-
render_compact()no longer accepts unused path arguments. - No findings returns
Ok(0). - Accepted-only findings return
Ok(0). - Any unaccepted finding returns
Ok(1), including a pathless finding. - Tests cover empty, accepted-only, active, and active-pathless findings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read crates/openshell-prover/src/lib.rs, report.rs, and accepted_risks.rs to trace how accepted risks, outcome evaluation, and rendering currently interact. Run the existing prover tests, then verify that one centralized outcome handles empty, accepted-only, active, and pathless unaccepted findings while both renderers remain presentation-only and render_compact() no longer takes path arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100