Skip to content

fix(browser): compare PNG IHDR bytes without ASCII folding - #2099

Merged
baron merged 3 commits into
morluto:mainfrom
fisforfaheem:fix/compare-png-ihdr-without-ascii-folding
Oct 12, 2026
Merged

baron merged 3 commits into
morluto:mainfrom
fisforfaheem:fix/compare-png-ihdr-without-ascii-folding

Conversation

@fisforfaheem

Copy link
Copy Markdown
Contributor

Summary

  • Screenshot validation already compares the PNG signature as raw bytes, then decoded the following chunk type with Buffer.toString("ascii").
  • Compare the four IHDR bytes with Buffer.equals in native UI snapshots and CDP screenshot capture, so a high-bit chunk type is not accepted as IHDR.

Test plan

  • npm run test:focused -- src/native/NativeUiObservation.test.ts
  • Pre-push typecheck and lint

Made with Cursor

fisforfaheem and others added 2 commits October 12, 2026 01:09
Screenshot checks already compare the PNG signature as raw bytes, then decoded the chunk type with an encoding that maps high-bit bytes onto IHDR.

Co-authored-by: Cursor <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:12

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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 ⚠️ Failed 2026-10-12T08:13:43.730873Z d4d8919 PR opened
ℹ️ 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.

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed repaired exact head e1df05b and current-main integration. Oracle and independent exact-commit reviews found no blocking source defect.

The two duplicate shallow PNG header interpretations now consume one domain-owned, byte-faithful header/dimension helper. Both callers preserve their existing capacity, dimensions, scope and identity checks; the helper does not claim full PNG validity. The separate pixel decoder retains stronger chunk/checksum/format semantics and latin1 type validation, rather than duplicating this shallow admission API. The ASCII-folding regression assertion now follows the mutation and is discriminating. No unrelated test pruning or runtime authority change.

Pinned validation: 23 focused tests, full check (six tasks plus architecture guards), and 916-file discovery passed. Live browser/native helper verification was not performed locally. Fresh published-head hosted CI is green, including Static checks, Test (coverage + timing), and CI required; original-head CI was not substituted. The reviewed CI run requiring GitHub approval was approved only after exact source/workflow-scope verification. Final integration is clean.

@baron
baron merged commit fdd8f82 into morluto:main Oct 12, 2026
34 checks passed
@morluto morluto mentioned this pull request Oct 13, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: build Build, CI, packaging, and publishing labels Oct 14, 2026
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.

4 participants