Repository navigation
Add diff_reviews helper for run-to-run finding comparison and scope gap reporting - #122
Open
chaos666888 wants to merge 1 commit into
Open
chaos666888 wants to merge 1 commit into
chaos666888 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Who this helps
Teams running Proofline in CI/CD pipelines, release automation, or coding-agent remediation loops often need to compare two runs (for example, PR run 1 vs run 2 after a fix push, or a baseline review vs a follow-up review) to answer:
WARNINGtoSERIOUSor change comment-gateplacement)?diff_reviews(baseline, current)provides a typed, offline, zero-network helper inproofline.diffthat composes cleanly with bothProoflineClientandAsyncProoflineClient(CustomerReviewDetailorReviewOutcome).Decisions made
finding_fingerprintstrictly (no synthetic hashes): Per the OpenAPI contract,finding_fingerprintis absent when unretained and no replacement is derived. Active findings without a retained fingerprint (or with duplicate fingerprints inside one assessment) are surfaced explicitly inuncorrelated_baseline/uncorrelated_currentwith a typedreason(MISSING_FINGERPRINT/DUPLICATE_FINGERPRINT) instead of guessing matches or silently dropping items.proofline.outcomescompletion semantics (status == "COMPLETED",receipt_recorded,COMPLETE_CHECKS,COMPLETE_LIFECYCLES, and_code_assessment). If an environment or code assessment is missing or incomplete in either run, or if a review is anaudit_modescan orReviewOutcome(review=None),diff_reviewsemits explicitScopeGaprecords (MISSING_IN_BASELINE,MISSING_IN_CURRENT,INCOMPLETE_BASELINE,INCOMPLETE_CURRENT,DUPLICATE_SCOPE,AUDIT_UNCOMPARABLE,MISSING_REVIEW) and setshas_gaps=True/complete=Falserather than falsely claiming findings were resolved or introduced.environment_display_namescopes;code_assessmentcorrelates only in the"code"lane whenassessment_count == 0and never cross-matches environment assessments.lifecycle_state == "RESOLVED"are excluded from open-finding sets.proofline/diff.py) re-exported fromproofline/__init__.pywithout modifyingproofline/_generated/,openapi.public.json, orscripts/contracts.py(including preserving the SDK's outcome-vocabulary constraints).How it was tested
Added
tests/test_diff.pycovering:WARNING -> SERIOUSescalation,SERIOUS -> WARNINGde-escalation, placement changes (CHECK_ONLY -> INLINE), and ignoring already-RESOLVEDrecords.None/"") and duplicatefinding_fingerprintisolation intouncorrelated_baseline/uncorrelated_current.receipt_recorded=False) producingScopeGapwithout false resolution.environment_display_name(DUPLICATE_SCOPE) andaudit_modereviews (AUDIT_UNCOMPARABLE).assessment_count == 0) andReviewOutcomeunwrapping (includingTIMED_OUTwithreview=None).Verified all repository checks locally:
python scripts/generate.py --check— passedpython scripts/contracts.py— passed (Python operation and outcome-vocabulary contracts passed.)ruff check .&ruff format --check .— passed (239 files formatted)mypy proofline scripts— passed (Success: no issues found in 230 source files)pytest -q— passed (223 passed)