Skip to content

lens: a .h is Objective-C only on Objective-C evidence (Fixes #4546) - #4970

Merged
squid-protocol merged 2 commits into
mainfrom
churn/4546-20261012T0915Z
Oct 12, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
churn/4546-20261012T0915Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Fixes #4546

What

A shared-extension .h is Objective-C only on Objective-C content evidence. Two mechanisms were wrongly calling plain headers ObjC:

  1. Tier-3 lexical scan: ObjC's broad rules outscored C on macro-heavy API headers (SDL-style, extern "C" guards).
  2. Ecosystem gravity: any .h beside .m files was locked to ObjC at tier 1.5 with no content check.

Fix: objectivec.py extensions_needing_discriminator: [".h"] (ObjC is not a Tier-3 candidate for .h, and a gravity vote for it is dropped); internal_discriminator widened for Foundation-only headers (NS_ENUM/NS_OPTIONS, NS_ASSUME_NONNULL_BEGIN, FOUNDATION_EXPORT, NSString *-style pointers); cpp.py shared_extension_evidence[".h"] gives line-anchored C++ evidence (namespace, template, class, std::, access labels, constexpr...) which beats a C neighbourhood. extern "C" is not C++ evidence.

Class table

member status
GL/Vulkan/SDL-style API headers, macro-heavy, plain prototypes, extern "C" guards C, in all 4 neighbourhoods (alone / beside .h / .c / .m)
C++ headers (namespace, template, class, std::) C++ in all 4 neighbourhoods
ObjC (@interface, @protocol, NS_ASSUME_NONNULL, #import Foundation/UIKit, NS_ENUM-only, NSString*-only, blocks) ObjC in all 4 neighbourhoods
same-stem foo.h + foo.m Sibling Anchor unchanged (still ObjC)

Tests: tests/core_engine/test_header_language_collision.py (70 cases, real registry).

Evidence

  • Before: SDL-style and C++ headers repro'd as objective-c; headers beside .m files all locked ObjC.
  • Golden crucible: crucible_check.py PASS on both legs (full + zero-dep), no drift, nothing blessed.
  • pr_gates --fast: lint failure (SIM102) fixed; audits/secrets/xray/gauntlet pass. --ratchets: 7/7 pass, 0 skipped. tests/core_engine + objc/cpp extraction: 2757 passed.
  • Not run locally: the two real headers from the issue (not in the checkout); minimal reproductions used.

Cross-repo: none.

Sibling gaps

Same mechanism (a shared extension in COLLISION_FREQUENCIES claimed by ecosystem gravity or broad Tier-3 rules with no content proof), probed with the real registry and a plain sample in alone / rival-neighbour directories. Not fixed here: each needs its own evidence regex and golden review.

member status repro note
.inc PHP gap a.inc = <?php function helper($a){...} -> c ("Collision Resolved") alone and beside .c/.cpp; php has no .inc discriminator
.inc Fortran gap fixed-form INTEGER I / COMMON /BLK/ I -> c, alone and beside .c
.mac Easytrieve gap FILE INPUT1 ... JOB INPUT INPUT1 ... PRINT -> hlasm alone, beside .cbl and even beside .ezt; easytrieve has no internal_discriminator
.sql / .ddl / .dml plain SQL beside COBOL by design, unproven SELECT ... FROM users beside .cbl/.jcl -> db2_sql via gravity (#2511 mainframe-sibling gravity); alone -> sqlite. Plain portable SQL beside COBOL is called Db2
.asm x86 beside COBOL/JCL by design, unproven section .text / mov eax,1 / int 0x80 beside .cbl/.jcl -> hlasm via gravity (#2503); alone -> assembly
.cshtml Razor ambiguous @model Foo <h1>@Model.Title</h1> -> html alone and beside .html; csharp only beside .cs; no Razor discriminator
.m MATLAB/ObjC, .y yacc/C, .cmd batch/REXX, .py python/embedded_python, .h covered an internal_discriminator (or this PR) gives content proof; probe passed in all neighbourhoods
.map, .c n/a single claimant
.pl, .v, .cls, .r not in COLLISION_FREQUENCIES .pl perl-only, .cls apex-only, .v/.r unclaimed: no gravity path, so the mechanism does not apply (Mercury/Prolog/Coq/Verilog are not in the registry)

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 12, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 12, 2026 09:38
@squid-protocol
squid-protocol enabled auto-merge (squash) October 12, 2026 09:38
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

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.

Plain C headers (SDL GL, Vulkan) classified as Objective-C

1 participant