Skip to content

fix: bind identity and coverage to the producing rule - #1513

Merged
morluto merged 5 commits into
mainfrom
cursor/brittleness-cleanup-07c3
Oct 10, 2026
Merged

morluto merged 5 commits into
mainfrom
cursor/brittleness-cleanup-07c3

Conversation

@morluto

@morluto morluto commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the filed identity and coverage bugs by changing the rule at the layer that owns it: one NFC logical-path normalizer, byte-backed container families, coverage that follows the bytes actually read, path-segment conventions, destination collisions only at the destination, leases keyed by the identity the OS already returned, Mach-O CPU selection, and firmware success returned beside cleanup failure.

Fixes #1485, #1486, #1487, #1488, #1489, #1490, #1491, #1496, #1497, #1498, #1499, #1500, #1501, #1502, #1503.

Problem and expected behavior

Several boundaries treated a nearby spelling, suffix, or later event as if it were the observation:

  • Joins used a private POSIX normalize, so NFC inventory identity and joined logical paths could diverge.
  • A filename suffix could classify a root as DMG, PKG, or ASAR without the matching magic.
  • ZIP inventories with identical entries and different non-entry tails (signing block, comment) could compare as unchanged, and pointer-fixup and Interface Builder traces could report complete coverage when the underlying range or decode was unread or partial.
  • Substring matches treated community and MyApp.framework as runtime families, and Apple anatomy used more than one case policy.
  • Case-distinct web script URL paths were folded before a destination collision was observed.
  • Windows private runtimes, scenario PATH lookup, attached CDP locks, parsed script frames, and repeated DOM attributes could follow a later or folded identity instead of the one already observed.
  • FAT slice selection and lipo -arch could name an architecture the header or lipo did not admit, and a firmware cleanup failure could hide a completed extraction and replay onto the next workspace.

Change and scope

Each fix is at the producing rule. Domain stays free of artifact, browser, and provider imports.

  • logicalPathNfc, normalizeJoinedLogicalPath, and logicalPathEscapesRoot live next to occurrence identity. Inventory joins and artifact path normalization call them. Feature-seed NFKC stays a query fold.
  • Root classification reads ZIP, ASAR, XAR, and koly before the suffix. A misnamed ELF or text file falls through to content classification. ZIP inventories record that non-entry tail bytes are not occurrences, and comparison reports a root-hash change when root_sha256 differs.
  • LC_DYLD_INFO rebase ranges set pointer_fixups to partial or unsupported when unread or unexamined. Interface Builder trace coverage copies the archive-decode facet.
  • Bridge and runtime-family matches are path-segment checks. Bundle anatomy uses one English (en-US) case fold for the fixed vocabulary; reported paths keep the archive spelling.
  • Web script export keeps case-distinct URL paths. A SafeOutputTree destination collision isolates that script under isolated/.
  • Windows runtimes are keyed by volumeSerial and fileId, with exact path match. Scenario executables use the same Windows environment-key canonicalization as the child snapshot. Attached CDP locks use the parsed discovery URL and target_id. A script keeps the frame it was parsed in. Repeated DOM attributes keep the first value.
  • FAT slices are selected from the admitted CPU type table, and 32-bit slices fail as unsupported 32-bit metadata. otool -arch is passed only for a name lipo listed. Firmware returns the completed extraction beside the cleanup error and does not latch that error onto the next root.

Archive case-distinct inventory identity (#1470) and the diverging-segment case-collision record (#1505) are unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain identity and conventions, then the artifact, browser, process, native, and firmware adapters that apply them. No new public tool.
  • CLI and MCP/tool-catalog contract: none. Existing results can name a limitation, a partial coverage status, a root-hash change, an isolated script path, or a cleanup error that was previously omitted or overstated.
  • Provider, bridge, target-format, or platform compatibility: FAT selection rejects unsupported 32-bit Mach-O metadata for the requested CPU type. otool is not asked for an architecture lipo did not list.
  • Evidence, artifact, provenance, or reconstruction contract: container family, ZIP-tail coverage, pointer fixups, Interface Builder traces, runtime-family labels, and DOM attributes follow the examined bytes or the first observed value.
  • Process execution, authorization, cleanup, or containment impact: firmware keeps a leaked workspace recorded when teardown fails and allows a later operation to create a new root. Windows runtime close deletes only the file id that was opened.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: archive identity and ZIP detection, JavaScript path joins, Apple and Android projection, web script export, Windows runtime, process scenario validation, CDP documents and scenario locks, Mach-O selection and dispatch coverage, Interface Builder trace, and firmware provider.
  • Base reproduction or other evidence: source tests assert the previous fold, suffix, coverage, and lease behaviors fail on the new contracts.
  • User-visible CLI/MCP output (if applicable): limitation and coverage text can change for ZIP tails, pointer fixups, Interface Builder archives, runtime families, and firmware cleanup. No new command or tool.
  • Remaining proof gaps: no real Windows volume, case-insensitive destination volume, attached Chrome, lipo/otool, or firmware image was exercised here. Simulated adapters do not establish those provider behaviors.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:local on the touched domain, application, browser, native, process, and firmware suites — passed before rebase onto main.
  • npm run test:focused on tests/boundary/filesystem/zipDetection.test.ts — passed before rebase onto main.
  • npm run check:fast (pre-push typecheck and lint) — passed on the rebased commit. Rebase onto main, including the diverging-segment case-collision record, applied without conflicts.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Callers can see partial or unsupported coverage, a root-hash difference, an isolated script path, or a firmware cleanup error that was previously collapsed into a stronger claim.
  • Real Hopper/Ghidra, browser, or OS coverage: not run. Mach-O, CDP, Windows, and firmware checks use local fixtures and fakes.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: firmware no longer deletes an unconfirmed leaked root or replays its cleanup error onto a new workspace. Destination isolation still goes through SafeOutputTree.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Open in Web Open in Cursor 

Logical paths, container families, examined bytes, path-segment conventions, destination collisions, file-id leases, Mach-O CPU selection, and firmware cleanup now follow the observation that owns each rule.
@morluto
morluto marked this pull request as ready for review October 10, 2026 08:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T08:31:17.647302Z c50c2d0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c50c2d0ca1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/NativeMachoInspection.ts Resolved
Comment thread src/native/AppleMachoFixups.ts Resolved
A fat target whose architecture lipo did not list now stops before slice tools run. Chained fixups still count unread LC_DYLD_INFO rebase bytes, and a firmware cleanup failure no longer blocks the next workspace.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…dary

NFC joins and segment conventions are now asserted by the path resolver, the Apple projection, and a real APK inventory instead of helper unit tests.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

The legacy LC_DYLD_INFO fixture keeps a rebase range this reader does not decode, so the public CLI and MCP check now requires that partial coverage beside the bind opcodes.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto
morluto merged commit b4db35f into main Oct 10, 2026
25 checks passed
@morluto
morluto deleted the cursor/brittleness-cleanup-07c3 branch October 10, 2026 09:14
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
* fix: bind identity and coverage to the producing rule

Logical paths, container families, examined bytes, path-segment conventions, destination collisions, file-id leases, Mach-O CPU selection, and firmware cleanup now follow the observation that owns each rule.

* fix: fail unmatched Mach-O slices and keep firmware roots independent

A fat target whose architecture lipo did not list now stops before slice tools run. Chained fixups still count unread LC_DYLD_INFO rebase bytes, and a firmware cleanup failure no longer blocks the next workspace.

* test: cover path identity and runtime families at the projection boundary

NFC joins and segment conventions are now asserted by the path resolver, the Apple projection, and a real APK inventory instead of helper unit tests.

* test: expect unread dyld rebase bytes in the Apple dispatch fixture

The legacy LC_DYLD_INFO fixture keeps a rebase range this reader does not decode, so the public CLI and MCP check now requires that partial coverage beside the bind opcodes.

---------

Co-authored-by: Cursor Agent <[email protected]>
morluto added a commit that referenced this pull request Oct 10, 2026
…normalizer (#1535)

* fix(reference): join internal symlink targets with the inventory NFC normalizer

checkSymlinks resolved an internal symlink target with bare
posix.normalize and looked the result up in the inventoried path set.
A target that a filesystem reports in NFD (macOS readlink commonly
does) joined to an NFD spelling while the inventory holds NFC, so
validation reported "Internal symlink target must resolve to an
inventoried entry" for a target the inventory actually contains.

Route the join through normalizeJoinedLogicalPath, the same inventory
identity normalizer #1513 applied to the runtime, HTML/module, and
import joins from #1488. The feature-seed NFKC query fold stays a
query.

Refs #1488

* fix(reference): preserve source spelling during symlink lookup

---------

Co-authored-by: morluto <[email protected]>
@CassieFox23

CassieFox23 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: Your fix list names #1500, and my Linux runs agree that this fixed it. GitHub only closed #1485 from that line, since it needs "Fixes" before each number. Ten of the fifteen are still open, and #1500 is one of them.

Edit: reworded. I first wrote this as if the PR did not name #1500.

frameForScript now reads the frameId stored at scriptParsed, not the live context map. I tested main before and after b4db35f09 with iframes that move to a new page, in Chromium 154 (BSD-3-Clause). Before, those scripts got null for their frame. After, they keep their iframe. export-web-scripts keeps them right too. The details are in my two comments on #1500.

Not run

🤖 Generated with Claude Code (Opus 5.5) 🦊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(artifacts): keep ZIP-tail bytes out of unchanged and complete claims

3 participants