Skip to content

Epic: exposure deltas vs independently identified events — risk over Git history (Rung 6; the validation.md harness) #2982

Closed

Description

@squid-protocol

Child of the validation program (docs/validation.md §"The next validation: risk over Git history", ladder rungs 6–7); successor programme to #2812 (Rung 2, closed, released as v2.6.0). The handoff surface for this work is the exposure-history sibling repo (harness, event datasets, scan DBs, regenerated report — the keyword-rosetta arrangement).

Status 2026-11-16: phases 0–5 done; close criterion met (see the closing-status comment). Work continues in temporal-crucible, tracked by its own register, docs/HYPOTHESES.md.

The question (rung 6, temporal validity)

Do commits independently identified as security fixes typically reduce the corresponding GitGalaxy exposure — and do the commits that introduced those vulnerabilities increase it — relative to ordinary commits?

Design: event-pair scanning, not per-commit sweeps and not tag panels. For each labeled event commit: scan the first parent and the commit itself (2 full scans), join per-file exposure across the two snapshots, record the delta. The engine's SQLite schema already supports this natively (record_keeper.py: repo_data/file_data keyed (repo_name, commit_hash) with UNIQUE — multiple revisions coexist in one DB, joined on file_path; idempotent per-(repo,commit) wipe = resumable batches). The scan-at-ref primitive is tests/tools/scope_check.py's detached-worktree shape. The record per event follows validation.md's own harness spec: SHA, parent state, changed files/functions, exposure before/after, deltas, event classification.

Pilot: curl

curl's machine-readable vulnerability data (https://curl.se/docs/vuln.json, OSV format) carries GIT ranges with both introduced and fixed commit SHAs for 189 of 215 CVEs (verified 2026-09-12) — both delta directions from one authoritative, independently maintained source. Controls: ordinary commits (merges and docs-only excluded), sampled matched on files-touched and diff size. ~50s/scan → the full pilot is hours of compute, resumable.

Guards (all four are Rung-2 lessons, applied before any number is computed)

  1. Temporal self-fulfillment — a fix commit mechanically raises churn/recency on touched files, so temporal-informed exposure would partly predict events from the event itself. Headline statistics use structural exposure only (churn/stability excluded); full-vector deltas are the labeled secondary. The harness records which mode produced every number.
  2. Size confounder — within-file before/after deltas self-control identity and size; control commits are matched on touched-file count and diff size (the length-leak lesson: never let LOC be the hidden variable).
  3. Rename tracking — git diff --name-status -M parent..child; R-entries remap paths before the join.
  4. Pre-registered criteria — recorded here, before the batch runs, evaluated verbatim in the report whatever they say:
    • H1 (fixes): on touched files, the distribution of structural-exposure deltas for security-fix commits lies below that of matched control commits — one-sided Mann–Whitney U, α = 0.01, with the median-delta difference reported as effect size.
    • H2 (introductions): introduced-by commits show deltas above matched controls, same test and α.
    • H3 (specificity): the per-vector effect table names which exposure vectors carry the signal; a result driven only by vectors with open score-contract findings (e.g. risk_secrets_risk is a density over LOC — measured leak rho -0.91 on the control corpus (score-contract territory) #2979's shape) is reported as such, not averaged away.
    • A null or reversed result is a published finding about the formulas and routes into the score-contract program — the corpus taught us instruments improve by being contradicted.

Phases

  • 0 · This epic — design + pre-registered criteria (this text).
  • 1 · Repo bootstrap — exposure-history: tools/scan_pair.py (worktree → scan ×2 → one history DB per repo), tools/exposure_delta.py (rename-tracked join, JSONL records), tools/event_harvest.py (OSV → events), tools/delta_report.py, engine wiring via GITGALAXY_PATH/GALAXYSCOPE_BIN.
  • 2 · Harness verified — 3 hand-picked curl CVE fixes end-to-end: worktrees clean up, distinct commit_hash row-sets, renames joined, determinism assert (same commit scanned twice ⇒ identical file rows), resumability assert (re-run is a no-op).
  • 3 · Events harvested — events/curl.json: ~189 fix + introduced pairs, matched controls, pinned curl HEAD.
  • 4 · Pilot subset — 50 events + 50 controls scanned; first docs/exposure_history_report.md with H1–H3 evaluated; then the full batch in a resumable background run.
  • 5 · Full curl report — all events; per-vector effect table; the criteria verdict published either way.
  • [~] 6 · Beyond (not this epic's close; carried out in temporal-crucible, see the closing-status comment): second repo for generalization; the tag-sampled trend panel; Rung 7 (does prior exposure predict future events — the prediction study).

Close criterion: the full-curl report exists, regenerates from events/curl.json + the scan DB with one command, and states the H1–H3 verdicts with the guards applied — whatever the verdicts are.

Engine changes, if any prove necessary (e.g. a DB output-path affordance), are filed as their own issues and land engine-first — this epic's harness must run against unmodified engine main.

Activity

  1. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status Phase 1–3: done — the harness is live at https://github.com/squid-protocol/exposure-history (public, first commit pushed).

    • scan_pair / run_batch: detached-worktree scans into one accumulating per-repo DB; the engine schema's (repo_name, commit_hash) keying makes batches resumable with zero harness bookkeeping. Verified end-to-end on CVE-2026-82209: the fix pair isolates exactly lib/cookie.c (the implicated file), temporal_delta reads exactly 0.0 under the ablation switch (guard 1 proven mechanically), independent rescans of the same commit produce identical risk rows 1134/1134 (determinism), and re-running a scanned pair is a no-op (resumability).
    • event_harvest: curl's OSV data yields 186 security-fix + 137 introduced events, 0 unresolvable SHAs, plus 185 controls matched on touched-file count and diff size (guard 2). events/curl.json pins the pool HEAD.
    • Pilot subset running: 50 per class (~300 scans) in a detached batch; scans run ~8–10s each with the ablation on. First delta_report with the pre-registered H1–H3 follows when it lands.

    One instructive first sample (not evidence, n=1): the CVE-2026-82209 fix raised structural exposure on lib/cookie.c (+0.45: dead_code +0.39, cognitive_load +0.12, tech_debt −0.08) — the added guard logic reads as complexity. Exactly why H1 is a distribution question over ~186 events against matched controls, not an anecdote.

  2. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status — incremental/longitudinal addendum (phases added; verified vs noted marked explicitly)

    Verified today (read from engine source, not assumed):

    • execute_incremental_scan (galaxyscope.py:2807+) is NOT a stale-graph shortcut: after the surgical parse of changed files, the Ripple Effect recomputes the dependency graph, the risk assembly (_calculate_risk_exposures), the full network graph and the auditor pass over ALL surviving files, then records under the NEW commit hash. Architecturally fit for history walking.
    • function_data rides file_id → file_data(commit_hash), so per-function states are already preserved per commit — the longitudinal panel gets function-level time series transitively, no schema change.
    • StateRehydrator.load_latest_state picks its baseline by ORDER BY commit_date DESC LIMIT 1 — wrong for a multi-commit history DB (arbitrary order) and unsafe even for forward walks (commit dates aren't monotonic). Filed as StateRehydrator: select an explicit baseline commit — 'latest by commit_date' breaks multi-commit history DBs and non-monotonic walks #2983: explicit --baseline <sha> selection, backward-compatible.
    • Interim workaround that needs NO engine change: a per-pair scratch DB seeded with only the parent scan, where "latest" == parent by construction. The parity audit runs this way against unmodified engine main.

    Noted, not yet verified (the parity audit exists to check exactly this):

    • That incremental output is row-identical to a cold full scan of the same commit. The design intent says yes; rehydration fidelity (DB→RAM round-trip of every field the ripple reads) is the risk. Full-scan determinism is already proven (identical rows across independent scans), so any incremental divergence will be attributable.

    Phases added to this epic:

    • P · Incremental parity audit — tools/parity_check.py in exposure-history: per pair, full-scan parent → --incremental child in a scratch DB vs independent full-scan child; row-diff file_data across the risk vector + context columns over ~20 event pairs. Parity ⇒ the full batch, the second repo, and all panels switch to onboard+delta, and the engine banks a validated claim about a shipped mode (the CI delta-scan story). Divergence ⇒ an engine finding about that shipped mode, filed with the differing rows as evidence.
    • W · Longitudinal walk (after StateRehydrator: select an explicit baseline commit — 'latest by commit_date' breaks multi-commit history DBs and non-monotonic walks #2983 + parity): onboard at commit X with one full scan, then --incremental --baseline <prev> per commit along first-parent order, tags recorded per commit — a non-destructive panel DB of every file's and function's state across history, keyed by commit hash. Budget note (measured, not guessed): full curl scans run ~8–10s under the temporal ablation; incremental should be cheaper; whole-history curl (~35k commits) is a background multi-day job, while a tag-level walk (~270 releases) is under an hour — the panel densifies from tags downward as questions demand.
    • A · Panel analyses — survival curves on exposure before CVE introduction/fix, exposure trajectories, lead–lag, and the Rung-7 prediction study reading the panel instead of pairs.

    Pilot state: subset batch (50/class, ~300 scans) running detached and resumable; harvest = 186 fix + 137 introduced + 185 matched controls, 0 unresolvable SHAs. First delta_report with the pre-registered H1–H3 follows when it lands.

  3. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status Phase P (parity): first result — 3/3 pairs row-identical. The shipped --incremental mode, run for each event's child against a scratch DB holding only the parent (the #2983 workaround), produces file_data rows byte-identical to an independent cold full scan across the entire risk vector and context columns (1134/1132/1133 files per pair). Full-scan determinism was already established, so the attribution is clean: rehydration round-trip and the surgical-parse → Ripple boundary are faithful, at least on these shapes. Tool: exposure-history tools/parity_check.py; the full ~20-pair sweep runs after the pilot batch frees the machine.

    Consequences if the full sweep holds: the remaining batches and the longitudinal walk (phase W) switch to onboard+delta, and the engine banks a validated claim about a shipped product mode — "delta scans provably equivalent to full scans over real history." The "noted, not verified" caveat in the previous comment is now half-converted; #2983 (explicit baseline selection) remains the one engine change the walk needs.

  4. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status Phase 4 (pilot subset): first pre-registered results are in — exposure-history docs/exposure_history_report.md, 50 fix / 46 control / 45 introduced events (subset; full batch resumable).

    H1 & H2: not supported (H1 p=0.58, H2 p=0.78 at α=0.01). Security fixes do not systematically reduce aggregate structural exposure vs matched controls. Published as pre-registered.

    Why the aggregate is null — H3 shows two real effects cancelling:

    • tech_debt drops in fixes vs controls at p=0.0006 (strongest vector; survives Bonferroni over the 11 vectors) — fixes remove FIXME/HACK-class debt.
    • cognitive_load moves the other way (p=0.98 against reduction) — guard code added by a fix reads as complexity. Sign split agrees: 56% of security fixes RAISE structural exposure.
    • Interpretation for the score-contract program: "a security fix should reduce exposure" is the wrong molecule-level expectation for a structural instrument — fixes trade debt for complexity. The per-vector layer is where temporal validity lives, not the 11-vector sum. This reshapes what rung-6 success should mean and is exactly why H3 was pre-registered.

    The rung-7 preview is the striking one: implicated files sit at the 80th–88th percentile of pre-event structural exposure — but matched control files sit at the 86th too. Change concentrates in high-exposure files generally (the known churn-complexity coupling); security-specific elevation over controls is small and n.s. so far (p=0.13). The honest question for rung 7 is therefore conditional: among the high-exposure files where all change lives, does exposure separate the ones that produce CVEs? The era table adds texture: implicated-file percentile rose 22 → 87 across 25 years (early CVEs hit ordinary files; modern ones hit the measured core — or early-era n is just tiny; the walk will say).

    Instrument controls all clean: untouched-file spillover median |Δ| = 0.000000 (p99 = 0.0 over 134,759 file-deltas; max 29.8 in <1% — graph-ripple candidates to inspect), LOC coupling ρ = −0.13 (deltas are not size change), temporal ablation asserted exactly 0.0.

    Next: finish the full batch (resumable), inspect the +47.1 outlier (CVE-2026-11586) and the spillover tail, add charts, and re-evaluate H1–H3 at full n. A null on the aggregate with a p=0.0006 vector-level signal is precisely the kind of result the pre-registration was designed to keep honest.

  5. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status — three findings that reshape the analysis, the chronological harness, and the security-layer audit (all in exposure-history main)

    1 · The tech_debt autopsy (H3's strongest signal was a costume). Direct diff analysis over all events: security fixes touch a TODO/FIXME/HACK marker in 1 of 186 commits (net −1 marker across all of them) — yet tech_debt dropped at p=0.0006. The mechanism is the density denominator: fixes net-add code (median +6 LOC, 77% net-growing vs controls' +3/64%), so constant markers over more lines reads as falling debt. The #2655/#2979 length-leak shape, caught inside our own strongest result by the report's new "commit anatomy" table. Score-contract evidence, live from real history. The introduced side is genuine: vulnerability-introducing commits are large feature additions (median +98 LOC, 88% growing) carrying +91 new debt markers across 25/136 commits — CVEs are born in big, debt-laden feature commits.

    2 · Dwell time: median 4.5 years introduced→fixed (p25 1.3y, p75 11.4y, max 25.2y; n=137 CVEs with both SHAs). The strategic number for rung 7: there is a years-long window in which a predictive flag would have mattered.

    3 · The security system, audited on real history: the credential shunt fires on 5,363 file-rows (test keys, CA tooling — working as designed) but on 0 implicated CVE files: curl's secrets surface and vulnerability surface are orthogonal. The ML threat layer (ai_threat_*, is_malware, binary_anomaly, obfuscation_flag) is unexercised, not exonerated — the scan env lacks the ML deps (the known security_auditor gap). And the granular lens counts (sec_tainted_injection, sec_db_hooks, …) are not persisted to the scan DB (audit-JSON only) — persisting them to file_data is the enabling engine change for per-CVE injection-surface analysis. Flagging both as engine follow-ups.

    Framework for the next questions: tools/walk_history.py — the phase-W chronological harness. Tag mode scans all 219 curl releases into the same accumulating DB (full scans, resumable, manifest per step; the incremental switch arrives with #2983); --every N densifies between releases. The tag walk is chained to launch automatically when the full batch completes. It feeds: per-file/function exposure trajectories, recidivism (post-fix exposure vs next CVE — lib/url.c has 30 events), dwell-vs-exposure, and the conditional rung-7 separation study.

    Live H-numbers as the batch fills (not final): H1 p 0.58 → 0.36 at fix n=91. Full-n regeneration when the batch lands.

  6. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status — the signal layer opened (exposure-history docs/signal_anatomy.md + tools/signal_anatomy.py)

    The DB was already carrying the whole raw layer: ~50 per-file signal counts and 112 per-function columns including per-function keyword counts, per commit. Three analyses now regenerate from it:

    1 · The grammar of a security fix. Fixes ADD state_pointers (+0.75 median event Δ, p=0.0014) and struct_branch (+1.0, p=0.017) vs size-matched controls at ~0. Introductions add pointers hardest (+1.71). In the engine's own vocabulary: a curl security fix is added pointer handling plus added branching — bounds checks and guard clauses. This is the per-keyword decomposition of the H3 cognitive_load rise.

    2 · Assumed vs observed. def_safety sits at the 91st percentile in CVE-fix files vs 82nd in control files before the event — "mitigating" keywords are risk markers at the level layer: guards accumulate where danger lives. The formulas' sign assumptions are level-vs-delta dependent (a safety keyword being present marks a battleground; a safety keyword being added is armor). bitwise_ops/state_safety_neg show +86/+81 percentile gaps but on zero-inflated scales (most changed files carry none; CVE files do) — real association, exaggerated units.

    3 · The vulnerable function — the day's sharpest result, with its caveat attached. Functions overlapping fix hunks (n=468) vs untouched same-file siblings (n=8,642), in the parent snapshot: complexity 13 vs 4, func_z_score +0.50 vs −0.29, loc 59.5 vs 23 — all p<1e-4. The instrument appears to localize below file granularity: within the same file, the function later patched already stood out. Required before this becomes a claim: longer functions overlap hunks more often by area alone (the loc medians show the confound); the loc-controlled analysis — does complexity separate implicated functions among length-matched peers? — is the next tool run, and the honest gate on the result.

    Batch at ~440/1000; tag walk (219 releases) chained to start on batch completion. Next: loc-controlled function analysis, full-n regeneration of all three reports, then the charts.

  7. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status — the length-bias gate CLOSED the function finding (working as designed), and the ML dataset ships

    The below-file localization claim is dead, honestly. Loc-matched pairs (each implicated function vs its length-closest untouched sibling in the same file, n=376): complexity 10 vs 10, z-score 0.19 vs 0.25, implicated "wins" 156/376 pairs (~42%). The striking complexity-13-vs-4 separation was entirely function length — patched functions are the long ones, and at equal length nothing in the current function metrics separates them. Residual honest claim: length itself is a cheap real predictor at function grain. This is the second costume the gates have removed in one day (tech_debt's denominator was the first) — the pre-registered-guards workflow is earning its keep.

    The aggregator-ready dataset (schema v1.0.0) — tools/export_dataset.py → dataset/<repo>.{events,files,functions}.jsonl.gz + manifest:

    • three grains: events (labels, CWE, severity, dwell), file samples (full before/after/delta vectors: context + risk vector + ~50 signals), function samples (parent-snapshot, ~90 per-function signal counts + implicated flag);
    • engine column names verbatim (traceable to the signal contracts), every record self-sufficient, gzipped JSONL for zcat | jq and any future trainer;
    • the manifest carries provenance (engine commit, pool head, temporal-ablation flags with a "never train on these columns" note) and label semantics including the documented hunk-area length bias;
    • first export: 307 events / 1,240 file samples / 26,128 function samples (201 events pending the still-running batch; the export is a one-command regeneration).

    Multi-repo future: the exporter is repo-agnostic (events file + history DB in, JSONL out) — repo #2 needs only an OSV-with-commits harvest. Batch continues; tag walk chained behind it; full-n regeneration of all reports + export when it lands.

  8. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    The handoff surface is renamed: exposure-history → temporal-crucible (the sibling-instrument name: language-crucible tested extraction against parsers; the temporal crucible tests signals and exposure against time and independently documented security events). Old links redirect. Local directory rename follows once the running batch + tag walk complete.

  9. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Phase M — multi-label expansion (filed with the label census, BEFORE any batch runs)

    The harness is a general commit-class → signal-signature instrument; CVE labels are its smallest, noisiest class. Census of label sources in curl (39,721 commits, measured 2026-09-12):

    label source commits class it defines
    OSV GIT ranges (current) 186 fix + 137 introduced security-fix / introduced
    Fixes #<issue> trailer 2,011 issue-linked bugfix
    Bug: trailer 1,320 bugfix (URL-referenced)
    Reported-by: trailer 2,798 externally-reported problem
    Follow-up subject/trailer 2,101 correction-of-a-correction (incomplete-fix class)
    Revert subject 164 revert
    <area>: subject prefix 16,281 subsystem (http, cookie, tls, …) — orthogonal facet, not a class

    Design (pre-registered):

    • event_harvest grows pluggable labelers (trailer / prefix / revert / OSV) emitting the existing events schema; one commit may carry several labels — records keep ALL labels, analyses declare which facet they read. Controls: the existing size-matched sampler per class.
    • M-H1: commit classes have distinguishable signal-delta signatures (class × signal matrix; global test then per-class contrasts at Bonferroni-corrected α=0.01 against matched controls; the security-fix signature — pointers + branches — is the anchor prediction).
    • M-H2 (the sharp one): security fixes differ from ordinary issue-linked bugfixes (Fixes #) in signal signature — the proper contrast class that generic controls are not. Prediction stated now: security fixes are pointer/branch-heavier; bugfixes are flux/state-heavier. Evaluated verbatim either way.
    • M-H3: Follow-up events mark incomplete fixes — do the ORIGINAL fixes they correct differ in signature from fixes that needed no follow-up? (The "what does a bad fix look like" question.)
    • Anomaly seed (exploratory, labeled as such, no p-values claimed): label-vs-signature disagreement rate — commits whose class signature mismatches their stated label — as the basis for a future commit-intent verification feature.
    • Multiple-comparisons discipline: with ~16 classes × ~50 signals, every confirmatory table carries its correction; anything not pre-registered above is exploratory and labeled so in the report.
    • Scan budget: Fixes # alone is ~2,000 events ≈ 4,000 scans ≈ 11h full-scan — the phase that finally needs the incremental path (StateRehydrator: select an explicit baseline commit — 'latest by commit_date' breaks multi-commit history DBs and non-monotonic walks #2983 + parity sweep) or event subsampling (pre-registered n per class before scanning).
    • Dataset: labels join the JSONL export as a list-valued labels field (schema 1.1.0, backward-compatible); the aggregator defines its own tasks.

    Everything downstream (batch runner, delta join, grammar tool, exporter) is already class-agnostic; this phase is one labeler module + the pre-registered analyses above.

  10. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Full-n results (all 508 events, 1,014 snapshots, 121.6 min) — the pre-registered verdicts

    hypothesis verdict at α=0.01 detail
    H1 fixes reduce aggregate structural exposure not supported (final) p=0.77 at n=182 vs 168
    H2 introductions raise it not supported direction right (+0.007 vs +0.000) but p=0.0227 misses the registered α — reported as registered
    H3 per-vector safety_score p=0.0072 — supported the one vector moving its assumed direction: security fixes genuinely reduce Error & Exception exposure. Consistent with the grammar (fixes add safety+branch constructs; that formula credits exactly那 pair). tech_debt p=0.0011 stands but is the diagnosed denominator artifact.

    Sharpened at full power: the fix grammar — state_pointers p=0.0001, struct_branch p=0.0004; introductions add pointers hardest (+1.58/file).

    Two clean nulls worth as much as the positives: the outlier-targeting hint fully dissolved (fix-files 86.2 vs control-files 86.5 percentile, p=0.57 — changed files are hot files; security-changed files are not hotter), and the length-bias gate stays closed (complexity 11 vs 11 in loc-matched pairs).

    The rung-6 verdict in one sentence: aggregate exposure does not respond to security events, but the instrument's signal layer (pointers, branches) and one formula built the way the contracts recommend (safety_score, a credit/debit net rather than a density) do — evidence that per-vector, unit-honest formulas are where temporal validity lives, exactly the score-contract program's thesis.

    Dataset v1.0.0 exported at full n: 507 events · 1,691 file samples · 34,030 function samples. Tag walk running (the 219-release panel). Phase M (multi-label) is pre-registered above and next.

  11. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Phase D — the guard-deficit study (pre-registered BEFORE the analysis runs)

    The grammar result implies a pre-state: if security fixes ADD safety + branch constructs (p=0.0001/0.0004), the vulnerable site presumably LACKED them. Hypothesis: vulnerabilities live where guards are missing relative to danger — a ratio/deficit, not a level (levels already failed: the 86th-percentile null, and def_safety presence marks battlegrounds).

    Definitions (function grain, parent snapshot, from function_data's own counts):

    • danger load = state_pointers + state_danger + state_memory_alloc + state_cast_hits
    • guard load = def_safety + state_bailout_hits
    • guard rate = guard_load / (danger_load + 1)

    Pre-registered:

    • D-H1: implicated functions have a LOWER guard rate than their length-matched same-file siblings (the existing 0.66–1.5× loc pairing; one-sided MW, α=0.01). Direction stated now: implicated < sibling.
    • D-H2: the fix RAISES the implicated function's guard rate (same-named function, parent → child snapshot; paired one-sided test, α=0.01) while siblings' rates stay flat.
    • Falsifier respected: if D-H1 fails, "notable absence of keywords" is wrong at function grain and the deficit story dies like the complexity story did.

    Danger-load-only control reported alongside (is any effect just "more pointers", which we already know), and the analysis lands in signal_anatomy.md with the same gates.

  12. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Phase D result — D-H1 and D-H2 not supported as registered, with the diagnosis attached:

    metric implicated matched sibling p
    guard rate (def_safety+bailouts per danger construct) 0.000 0.000 0.22
    danger load (control) 20.0 17.0 0.032
    guard-rate change after fix +0.0000 +0.0000 0.87

    The metric was degenerate, and that is itself the finding: at function grain in curl's C, the registered guard vocabulary (def_safety + bailouts) is essentially empty — median 0 on both sides, so the test had no resolution. C's guard idiom is if (!ptr) return — a branch — which is exactly what the grammar shows fixes adding (struct_branch p=0.0004). The deficit story may be right with branches as the guard vocabulary, but testing branch-per-danger on THIS data after seeing it would be post-hoc; it is hereby registered as D-H1′ for repo #2 (directions: implicated functions have lower branch-per-danger than length-matched siblings; the fix raises it), and any curl branch-rate number published before then is labeled exploratory.

    Meanwhile the danger-load control is the live lead: at equal length, implicated functions carry more danger constructs (20 vs 17, p=0.032 — under α, suggestive): danger density, not guard absence, may be the function-grain marker. Also flagged for repo-#2 confirmation.

    Running score: registered hypotheses to date — H1 ✗, H2 ✗ (direction right), H3 ✓ (safety_score), D-H1 ✗, D-H2 ✗. Three of five died honestly; the survivors are specific. This is what a crucible is for.

  13. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    status — the hypothesis ledger is law, the prevalence table is in, and curl's function-level profile is registered as a prediction

    docs/HYPOTHESES.md now exists in temporal-crucible as the register of record — the deviation-ledger sibling: the hypothesis-first protocol codified (register direction/test/α before running; verdicts published either way; exploratory labeled and never re-tested on the data that suggested it; every test carries its guards), the scope statement (ONE repo: curl — every "supported" is single-project until repo #2), the full register (H1 ✗ · H2 ✗ · H3 ✓ safety_score · D-H1/2 ✗ · M-H1..3 pending · D-H1′ and R2-H1 registered for repo #2), and the six lessons.

    Prevalence (exploratory-labeled, now in signal_anatomy.md): no single construct is a fingerprint — 62% of fixes add branches, 54% pointers, only 13% safety keywords. But the composite "fix-shaped" = branch/pointer-adds WITHOUT new allocations or casts reads 66% / 38% / 40% (fix/control/introduced) — the first descriptor that separates fixes from introductions (the loose signature reads 71/45/71 and cannot). The differential physics: fixes and introductions both touch pointers and branches; introductions additionally carry the allocs, casts, and debt markers of new feature code. Multi-feature classification is the JSONL dataset's job.

    The registered prediction for repo #2 (curl's answer to "which functions undergo CVE corrections"): the LONG functions (length dominates; complexity adds nothing at equal length), danger-dense at equal length (R2-H1), in ordinarily-hot files; corrected by branch+pointer additions without allocs/casts; introduced by large alloc/cast/debt-carrying feature commits; with a median 4.5-year window between the two moments. Confirming or killing that profile on a second repository is the program's single highest-value next step.

  14. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Research notes — repowise (repowise-dev/repowise) assessed for bug-prediction methodology; hypotheses extracted

    What they measure for defect prediction: a per-file 1–10 health score from 49 deterministic detectors (McCabe, "brain methods", LCOM4 cohesion, god classes, Rabin–Karp clone detection, untested hotspots, change entropy, prior-defect history, cross-file N+1/I-O-in-loop via the call graph) + git-behavioral signals (hotspots, ownership, co-change, bus factor, bug-fix history). Only 26 of 49 detectors are permitted to move the defect number — the ones carrying published claims. Labels: keyword-labelled bug fixes over 6-month forward windows, scored at a pre-window commit (leakage-free). Published: ROC AUC 0.737 [0.683–0.787] over 21 repos / 9 languages / 2,826 files.

    The three admissions that matter most — because they independently replicate what our crucible found today:

    1. "Not better than raw file size at discrimination: LOC-only scores 0.742 vs our 0.737 (p=0.92, a tie)." Their entire calibrated 26-marker model ties a line count on AUC.
    2. Within fixed size bands, AUC collapses to 0.525/0.572/0.593/0.718 across quartiles — survives only among the largest files. Our loc-matched-pairs gate found the same at function grain (complexity 10 vs 10).
    3. A prior-defects baseline still beats them on effort-aware ranking (Popt +0.085) — recidivism is the strongest known predictor.
      → Convergent evidence from an independent, well-run program: size dominates discrimination; the honest value is effort-aware ORDERING plus explanation (their Popt +0.134 over LOC — "the same discrimination as counting lines, much better at ordering a review budget, and unlike a line count it says why").

    Methods worth adopting (hypothesis/design menu for the crucible):

    • RW-1 (the size-controlled fit): their calibration recipe — L2-logistic with file size as an explicit control, "a marker only earns weight for defect lift beyond being big" — is the multivariate generalization of our matched-pairs gate. This is the registered method for the ML/aggregator stage over our JSONL dataset: which GitGalaxy signals earn weight beyond size against CVE labels?
    • RW-2 (effort-aware evaluation): adopt Popt and recall@20%-LOC-budget alongside AUC for rung 7 — the axes where structure can beat a line count even when AUC ties.
    • RW-3 (recidivism first): register prior-CVE-history as the baseline every rung-7 model must beat (crucible issue Bump actions/setup-python from 5 to 6 #3's analysis, now with a literature-grade justification).
    • RW-4 (feature gaps to evaluate): change entropy, co-change, bus factor, cohesion (LCOM4-like), clone mass, untested-hotspot (our def_test/verification × danger) — none in our current export. Temporal features stay ablated for delta-attribution studies but are legitimate, separately-grouped inputs for prediction studies (which must then beat the churn baseline, per their +0.100 AUC margin over churn).
    • RW-5 (benchmark bridge): their labels ≈ our Phase M Fixes # class — running our features on curl with their evaluation protocol gives a directly comparable AUC/Popt reading against their published 0.55–0.86 per-repo range.

    What we have that they measurably do not: CVE-grade labels (theirs are keyword-guessed bugs), introduced-by events (the birth side; they only see fixes), per-function contracted signal grain across 46 languages, dwell time, matched control classes, and the fix-vs-introduction differential signature. Their published numbers set a realistic bar and their honesty conventions match ours — a good external calibration point, and their traps (business-impact axis unreplicated on open data; merge-time ≈ queue noise) are noted so we don't re-step in them.

  15. squid-protocol commented on Sep 12, 2026

    @squid-protocol
    OwnerAuthor

    Registered: RW-H1 and RW-H2 (repowise-derived, testable on EXISTING curl data — no new scans)

    • RW-H1 (effort-aware value): ranking a parent snapshot's files by pre-event structural exposure achieves higher recall@20%-of-LOC review budget for future-CVE-implicated files than ranking by LOC alone. Registered direction: exposure > LOC on recall@budget; α=0.01, paired over event snapshots. Rationale: repowise's Popt result says structure's value is ordering under a budget even when AUC ties LOC; our percentile null says maybe not. Genuine uncertainty — the best kind of registration. Evaluated on parent snapshots we already hold.
    • RW-H2 (the recidivism baseline): a file's prior CVE-fix count predicts its future CVE involvement better than any single static signal (recall@budget and AUC). Registered direction: prior-defects ≥ best static signal. Rationale: prior-defect history beat repowise on Popt (+0.085) even while losing AUC; if it dominates on our data too, it becomes the baseline every rung-7 model must beat, and the crucible's recidivism analysis (temporal-crucible#3) gets its confirmatory framing.
    • RW-H3 (deferred to the size-controlled fit): our analogues of their floored markers (def_safety, encapsulation-family levels) earn no defect-weight beyond size against CVE labels — evaluated when the RW-1 logistic runs over the JSONL dataset, not before.

    Also filed: the calibration contract design placeholder (a signal earns formula weight by demonstrated lift beyond size) on the score-contract track.

  16. 22 remaining items

  17. squid-protocol commented on Sep 13, 2026

    @squid-protocol
    OwnerAuthor

    Reframe on record (2026-09-13): the program's falsification is scoped precisely — risk as a per-file, isolated, standing marker level is dead (all variants); risk as a system property is untested and now scoped as the SYS/INT wave (temporal-crucible#37: module-level dosage/dispersion/trajectory, cross-file discipline splits, marker×HCM interaction; INT-2 neighborhood load blocked on #2992 edge persistence). Descriptive-layer reform scoped in #2991 (disposition table for all 13 vectors: keep-descriptive / rework-artifact / promote-history-family-to-predictive-layer). Biology framing + the GWAS rationale for the multi-repo corpus recorded in the issue. Hypothesis 3 of the readme is not closed — it is restated one level up.

  18. added
    epic
    metrics
    testing
    on Sep 13, 2026
  19. added 2 commits that reference this issue on Sep 13, 2026
  20. added
    scope:frontier
    needs:corpus
    on Oct 16, 2026
  21. squid-protocol commented on Oct 23, 2026

    @squid-protocol
    OwnerAuthor

    DYN-H1 / DYN-H2 — PRE-REGISTRATION (α=0.01; ≥20-positives power rule)

    Registered 2026-10-23, before any dynamism statistic is computed on the evaluation data. Source: gitgalaxy's outcome-label pilot (#2720; docs/research/outcome_label_pilot.md, memo on #2716). The pilot found per-file dynamism associated with more later fix commits at equal size and evidence: pooled MH rate ratio 1.27 (1.06–1.50), 1.20 (0.98–1.50) with the bulk-commit guard. The ratio shrank as LOC was held tighter (1.81 at 3×3 strata, 1.39 at 6×6, 1.27 at 10×4), and curl and redis carried it. That result is exploratory (not pre-registered), so it is never scored on the data that suggested it.

    Predictor. state_heat_triggers, the file_data column of the reflection_metaprogramming signal: the per-file dynamism count that gitgalaxy#2719's risk term reads. In C (all evaluation repos below) the signal is the union of function-like #define and goto:
    ^#\s*define\s+[ID_START][ID_CONTINUE]*\([^)]*\)|\bgoto\b (gitgalaxy languages/c.py). If the C pattern differs from this at the scan's engine SHA, the run stops and the registration is amended before any statistic is computed.

    Data (unseen for this predictor). nDPI security-fix events (events/ndpi.json, 121), then openssl (repo #3, tc#26) once harvested. Excluded from scoring: curl (it carried the pilot estimate) and every other pilot repo. curl may appear as labelled context only.

    Unit and leakage guard. Every file in each event's first-parent snapshot (T0) is a candidate. A positive is a T0 file the event commit touches (rename-tracked, the B-H1 join). Every feature is read at T0. Every T0 snapshot is scanned at one engine SHA, recorded in the result doc, under SCAN_ENV (GITGALAXY_DISABLE_GIT_HISTORY=1).

    id claim (α=0.01) supported iff
    DYN-H1 Dynamism beats LOC at ranking fix-touched files within size bands (the gitgalaxy#2987 defect-lift-over-LOC bar) In ≥1 powered absolute-NLOC band (≤22, 23–48, 49–108, >108; the B-H1 scheme): lift = AUC(state_heat_triggers) − AUC(total_loc) > 0 with its one-sided event-bootstrap lower bound (5,000 rounds) > 0, Bonferroni α = 0.01 / (number of powered bands)
    DYN-H2 The pilot's estimand replicates: files with any dynamism are touched by fixes at a higher rate at equal size and evidence Mantel-Haenszel rate ratio (exposed = state_heat_triggers > 0; strata = event × LOC decile × evidence quartile, edges per T0 snapshot; evidence = sum of EVIDENCE_COLUMNS in gitgalaxy tests/tools/outcome_pilot.py @ 3e3347c, dynamism excluded) has a one-sided event-bootstrap lower bound (5,000 rounds, α=0.01) > 1.0

    Nulls. A replicated null is claimed only by equivalence: DYN-H2's 90% CI inside [0.80, 1.25]; DYN-H1's two-sided 90% CI for the lift inside [−0.02, +0.02] in every powered band. Anything else not supported is inconclusive, not null. A band or repo below 20 positives is not evaluable.

    Repos. The verdict is published per repo: nDPI first, openssl added when tc#26 lands. A claim is supported overall iff it is supported on every evaluable repo.

    Decision rule (registered with the claims).

    • (a) Neither claim supported on any evaluable repo, or both equivalence-null: open a gitgalaxy issue to set the per-file dynamism weight (the engine PR 2: per-file dynamism count replaces the flat irc term (child of #2716) #2719 term) to zero, the same rule that zeroed the strictness weight.
    • (b) DYN-H2 supported, DYN-H1 not: keep the current modest weight as a correction; no increase.
    • (c) DYN-H1 supported: keep it, and treat it as a ranking-layer candidate. Before any weight increase, it needs a third-repo replication registered separately.

    Exploratory alongside (no verdicts): a C construct split (goto vs function-like #define, counted separately from T0 source), security-fix vs size-matched control context, and curl pre-pin history as context.

    Priors on record: DYN-H1 expected not supported (every structural signal so far reduced to size); DYN-H2 uncertain (the pilot's ratio shrank under tighter size control).

    Tracking: temporal-crucible#41. Mirrored in temporal-crucible docs/HYPOTHESES.md (registration PR, separate from any verdict).

  22. added
    priority: low
    on Oct 28, 2026
  23. squid-protocol commented on Nov 16, 2026

    @squid-protocol
    OwnerAuthor

    Closing status (2026-11-16): the close criterion is met

    Close criterion (from the body): the full-curl report exists, regenerates from events/curl.json + the scan DB with one command, and states the H1–H3 verdicts with the guards applied, whatever they are.

    • Report: docs/exposure_history_report.md in temporal-crucible. Regenerate with python tools/delta_report.py --events events/curl.json. Coverage is 182 fix, 168 control and 118 introduced events analysed.
    • Verdicts, as registered (final, α=0.01):
    • Guards: all four held, and a fifth was added (label card, 2026-11-13). Temporal ablation asserted at exactly 0.0, untouched-file spillover median |Δ|=0, matching and rename tracking applied.

    Phase 6 ("Beyond") was done in temporal-crucible, not here.

    item outcome
    Second repo nDPI, then openssl, libarchive, harfbuzz and a 25-repo drawn panel. Only recidivism replicated (RW-H2).
    Tag-sampled trend panel The 219-release walk ran. Trajectory slopes are about chance (walk_trajectories.md).
    Rung 7 (does prior exposure predict later events) No static or structural predictor beats LOC or churn. History predicts: recidivism and change entropy (HCM1_LD_30, validated selection-free, B-H3). The standing is in docs/TAKEHOMES.md: "not a bug predictor beyond history and size."

    Engine follow-ups this epic spawned: #2983, #2984, #2985, #2988, #2991, #2992, #2994 and #3018 are all closed. #2987 (calibration contracts) is still open and now carries the score-contract thread.

    Not closed by the evidence, and tracked elsewhere:

    • The incremental parity sweep. Only the first 3/3 row-identical pairs are recorded here. The ~20-pair sweep should be confirmed or filed separately.
    • The system-property wave (tc#37, SYS/INT) and the DYN-H1/H2 registration (tc#41).
    • Both live in temporal-crucible's register.

    Rung-6 verdict in one line: aggregate exposure does not respond to security events. The signal layer (pointers and branches) and unit-honest formulas such as safety_score do. That points to the per-vector, score-contract work (#2987) rather than another history epic.

    Proposed: close as completed. Further history-validation work belongs in temporal-crucible issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicmetricsneeds:corpuspriority: lowscope:frontiertesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions