Skip to content

feat(apple): inspect IPS crash reports - #6511

Merged
gensokyo-dev merged 24 commits into
morluto:mainfrom
mvanhorn:feat/apple-ips
Oct 24, 2026
Merged

gensokyo-dev merged 24 commits into
morluto:mainfrom
mvanhorn:feat/apple-ips

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds inspect_apple_ips / inspect-apple-ips for a selected local Apple crash JSON file (bug_type: "309"), returning process/exception/termination/frame/image/register facts, lossless integers, classification evidence and explicit coverage. No target execution or symbolication occurs.

The parser projects selected members and admits row/integer-text costs before expansion. Frames reference image facts retained once; malformed UUIDs and rejected integer lookups retain their source spelling. Recorded indexes remain separate from resolved references, and each frame keeps its own recorded offset. Follow-up review fixes preserve original JSON text, accept only JSON whitespace, require unresolved faulting-thread diagnostics at the shared service boundary, and advertise consistent classified/nonempty and unclassified/empty schema variants.

Validation: all 216 selected producer/service/filesystem/CLI/actual-stdio-MCP/consumer checks pass after integrating main 98ec00f4068bab894639d0d1d83ac0bfc428bcbf, plus check:fast, complete format:check and docs:check. Nineteen new consistency/admission controls fail before correction; actual SDK/Ajv checks validate both classification alternatives and reject contradictions. Existing coverage includes a 7,500,000-escape file under a selected 256 MiB heap. Two pinned public crash files pass actual SDK/oracle validation; live OS capture, dSYM joins and symbolication remain unqualified.

Earlier completed tasks preserve full Evidence/IDs and document large image-metadata savings and a case-specific escaped-string CPU/memory improvement. Those pins are retained; no token or speed reduction is claimed for the final consistency correction or its expanded output schema. Exact measurements, failed attempts, CI attribution and verification gaps: report. No skipped/cancelled job counts as passing. Existing human-readiness declarations are preserved below.

Author readiness

Human owner: @mvanhorn

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Add inspect_apple_ips for caller-selected Apple .ips files. Parse the
first-line metadata object and, when bug_type is the string 309, the
crash body: process identity, exception and termination facts, threads,
usedImages, lossless integer registers, and documented classification
rules. Other bug types including 288 stackshots return no crash result.
Opened Mach-O and dSYM UUID joins remain unobserved.

Related to morluto#4297
Use the arm64e fixture integer that matches 0x8527000193ed4944 instead
of an IEEE-754-rounded decimal, and count the lossless JSON example
length from the source text.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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 🔄 Running since 2026-10-24T07:20:17.047313Z 98e1a61 New commits
ℹ️ 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: c3554c6271

ℹ️ 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/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; all previous findings are addressed and no new actionable issues were found.

Summary

Adds inspect_apple_ips / inspect-apple-ips for a selected local Apple crash report.

  • Apple .ips crash reports become structured crash evidence.
  • The CLI and MCP let callers inspect a selected Apple .ips file.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["CLI or MCP: selected file"] --> B["Read bounded, stable bytes"]
  B --> C["Decode UTF-8 and read metadata"]
  C --> D{"bug_type is 309?"}
  D -- No --> E["Unsupported; no crash result"]
  D -- Yes --> F["Parse selected fields with limits"]
  F --> G["Read facts and record type mismatches"]
  G --> H["Classify recorded crash strings"]
  H --> I["Check output and build Evidence"]
  I --> J["Return inline result"]
  F -- "Malformed or over limit" --> K["Typed error; no partial success"]
Loading

Reviews (2) · Last reviewed commit: "fix(apple): budget IPS parsing and keep ..." · Reviewed by Greptile

Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/losslessJson.ts Resolved

@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.

AI-assisted independent review confirms substantive existing parser findings despite green main CI; please fix the producing representation rather than downstream output.

Concrete counterexamples at this head:

  • Wrong-type threads/usedImages collections become empty arrays with coverage.status="complete", silently losing recorded input.
  • Decimal 3735933132 is 0xdeadd0cc, yet the classifier emits a dead10cc match and evidence value 0xdead10cc. Compare the already-parsed canonical hex once; the correct decimal is 3735883980.
  • A 300,056-byte report with 150,000 threadState.x entries expands into 150,000 register objects under default row limits while reporting complete coverage. Budget intermediate JSON/collection/register expansion before allocating.

The review also confirms the existing OS-version dictionary, non-faulting top-frame role and invalid-UTF-8 concerns. These are not merely missing tests. Preserve typed presence, original values and explicit unknown/partial states; add real-producer, malformed and capacity controls.

Validation was exact-head source review plus isolated parser probes with adapted imports/constant-table dependencies, not full CLI/MCP or a real Apple-generated report. No OOM or peak-memory measurement is claimed. Main CI 39917627186 passed; readiness correctly fails the unchecked human declarations. Existing threads already cover these issues, so no duplicate inline threads added.

Parse the IPS metadata and crash body through a projection of the
documented members. Members the report does not interpret are
syntax-checked without being materialized, and thread, frame, image and
the new max_registers budgets run before each row is parsed, so a large
selected file fails with a typed resource error instead of first
expanding every row. Fixed allowances bound JSON nesting, unlisted key
names and termination reasons.

Present values whose JSON type differs from the documented one are no
longer read as absence: they are listed in coverage.type_mismatches and
coverage becomes partial, including wrong-type or missing threads and
usedImages collections. osVersion keeps the producer dictionary or the
string form. Frame roles follow physical frame depth, so the top frame
of a non-faulting thread is current_instruction and inlined rows share
the following frame's role. SIGKILL classes compare the canonical hex
once, so 0xdeadd0cc no longer matches dead10cc. Invalid UTF-8 is refused
instead of being replaced, and JSON strings are decoded by copying
unescaped spans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra7LM2NyQ7DumdssxbUq5g
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@baron thanks for the detailed review. 80ad2a0 fixes these in the parser rather than downstream: wrong-type collections are reported as typed mismatches with partial coverage, the classifier compares canonical hex (3735933132 no longer matches dead10cc), and thread, frame, image, and register budgets are checked before rows are materialized, so the 150,000-register report is refused under defaults. OS version dictionaries, depth-based frame roles, and invalid UTF-8 rejection are covered too, with malformed, producer-shaped, and capacity tests. Not yet validated against a real Apple-generated report; the fixture follows ReportCrash output.

@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: 80ad2a02e9

ℹ️ 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/apple/AppleIpsParser.ts Resolved

@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: 2b925786b9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/native/apple/losslessJson.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved

@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: 45a570656c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/native/appleIps.ts Resolved

@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: c838caea4a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/native/apple/AppleIpsFieldReader.ts Resolved
@gensokyo-dev

Copy link
Copy Markdown
Collaborator

The static-check failure on c838cae was introduced by my two schema-binding lines retaining the previous indentation after I added their explicit SDK schema types. Commit f6c270d fixes only that whitespace. The complete local format:check passes on all 5,556 matched files; check:fast/docs and the 182-case public-workflow result remain applicable. This failure is not classified as an unrelated main failure. Current-head CI is being evaluated separately.

@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: a5cdb343d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/native/apple/AppleIpsParser.ts Resolved
Comment thread src/domain/native/appleIps.ts Resolved
@gensokyo-dev

Copy link
Copy Markdown
Collaborator

The successful Build package job checked out exact CI merge 4328412c8ed6f841375bf97b5bfacc782971d128 (main d87e73f2db50be72d33a4b3c7199af35518b441c + PR head a5cdb343d4eae8c7f468476aab13683fb5d1e4c3). I checked out that exact merge separately: check:fast, cached build and all 193 selected producer/service/filesystem/CLI/production-stdio-MCP/consumer cases pass. The selected run took 47.894 s elapsed, 47.268 s waited CPU and 1342.1 MiB sampled process-family RSS. Other GitHub jobs are still queued; these local results do not mark them passed. All current review threads are resolved. Pinned behavior/cost verification report.

@gensokyo-dev

gensokyo-dev commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Final head 98e1a6192150d46d4faab5f04f24ac4c1ea6e0a4 passes all required CI and all eight test shards. The two cancelled metadata jobs never acquired runners; their same-head replacements pass. Current review threads are all resolved and the existing human-owner readiness declaration is preserved.

The historical changes-requested review on c3554c627177dfe626cb59ff1d0de0fb2ca0a97e identified collection/type loss, the dead10cc constant, expansion admission, OS-version shape, frame roles and UTF-8 handling. Those producing-boundary issues are addressed in the current implementation; 216 selected checks and both pinned public crash-file SDK/oracle workflows pass, with explicit coverage/provenance and resource controls. The newer JSON/reference/classification findings also have failing-before regressions and actual SDK validation. See the committed verification report and resolved threads for exact pins and limits.

Since CI started, main added verifier cleanup ownership, unrelated browser/function-error changes, and a bounded stable-read optimization. The exact predicted merge with 4a041ae7532588eaf9973584e517c9bce995445b passes local type/lint, runtime build and all selected MCP/consumer/stable-read/cleanup checks. The old review state remains recorded; using the merge authorization for this maintenance task to merge this validated head. No failed CI is represented as passing.

Main subsequently added environment state-target support in 977c9727e656c8493b62587c50447b371eb9a0a5; the source delta was reviewed and does not change the IPS parser/service or stable-read boundary. The exact local verification above remains pinned to 4a041ae7532588eaf9973584e517c9bce995445b. Additional verification will target the actual merge commit.

@gensokyo-dev
gensokyo-dev merged commit 781760a into morluto:main Oct 24, 2026
44 of 46 checks passed
@morluto morluto added the enhancement New feature or request label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants