Skip to content

aperture: payload guards keep files with function definitions beside a data table (Part of #5460) - #5493

Merged
squid-protocol merged 7 commits into
mainfrom
churn/5460-20261018T1521Z
Oct 18, 2026
Merged

squid-protocol merged 7 commits into
mainfrom
churn/5460-20261018T1521Z

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Part of #5460 (slice 1 of the payload-guard class). Does not close it.

Change

ApertureFilter._has_definitions(lines, need=1): a linear, bounded-quantifier scan for function definitions (type name(args) {, lone { after a closing ), GNU style name-on-its-own-line, args over several lines). Gates that would block a file first ask it:

member gate status
Embedded Hex Payload 3.4 fixed, kept when >=1 definition
Embedded Array/Matrix Payload 3.4 fixed, same
Saturation (long line in head) 4.1 fixed, same
Lexical Monotony 5.1 fixed, needs >=2 definitions (one function round an unrolled loop is still generated; test_aperture_machine_gen_and_monotony pins it)
Packed Payload Guard (rho > 3.0) statistical_auditor.py NOT here (post-extraction density; different mechanism)
Zero-Density, Machine-Generated OK per issue

A pure table has no definition and is still excluded (test per guard).

Evidence

  • DOOM corpus (3,884 C-family files >20 KB): 76 files newly admitted by the old-vs-new gate comparison, 0 of them without ctags-visible functions (2,192 functions). The 4 tables.c still blocked have 0 ctags functions. A galaxyscope scan of 5 of them (srb2 / linuxdoom tables.c, aes_prng.c, d_dehtbl.cpp, r_bmaps.c) yields 54 functions, none excluded.
  • language-crucible (re-measured at head b4dad26 against merge-base 08c28bb): exactly 8 files leave the excluded queue (typescript builtins.ts/parser.ts/emitter.ts, tokio tokio_udp.rs, freebsd ed_test.sh, haiku generate_ids_from_drivers.sh, zls langref.html.in, plus the 54k-line TypeScript checker.ts, which main's monotony gate still excluded); no other aperture flips. Golden diff per fixture: 182 part files, +184,502 / -65,381 lines (both fixtures identical in size, 364 files total). Nearly all of it is the repo-wide PageRank / composition re-solve those 8 files cause (cobol 3.9k etc.), not parser drift. Both fixtures blessed via golden-lock.sh crucible_check.py --update --yes, then re-blessed on the merged tree (b4dad26: also drops the retired feature_flags.json, archetypes: retire feature_flags and project the file brain without it (Part of #4111) #5487).
  • Gates at head b4dad26 (rerun after the final bless): pr_gates --fast 6/6 PASS (lint, audits, secrets, xray, gen-docs, gauntlet); --ratchets 8/8 PASS; aperture tests 80 passed. The golden masters are not a ratchet row; crucible_check.py ran as the bless.
  • Hand-written files: 2 (gitgalaxy/core/aperture.py, tests/core_engine/test_aperture_payload_guards_5460.py); the rest is regenerated golden.

Remaining slices

  • statistical_auditor.py Packed Payload Guard (EntityFlags.cs 363 fns, gl_load.c, mac.c).
  • Issue acceptance "rescan the corpus: zero first-party files with ctags-visible functions excluded" needs the doom-study rescan (scripts/clean_check.py) once all slices land.

Risk: checker.ts (54,434 lines, 2,719 functions) is now scanned. Re-timed standalone: one galaxyscope run end to end took ~23 s on a lightly loaded box (an earlier 29.6 s was under load), no exclusion. The per-file ReDoS fuse in galaxyscope.py is signal.alarm(60) (the "15-second" wording in its comment and in the golden-master rules is stale), so headroom is ~2.5x against the 60 s fuse. A runner more than ~2.5x slower than this box would drop the file and show as a golden mismatch in CI, not a silent pass. No guard added: the cost is the detector on one real 3 MB file, which a unit test cannot reproduce without committing it.

Owner decisions

None pending. Applied from the brief: burned estates only, never loosen a proof (a pure table with no definitions is still excluded, one test per guard), no issues filed (sibling gap listed above), draft PR with no labels / milestone / shepherd:merge.
Note: origin/main has moved 3 commits since (#5494, #5495 cpp func_start, #5486); the PR is mergeable-clean. #5495 changes C++ extraction, so the goldens need a re-bless once main is merged for the final merge.

Cross-repo: none.

🤖 Generated with Claude Code

Gates at 7af0e3f: pr_gates --fast 6/6, --ratchets 8/8. Hand-written files: 2 (aperture.py, the guard test).

squid-protocol and others added 6 commits October 18, 2026 11:28
…side a data table (Part of #5460)

Gate 3.4 (hex, array/matrix), 4.1 (saturation) and 5.1 (monotony, two definitions) now ask
_has_definitions first; a pure table has none and is still excluded.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…itions (Part of #5460)

Seven crucible files leave the excluded queue (typescript builtins/parser/emitter, tokio_udp.rs,
ed_test.sh, generate_ids_from_drivers.sh, zls langref.html.in); the rest is the repo-wide
PageRank / rollup re-solve that follows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…521Z

# Conflicts:
#	tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_audit/2_global_ecosystem_summary/ecosystem_audits.json
#	tests/golden_master_audit/2_global_ecosystem_summary/ecosystem_fingerprint.json
#	tests/golden_master_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/global_architectural_fingerprint.json
#	tests/golden_master_audit/2_global_ecosystem_summary/health.json
#	tests/golden_master_audit/2_global_ecosystem_summary/network_macro.json
#	tests/golden_master_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_audit/2_global_ecosystem_summary/unparsable_files.json
#	tests/golden_master_audit/3_forensic_security_vulnerability_audit/raw_threat_signature_hits_total_repository_occurrences.json
#	tests/golden_master_audit/3_forensic_security_vulnerability_audit/scope.json
#	tests/golden_master_audit/4_high_value_forensic_report/systemic_bottlenecks.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/11_scan_db_snapshot/pagerank.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/x.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/z.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/4_vulnerability_risk_exposures/testing_exposure.json
#	tests/golden_master_audit/6_parsed_files_scanned_artifacts/files/8_dependency_network/total_upstream_absolute_fragility.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/graph_sqlite.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/llm_brief.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/ecosystem_audits.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/ecosystem_fingerprint.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/global_architectural_fingerprint.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/health.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/network_macro.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/unparsable_files.json
#	tests/golden_master_zero_dep_audit/3_forensic_security_vulnerability_audit/raw_threat_signature_hits_total_repository_occurrences.json
#	tests/golden_master_zero_dep_audit/3_forensic_security_vulnerability_audit/scope.json
#	tests/golden_master_zero_dep_audit/4_high_value_forensic_report/systemic_bottlenecks.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/11_scan_db_snapshot/pagerank.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/x.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/2_topological_coordinates/z.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/4_vulnerability_risk_exposures/testing_exposure.json
#	tests/golden_master_zero_dep_audit/6_parsed_files_scanned_artifacts/files/8_dependency_network/total_upstream_absolute_fragility.json
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 18, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 18, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 18, 2026 16:54
@squid-protocol
squid-protocol enabled auto-merge (squash) October 18, 2026 16:58
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit c89492d into main Oct 18, 2026
70 checks passed
@squid-protocol
squid-protocol deleted the churn/5460-20261018T1521Z branch October 18, 2026 17:14
squid-protocol added a commit that referenced this pull request Oct 18, 2026
…re now keeps (Part of #5503) (#5509)

#5493 (aperture payload guards) moved tokio_udp.rs, ed_test.sh and
generate_ids_from_drivers.sh out of the excluded queue, so the pinned
corpus scan counts them: rust 48->49 files, shell 252->254 files.
Shell recall drops 99.1% -> 84.2% because ed_test.sh defines ~150 functions
GitGalaxy does not find (separate engine gap). Typescript is not included:
extra_functions 1 -> 106, which the tool refuses to bless.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
squid-protocol added a commit that referenced this pull request Oct 18, 2026
…in (#5511)

pinned_ruff_lint / pinned_mypy_audit matched the caller's ruff/mypy against
CI's pin, then ran the audit under `env -i PATH=<interpreter bin>:/usr/bin:/bin`.
churn's precheck runs pr_gates under /usr/bin/python3 while the pinned ruff
sits on ~/.local/bin (nyx), so that PATH had no ruff: lint failed in 0 s with
FileNotFoundError and green PRs (#5483, #5493, #5504) were sent back; workers
rerunning under the venv python could never reproduce it.

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
squid-protocol added a commit that referenced this pull request Oct 19, 2026
…e now keeps (Closes #5581) (#5583)

#5493 (aperture payload guards) changed which pinned-corpus files the scan
keeps, so typescript went 35->36 files, real_functions 7391->8484 and
real_classes 894->1488. #5509 re-baselined rust and shell but skipped
typescript while extra_functions was 106; #5516 brought it back to 1, so the
tool now blesses it with no regressions. The language-crucible pin (v1.7.0)
is unchanged.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant