Repository navigation
feat(core): recorded signal counts are raw counts; proximity weights move to a weighted view (#2813, D1) - #2815
Merged
Merged
Conversation
…move to a weighted view (#2813, D1) The six proximity pairs in core/spatial_correlation.py used to add their weights into counts[...] in place (x3 cascading flux, the silencer dampener, the x5 / x100 / +1 amplifiers), so state_mutation in every recorder, both golden masters and every corpus manifest was raw + 2 * cascading. They now tally only; PROXIMITY_WEIGHTS + weighted_count() give the score layer the figure the recorded count used to carry, so every risk_* column, structural magnitude and coordinate in both golden masters is byte-identical (2,822 diffs each, all in the per-file mitigation/signature sections). Also: signal_processor wrote the galaxyscope:ignore list into the mitigation_telemetry slot, so the audit report's section 6 was None Detected for all 2,817 files; it now carries the detector's tally plus a weighted_signals block. Block 0 tallies under amplified_exfiltration (amplified_leaks is the Active Hemorrhage's key). test_detector's dead-branch test passed only via the silencer; pinned against #2814. Closes #2813 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Closed
13 of 24 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2813
Part of #2812 (contract roadmap Phase 2, decision D1). One layer per PR: this is the correlation → score boundary; no rule regex, slicer or formula changes.
What changes
A recorded signal count is a count. The six proximity pairs in
core/spatial_correlation.pyused to add their weights intocounts[...]in place (×3 cascading flux, the silencer dampener, the ×5 / ×100 / +1 amplifiers), sostate_mutationinfile_data, every recorder, both golden masters and every keyword-rosetta manifest wasraw + 2 × cascading— a score wearing a count's name. They now write only to the per-filemitigation_telemetrytally.core/spatial_correlation.py:PROXIMITY_WEIGHTS(signal → tally key × weight),weighted_count(),weighted_view().apply_dampener_correlations/apply_amplifier_correlationslose theircountsparameter. Block 0 tallies under its own keyamplified_exfiltration:amplified_leaksis the Active Hemorrhage's key (galaxyscope.py Phase 5.5) and the two used to share it, so a weightedmemory_scrapingcould not be told apart from a hemorrhaging secret.metrics/signal_processor.py:_weighted()builds the score-layer view once per file fromraw_signals + mitigation_telemetry; every_calc_*, the structural-magnitudefile_massand the archetype fingerprint read it.hit_vectorcarries the raw counts.security/security_auditor.py(the ML feature frame — the trained model saw weighted inputs; dropping that is a retrain, not this fix) andmetrics/statistical_auditor.py(the outlier / dead-code / threat gates).signal_processor.pywrote thegalaxyscope:ignoresuppression list intotelemetry["mitigation_telemetry"], not the detector's tally dict — so "6. Contextual Mitigations & Amplifications" readNone Detectedfor all 2,817 golden-master files and the docs(core): document + pin the ×3 cascading-flux weighting (closes #2546) #2631 "raw is recoverable from telemetry" promise never reached the report. The slot now carries the tally (suppressions folded in as 1-tallies, the shape the recorders already accept).telemetry["weighted_signals"]holds the weighted figure for each adjusted signal under its own key; the audit report shows it in section 6 beside the tally (State Mutations / Variable Reassignments (Weighted View): 7), the LLM brief likewise. SQLite / SARIF / section 7 are the raw counts. The section-7 label still says "(Net Mitigated Signals)" — renaming that JSON key touches every file in both golden masters and belongs with the README copy in Phase 5.core/README.mdproximity table (tally key + weighted view columns; the two same-shaped adjustments that remain in place —rce_funnel×50 incoding_analysis()and the Active Hemorrhage — are named),signal_contracts.pySTREAM_CONTRACT corollary 3 (+ re-rendereddocs/signal_contracts.md),how_to_add_a_language.mdRULE 18.Proof (as specified in #2813)
Both golden masters: every
risk_*column byte-identical. The bless diff (uncapped,golden_diff.deep_compare) touches only two sections per file:None Detected→ tally)Section 7 (full precision) moves exactly the five signals the weight table names, each in the predicted direction, across 42 languages:
state_mutation↓ 1,096 files,high_risk_execution↑ 147 (the silencer no longer subtracts),memory_alloc↑ 120,concurrency↓ 137,sec_tainted_injection↓ 135. No topological coordinate, structural magnitude, archetype, drift or ecosystem-summary line moved.tests/core_engine/test_signal_processor.py::test_signal_processor_weighted_view_is_score_neutral: raw + tally scores byte-identical to the old weighted counts (risk_vector, file_impact, archetype fingerprint), hit_vector raw, telemetry carries both.tests/core_engine/test_spatial_correlation.py: the five docs(core): document + pin the ×3 cascading-flux weighting (closes #2546) #2631 flux pins assert the tally +weighted_count(); one new pin per pair reproducing the old recorded value; the weight table itself.tests/tools/audit_risk_equations.py,audit_length_invariance.py: unchanged (both pass).PYTHONPATHshadow, full-precision venv):verify_language.py45/46 PASS. The one mismatch is the predicted shape: agc_assemblyc.agcmemory_allocexpected 0, got 1 (the alloc a same-function cleanup mitigates is now recorded raw; the mitigation is in the tally).state_mutationalready lands on its pinned value in all 46 languages — the ledger's 21-language list understate-flux-branch-weightingis decayed: since fix(standards): stop counting bare return as branch in 6 languages (closes #2545) #2634 droppedreturnfrombranch, the ×3 no longer fires on any corpus file, which is exactly what Phase 0's decayed-entry check is for.Found on the way
test_detector_c_macro_dead_branch_shieldpassed only through the silencer: thestrcpyin a#if 0branch is counted at file and function level, the macro shield only serves brace matching. The test now pins the actual behaviour and points at the issue.state_mutationwould drop to the planted 2 was based on a decayed ledger entry; the corpus effect is one cell (above). The crucible (real repositories) is where the weights actually fired: 1,096 files'state_mutation.Cross-repo
c.agcmemory_alloc0 → 1 with a ledger note; ledger entrystate-flux-branch-weightingflipsstill_reproduces: falseandstring-literal-selective-shielding's "triples nearby mutations" clause is retired;bias_report.py'scorrelationcategory is expected to go to 0.rosetta:rebless-owed.state_mutationcontract).🤖 Generated with Claude Code