Skip to content

[FEATURE/CORE-ENGINE] Persist a satellite-aware spatial ledger for post-hoc correlation (#346 phase 2) #348

Closed

Description

@squid-protocol

🛑 Problem Statement

This is phase 2 of #346, split out to ship the safety-critical dampener-scoping fix (phase 1) independently and sooner, without also solving the larger problem below in the same PR.

detector.py's six existing _correlate_signals calls (now migrated onto the shared primitive and satellite-scoped for the three dampener pairs, in phase 1) still only operate on spatial_map — a dict local to a single coding_analysis() call, discarded the moment that function returns. Nothing outside detector.py can correlate against it.

That's a hard blocker for #105 and #106: both need to correlate signals from outside detector.py, at the post-hoc pipeline stage (dev_agent_firewall.py and the eventual db_hooks correlation both run over parsed_files in galaxyscope.py, well after coding_analysis()'s spatial_map is gone). threat_locations (rule_name -> [line_numbers]) does survive to that stage, but it's write-only today, has no notion of which satellite/function a hit belongs to, and security_lens.py's own already-computed line positions (e.g. for db_hooks) never get folded into it.

🎯 Objective

Make threat_locations (or its successor) the one persisted, satellite-aware spatial ledger usable by any pipeline stage, not just internal to detector.py.

🛠️ Proposed Implementation

✅ Acceptance Criteria

Part of #102. Depends on #346 phase 1 (dampener scoping) landing first.

Activity

  1. added
    enhancementNew feature, sensor, or structural signature
    appsecAgentic guardrails, prompt injection, and RCE sensors
    core-engineModifications to the central physics and parsing engine
    on Jul 24, 2026
  2. squid-protocol commented on Jul 24, 2026

    @squid-protocol
    OwnerAuthor

    Opened PR #350. One design deviation worth flagging: rather than literally embedding an owning-satellite id into each threat_locations entry, correlate_against_ledger() joins threat_locations against file_data["functions"] (which already has file-global start_line/end_line) at query time. Mutating threat_locations's shape would have broken sarif_recorder.py, which reads threat_locations[key][idx] expecting a plain int line number. Also folded in an extra fix: the still-dead "Active Hemorrhage" block from #344/#346 is now removed from detector.py and reimplemented as a real post-hoc correlation using this new ledger.

  3. added a commit that references this issue on Sep 16, 2026
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

    appsecAgentic guardrails, prompt injection, and RCE sensorscore-engineModifications to the central physics and parsing engineenhancementNew feature, sensor, or structural signature

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions