← Back to Pull requests

feat: expose diagnostic reductions and file permission options #117

Closed
unknown closed this pull request without merging on Oct 04, 2026 10:43 UTC
View on GitHub
unknown unknown commented on Oct 04, 2026 10:05 UTC
Author

[!NOTE]

Drafted by a LLM-based AI tool (Codex/GPT-6).

Downstream reports need per-chain energy diagnostics, reductions of diagnostic tables they have already calculated, and the permissions of an ordinary newly created file. These operations currently require repeated local code or private library functions.

Expose bfmi_per_chain and diagnostic_extrema without choosing variables or applying convergence thresholds. Retain the private energy-function compatibility path and route sampling_quality through the public operations. Add optional permission bits or mode="default" to atomic_write, plus a default_file_mode probe that does not change the process-wide creation mask. The existing default file permissions and failure behaviour remain intact.

Include the downstream reuse review and implementation record. The downstream migrations use APIs already available in version 0.16.2. Adopting these new diagnostic and permission APIs needs a later library release and downstream tests.

Validation passed for the full library suite with 1,199 tests and 5 skips, Ruff, Markdown formatting and spellcheck. Added tests cover named dimension order, missing and constant energy, unrounded diagnostic boundaries, unavailable diagnostics, nullable missing values in pandas and Arrow-backed columns, permission masks, copied metadata, invalid modes and preservation of the old file after failures. Platform and unavailable optional-dependency tests were skipped; tests used Python 3.14 with PYTENSOR_FLAGS=cxx= because the local C linker was unavailable.

The related downstream migrations use version 0.16.2 APIs. Their pull requests record their own validation results, including the passing 392-test vocabulary-growth slow suite.

  • Language and reading predictors

  • Vocabulary growth

  • US birth certificates
  • Diff: 254 lines (+190 / -64) across 3 files Reviewer: frankbuckley Review duration: 38m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.67) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 254 lines diff across 3 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.332
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.067
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #117"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 67.2% (HIGH) · Higher = larger blast radius
    67.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.2% · Safe to merge
    28.2%