Skip to content

fix(insights): refuse ungrounded quantitative claims - #2783

Merged
Sinity merged 5 commits into
masterfrom
feature/fanout/rigor-contracts
Jul 13, 2026
Merged

Sinity merged 5 commits into
masterfrom
feature/fanout/rigor-contracts

Conversation

@Sinity

@Sinity Sinity commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refuse unsupported quantitative claims in insight rollups and claim-vs-evidence reports.

Problem

Cost-rollup confidence previously collapsed an absent priced-session denominator into 0.0. The rigor audit also had no registry-derived proof that every public numeric leaf had an evidence contract or explicit true-zero rationale. Failure-follow-up reports could publish a classified-only rate using a classified denominator below n_min.

Solution

  • Make cost-rollup confidence nullable in both aggregation routes and render absent confidence as uncovered.
  • Derive public numeric leaves recursively from registered production item models. Every leaf has an exact RigorFieldContract or RigorFieldExemption; the policy rejects missing models, unclassified leaves, non-nullable null-over-empty contract targets, and contracts that disable null refusal.
  • Apply n_min to each failure-follow-up rate's own denominator. Split and aggregate classified-only rates now have independent coverage/publication status and remain null below threshold. Calibration precision/recall retain their separate labeled-sample semantics.

Acceptance criteria

Bead Status Evidence
Ref polylogue-uwk3 Satisfied Every current registered public numeric leaf is exactly contracted or explicitly exempted; the static policy rejects new nested metrics and non-nullable null-over-empty contracts.
Ref polylogue-jph5 Satisfied Thin failure-follow-up rates are marked insufficient/not-supported and publish null values, including generated public artifacts.

Verification

  • Focused rigor, registry, policy, and claim tests passed after the final fixes.
  • Insight-honesty policy JSON: no uncovered products, missing item models, unclassified numeric fields, or invalid nullable contracts.
  • Pre-push quick verification: format, lint, mypy, rendered surfaces, topology, and layering checks passed.
  • Isolated demo insight-rigor audit: all 11 registered products reported covered; unpriced cost rollups report unknown confidence.

Anti-vacuity: rollup tests exercise both the production SQLite route and pure reducer; restoring the 0.0 fallback fails them. The rigor-policy regressions replace real registered response models with nested numeric/non-nullable variants; removing recursive discovery, exact-path coverage, or nullable validation makes them fail. Claim tests call build_report against a fixture SQLite archive; removing either denominator-specific n_min gate publishes a rate and fails the assertions. The artifact regression writes a thin aggregate report and requires explicit refusal statuses in every public summary surface.

Cost-rollup confidence now renders null when no priced sessions provide a denominator. The rigor policy enforces all known zero-denominator field contracts, and claim-vs-evidence suppresses rates for split cells below n_min.

Compatibility: cost_rollup confidence is now nullable when pricing evidence is absent.

Co-Authored-By: Codex <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 39 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c2bcef11-ba80-4a80-9080-0c3bb0c3aeda

📥 Commits

Reviewing files that changed from the base of the PR and between 901825e and 0d4da12.

📒 Files selected for processing (14)
  • devtools/claim_vs_evidence.py
  • devtools/verify_insight_rigor_honesty.py
  • docs/insights-rigor-matrix.md
  • polylogue/insights/archive.py
  • polylogue/insights/archive_rollups.py
  • polylogue/insights/registry.py
  • polylogue/insights/rigor.py
  • polylogue/storage/sqlite/archive_tiers/archive.py
  • tests/unit/devtools/test_claim_vs_evidence.py
  • tests/unit/devtools/test_verify_insight_rigor_honesty.py
  • tests/unit/insights/test_archive_rollups.py
  • tests/unit/insights/test_cost_rollup_summary_path.py
  • tests/unit/insights/test_registry.py
  • tests/unit/insights/test_rigor_audit.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fanout/rigor-contracts

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: 17d2c746dc

ℹ️ 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 polylogue/insights/archive.py Resolved
Comment thread devtools/claim_vs_evidence.py Resolved
The rigor policy now discovers direct public quantitative fields and requires either a denominator contract or an explicit true-zero rationale. Plain cost-rollup output preserves absent confidence as uncovered, and n_min now gates aggregate rates as well as split cells.

Co-Authored-By: Codex <[email protected]>
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 1

Findings and fixes:

  • Real: plain cost-rollup CLI output still converted absent confidence to 0. Fixed the descriptor to render uncovered; added a renderer regression test.
  • Real: the prior field-policy inventory was manually closed and could not detect an uncovered numeric field. The policy now discovers direct public numeric fields from the registry insight models and requires either a RigorFieldContract or a field-level true-zero exemption. Added a regression that removes the cost-rollup contract and observes the missing coverage.
  • Real: the human-readable rigor matrix was stale. Updated its cost-rollup semantics and removed the inaccurate claim that it is automatically regenerated.
  • Borderline resolved strictly: aggregate claim rates now obey n_min, not only split rows; below threshold they are explicitly insufficient_n / not_supported with null rate values.

Verification: focused rigor/registry/rollup/claim tests: 133 passed; devtools lab policy insight-honesty --json: no uncovered products or numeric-field coverage gaps; devtools render all --check: clean.

Commit: 9012399a0.

Problem: the quantitative-field audit enumerated a hand-maintained\nsubset of insight models, so newly exposed nested numbers could bypass\nthe rigor matrix.\n\nWhat changed: registry descriptors now identify their production item\nmodels, and the audit recursively discovers every public numeric leaf.\nEvery existing leaf has an exact field contract or exemption; the policy\nrejects missing item models and unclassified nested leaves.\n\nRef polylogue-uwk3\n\nCo-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 2

Finding: the numeric-field audit still used a hand-maintained model list, which omitted registered products and could allow a newly added nested public numeric field to bypass rigor coverage. A first pass also made envelope exemptions too broad.

Fix: every registered descriptor now names its production item model. The rigor policy recursively discovers numeric leaves from the registry, requires a model for every descriptor, and accepts only exact field-contract or field-exemption paths. The regression test replaces the cost-rollup pricing-basis model with a subclass carrying a new numeric leaf and proves the policy rejects it.

Verification:

  • Focused rigor, registry, and policy tests: 104 passed.
  • Insight-honesty policy JSON: no uncovered products, missing item models, or missing numeric fields.
  • Pre-push quick verification: format, lint, mypy, generated-surface, topology, layering, and policy checks passed.
  • Isolated demo insight-rigor audit: all 11 registered products reported covered; its six unpriced cost rollups had unknown confidence, as intended.

Survived scrutiny: contracts/exemptions now cover every current registered public numeric leaf exactly; a future nested metric cannot pass through a prefix or envelope exemption.

Problem: a field contract could promise null-over-empty while its\nregistered response model still serialized a numeric sentinel. Classified\nclaim rates also used the failure sample threshold instead of their own\nclassified denominator.\n\nWhat changed: the rigor policy rejects non-nullable or opt-out contracts,\nand claim-vs-evidence tracks support independently for classified rates in\nsplit and aggregate reports.\n\nRef polylogue-uwk3\nRef polylogue-jph5\n\nCo-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 3

Findings fixed:

  • A RigorFieldContract could claim null-over-empty while its registered response field was non-nullable. The policy now resolves contract paths through the production registry model and fails non-nullable targets or contracts that disable null refusal.
  • The classified-only claim rate used failures as its n_min gate. Split, aggregate, and window-3 classified rates now require classified outcomes to meet n_min independently; each exposes its own insufficient/support status.
  • Addressed the substantive inline Codex review on the classified denominator with the same fix and regression coverage.

Verification:

  • Focused rigor, policy, and claim tests: 43 passed.
  • Insight-honesty JSON: no uncovered products, models, fields, or invalid nullable contracts.
  • Pre-push quick verification: all checks passed.

Survived scrutiny: a non-nullable confidence model and a failure-supported/classified-thin report cell both fail the relevant policy or rate assertion.

Commit: 1e5fd81.

Problem: public claim-vs-evidence artifacts rendered null aggregate rates\nwithout their insufficient-sample status, leaving readers to infer why a\nclaim was withheld.\n\nWhat changed: public-summary, summary, and reproduction artifacts now\ncarry and render denominator-specific coverage/publication status next to\nevery aggregate and windowed rate.\n\nRef polylogue-jph5\n\nCo-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 4

Finding fixed: generated public claim-vs-evidence artifacts propagated null aggregate/window rates but omitted the associated coverage and publication status. Public readers saw only “not enough labels,” not an explicit refusal.

Fix: public-summary JSON, summary JSON, README, and PUBLIC_REPRODUCTION now carry and render n_min plus denominator-specific coverage/publication statuses alongside every exposed aggregate, classified, and windowed rate.

Verification:

  • claim-vs-evidence artifact tests: 7 passed.
  • The new n_min=5 out-dir regression asserts public-summary, summary, and PUBLIC_REPRODUCTION explicitly contain insufficient_n / not_supported for withheld aggregate rates.
  • Pre-push quick verification passed.

Survived scrutiny: no additional numeric-coverage, nullable-contract, split-rate, Bead-AC, or review-comment gap was found in the same cold review.

Commit: 0d4da12.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 5

Finding: the PR body overstated the n_min scope as every rate. Calibration precision/recall are separate labeled-sample metrics and intentionally retain their own semantics.

Fix: narrowed the PR body to failure-follow-up rates and explicitly distinguished calibration metrics. No runtime behavior changed.

The same cold review found no unresolved Bead-note, review-comment, numeric-coverage, nullable-contract, rate-gating, or public-artifact defect.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Final acceptance matrix — adversarial fixpoint reached

Bead AC status Evidence
Ref polylogue-uwk3 Satisfied Every current registered public numeric leaf is discovered recursively from its production item model and has an exact field contract or explicit field exemption. The policy rejects missing item models, unclassified nested fields, non-nullable null-over-empty contract targets, and contract opt-outs. Cost-rollup confidence is null/uncovered without priced sessions in both aggregation routes and plain rendering.
Ref polylogue-jph5 Satisfied Failure-follow-up rates are gated by their own denominators in split, aggregate, and window-3 reports. Thin rates are null with explicit insufficient_n/not_supported metadata in the report, summary JSON, public-summary JSON, README, and PUBLIC_REPRODUCTION. Calibration precision/recall remain explicitly outside this failure-follow-up n_min rule.

Final independent review found zero new substantive findings after re-reading both Beads (including notes/AC), the full branch diff, PR body/comments/inline threads, and production paths.

Final verification:

  • Insight-honesty policy JSON is clean.
  • Focused selector: 123 passed; one unrelated existing MCP discovery failure remains because join_typed_annotations lacks its _KNOWN_MINIMAL fixture. No changed path participates in that failure.
  • Branch worktree is clean; latest pushed commit is 0d4da12.

No Beads were closed and this PR was not merged.

@Sinity
Sinity merged commit 45afd76 into master Jul 13, 2026
3 of 16 checks passed
@Sinity
Sinity deleted the feature/fanout/rigor-contracts branch July 13, 2026 00:14
Sinity added a commit that referenced this pull request Jul 13, 2026
…807,2780,2790,2791,2795,2802,2806,2809

uwk3, jph5 (rigor-contracts #2783), bby.17 (web-cockpit #2793), dmp
(terminal-note #2801), ra3w (basetemp-fix #2807), r4no/bkff/r2kb
(extension-redesign #2780) fully satisfied — closed. nhjs (#2793), peo
(daemon-forensics #2802), 4g3n (#2780), 67ac/212.11 (demo-corpus #2795),
rsad (mcp-ergonomics #2790, real gaps remain per 5-iteration adversarial
cap), 9e5.8.4/jnj.7 (provider-origin #2806), mrxt/37t.12/p5g/rxdo.4
(annotation-judgment #2791), s7ae.8/20d.2 (live-performance-2 #2809)
partially satisfied — noted with disposition, left open.

Also discovered and documented the actual root cause of this session's
recurring bead-revert incidents: bd reimports the live database from
.beads/issues.jsonl on every CLI invocation, so a write not immediately
exported is lost the moment the next bd command runs. Every mutation in
this commit was individually export-verified against that behavior.

Co-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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.

1 participant