← Back to Pull requests

feat(core): add a rightSizing finding that recommends a core count from the scaling model #216

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 26, 2026 16:23 UTC
Author

Intent

Add a finding to the Spark event-log analyzer that turns the what-if scaling simulation into a recommendation. Today the scaling simulation and the efficiency model show numbers, and the utilization finding flags idle allocation, but nothing says "this run needs about half the cores". Competing tools score 2 or more on compute-efficiency criteria (a per-SQL idle-core rate, a cost model, and an executor-count sweep and critical-path simulation), while this tool's scaling and efficiency lenses are descriptive, gated only through the user-set --min-efficiency. The new finding builds on the existing scaling simulation in packages/core/src/scaling-sim.ts (which self-checks its model against the observed makespan) and on the existing idle-allocation work in utilization; it does not need currency or cost output.

Requested behavior:

  • One finding that fires when the smallest core count whose modeled makespan stays within a stated percentage of the observed makespan is well below the observed core count, with the computed numbers in its text.

  • Suppress it when the model error exceeds a stated bound, and mark it low confidence like the other model-based findings.

  • Calibrate its thresholds against the public corpus with the corpus gate, and add the thresholds to the detector threshold table.
  • What Changed

  • New rightSizing app detector (tag UTIL, always low confidence) in packages/core/src/detectors.ts. It finds the smallest core count whose modeled stage time stays within tolerancePct (10%) of the observed stages-active time. It reports that count when the count is at most maxCoreShare (75%) of the peak cores held, on runs with at least minBaselineCores (8). The finding stays silent when the model error is above maxModelErrorPct (20%). The text and evidence carry the observed and modeled times, the observed cores and the model error. --thresholds can override all four thresholds.

  • scaling-sim.ts moves the baseline calibration into a shared helper and adds smallestCoresWithinTolerance, a binary search over core counts. The finding type, ID discriminators, presentation row (it shares the shrink-or-enable-dynamic-allocation advice with utilization) and evidence report are wired up in core. A new RightSizing widget sits in the dashboard's action region.

  • Adds core tests for the search and the detector, plus a view test for the widget. Documents the finding and its thresholds in the user guide, the detector threshold table, the board-widgets and evidence-report contributor pages, and the CI page.
  • Risk Assessment

    ✅ Low: The change adds one bounded, always-low-confidence finding behind four frozen thresholds that the corpus gate shows never fire. The model's monotonic binary search is correct. The fix round did what the user asked: it recorded the corpus result in the provenance row, named the peak baseline in the finding text and docs, and added a shared idleCapacityRecommendation helper. It did not change simulateScaling.

    Testing

    I made five synthetic Spark logs and ran them through the real CLI (JSON and Markdown) and the Vite dashboard in headless Chromium. On the oversized run, the finding says 8 of the 16 cores held at peak, within 10% of the observed 10.0s, at low confidence. It is silent on the 50%-error, busy and small-cluster runs. Raising maxModelErrorPct to 60 makes it fire on the 50%-error run, which proves the error bound causes the suppression. The threshold overrides change or silence it as expected. The corpus gate passes with no changes. The dashboard ranks it as F2 UTIL and renders the Right-sized Cluster widget, with screenshots captured. The targeted unit tests pass. The dev server and the corpus submodule were removed, and the worktree is clean.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
  • | Scenario | Result | Live | Evidence |
    | --- | --- | --- | --- |
    | CLI user analyzes an over-provisioned run: rightSizing fires with core counts, observed time and low confidence | ✅ pass | live | oversized.json / oversized.md: value 8, observedCores 16, observedActiveMs 10000, modelErrorPct 0, confidence low, recommendation names 8 of 16 cores held at peak |
    | Adversarial: model error 50% (> 20% bound) suppresses the finding, and raising maxModelErrorPct to 60 makes it fire | ✅ pass | live | model-miss.json has no rightSizing. With --thresholds maxModelErrorPct 60 it fires with modelErrorPct 50 and a 'Produced with tuned thresholds' note |
    | Adversarial: stages that use most cores, or a cluster under 8 cores, get no rightSizing finding | ✅ pass | live | busy.json and small.json findings lists have no rightSizing |
    | Dynamic allocation already on: the advice changes to lowering spark.dynamicAllocation.maxExecutors | ✅ pass | live | oversized-dynalloc.json recommendation and remediation key spark.dynamicAllocation.maxExecutors |
    | CLI --thresholds overrides change or silence the finding and mark it tuned | ✅ pass | live | maxCoreShare 0.4 gives no finding. tolerancePct 40 gives value 6 with tunedThresholds {tolerancePct: 40 default 10} |
    | Detector catalog exposes the rightSizing thresholds (10 / 0.75 / 8 / 20) | ✅ pass | live | oversized.json detectors entry for rightSizing |
    | Corpus gate passes with no finding changes, which matches the threshold-table provenance row | ✅ pass | live | corpus-gate.txt: 'No finding changes against dev/corpus-snapshot.json'. The snapshot has no rightSizing entry |
    | Dashboard user loads the run: the finding shows as UTIL 'Right-size cluster' and the Right-sized Cluster widget shows 8 of 16 cores. The model-miss run shows neither | ✅ pass | live | ui-oversized-dashboard.png, ui-oversized-right-sizing-card.png, ui-oversized-f2-evidence.png, ui-model-miss-full-report.png. No page or console errors |

    !Dashboard with rightSizing finding (F2 UTIL)
    !Right-sized Cluster widget card
    !F2 row with evidence expanded
    !Model-miss run full report (no Right-sized widget)
    <details>
    <summary>Evidence: CLI JSON for oversized run</summary>

    {
      "schemaVersion": 5,
      "summary": {
        "app": {
          "id": "application_0000000000000_0001",
          "name": "oversized",
          "sparkVersion": "3.5.0"
        },
        "stageCount": 1,
        "jobCount": 1,
        "sqlExecutionCount": 0,
        "skippedLines": 0,
        "findingCount": 6,
        "impactBandCounts": {
          "critical": 0,
          "warning": 3,
          "info": 3
        },
        "actionableFindingCount": 5,
        "actionableImpactBandCounts": {
          "critical": 0,
          "warning": 3,
          "info": 2
        },
        "clean": false,
        "outcome": {
          "failedJobs": 0,
          "totalJobs": 1,
          "failureReason": null,
          "failureReasonStageId": null
        },
        "runShape": {
          "wallClockMs": 100000,
          "efficiencyPct": 10,
          "unusedCoreTimePct": 95,
          "etlPhasesMs": null,
          "peakBusyCores": 8
        }
      },
      "verdict": {
        "title": "Start with cluster size: 95% of executor capacity sat idle",
        "summary": [
          "Its one job succeeded.",
          "5 findings in 5 places. The count leaves out 1 note on incomplete or missing log data."
        ],
        "steps": [
          {
            "key": "app:utilization",
            "stageId": null,
            "type": "utilization",
            "tag": "UTIL",
            "leadFindingId": "47606250",
            "actionLabel": "Reduce cluster size",
            "recommendation": "Average executor utilization was only 5%: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.",
            "impact": "0.4 core-h",
            "impactMeaning": "of idle core capacity",
            "relatedTypes": [],
            "text": "Reduce cluster size: Average executor utilization was only 5%: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation. Potential savings: 0.4 core-h of idle core capacity"
          },
          {
            "key": "app:rightSizing",
            "stageId": null,
            "type": "rightSizing",
            "tag": "UTIL",
            "leadFindingId": "8a2b006e",
            "actionLabel": "Right-size cluster",
            "recommendation": "The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.",
            "impact": null,
            "impactMeaning": null,
            "relatedTypes": [],
            "text": "Right-size cluster: The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation."
          },
          {
            "key": "app:memoryUtilization:idleCores",
            "stageId": null,
            "type": "memoryUtilization",
            "tag": "MEM",
            "leadFindingId": "92fc60c1",
            "actionLabel": "Reduce idle cores",
            "recommendation": "95% of available core-time ran no task: either reduce cluster size (spark.executor.instances) or enable dynamic allocation.",
            "impact": "0.1 GB-h",
            "impactMeaning": "of unused executor memory (modeled)",
            "relatedTypes": [],
            "text": "Reduce idle cores: 95% of available core-time ran no task: either reduce cluster size (spark.executor.instances) or enable dynamic allocation. Potential savings: 0.1 GB-h of unused executor memory (modeled)"
          }
        ],
        "costSteps": [],
        "idle": {
          "coreHours": 0.4221777777777778,
          "allocatedCoreHours": 0.4444,
          "pct": 95,
          "text": "0.4 core-h (95%) of the allocation ran no task."
        },
        "remainingPlaces": 2,
        "copyText": "Spark run oversized: Start with cluster size: 95% of executor capacity sat idle\n\n1. Reduce cluster size: Average executor utilization was only 5%: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation. Potential savings: 0.4 core-h of idle core capacity\n2. Right-size cluster: The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.\n3. Reduce idle cores: 95% of available core-time ran no task: either reduce cluster size (spark.executor.instances) or enable dynamic allocation. Potential savings: 0.1 GB-h of unused executor memory (modeled)\n\n2 more places to look at in the full findings list."
      },
      "evidenceAvailability": {
        "schemaVersion": 1,
        "entries": [
          {
            "key": "executorMetrics",
            "state": "disabled",
            "reasonCode": "explicitlyDisabled",
            "summary": "Disabled in this event log, by its configuration or by Spark's default."
          },
          {
            "key": "rddStorageSnapshots",
            "state": "notEmitted",
            "reasonCode": "noRddStorageSnapshot",
            "summary": "Stages were submitted without RDD storage snapshots."
          },
          {
            "key": "sqlPlan",
            "state": "notApplicable",
            "reasonCode": "noSqlExecution",
            "summary": "Not applicable to this event log."
          },
          {
            "key": "sparkConfiguration",
            "state": "present",
            "reasonCode": "observed",
            "summary": "Observed in this event log.",
            "evidence": {
              "eventType": "environmentUpdates",
              "count": 1
            }
          },
          {
            "key": "taskCoreTime",
            "state": "present",
            "reasonCode": "observed",
            "summary": "Observed in this event log.",
            "evidence": {
              "eventType": "taskRecords",
              "count": 8
            }
          },
          {
            "key": "infrastructureContext",
            "state": "outsideEventLog",
            "reasonCode": "outsideEventLogScope",
            "summary": "Available outside local event-log scope."
          },
          {
            "key": "sourceContext",
            "state": "outsideEventLog",
            "reasonCode": "outsideEventLogScope",
            "summary": "Available outside local event-log scope."
          },
          {
            "key": "costContext",
            "state": "outsideEventLog",
            "reasonCode": "outsideEventLogScope",
            "summary": "Available outside local event-log scope."
          }
        ]
      },
      "detectors": [
        {
          "type": "skew",
          "version": 1,
          "scope": "stage",
          "thresholds": {
            "ratioWarn": 3,
            "minTasksForP95": 20,
            "dataShareMin": 0.5,
            "floorPctWarn": 0.005
          },
          "docAnchor": "#bottleneck-skew"
        },
        {
          "type": "stageShape",
          "version": 2,
          "scope": "stage",
          "thresholds": {
            "pRatioMax": 0.5,
            "oiRatioMax": 10,
            "skewWarn": 3,
            "stageShareMin": 0.5,
            "lowParallelismFloorPct": 0.005,
            "taskStageSkewFloorPct": 0.005
          },
          "docAnchor": "#bottleneck-stage-shape"
        },
        {
          "type": "shuffle",
          "version": 1,
          "scope": "stage",
          "thresholds": {
            "minBytes": 52428800,
            "stageFloorPct": 0.005
          },
          "docAnchor": "#bottleneck-shuffle"
        },
        {
          "type": "partitionSizing",
          "version": 1,
          "scope": "stage",
          "thresholds": {
            "skewRatio": 5,
            "skewFloorBytes": 268435456,
            "lowParTotalBytes": 1073741824,
            "lowParMaxTasks": 7,
            "maxPartBytes": 5368709120
          },
          "docAnchor": "#bottleneck-partition-sizing"
        },
        {
          "type": "spill",
          "version": 1,
          "scope": "stage",
          "thresholds": {
            "singleTaskDiskGiB": 1,
            "singleTaskMemGiB": 4,
            "highDiskGiB": 1,
            "highTaskDiskMB": 512,
            "highMemGiB": 4,
            "medDiskMB": 256,
            "medMemGiB": 1,
            "skewRatio": 5,
            "skewDiskFloorMB": 128,
            "skewMemFloorMB": 256,
            "skewMinTasks": 10,
            "stageFloorPct": 0.005,
            "wideRowRatio": 10,
            "wideRowMinInputMB": 64
          },
          "docAnchor": "#bottleneck-spill"
        },
        {
          "type": "gc",
          "version": 1,
          "scope": "stage",
          "thresholds": {
            "warnPct100": 10,
            "lowInfoPct100": 5,
            "minRunTimeMs": 10000,
            "lowInfoFloorPct": 0.005
          },
          "docAnchor": "#bottleneck-gc"
        },
        {
          "type": "slowHost",
          "version": 2,
          "scope": "stage",
          "threshol
    
    ... [13939 bytes truncated] ...
    
    emory-utilization",
          "impactEstimate": {
            "basis": "informational",
            "wallClock": null,
            "estimateMethod": "modeled",
            "coreTimeMs": null
          }
        }
      ],
      "writeTargets": {
        "writes": [],
        "executionsWithoutPlan": [],
        "skippedLines": 0
      },
      "recommendations": [
        {
          "type": "utilization",
          "tag": "UTIL",
          "actionLabel": "Reduce cluster size",
          "findingCount": 1,
          "findingIds": [
            "47606250"
          ],
          "kind": "resource",
          "unit": "coreHours",
          "total": 0.42217777777777776,
          "impact": "0.4 core-h",
          "impactMeaning": "of idle core capacity"
        },
        {
          "type": "memoryUtilization",
          "tag": "MEM",
          "actionLabel": "Reduce idle cores",
          "findingCount": 1,
          "findingIds": [
            "92fc60c1"
          ],
          "kind": "resource",
          "unit": "mbSeconds",
          "total": 534983.6799999999,
          "impact": "0.1 GB-h",
          "impactMeaning": "of unused executor memory (modeled)"
        },
        {
          "type": "rightSizing",
          "tag": "UTIL",
          "actionLabel": "Right-size cluster",
          "findingCount": 1,
          "findingIds": [
            "8a2b006e"
          ],
          "kind": "count",
          "byImpactBand": {
            "warning": 1
          },
          "impact": null,
          "impactMeaning": null
        },
        {
          "type": "gc",
          "tag": "GC",
          "actionLabel": "Right-size executor memory",
          "findingCount": 1,
          "findingIds": [
            "07b41a64"
          ],
          "kind": "count",
          "byImpactBand": {
            "info": 1
          },
          "impact": null,
          "impactMeaning": null
        },
        {
          "type": "configAudit",
          "tag": "CFG",
          "actionLabel": "Switch to Kryo",
          "findingCount": 1,
          "findingIds": [
            "6650899b"
          ],
          "kind": "count",
          "byImpactBand": {
            "info": 1
          },
          "impact": null,
          "impactMeaning": null
        }
      ],
      "cleanChecks": [
        {
          "type": "skew",
          "tag": "SKEW",
          "thresholdSummary": "P95 task time over 3× the median (the longest task on stages under 20 tasks), and the slow tasks read correspondingly more data"
        },
        {
          "type": "stageShape",
          "tag": "SHAPE",
          "thresholdSummary": "under 0.5 tasks per core, output over 10× input, or one task spanning over 50% of the stage's wall-clock at over 3× the median task"
        },
        {
          "type": "shuffle",
          "tag": "SHFL",
          "thresholdSummary": "stage shuffle read above 50 MiB"
        },
        {
          "type": "partitionSizing",
          "tag": "PART",
          "thresholdSummary": "a shuffle partition over 5× the median or over 5 GiB, or 1 GiB of shuffle on 7 tasks or fewer"
        },
        {
          "type": "spill",
          "tag": "SPILL",
          "thresholdSummary": "single-task disk spill above 1 GiB"
        },
        {
          "type": "slowHost",
          "tag": "HOST",
          "thresholdSummary": "a host 2× slower than its peers by mean task time (per-executor figures from 1.33×, and only when the stage's own task-time spread cannot explain the gap)"
        },
        {
          "type": "stageSlowness",
          "tag": "SLOW",
          "thresholdSummary": "a stage running far longer than its peers, not attributable to a single slow host"
        },
        {
          "type": "stageFailed",
          "tag": "SFAIL",
          "thresholdSummary": "a stage that failed outright"
        },
        {
          "type": "failures",
          "tag": "FAIL",
          "thresholdSummary": "over 5% of a stage's tasks failing"
        },
        {
          "type": "straggler",
          "tag": "STRAG",
          "thresholdSummary": "one or more tasks finishing far after the rest of their stage, for a reason other than reading more data"
        },
        {
          "type": "speculationWaste",
          "tag": "SPEC",
          "thresholdSummary": "5+ discarded speculative attempts wasting at least 60s"
        },
        {
          "type": "retryWaste",
          "tag": "RETRY",
          "thresholdSummary": "3+ retried attempts wasting at least 30s"
        },
        {
          "type": "tinyTask",
          "tag": "TINY",
          "thresholdSummary": "100+ tasks with a median of 500ms or less and a P95 of 1000ms or less"
        },
        {
          "type": "incompleteRun",
          "tag": "INCMP",
          "thresholdSummary": "an event log missing its terminal ApplicationEnd event"
        },
        {
          "type": "coldStart",
          "tag": "COLD",
          "thresholdSummary": "the first stage waiting over 30s for an executor"
        },
        {
          "type": "cacheUtilization",
          "tag": "CSTOR",
          "thresholdSummary": "cached partitions evicted or spilled to disk"
        },
        {
          "type": "coreLocality",
          "tag": "LOCAL",
          "thresholdSummary": "task placement missing data-local core assignment"
        },
        {
          "type": "autoscalingChurn",
          "tag": "CHRN",
          "thresholdSummary": "over 30% of removed executors living under 2 minutes"
        },
        {
          "type": "cachingOpportunity",
          "tag": "CACHE",
          "thresholdSummary": "a dataset re-read from source multiple times with no cache/persist"
        },
        {
          "type": "jobFailureRate",
          "tag": "JOBS",
          "thresholdSummary": "at least 10% of jobs failing"
        },
        {
          "type": "duplicatePlanSubtree",
          "tag": "PLAN",
          "thresholdSummary": "the same physical plan subtree executed more than once"
        },
        {
          "type": "smallFiles",
          "tag": "PLAN",
          "thresholdSummary": "over 100 files averaging under 3 MiB"
        },
        {
          "type": "overBroadcast",
          "tag": "PLAN",
          "thresholdSummary": "a broadcast over 1 GiB"
        },
        {
          "type": "underBroadcast",
          "tag": "PLAN",
          "thresholdSummary": "a join side its type can broadcast, between 1 MiB and 1 GiB, that skipped broadcast"
        },
        {
          "type": "pythonUdf",
          "tag": "PLAN",
          "thresholdSummary": "over 64 MiB sent to Python workers by stages running over 30 s"
        },
        {
          "type": "nestedLoopJoin",
          "tag": "PLAN",
          "thresholdSummary": "a nested-loop or cartesian join with over 1,000,000 output rows, at least 10x its larger input"
        }
      ],
      "notRunChecks": [],
      "generator": {
        "name": "sparkforensics-cli",
        "version": "0.11.0",
        "buildId": "ec6653141590b1213ffe129ecc9e5b52413a26800ff949f6c8ff0f57248e1653"
      },
      "app": {
        "id": "application_0000000000000_0001",
        "attemptId": null
      },
      "metrics": {
        "schemaVersion": 1,
        "runComplete": true,
        "time": {
          "wallClockMs": 100000,
          "executorCpuTimeMs": 80000,
          "executorRunTimeMs": 80000,
          "gcTimeMs": 0
        },
        "data": {
          "memorySpillBytes": 0,
          "diskSpillBytes": 0,
          "shuffleReadBytes": 0,
          "shuffleWriteBytes": 0,
          "inputBytes": 0,
          "outputBytes": 0,
          "outputRows": 0,
          "peakExecutionMemoryBytes": null
        },
        "shape": {
          "taskCount": 8,
          "stageCount": 1,
          "failedStageAttempts": 0,
          "retriedStages": 0,
          "failedTasks": 0,
          "retriedTasks": 0,
          "maxSkew": 1
        },
        "allocation": {
          "coreHours": 0.4444,
          "memoryGbHours": 0.1527625,
          "dynamicAllocation": "off",
          "executorsPeak": 4,
          "executorsMean": 3.9996,
          "executorCores": 4,
          "executorSeconds": 399.96
        },
        "python": {
          "shareOfTaskRunTime": 0
        },
        "stages": {
          "count at job.py:#§": {
            "stageIds": [
              0
            ],
            "failed": false,
            "retried": false,
            "python": false,
            "durationMs": 10000,
            "executorCpuTimeMs": 80000,
            "executorRunTimeMs": 80000,
            "gcTimeMs": 0,
            "memorySpillBytes": 0,
            "diskSpillBytes": 0,
            "shuffleReadBytes": 0,
            "shuffleWriteBytes": 0,
            "inputBytes": 0,
            "outputBytes": 0,
            "outputRows": 0,
            "peakExecutionMemoryBytes": null,
            "taskCount": 8,
            "failedTasks": 0,
            "retriedTasks": 0,
            "skew": 1
          }
        }
      },
      "effectiveConf": {
        "schemaVersion": 1,
        "values": {
          "spark.app.id": "application_0000000000000_0001",
          "spark.dynamicAllocation.enabled": "false",
          "spark.executor.cores": "4",
          "spark.executor.instances": "4"
        },
        "maskedKeys": [],
        "absentKeys": []
      }
    }
    

    </details>
    <details>
    <summary>Evidence: CLI Markdown for oversized run</summary>

    # Spark run evidence report
    
    - Application: oversized (application_0000000000000_0001)
    - Spark version: 3.5.0
    - Stages: 1 · Jobs: 1 · SQL executions: 0
    - Findings: 6 (critical 0, warning 3, info 3)
    - Findings to act on: 5 (critical 0, warning 3, info 2)
    - Outcome: Its one job succeeded.
    - Wall-clock: 1m 40s
    - Efficiency: 10% (share of the run with a stage running)
    - Unused core time: 95% (driver idle plus executor slack, as a share of available core time)
    - Peak busy cores: 8
    
    ## Verdict
    
    Start with cluster size: 95% of executor capacity sat idle
    
    Its one job succeeded. 5 findings in 5 places. The count leaves out 1 note on incomplete or missing log data.
    
    0.4 core-h (95%) of the allocation ran no task.
    
    By cluster time (task-hours):
    
    1. [UTIL] Reduce cluster size: Average executor utilization was only 5%: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation. Potential savings: 0.4 core-h of idle core capacity
    2. [UTIL] Right-size cluster: The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.
    3. [MEM] Reduce idle cores: 95% of available core-time ran no task: either reduce cluster size (spark.executor.instances) or enable dynamic allocation. Potential savings: 0.1 GB-h of unused executor memory (modeled)
    
    2 more places to look at in the Findings section below.
    
    ## Fix these first (5)
    
    1. [UTIL] Reduce cluster size
       - 0.4 core-h of idle core capacity · ×1 finding(s)
    2. [MEM] Reduce idle cores
       - 0.1 GB-h of unused executor memory (modeled) · ×1 finding(s)
    3. [UTIL] Right-size cluster
       - 1 warning · ×1 finding(s)
    4. [GC] Right-size executor memory
       - 1 info · ×1 finding(s)
    5. [CFG] Switch to Kryo
       - 1 info · ×1 finding(s)
    
    ## Findings (6)
    
    \### Memory Utilization · warning
    - action: Reduce idle cores
    - idleCoreRate: 95
    - 95% of available core-time ran no task: either reduce cluster size (spark.executor.instances) or enable dynamic allocation.
    - impact: 0.1 GB-h of unused executor memory (modeled) (estimateMethod: modeled)
    - estimate: Modeled; 0.1 GB-h of unused executor memory, which may not shorten the run.
    - detector version: 1
    - evidence:
      - variant: idleCores
    
    \### Right-Sized Cluster · warning
    - action: Right-size cluster
    - rightSizedCores: 8
    - The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.
    - confidence: low
    - validation: Modeled from each stage's task time spread over its cores, which misses the observed stage time by 0% at the 16 cores held at peak (the scaling simulator measures its error at every executor added, so the two differ when executors were replaced or scaled): re-run with fewer cores to confirm.
    - detector version: 1
    - evidence:
      - modelErrorPct: 0
      - modeledActiveMs: 10000
      - observedActiveMs: 10000
      - observedCores: 16
    
    \### Executor Utilization · warning
    - action: Reduce cluster size
    - avgUtilization: 5
    - Average executor utilization was only 5%: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.
    - impact: 0.4 core-h of idle core capacity (estimateMethod: measured)
    - estimate: Measured; 0.4 core-h of idle core capacity, which may not shorten the run.
    - detector version: 1
    - evidence:
      - cpuUtilizationPct: 5
    
    \### Config Audit · info
    - action: Switch to Kryo
    - config: (default JavaSerializer)
    - Current serializer is the default JavaSerializer: consider spark.serializer=org.apache.spark.serializer.KryoSerializer for faster, smaller buffers.
    - detector version: 1
    - evidence:
      - property: spark.serializer
    
    \### GC Pressure · info (stage 0)
    - action: Right-size executor memory
    - gcPct: 0
    - GC consumed only 0% of executor run time: memory may be over-provisioned; consider reducing spark.executor.memory for cost savings.
    - confidence: high
    - validation: Checked only on stages with at least 10s of executor run time.
    - detector version: 1
    - evidence:
      - direction: low
    
    \### Memory Utilization · info
    - action: Executor heap peaks unavailable
    - memoryBand: null
    - Executor heap peaks are missing from this log: Spark samples them at the executor heartbeat, so tasks shorter than the heartbeat interval report zeros (and local mode reports zeros throughout), and executor memory sizing was not measured. To measure it, set spark.eventLog.logStageExecutorMetrics=true to record the peaks per stage.
    - detector version: 1
    - evidence:
      - dataUnavailable: true
      - variant: memoryBand
    
    ## Evidence availability
    
    - executorMetrics: disabled (Disabled in this event log, by its configuration or by Spark's default.)
    - rddStorageSnapshots: notEmitted (Stages were submitted without RDD storage snapshots.)
    - sqlPlan: notApplicable (Not applicable to this event log.)
    - sparkConfiguration: present (Observed in this event log.)
    - taskCoreTime: present (Observed in this event log.)
    - infrastructureContext: outsideEventLog (Available outside local event-log scope.)
    - sourceContext: outsideEventLog (Available outside local event-log scope.)
    - costContext: outsideEventLog (Available outside local event-log scope.)
    
    ## Detectors
    
    - skew (v1, stage), thresholds: {"ratioWarn":3,"minTasksForP95":20,"dataShareMin":0.5,"floorPctWarn":0.005}
    - stageShape (v2, stage), thresholds: {"pRatioMax":0.5,"oiRatioMax":10,"skewWarn":3,"stageShareMin":0.5,"lowParallelismFloorPct":0.005,"taskStageSkewFloorPct":0.005}
    - shuffle (v1, stage), thresholds: {"minBytes":52428800,"stageFloorPct":0.005}
    - partitionSizing (v1, stage), thresholds: {"skewRatio":5,"skewFloorBytes":268435456,"lowParTotalBytes":1073741824,"lowParMaxTasks":7,"maxPartBytes":5368709120}
    - spill (v1, stage), thresholds: {"singleTaskDiskGiB":1,"singleTaskMemGiB":4,"highDiskGiB":1,"highTaskDiskMB":512,"highMemGiB":4,"medDiskMB":256,"medMemGiB":1,"skewRatio":5,"skewDiskFloorMB":128,"skewMemFloorMB":256,"skewMinTasks":10,"stageFloorPct":0.005,"wideRowRatio":10,"wideRowMinInputMB":64}
    - gc (v1, stage), thresholds: {"warnPct100":10,"lowInfoPct100":5,"minRunTimeMs":10000,"lowInfoFloorPct":0.005}
    - slowHost (v2, stage), thresholds: {"minHosts":3,"minTasks":15,"ratioWarn":2,"minShare":0.2,"shareWarn":0.75,"taskShareWarn":0.5,"ratioTiers":[1.33,1.78,3.16,10],"floorMs":1000,"floorBytes":67108864,"stageFloorPct":0.005,"outlierAlpha":0.005}
    - stageSlowness (v2, stage), thresholds: {"infoMin":15}
    - stageFailed (v1, stage), thresholds: {}
    - failures (v2, stage), thresholds: {"minTasks":10,"warnRate":0.05,"critRate":0.2}
    - straggler (v1, stage), thresholds: {"minTasks":10,"shareWarn":0.05,"shareWarnAtFloor":0.025,"warnPct":0.1,"critPct":0.2,"floorPctWarn":0.005,"floorPctCrit":0.02}
    - speculationWaste (v1, stage), thresholds: {"minWasted":5,"minWasteMs":60000}
    - retryWaste (v1, stage), thresholds: {"minWasted":3,"minWasteMs":30000}
    - tinyTask (v1, stage), thresholds: {"minTasks":100,"maxP50":500,"maxP95":1000,"stageFloorPct":0.005}
    - incompleteRun (v1, app), thresholds: {}
    - coldStart (v1, app), thresholds: {"gapSeconds":30}
    - utilization (v1, app), thresholds: {"minUtil":0.6}
    - rightSizing (v1, app), thresholds: {"tolerancePct":10,"maxCoreShare":0.75,"minBaselineCores":8,"maxModelErrorPct":20}
    - memoryUtilization (v1, app), thresholds: {"idleCoreWarn":0.5,"bandTooHigh":0.7,"wasteBufferMultiplier":1.5}
    - cacheUtilization (v2, app), thresholds: {"cachedRatioWarn":0.5,"cachedRatioInfo":0.9,"diskRatioWarn":0.4,"diskRatioInfo":0.15}
    - coreLocality (v1, app), thresholds: {"minTasks":50,"warnRatio":0.15,"critRatio":0.35}
    - autoscalingChurn (v2, app), thresholds: {"shortLivedMs":120000,"warningPct":0.3,"criticalPct":0.6,"minExecutors":5}
    - cachingOpportunity (v1, app), thresholds: {"minExecutions":2}
    - jobFailureRate (v1, app), thresholds: {"infoRate":0.1,"warnRate":0.3,"critRate":0.5}
    - configAudit (v1, config), thresholds: {}
    - configAudit (v1, config), thresholds: {}
    - configAudit (v1, config), thresholds: {"floorMB":384,"floorPct":0.1}
    - duplicatePlanSubtree (v2, sql), thresholds: {"minSubtreeSize":3,"minOccurrences":2,"stageFloorPct":0.005}
    - smallFiles (v2, sql), thresholds: {"minFiles":100,"maxAvgFileSizeMB":3}
    - broadcastSizing (v3, sql), thresholds: {"broadcastTiers":[10485760,104857600,1073741824],"comparisonTiers":[10737418240,322122547200],"overBroadcastBytes":1073741824,"minSmallerSideBytes":1048576}
    - pythonUdf (v1, sql), thresholds: {"minBytesSent":67108864,"minStageMs":30000}
    - nestedLoopJoin (v1, sql), thresholds: {"minOutputRows":1000000,"minExpansion":10}
    
    ## Clean checks (26)
    
    - [SKEW] skew: P95 task time over 3× the median (the longest task on stages under 20 tasks), and the slow tasks read correspondingly more data
    - [SHAPE] stageShape: under 0.5 tasks per core, output over 10× input, or one task spanning over 50% of the stage's wall-clock at over 3× the median task
    - [SHFL] shuffle: stage shuffle read above 50 MiB
    - [PART] partitionSizing: a shuffle partition over 5× the median or over 5 GiB, or 1 GiB of shuffle on 7 tasks or fewer
    - [SPILL] spill: single-task disk spill above 1 GiB
    - [HOST] slowHost: a host 2× slower than its peers by mean task time (per-executor figures from 1.33×, and only when the stage's own task-time spread cannot explain the gap)
    - [SLOW] stageSlowness: a stage running far longer than its peers, not attributable to a single slow host
    - [SFAIL] stageFailed: a stage that failed outright
    - [FAIL] failures: over 5% of a stage's tasks failing
    - [STRAG] straggler: one or more tasks finishing far after the rest of their stage, for a reason other than reading more data
    - [SPEC] speculationWaste: 5+ discarded speculative attempts wasting at least 60s
    - [RETRY] retryWaste: 3+ retried attempts wasting at least 30s
    - [TINY] tinyTask: 100+ tasks with a median of 500ms or less and a P95 of 1000ms or less
    - [INCMP] incompleteRun: an event log missing its terminal ApplicationEnd event
    - [COLD] coldStart: the first stage waiting over 30s for an executor
    - [CSTOR] cacheUtilization: cached partitions evicted or spilled to disk
    - [LOCAL] coreLocality: task placement missing data-local core assignment
    - [CHRN] autoscalingChurn: over 30% of removed executors living under 2 minutes
    - [CACHE] cachingOpportunity: a dataset re-read from source multiple times with no cache/persist
    - [JOBS] jobFailureRate: at least 10% of jobs failing
    - [PLAN] duplicatePlanSubtree: the same physical plan subtree executed more than once
    - [PLAN] smallFiles: over 100 files averaging under 3 MiB
    - [PLAN] overBroadcast: a broadcast over 1 GiB
    - [PLAN] underBroadcast: a join side its type can broadcast, between 1 MiB and 1 GiB, that skipped broadcast
    - [PLAN] pythonUdf: over 64 MiB sent to Python workers by stages running over 30 s
    - [PLAN] nestedLoopJoin: a nested-loop or cartesian join with over 1,000,000 output rows, at least 10x its larger input
    

    </details>

  • Evidence: Corpus gate output (local file: <code>~/.no-mistakes/evidence/01M5WFRF07D3KF349PC6V3E9M0/corpus-gate.txt</code>)
  • <details>
    <summary>Evidence: CLI finding text (oversized)</summary>

    \### Right-Sized Cluster · warning
    - action: Right-size cluster
    - rightSizedCores: 8
    - The modeled stage time stays within 10% of the observed 10.0s with about 8 of the 16 cores held at peak: consider either reducing cluster size (spark.executor.instances) or enabling dynamic allocation.
    - confidence: low
    - validation: Modeled from each stage's task time spread over its cores, which misses the observed stage time by 0% at the 16 cores held at peak (...): re-run with fewer cores to confirm.
    

    </details>
    <details>
    <summary>Evidence: Synthetic log generator</summary>

    // Writes synthetic Spark event logs for the rightSizing scenarios.
    import { writeFileSync } from 'node:fs';
    const out = process.argv[2];
    function log({ name, appNum, executors, coresPer, tasks, taskMs, stageMs, appMs = 100000, dynAlloc = false }) {
      const T0 = 1700000000000;
      const appId = `application_0000000000000_000${appNum}`;
      const L = [];
      L.push({ Event: 'SparkListenerLogStart', 'Spark Version': '3.5.0' });
      L.push({ Event: 'SparkListenerEnvironmentUpdate', 'JVM Information': {}, 'Spark Properties': {
        'spark.app.id': appId, 'spark.executor.cores': String(coresPer), 'spark.executor.instances': String(executors),
        'spark.dynamicAllocation.enabled': String(dynAlloc) }, 'Hadoop Properties': {}, 'System Properties': {}, 'Classpath Entries': {} });
      L.push({ Event: 'SparkListenerApplicationStart', 'App Name': name, 'App ID': appId, Timestamp: T0, User: 'spark' });
      for (let e = 1; e <= executors; e++) L.push({ Event: 'SparkListenerExecutorAdded', Timestamp: T0 + 10, 'Executor ID': String(e),
        'Executor Info': { Host: `10.0.0.${e}`, 'Total Cores': coresPer, 'Log Urls': {} } });
      const s0 = T0 + 1000;
      const stageInfo = (extra) => ({ 'Stage ID': 0, 'Stage Attempt ID': 0, 'Stage Name': 'count at job.py:10', 'Number of Tasks': tasks,
        'RDD Info': [], 'Parent IDs': [], Details: '', Accumulables: [], ...extra });
      L.push({ Event: 'SparkListenerJobStart', 'Job ID': 0, 'Submission Time': s0, 'Stage Infos': [stageInfo({})], 'Stage IDs': [0], Properties: {} });
      L.push({ Event: 'SparkListenerStageSubmitted', 'Stage Info': stageInfo({ 'Submission Time': s0 }), Properties: {} });
      const slots = executors * coresPer;
      for (let t = 0; t < tasks; t++) {
        const wave = Math.floor(t / slots);
        const launch = s0 + wave * taskMs;
        const exec = String((t % executors) + 1);
        L.push({ Event: 'SparkListenerTaskStart', 'Stage ID': 0, 'Stage Attempt ID': 0, 'Task Info': { 'Task ID': t, Index: t, Attempt: 0,
          'Partition ID': t, 'Launch Time': launch, 'Executor ID': exec, Host: `10.0.0.${exec}`, Locality: 'PROCESS_LOCAL', Speculative: false,
          'Getting Result Time': 0, 'Finish Time': 0, Failed: false, Killed: false, Accumulables: [] } });
        L.push({ Event: 'SparkListenerTaskEnd', 'Stage ID': 0, 'Stage Attempt ID': 0, 'Task Type': 'ResultTask', 'Task End Reason': { Reason: 'Success' },
          'Task Info': { 'Task ID': t, Index: t, Attempt: 0, 'Partition ID': t, 'Launch Time': launch, 'Executor ID': exec, Host: `10.0.0.${exec}`,
            Locality: 'PROCESS_LOCAL', Speculative: false, 'Getting Result Time': 0, 'Finish Time': launch + taskMs, Failed: false, Killed: false, Accumulables: [] },
          'Task Executor Metrics': {}, 'Task Metrics': { 'Executor Deserialize Time': 0, 'Executor Deserialize CPU Time': 0, 'Executor Run Time': taskMs,
            'Executor CPU Time': taskMs * 1e6, 'Peak Execution Memory': 0, 'Result Size': 1000, 'JVM GC Time': 0, 'Result Serialization Time': 0,
            'Memory Bytes Spilled': 0, 'Disk Bytes Spilled': 0,
            'Shuffle Read Metrics': { 'Remote Blocks Fetched': 0, 'Local Blocks Fetched': 0, 'Fetch Wait Time': 0, 'Remote Bytes Read': 0, 'Remote Bytes Read To Disk': 0, 'Local Bytes Read': 0, 'Total Records Read': 0 },
            'Shuffle Write Metrics': { 'Shuffle Bytes Written': 0, 'Shuffle Write Time': 0, 'Shuffle Records Written': 0 },
            'Input Metrics': { 'Bytes Read': 0, 'Records Read': 0 }, 'Output Metrics': { 'Bytes Written': 0, 'Records Written': 0 }, 'Updated Blocks': [] } });
      }
      L.push({ Event: 'SparkListenerStageCompleted', 'Stage Info': stageInfo({ 'Submission Time': s0, 'Completion Time': s0 + stageMs }) });
      L.push({ Event: 'SparkListenerJobEnd', 'Job ID': 0, 'Completion Time': s0 + stageMs, 'Job Result': { Result: 'JobSucceeded' } });
      L.push({ Event: 'SparkListenerApplicationEnd', Timestamp: T0 + appMs });
      writeFileSync(`${out}/${name}.ndjson`, L.map((x) => JSON.stringify(x)).join('\n') + '\n');
    }
    // Fires: 16 cores, 8 tasks of 10 s in one 10 s wave.
    log({ name: 'oversized', appNum: 1, executors: 4, coresPer: 4, tasks: 8, taskMs: 10000, stageMs: 10000 });
    // Model error 50%: same work, stage observed for 20 s.
    log({ name: 'model-miss', appNum: 2, executors: 4, coresPer: 4, tasks: 8, taskMs: 10000, stageMs: 20000 });
    // Uses all cores: 64 tasks of 2.5 s on 16 cores, 4 waves.
    log({ name: 'busy', appNum: 3, executors: 4, coresPer: 4, tasks: 64, taskMs: 2500, stageMs: 10000 });
    // Small cluster: 4 cores, 1 task.
    log({ name: 'small', appNum: 4, executors: 1, coresPer: 4, tasks: 1, taskMs: 10000, stageMs: 10000 });
    // Dynamic allocation on, otherwise oversized.
    log({ name: 'oversized-dynalloc', appNum: 5, executors: 4, coresPer: 4, tasks: 8, taskMs: 10000, stageMs: 10000, dynAlloc: true });
    

    </details>

    Pipeline

    Updates from git push no-mistakes

    <!-- no-mistakes-pipeline-attestation:v1 {"head_sha":"e7d3ce6c6619b774ef450421fe3a77d199b89c97","steps":[{"step":"intent","status":"completed"},{"step":"rebase","status":"completed"},{"step":"review","status":"completed"},{"step":"test","status":"completed"},{"step":"document","status":"completed"},{"step":"lint","status":"completed"},{"step":"push","status":"completed"},{"step":"pr","status":"running"},{"step":"ci","status":"pending"}]} -->

    <details>
    <summary>✅ intent - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Rebase - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>🔧 Review - 3 issues found → auto-fixed ✅</summary>

  • ⚠️ docs-site/contributor-guide/architecture/detector-contract/threshold-tables.md:190 - The intent requires: &#34;Calibrate its thresholds against the public corpus with the corpus gate&#34;. The change does not show that calibration. dev/corpus-snapshot.json is unchanged and has no rightSizing entry. The provenance row added here says the opposite: &#34;rightSizing tolerancePct, maxCoreShare, minBaselineCores and maxModelErrorPct | Our own cuts, unvalidated&#34;. Also, detectors.ts:2705 ships the defaults 10 / 0.75 / 8 / 20 with no corpus evidence in the commit or docs. Ask the author for one of two things: run node dev/bench-analyze.mjs --check (and --update if the finding fires), then record the corpus result in the provenance row; or confirm that the uncalibrated cuts are acceptable.

  • ⚠️ packages/core/src/detectors.ts:2712 - The finding calibrates the model at computePeakConcurrentCores. The existing simulateScaling (packages/core/src/scaling-sim.ts:64) calibrates the same model at computeTotalCores, the sum of every executor ever added. When a run uses dynamic allocation or replaces executors, the two baselines differ. The dashboard&#39;s scaling simulation and the new finding then report different model errors for the same run. Example: a run that adds 4x4-core executors, removes them, and adds 4 more has computeTotalCores = 32 but peak = 16. The scaling widget then shows a model error at 32 cores, and the finding reports a different error at 16 cores, which can pass the 20% gate. The two surfaces then disagree about whether the model can be trusted. Changing simulateScaling&#39;s baseline changes existing user-visible output, so ask before you align them. Another option is to name the different baseline in the finding&#39;s text.

  • ℹ️ packages/core/src/finding-presentation.ts:207 - rightSizing.genericRecommendation copies utilization.genericRecommendation (lines 374-376) character for character. Move it into one shared helper (for example idleCapacityRecommendation(f)) that both rows call. Then the two UTIL rows cannot drift apart.
  • 🔧 Fix applied.
    ✅ Re-checked - no issues remain.
    </details>

    <details>
    <summary>✅ Test - passed</summary>

    ✅ No issues found.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
  • | Scenario | Result | Live | Evidence |
    | --- | --- | --- | --- |
    | CLI user analyzes an over-provisioned run: rightSizing fires with core counts, observed time and low confidence | ✅ pass | live | oversized.json / oversized.md: value 8, observedCores 16, observedActiveMs 10000, modelErrorPct 0, confidence low, recommendation names 8 of 16 cores held at peak |
    | Adversarial: model error 50% (&gt; 20% bound) suppresses the finding, and raising maxModelErrorPct to 60 makes it fire | ✅ pass | live | model-miss.json has no rightSizing. With --thresholds maxModelErrorPct 60 it fires with modelErrorPct 50 and a &#39;Produced with tuned thresholds&#39; note |
    | Adversarial: stages that use most cores, or a cluster under 8 cores, get no rightSizing finding | ✅ pass | live | busy.json and small.json findings lists have no rightSizing |
    | Dynamic allocation already on: the advice changes to lowering spark.dynamicAllocation.maxExecutors | ✅ pass | live | oversized-dynalloc.json recommendation and remediation key spark.dynamicAllocation.maxExecutors |
    | CLI --thresholds overrides change or silence the finding and mark it tuned | ✅ pass | live | maxCoreShare 0.4 gives no finding. tolerancePct 40 gives value 6 with tunedThresholds {tolerancePct: 40 default 10} |
    | Detector catalog exposes the rightSizing thresholds (10 / 0.75 / 8 / 20) | ✅ pass | live | oversized.json detectors entry for rightSizing |
    | Corpus gate passes with no finding changes, which matches the threshold-table provenance row | ✅ pass | live | corpus-gate.txt: &#39;No finding changes against dev/corpus-snapshot.json&#39;. The snapshot has no rightSizing entry |
    | Dashboard user loads the run: the finding shows as UTIL &#39;Right-size cluster&#39; and the Right-sized Cluster widget shows 8 of 16 cores. The model-miss run shows neither | ✅ pass | live | ui-oversized-dashboard.png, ui-oversized-right-sizing-card.png, ui-oversized-f2-evidence.png, ui-model-miss-full-report.png. No page or console errors |

  • <code>node gen-logs.mjs logs (evidence dir): built five synthetic event logs. They are oversized (16 cores, 8 tasks of 10 s in one 10 s wave), model-miss (same work over a 20 s stage), busy (64 tasks on 16 cores), small (4 cores) and oversized-dynalloc</code>

  • <code>node packages/cli/bin/sparkforensics-analyze.mjs &lt;log&gt; --format json on each of the five logs</code>

  • node packages/cli/bin/sparkforensics-analyze.mjs oversized.ndjson --format md

  • <code>--thresholds with {&#34;rightSizing&#34;:{&#34;maxCoreShare&#34;:0.4}}, {&#34;rightSizing&#34;:{&#34;tolerancePct&#34;:40}} on oversized and {&#34;rightSizing&#34;:{&#34;maxModelErrorPct&#34;:60}} on model-miss</code>

  • <code>git submodule update --init dev/log-corpus then node dev/bench-analyze.mjs --check dev/corpus-snapshot.json. The submodule was deinitialized afterward</code>

  • <code>npx vite --port 5391 dev server, driven with Playwright (drive-ui2.mjs): loaded oversized and model-miss through Choose file, opened F2&#39;s evidence and the Full app report widget, took screenshots</code>

  • npx vitest run tests/view/right-sizing.test.tsx

  • cd packages/core && npx vitest run test/scaling-sim.test.js test/analyzer.test.js -t 'rightSizing|smallestCores|scaling'

  • </details>

    <details>
    <summary>✅ Document - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Lint - passed</summary>

    ✅ No issues found.
    </details>

    <details>
    <summary>✅ Push - passed</summary>

    ✅ No issues found.
    </details>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 0m
    All Vouch review confidence checks passed
    Residual risk 0.49 = Change Risk (0.57) × (1 − Review Confidence (0.14)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 3% · Reviewer familiarity: 35%
    13%
    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.388
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #216"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 13.7% reviewed
    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: 57% (MEDIUM) · Higher = larger blast radius
    57%
    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: 13.7% · Lower = rushed or shallow review
    13.7%
    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: 49.2% · Moderate risk
    49.2%