Skip to content

recorder: raw pre-adjustment hit_vector is unrecoverable once the Contextual Baseline Fix rewrites api/orphaned_logic #2536

Closed

Description

@squid-protocol

Summary

The #1096 control corpus validates structural extraction by diffing planted keyword counts
against the recorder DB's per-file hit columns. That surface is post-adjustment: the
Contextual Baseline Fix (galaxyscope.py ~2145) rewrites api += orphaned_logic; orphaned_logic = 0 for any file with popularity > 0 before recording.

Verified micro-repro (2026-08-31): x.py with 2 uncalled defs, imported by y.py → recorded
api = 4 (2 real def matches + 2 converted orphans); the same file un-imported records
api = 2. The corpus's a/b/c files (each imported, probes uncalled) all record
api = defs × 2.

Why this matters for validation tooling

The adjustment is reasonable scoring semantics, but it means raw extraction counts are
unrecoverable from the DB
for exactly the signals the adjustment touches — a
cross-language extraction-equivalence check (#1096's whole purpose) has to reverse-engineer
the popularity graph to know what detector.py actually matched. Today the corpus bakes
the adjusted numbers into its manifests with a note, which works but couples every
manifest to scoring-layer behavior that can legitimately change.

Proposal

Persist the raw pre-adjustment hit_vector alongside the adjusted values — either a parallel
raw_* column set for the affected keys (only api/orphaned_logic today), or a single
JSON column of the pre-adjustment vector, or a --raw-signals recorder flag. No behavior
change to scoring; purely additive recording.

References

Activity

  1. added
    enhancement
    core-engine
    on Aug 31, 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

    core-engineenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions