Skip to content

aperture: exclude vendored code under every common spelling (#4545) - #4573

Merged
squid-protocol merged 2 commits into
mainfrom
fix/4545-vendor-dirs
Oct 6, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/4545-vendor-dirs

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Closes #4545

Decision: exclude, not flag

Vendored copies of other projects are excluded from the scan, the same treatment vendor/ and third_party/ always had via IGNORED_DIRECTORIES, so every first-party metric reads first-party code only. Documented in docs/wiki/02-03-aperture-filter.md ("Vendored code") and beside the config entries.

  • By name (IGNORED_DIRECTORIES): third-party, thirdparty, 3rdparty, 3rd_party, 3rd-party, vendored. By suffix: *.framework.
  • On evidence (aperture.VendorDirectoryDetector, cached per dir): a generic name counts only when it holds a separate project, meaning a license file of its own whose text differs from the scan root's license. If the root has no license, there is no evidence.
    • container libraries/ libs/ deps/ extern/ external/ externals/: excluded whole when at least half of its non-empty subdirs carry such a license;
    • versioned dir (SDL2-2.32.10/): excluded when it carries one itself. linuxdoom-1.10/ (license at root) stays.
    • The scan root itself is never a candidate.
  • The GuideStar doc walk and the chronometer fallback walk prune the same way, as they do for Scanner drops any directory named env as a virtualenv, silently excluding real source (room4doom: 3,646 lines) #4542.

Real-scan proof (doom-study, all 14 repos, origin/main 95d6b27 vs branch)

repo files coding LOC
gzdoom 3078 → 1422 931,079 → 415,988
doomretro 516 → 204 177,679 → 137,805
woof 475 → 452 142,932 → 110,355
other 11 (incl. linuxdoom, odamex, eternity, zandronum) unchanged unchanged

Newly excluded files, all genuinely vendored and all under these trees:

  • gzdoom libraries/ (1,544 files: ZMusic incl. its thirdparty/, ZVulkan, ZWidget, asmjit, bzip2, cppdap, discordrpc, lzma, miniz, range_map, webp) and src/common/thirdparty/ + src/common/audio/sound/thirdparty/ (109 + 3).
  • doomretro SDL2-2.32.10/ (94), SDL2_mixer-2.8.2/ (16), xcode/SDL2{,_image,_mixer}.framework/ (202).
  • woof third-party/ (23: base64, libebur128, md5, minimp3, miniz, pffft, sha1, spng, yyjson).

No files were newly admitted anywhere.

Not covered (documented; use exclude_dirs)

  • odamex libraries/ (21k LOC): only fmt has a license that differs from the root's. minilzo's GPL COPYING matches the root's, and most subdirs are empty submodules, so the container falls below the half threshold. Erring this way is deliberate.
  • Eternity's single source/nlohmann/json.hpp, and bare root-level library dirs (zlib/, libpng/ in eternity and zandronum).

Gates

  • Golden crucible (both legs): PASS with zero drift, so no bless was needed.
  • pr_gates.py: audits, secrets, xray, gauntlet, golden and suite pass. Lint passes after the PEP 604 fix.
  • Ratchets: port-surface, estate, fact-crosscheck, completeness and ground-truth pass. ports was skipped because there is no local cics-crucible checkout. ast_accuracy_audit shows no regressions.
  • New tests/core_engine/test_vendored_dirs_4545.py (21 tests: each pattern, plus first-party lookalikes: linuxdoom-1.10, Nx libs/, a mostly first-party container, extern/ glue, root never a candidate).

🤖 Generated with Claude Code

https://claude.ai/code/session_017BVJCCUMdjLJq1TAM3V34V

squid-protocol and others added 2 commits October 6, 2026 10:25
Vendored copies of other projects stay EXCLUDED (the existing treatment of
vendor/ and third_party/), now also for:
- by name (IGNORED_DIRECTORIES): third-party, thirdparty, 3rdparty, 3rd_party,
  3rd-party, vendored; by suffix: *.framework bundles;
- on evidence (VendorDirectoryDetector): libraries/libs/deps/extern(al) when at
  least half their non-empty subdirectories carry a license of their own that
  differs from the scan root's; versioned dirs (SDL2-2.32.10/) carrying one.
  No root license, no evidence. The scan root is never a candidate.

The GuideStar doc walk and the chronometer fallback walk prune the same way.

Doom study, coding LOC before -> after: gzdoom 931,079 -> 415,988 (libraries/,
src/common/thirdparty/), doomretro 177,679 -> 137,805 (SDL2*-x.y.z/,
xcode/*.framework), woof 142,932 -> 110,355 (third-party/); linuxdoom-1.10/
and the other 11 repos unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017BVJCCUMdjLJq1TAM3V34V
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine core-engine Modifications to the central physics and parsing engine data-quality priority: medium labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 6, 2026 15:08
@squid-protocol
squid-protocol merged commit df8abee into main Oct 6, 2026
28 of 30 checks passed
@squid-protocol
squid-protocol deleted the fix/4545-vendor-dirs branch October 6, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine core-engine Modifications to the central physics and parsing engine data-quality priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vendored-code detection misses third-party/, thirdparty/, libraries/, versioned SDL dirs and .framework, so first-party metrics are inflated

1 participant