Skip to content

Expose versioned reconciliation JSON for reporting consumers - #382

Merged
HackingGate merged 3 commits into
mainfrom
feat/reconciliation-json-20261016
Oct 16, 2026
Merged

HackingGate merged 3 commits into
mainfrom
feat/reconciliation-json-20261016

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

Python review and OSCAL consumers parse human reconciliation output, which makes wording part of their machine contract. Add uphold check --json with a versioned report of evaluated claims, suppliers, violations, and unavailable evidence, rendered from the same result as the human report.

Migrate both consumers to validated JSON. Review retains the exact principle/rule pairs that reconciled during an evaluated refusal; malformed reports, unsupported versions, unexpected process statuses, and unavailable evidence fail explicitly. Default human output and exit semantics remain compatible. Pre-evaluation failures return exit 2 with stderr and no JSON document.

Known unusable range hooks do not supply partial evidence. A same-named hook with a valid stage or another valid runner still supplies the claim independently.

Validation: 52 check CLI tests, 143 Python tests, all-target Clippy, and normal commit/push checks. Default reconciliation and review output compared byte for byte with main.

Closes #375.

Evaluate claims once for the human and JSON renderers, preserving the
existing human output and exit precedence while retaining partial evidence
in the machine report. Review and OSCAL validate the schema and process
status before using explicit supplying components. Pre-evaluation failures
remain exit 2 with stderr diagnostics and no report.

Remove reconciled_count and its prose tokens now that consumers read JSON.

Validation: 51 check CLI tests, 141 Python tests, all-targets clippy, Ruff,
and unchanged default check/review output against the main baseline.

Remove drifted, test_a_drifted_report_publishes_no_component_definition,
and test_a_report_this_reader_cannot_parse_is_could_not_look from the old
human-report parser tests. Machine-contract tests now cover malformed data,
unsupported versions, partial reports and explicit component identities.
A range-only hook declared exclusively at stages without a push range cannot
supply an enforcement claim. Exclude that declaration before forming the
local supplier set, while retaining misplaced diagnostics and independently
valid declarations of the same id. JSON partial results now keep review from
crediting an explicitly unusable hook.

Validation: 52 check CLI tests cover invalid, mixed and independent supplying
stages; 29 reporting tests include the review regression. All-targets clippy,
Ruff and formatting pass.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ae5a8df-7818-4a19-830e-da0b0f76a611
📥 Commits

Reviewing files that changed from the base of the PR and between 3ae2ecf and 30f3b0d.

📒 Files selected for processing: 7
  • docs/DESIGN.md
  • docs/REFERENCE.md
  • src/check.rs
  • src/main.rs
  • tests/check_cli.rs
  • tests/test_uphold_check.py
  • uphold_check.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.85475% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.62%. Comparing base (3ae2ecf) to head (30f3b0d).

Files with missing lines Patch % Lines
src/check.rs 93.64% 11 Missing ⚠️

❌ Your patch status has failed because the patch coverage (93.85%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #382      +/-   ##
==========================================
+ Coverage   94.61%   94.62%   +0.01%     
==========================================
  Files          46       46              
  Lines       25233    25341     +108     
==========================================
+ Hits        23873    23979     +106     
- Misses       1360     1362       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate marked this pull request as ready for review October 16, 2026 12:36
@HackingGate
HackingGate merged commit 9cdc754 into main Oct 16, 2026
12 checks passed
@HackingGate
HackingGate deleted the feat/reconciliation-json-20261016 branch October 16, 2026 12:37
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.

Design: expose versioned reconciliation JSON for machine consumers

2 participants