Skip to content

feat(fp-judge): domain contracts + rubric + FP-control + overlay consumer - #31

Merged
PhysShell merged 3 commits into
mainfrom
fp-judge-phase0-1-consumer
Jul 2, 2026
Merged

feat(fp-judge): domain contracts + rubric + FP-control + overlay consumer#31
PhysShell merged 3 commits into
mainfrom
fp-judge-phase0-1-consumer

Conversation

@PhysShell

@PhysShell PhysShell commented Jul 2, 2026

Copy link
Copy Markdown
Owner

What & why

Domain (OwnAudit) side of the FP-judge — the layer that triages own-check's residual
findings into real leak / false positive / uncertain. The judging harness itself is
007's private o7 judge (claude -p, read-only, whole-file); this PR is everything the
domain owns: the rubric, the finding identity, the contract, and the
consumer that merges the verdict overlay back into the audit — with a staleness guard
so an overlay judged against an old audit can never render as current truth.

Follows the delegate-normalization fix (Own.NET#163) that already cut subscription
findings 323→156; this makes the remaining 156 triageable.

Contents

file role
docs/fp-judge/verdict-contract.md finding_id (line-independent sha1 of path+rule+message), fp-verdicts.json fields, generated_from = sha256(findings bytes)
docs/fp-judge/rubric.md per-class criteria (subscription / idisposable / region-escape); rebind-setter → uncertain
docs/fp-judge/STATUS.md resume note / roadmap (gate passed → STS run → merge)
oracle/fixtures/findings-fp-control.json adversarial FP control on the Fixed*ViewModel counterparts → must judge false_positive
viz/apply_verdicts.py overlay consumer: staleness guard + join by finding_id + triage split; --selftest
viz/build_dashboard.py read any audit-output folder via a positional DATA_DIR (default artifacts)

Phase-1 gate — PASSED both directions

  • real: oracle's 2 intentional leaks (subscription + timer) → both real, grounded reasoning.
  • false_positive: findings-fp-control.json (fixed counterparts) → both false_positive.
    A judge that only ever says real would have failed this.

How verified

  • python viz/apply_verdicts.py --selftest — guard (digest match→merge, mismatch→reject) + finding_id + classify + merge.
  • Live guard: the oracle overlay is correctly rejected against the STS findings.json (generated_from ≠ STS-210 digest) — the staleness guard working.
  • python viz/build_dashboard.py [artifacts|<dir>] builds; bad dir errors cleanly.

Next (not in this PR)

The real STS run (o7 judge --repo <SectorTS root> --findings artifacts/findings.json …),
then apply_verdicts (guard now passes) + dashboard. See docs/fp-judge/STATUS.md.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a verdict-application workflow to combine audit findings with review results, including freshness checks and merged triage output.
    • Dashboard generation can now read from a configurable audit output folder, with a new default source location.
  • Bug Fixes

    • Improved handling of repeated findings and confidence-based triage so results are grouped and ordered more consistently.
  • Documentation

    • Added documentation for the review contract, rubric, and current FP-judge progress.
  • Chores

    • Updated ignore rules and refreshed audit history data.

…umer

Phase-0/1 domain side of the FP-judge. 007's private `o7 judge` triages own-check's
residual findings (real leak / false positive / uncertain); this repo owns the rubric,
the finding identity, and consuming the overlay. Contract across the seam = the overlay
file + verdict-contract.md, nothing else.

- docs/fp-judge/verdict-contract.md — finding_id = sha1(path\x1f rule\x1f message)[:16]
  (line-independent; identical patterns share an id), fp-verdicts.json fields, and
  generated_from = sha256 of the raw findings.json bytes (staleness key).
- docs/fp-judge/rubric.md — subscription / idisposable / region-escape criteria for
  real|false_positive|uncertain; the rebind-setter case is pinned to `uncertain`.
- docs/fp-judge/STATUS.md — resume note: Phase-1 gate PASSED both directions; next = the
  real STS run, then merge + dashboard.
- oracle/fixtures/findings-fp-control.json — adversarial FP control: own-check-shaped
  findings aimed at the Fixed*ViewModel counterparts (which detach/dispose), so the judge
  must return false_positive. Closes the false_positive direction of the gate (leaks-only
  oracle proved only the `real` direction).
- viz/apply_verdicts.py — overlay consumer: verify generated_from vs the current
  findings.json (refuse a stale overlay), join verdicts by finding_id, split into
  real / uncertain / unjudged / judged-FP (confident FP retired, counted not hidden).
  --selftest covers the staleness guard + finding_id + classify + merge.
- viz/build_dashboard.py — read any audit-output folder via a positional DATA_DIR arg
  (default: artifacts); no hardcode on sts_audit/artifacts.

Verified: apply_verdicts --selftest OK; live guard correctly rejects the oracle overlay
against the STS findings.json (digest mismatch); dashboard builds from artifacts/ (210).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PhysShell, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 84fa22eb-cb7f-4d62-a8b3-ae51da0e0b38

📥 Commits

Reviewing files that changed from the base of the PR and between 2ac6ec7 and 1f5a988.

📒 Files selected for processing (1)
  • viz/apply_verdicts.py
📝 Walkthrough

Walkthrough

Adds FP-judge domain documentation (rubric, verdict-contract, status notes), a new viz/apply_verdicts.py script that merges judge verdict overlays into findings with staleness checking and self-tests, a false-positive fixture, dashboard CLI rewiring to read from an artifacts directory, a history log entry, and a gitignore extension.

Changes

FP-judge overlay contract and verdict application

Layer / File(s) Summary
Verdict contract, rubric, and status docs
docs/fp-judge/verdict-contract.md, docs/fp-judge/rubric.md, docs/fp-judge/STATUS.md
Documents line-independent finding_id computation, fp-verdicts.json schema, staleness-guard requirements, per-category classification rubric (subscription-leak, idisposable-leak, region-escape), and phase status/next-steps.
Verdict merge script and fixture
viz/apply_verdicts.py, oracle/fixtures/findings-fp-control.json
Implements finding_id, sha256_file, verify_fresh, triage_class, merge, run, main, and _selftest to merge overlay verdicts into findings with a confidence threshold and staleness guard; adds a fixture with deliberately incorrect findings to validate false-positive classification.

Dashboard artifacts source rewiring

Layer / File(s) Summary
Dashboard CLI DATA_DIR support
viz/build_dashboard.py, viz/history.jsonl, .gitignore
Replaces main() with main(argv=None) accepting a DATA_DIR argument, changes default STS path from sts_audit to artifacts, updates docstring/footer, appends a new digest entry to history.jsonl, and extends .gitignore for .commit-msg/.pr-body.md.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • PhysShell/OwnAudit#6: Introduced the original viz/build_dashboard.py implementation now updated with the artifacts/DATA_DIR argparse wiring.
  • PhysShell/OwnAudit#7: Also modifies viz/build_dashboard.py data source and entry-point wiring related to this PR's changes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and accurately reflects the main FP-judge contract, rubric, control fixture, and overlay consumer additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fp-judge-phase0-1-consumer

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20ee3b6e4e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread viz/build_dashboard.py
Comment on lines +606 to +608
ap.add_argument("data_dir", nargs="?", default="artifacts",
help="folder with findings.json + health-report.md (default: artifacts). "
"A relative path resolves from the repo root.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the triaged findings for dashboard builds

When following the new FP workflow (apply_verdicts --out artifacts/findings-triaged.json then build_dashboard.py), this argument only accepts an audit directory and collect() still opens <DATA_DIR>/findings.json, so the dashboard never reads the merged finding_id/triage_class output. In that context, confident judged_fp rows remain in every KPI/chart/table as raw findings, defeating the overlay’s de-noising; prefer/accept the triaged file or make apply_verdicts update the file this path reads before rendering.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Accurate observation, but intentionally out of scope for this PR. build_dashboard.py's change here is only the positional DATA_DIR (read any audit-output folder); wiring the triaged overlay into the dashboard is explicitly deferred — see the PR description's "Next (not in this PR)": apply_verdicts (guard now passes) + dashboard.

Worth noting the fix is also bigger than swapping the input filename: collect() doesn't read triage_class at all, so pointing it at findings-triaged.json alone wouldn't de-noise anything — the dashboard needs genuine triage-aware filtering (drop/flag judged_fp), which is the feature that follow-up will add. Leaving this thread open as a tracked reminder for that PR.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

@PhysShell I'll review the changes now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@viz/apply_verdicts.py`:
- Around line 126-129: The merged summary in apply_verdicts.run() is dropping
run_id from the original document, so preserve it when building merged alongside
the existing verdict_summary and findings. Update the merged dictionary
construction to carry fdoc’s run_id through unchanged (along with the other
summary fields) so downstream consumers can use it in the report footer.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 206c559b-e676-46cb-80e1-6cc5b3fe943a

📥 Commits

Reviewing files that changed from the base of the PR and between af1c239 and 2ac6ec7.

📒 Files selected for processing (8)
  • .gitignore
  • docs/fp-judge/STATUS.md
  • docs/fp-judge/rubric.md
  • docs/fp-judge/verdict-contract.md
  • oracle/fixtures/findings-fp-control.json
  • viz/apply_verdicts.py
  • viz/build_dashboard.py
  • viz/history.jsonl

Comment thread viz/apply_verdicts.py
The verdict-contract (§2) specifies run_id as an fp-verdicts.json envelope
field that the domain carries through into the report footer. run() forwarded
model and generated_from but dropped run_id, losing judge-run provenance for
downstream consumers. Pull it from the overlay alongside the other provenance
fields.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFSpD9yXgXePrFFX62XZ53
@PhysShell
PhysShell merged commit f9b4af4 into main Jul 2, 2026
2 of 3 checks passed
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.

2 participants