Skip to content

aperture silently excludes 45% of the sqlite crucible corpus from scanning (generated-file + infra-path heuristics) #2512

Closed

Description

@squid-protocol

Summary

Two independent aperture heuristics silently exclude 33 of the sqlite crucible corpus's 73
git-tracked .sql files from being scanned at all -- they never reach prism/detector, so they
never contribute to function_data/class_data or to the tri-comparison precision/recall
measurement (found while running the tri-comparison-ledger-sweep/harden-language-extraction
skills on sqlite, PR #2511). Same underlying class of problem as #2415 (aperture silently dropping
legitimate crucible corpus content), different mechanism.

Reproduction

Corpus: language-crucible (main, sqlite category). galaxyscope data/sqlite --db-only --debug
(no manifest -> has_intent=False).

1. Aperture._check_ignore_rules's infra_path_pattern (aperture.py:107) -- correctly
left-boundary-guarded post-#2415, but the semantic list itself (gen, generated, scripts, ...)
is broad enough to catch real, hand-authored, git-tracked corpus files whose path merely contains
one of those words as a normal segment, not generated build output:

  • mediawiki_sqlite_tables/tables-generated.sql (28KB, 64 real CREATE TABLE statements,
    MediaWiki's official abstract-schema-generated-but-committed-and-canonical DDL) -- matches
    -generated.
  • All 11 sqlite_cli_scripts/*.sql files (SQLite's own CLI test fixtures) -- matches _scripts/

2. The content-based "Machine-Generated Source Code Signature" heuristic (separate gate, logs
ANOMALY: <file> | Blocked (Machine-Generated Source Code Signature: N LOC) /
UNPARSABLE_BYPASS: '<file>' lacks structural integrity) -- blocks all 18 files under
mediawiki_sqlite_alterpatches/ plus 2 more in mediawiki_sqlite_tables/ and
prisma_typed_sql/getBigInt.sql. These are real MediaWiki schema-change patches (e.g.
patch-archive-drop-ar_sha1.sql, CREATE TEMPORARY TABLE /*_*/__temp__archive AS SELECT ...) --
their header comment literally says "This file is automatically generated using maintenance/
generateSchemaChangeSql.php", which is presumably what trips the heuristic, but the SQL itself is
real, valid, hand-reviewed-and-committed schema-migration logic, not build/vendor debris.

Net effect: 33/73 (45%) of the sqlite corpus is invisible to the engine. The detector itself
classifies every one of these files correctly as sqlite when probed directly
(LanguageDetector.inspect()) -- the drop happens entirely at the aperture perimeter, before
prism/detector ever see the content.

Why this matters

This corpus is the ground truth docs/self_scan/tri_comparison_ledger.json's sqlite shapes are
measured against. Silently dropping 45% of it doesn't cause a wrong reading -- it caps how much of
the real precision/recall surface can ever be verified in the first place, and would equally
under-count any real user repo that happens to have "scripts"/"generated" in a legitimate SQL
schema path (both real, common naming conventions for hand-maintained SQL, not just this corpus).

Suggested scope (not investigated further -- filing to track, not blocking PR #2511)

  • infra_path_pattern: consider whether has_intent-gating alone is the right lever, or whether
    the semantic list needs a narrower default for known-source extensions (.sql among them) the
    way exact_match_files/whitelisted_extensions already special-case elsewhere in aperture.py.
  • The "Machine-Generated Source Code Signature" gate: consider whether a file's own claim about
    itself (a generator-tool comment) should be enough to exclude it outright, vs. a softer signal
    combined with LOC/structure the way the neighboring gates already weight multiple factors.

Priority

Not COBOL/JCL, so standard triage -- but note it's a real recall gap affecting how much of ANY
corpus's precision/recall can be verified, not just sqlite's.

Activity

  1. added
    bug
    core-engine
    threat: false-negative
    on Aug 30, 2026
  2. added 2 commits that reference this issue on Aug 30, 2026
  3. added this to the v2.4.9 milestone 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

    bugcore-enginethreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions