Repository navigation
Description
The claim in the name
The engine persists 13 per-file vectors named risk_* (risk_cognitive_load, risk_concurrency, risk_api_exposure, risk_tech_debt, risk_safety_score, …). The prefix asserts these measure risk — i.e., that higher values indicate elevated probability of defects/vulnerabilities. The temporal-crucible validation program (epic #2982; ~3,550 scanned snapshots, two repositories, three label families, every test pre-registered) has now tested that assertion to exhaustion. The evidence says the vectors measure activity and content, not risk. The naming now contradicts the program's own published record.
The evidence, by claim
1. "Risk" doesn't fall when risk is removed. H1 (the founding hypothesis): median structural delta after a security fix = +0.000 (p=0.77 curl; equivalence-confirmed near-zero on nDPI, CI ⊂ ±0.10). Fixes raise the scores slightly more often than they lower them (48% vs 42%) — because repair adds guard code, and guard code reads as structure. The instrument watches vulnerabilities being eliminated and reports "no change."
2. "Risk" doesn't predict where risk materializes. Summed structural exposure ranks last of six features for predicting fix-touched files (AUC 0.724 vs churn 0.859, LOC 0.859); within churn bands it loses to a plain line count in 3/4 bands (−0.16 in the band holding 82% of positives); density- and length-matched variants collapse to chance (0.503); a 26-signal multivariate vector under a temporal split scores 0.479 vs LOC's 0.531 — both chance out-of-time; trajectory (slope/drift) features sit at ≈0.50. Independently corroborated: repowise-bench's size-confound wall (their pooled 0.737 → 0.525/0.572 within small/medium NLOC bands, different labels, different instrument).
3. The vectors don't even mark risk type. The specificity battery (S-H0): the family→matched-vector confusion matrix is not diagonal — memory-danger signals ranked highest even for info-leak bugs. The vectors are not mechanism-diagnostic.
4. What a vector actually measures — the specimen. CURL-CVE-2026-11586's +47.1 "risk spike": risk_concurrency 0→87.26 because a test file added a threading harness. The meter worked perfectly — threading appeared, the concurrency meter moved. It measured "threading happens here." Only the word "risk" was wrong. Likewise risk_tech_debt's H3 "signal" was its own density denominator (#2984), and risk_secrets_risk ρ=−0.91 vs LOC (#2979).
5. What actually predicts is not in these vectors. The two validated predictors are recidivism (prior-fix count; replicated both repos, p<1e-4) and change entropy / Hassan HCM (validated out-of-selection on fresh labels, lift over LOC +0.038) — both history metrics, both currently zeroed in every scan by GITGALAXY_DISABLE_GIT_HISTORY (see #29).
What the vectors ARE good at (validated)
Describing activity: the fix-grammar gradient (fix-shaped composite 66% security-fix → 53/48/46% ordinary-fix classes → 38% control → 13% revert) shows the deltas reliably characterize what kind of change happened; keyword pools recover coherent activity groupings (the alloc/cleanup discipline pair, ρ=0.85, size-independent); extraction ties tree-sitter at zero dependencies across 59 languages. This is a real, differentiated capability — an x-ray of what code does — mislabeled as a prognosis.
Proposed resolution (design decision, not prescribed here)
Options, roughly in order of invasiveness:
- Docs/semantics reframe: keep column names for compatibility; re-document the 13 vectors as activity/content vectors ("concurrency surface", "API surface", …), with an explicit statement that they are descriptive, not predictive, citing this record.
- Schema alias: introduce
activity_*(orsurface_*) names withrisk_*as deprecated aliases; migrate reports/LLM briefs to the new vocabulary. - Split the product claim: descriptive vectors (these) + a separate, honestly-named predictive layer built from what validates — recidivism + HCM + churn (requires Update README with improved mapping description #29's history-enabled mode) — gated per Calibration contracts: a signal earns entry to a gated formula by demonstrated defect-lift beyond size (score-contract track) #2987's promotion contract.
Whatever the choice, the current situation — shipping risk_* columns that the project's own pre-registered validation shows do not measure risk — is the kind of finding an external auditor or reviewer would surface; better that the record shows we surfaced it ourselves and acted deliberately.
Related: #2982 (the validation record), #2987 (promotion contract), #2984/#2979 (density artifacts), #2988 (determinism), #29-temporal-crucible (history-enabled mode), #2990 (vocabulary assessment).
Activity
squid-protocol commentedon Sep 13, 2026
Disposition table for the 13 vectors (follow-up: the concrete "what to do per equation")
Evidence-based triage of each
risk_*calculator against the #2982 record. Three buckets: KEEP-DESCRIPTIVE (honest presence/surface meter — rename per this issue), REWORK (known formula artifact), PROMOTE (belongs in a separate, honestly-named predictive layer).concurrencyapi_exposurecognitive_loadsafety_scoredead_code,spec_match,documentationstate_fluxtech_debtsecrets_riskverificationstability,churnchange_entropy/HCM,ownership_entropy, recidivism count) under #29's history-enabled mode, gated per #2987Net shape: raw per-function markers (unchanged — they are the validated x-ray) → descriptive surface vectors (renamed, artifacts fixed) → a separate small predictive layer built from what validates (history family), promoted only through #2987's defect-lift gate.
squid-protocol commentedon Sep 13, 2026
Formula-facts extraction (mechanical audit of all 13 calculators) — and a structural finding
Full per-calculator table (inputs, arithmetic, constants, line refs) extracted from
signal_processor.py; summary of the structurally important columns:The structural finding: 11 of 13 vectors are density formulas. The validation record convicted the density shape specifically — the ledger's reflection #2 ("every density either stayed flat or produced an artifact; the one vector that moved its assumed direction is a credit/debit net") and the two ticketed artifacts (#2984, #2979) are instances of a pattern that turns out to be the layer's default architecture, not exceptions. Every density formula has the same failure mode available to it: the denominator moves when code is added/removed, so the score can change with no change in the phenomenon it names.
Consequence for the disposition plan: the REWORK bucket is larger than the two ticketed vectors. For the descriptive reframe, each density vector should either (a) publish its raw numerator alongside (the count IS the presence meter — the validated x-ray layer is the raw signals), or (b) be re-derived count-based. The sigmoid+cap+multiplier stacks (9 tuned constants in cog_load alone, breach floors, path multipliers) assert calibration that was never validated against outcomes — appropriate for a display normalization if documented as such, inappropriate as measurement claims.
Also noteworthy:
stability/churn— the family the evidence PROMOTES — are the two calculators with the simplest, most honest arithmetic in the file (age ratio; commits/√weeks, unbounded).Full table: extraction artifact
vector_formulas.md(session scratchpad; will be committed with the docs reform PR).squid-protocol commentedon Sep 13, 2026
Option A approved and implemented: PR #2993 (draft). Dual-emission verified — every
risk_*column/key byte-identical (full suite 8563/0 incl. golden-crucible byte-comparisons); new vocabulary at display surfaces +VECTOR_NAMEScanonical mapping; README claim section restated per the #2982 record;docs/vectors.md+docs/vector_formulas.mdlanded. Follow-ups noted in the PR:docs/validation.mdstaleness (same class as the README's old section — needs its own pass) and the scheduled brief regeneration.Vector rename via aliases (Option A of #2991): Structural Surface Pro…
docs(wiki): reframe "Risk Exposure" as the Structural Surface Profile (…
squid-protocol commentedon Sep 13, 2026
Resolved via Option A — the vector rename shipped in #2993 (merged) and released in v2.7.0:
VECTOR_NAMESmaps the descriptive names over the frozenrisk_*schema, with the full name table and validation record indocs/vectors.md. The engine,site/, and metrics READMEs adopt the vocabulary; a wiki/docs reframe sweep is tracked as follow-up (PR #2999). Closing as completed.feat(report): stop the risk surface claiming more than it measures (#…