Repository navigation
Description
🛑 Problem Statement
detector.py's coding_analysis() spatially corroborates RCE risk by correlating sec_high_risk_execution against sec_io/io hits within a 250-character radius, writing the result into counts["sec_tainted_injection"] (detector.py:1004-1013). Separately, security_lens.py::scan_content() runs its own, independent variable-echo taint check and produces its own tainted_injection count.
galaxyscope.py merges the two at lines 425-426:
for sec_key, hit_count in sec_results["counts"].items():
logic_data["equations"][f"sec_{sec_key}"] = hit_countThis is a plain assignment (=), not additive, and it runs after coding_analysis() has already populated equations["sec_tainted_injection"]. Because security_lens.py's own tainted_injection count gets the same sec_ prefix applied, it silently overwrites whatever detector.py's proximity-based corroboration computed for the same key, on every non-inert file. One of the two spatial-correlation systems' output is discarded every time, with no error or warning.
Found while scoping #102/#105/#106 — both of those tickets propose feeding new deterministic signals into _calc_injection_surface following the exact pattern sec_tainted_injection already uses (signal_processor.py's "+500 gravity spike" for confirmed taint). That pattern isn't trustworthy until this collision is fixed.
🎯 Objective
Ensure both spatial-correlation systems' contributions to RCE/injection corroboration survive the merge, instead of one silently discarding the other.
🛠️ Proposed Implementation
Pick one explicitly, rather than leave the collision:
- Keep
sec_tainted_injectionasdetector.py's proximity-based count, and givesecurity_lens.py's variable-echo result its own key (e.g.sec_variable_taint) instead of colliding on the same name, or - Merge additively (
+=) instead of overwriting, if the two are meant to represent the same conceptual signal.
Whichever is chosen, update _calc_injection_surface (and any other consumer of sec_tainted_injection) to read the correct key(s).
✅ Acceptance Criteria
-
equations["sec_tainted_injection"](or its renamed successor) reflects both systems' findings, not just whichever ran last. - A regression test exercises a file that would trigger both
detector.py's proximity check andsecurity_lens.py's variable-echo check, and asserts neither result is silently dropped. -
signal_processor.py's_calc_injection_surface(and any other reader) is updated to match the resolved key(s).
Blocks trust in the "amplified" signal pattern that #105 and #106 both build on. Part of #102.
Activity
squid-protocol commentedon Jul 24, 2026
Correction to the diagnosis above, found while implementing this — the actual bug is more fundamental than a merge overwrite.
Every
sec_-prefixed key is explicitly the "PASSIVE SECURITY LENS OBSERVERS" section ofSIGNAL_SCHEMA(analysis_lens.py:1165-1180) — by design, only ever meant to be populated fromsecurity_lens.py, merged in duringgalaxyscope.py's Phase 5.5, which runs afterdetector.splice()(and thecoding_analysis()call inside it) has already returned.But
detector.py's "1. Taint Tracking (RCE Weaponization)" block (detector.py:1005) and "4. The Active Hemorrhage" block (detector.py:1042) checkspatial_map— a dict local to a singlecoding_analysis()call, populated only from that function's own per-language regex rules — forsec_high_risk_execution/sec_hardcoded_secrets. Those keys can never appear inspatial_map: nothing incoding_analysis()'s own rule set produces asec_-prefixed name, and the one thing that does hasn't run yet at this point in the pipeline. Both conditions are permanently False — these are dead, unreachable blocks, not a real value that gets overwritten. Detector.py's own contribution tosec_tainted_injection/sec_hardcoded_secrets's amplification has always been exactly 0.The
=vs+=merge overwrite is still real, but it's the second half of the bug, not the first:detector.py's own rules do populate the correct unprefixed keys (high_risk_execution,io,hardcoded_secrets) inspatial_map. Once the dead blocks are pointed at the keys that actually exist, they'll start writing real values intosec_tainted_injection/sec_hardcoded_secrets— and that's when the unconditional=in the galaxyscope.py merge would immediately erase them again withsecurity_lens.py's independent count.Revised fix, both parts required together:
detector.py::coding_analysis()at the keys that are actually present at that stage (high_risk_execution/iofor block 1,hardcoded_secretsfor block 4).galaxyscope.pyPhase 5.5 merge additive instead of an unconditional overwrite, sosecurity_lens.py's independent corroboration adds to detector.py's now-real contribution instead of replacing it.Implementing both together now.
squid-protocol commentedon Jul 24, 2026
Opened PR #347 with the corrected fix (both parts: the dead-key guard in
detector.py, and the additive merge ingalaxyscope.py). Block 4 (sec_hardcoded_secrets) is intentionally left dead in this PR, annotated in place, since it genuinely needs #346's correlate-after-both-phases fix rather than a key-name correction.Fix detector.py's dead RCE-taint corroboration and the sec_ merge ove…
Persist a satellite-aware spatial ledger for post-hoc correlation (#348…
Implement the Spatial Radar for DB injection funnels (#105) (#359)
Spatially verify Metaprogramming Hallucination Risk in Dev Agent Fire…