Repository navigation
fix(native): preserve Objective-C records with unreadable protocol lists - #8958
Conversation
…xceeds its count limit Fixes morluto#8945
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no blocking issue remains. SummaryThe PR preserves independently readable Objective-C records when their adopted-protocol lists cannot be read.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Class, category or protocol] --> B[Shared protocol-list reader]
B --> C{List readable?}
C -->|Yes| D[Return protocol names]
C -->|No| E[Return known names and failure reason]
D --> F[Retain owner facts]
E --> G[Retain owner facts with partial status]
F --> H[Publish under reader v3]
G --> H
Reviews (6) · Last reviewed commit: "fix(native): invalidate snapshots from t..." · Reviewed by Greptile |
readAdoptedProtocols now returns Result<string[], ProtocolListUnreadable> and readClass records the failure reason and marks the class row partial.
Own adopted protocol-list recovery at the shared reader and retain readable prefixes and independent class, category and protocol facts. Remove the class-only wrapper and cover source-preserving provider delivery. Fixes morluto#8945 Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
Exercise the count guard through the real Darwin entrypoints selected by the Apple artifact CI lane, retaining target identity and partial facts. Share the existing controlled byte fixture with provider-boundary tests. Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
Advance the source-owned reader commitment for recovered protocol-list results. Replace the fictional old-version control with the actual v2 binding so the regression catches unintended reuse of pre-fix snapshots. Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
|
Welcome to REA, @SahinurDEV, and thanks for improving Objective-C metadata recovery. Keeping readable class and protocol facts when an adopted-protocol list cannot be decoded gives analysts useful evidence without hiding the partial result. |
Summary
Fixes #8945. An unreadable adopted-protocol sublist no longer discards its independently readable owner. Classes/metaclasses, categories and adopting protocol declarations retain their own facts, any readable protocol-name prefix and explicit partial decode status (
protocol_list_unreadable). Empty partial arrays do not establish absence.The shared protocol reader owns the pointer field, count and entry decoding and returns a tagged
Result, including known names and the failure reason. All three consumers use that result. The original class-only recovery wrapper and old list callback are removed. The existing 20,000-entry guard, record budget, malformed top-level refusals and source identity remain intact; no new cache, schema or ceiling is introduced. The source-owned reader profile advances to v3 so v2 snapshots cannot replay stale missing-owner results. Product documentation explains the partial-list semantics.Validation
93ce13e76: the original count-limit case fails; expanded class/prefix/category/adopting-protocol cases give 4 failures / 110 passes. The original PR's class-only fix leaves 3 failures / 111 passes, establishing the related producer-boundary gap.NativeFixtureRunner; they do not qualify Apple's tools or a Darwin runtime.libglfw.3.dylib(263,308 bytes) from the officialglfw==2.11.0macOS wheel on PyPI. Wheel SHA2567405d3e3041add442e40a15ef5a880178ff90f486d576a82e112240c66f59555; dylib SHA256409f1c5acc4f512c448f8297a5a7e8f8a1d41fcc90e065d1ba25b4a25508d19a. It is neither installed nor executed.structMach-O/segment/class/protocol walk establish five classes and five metaclasses. An owned copy changes only the 8-byte protocol-count field at offset 199,992 from 1 to 20,001. Before: eight rows, bothGLFWApplicationDelegaterows lost. After: all ten rows retained, those two explicitly partial with the unread protocol lists, and all four independent properties retained. The original binary's entire byte-decoder result equals the baseline; both input hashes remain unchanged.1nand20001nover CLI and stdio MCP. These are authored byte fixtures executed on Darwin, distinct from the public GLFW byte-decoder control.native-macosis not selectable on this Linux host; the ordinary automatic selection returnsprovider_unavailable. Those local attempts do not qualify Darwin; the macOS CI cases above do. No GUI or target execution is claimed. The real public-data positive controls exercise the production byte decoder.check:fast,docs:check(9 consistency tests), formatting andgit diff --checkpass. No binary, wheel or generated artifact is committed.Resources and remaining scope
Two CPUs and time/RSS guards throughout; no guard stop or OOM. The two-file production-decoder control used 0.79 s wall / 0.88 CPU s / 158.4 MiB sampled family RSS before, and 1.19 s / 1.17 CPU s / 164.7 MiB after. Fresh Node processes with uncontrolled warm OS caches; the modified input retains more correct facts after the fix, so these single observations establish no speedup/regression claim and do not measure a full Darwin investigation. RSS sampling sums descendants at 100 ms, can double-count shared pages and miss short peaks; model tokens are unmeasured.
The three adopted-list consumers and their superseded wrapper are covered in this change. Darwin CI qualifies the two new authored CLI/MCP cases; the public GLFW comparison remains a production byte-decoder control, without a public-application GUI or live-target claim. Full technical CI passes on the final head, including all eight shards, real Apple CLI/MCP, platform package baselines and required aggregates. The original unchecked Author readiness declarations remain subject to the explicitly authorized maintainer exception; they do not attest to human review.
Author readiness
Human owner: @SahinurDEV
Before merge
type(scope): outcome.