Skip to content

fix(apple): preflight OpenStep plist value nesting - #2970

Closed
rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-openstep-20261013
Closed

rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-openstep-20261013

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 13, 2026 •

Copy link
Copy Markdown

The OpenStep nesting preflight could continue after an impossible closer, scalar, or separator and misclassify a malformed document as a depth limit if its suffix contained deeply nested containers. Track the next lexical token expected by each active container and yield at the first impossible token, leaving the pinned plist decoder responsible for exact syntax diagnostics and values. Preserve compound keys, optional dictionary semicolons, array trailing commas, first-root behavior and valid depth protection.

AI-assisted correction responding to review of #2970. Verification: all eight real filesystem-reader regressions fail against the previous owner and pass fixed with the exact plist 5.0.0 syntax message and format classification; a valid deep control remains a limit. Two completed-container regressions also require the exact named limit for deeply nested array siblings and dictionary values after compound keys; both fail against the discarded helper-ordering refinement. All 63 focused tests, test discovery, and npm run check pass. Fresh compiled public CLI replay verifies all eight format failures and the valid limit control, including their distinct outer error codes. Separator transitions and closer admission have separate private helpers. The refined tree also passes 112 pinned-decoder comparisons, six depth controls and all eight malformed-input comparisons; scoped lint has zero diagnostics. Repository checks still report existing warnings; no human approval or full-suite claim is made.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-13T19:18:32.108095Z 51c1a97 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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issue was established.

Summary

The PR adds an OpenStep depth check before plist.parse. The latest update tracks which token each container expects and stops at impossible tokens so the decoder can report syntax errors.

  • OpenStep plist checks stop at the first impossible token.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["OpenStep input"] --> B["Check expected tokens and depth"]
  B -->|"Too deep"| C["Named depth error"]
  B -->|"Impossible token or first root ends"| D["plist.parse"]
  D -->|"Malformed input"| E["Decoder syntax error"]
  D -->|"Decoded value"| F["omitPrototypeKeys"]
Loading

Reviews (2) · Last reviewed commit: "fix(apple): preserve OpenStep syntax fai..." · Reviewed by Greptile

@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: 84fa8d40e4

ℹ️ 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/domain/propertyListKeys.ts Outdated
continue;
}
if (character === "}" || character === ")") {
const container = containers.pop();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop scanning when a closer does not match

When malformed OpenStep text contains an unexpected closer followed by a deep suffix, such as (} plus 130 opening parentheses, this unconditional pop discards the root, continues into the suffix, and throws the shared RangeError before the pinned parser can report the syntax error at }. The reader path in src/artifacts/apple/KeyedArchiveReader.ts:233-235 classifies that RangeError as reason: "limit", so a malformed archive is incorrectly reported as a capacity failure; return control to the decoder when the closer does not match the active container.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 51c1a97: admitsOpenStepCloser now returns control to the pinned decoder when a closer does not match the active container (or follows a key without its value). '(}' followed by 130 opening parens now yields the decoder's syntax error (format), not a depth limit; covered by the malformed-input regressions in keyedArchiveXmlNesting.test.ts.

@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: 51c1a975a9

ℹ️ 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 on lines +229 to +231
} else if (character === "<") {
const end = text.indexOf(">", cursor + 1);
cursor = end === -1 ? text.length : end + 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop at malformed OpenStep data literals

When an invalid data literal precedes a deep sibling, for example (<gg>, followed by 130 opening parentheses, this branch treats everything through > as a completed scalar. The pinned plist parser rejects the non-hex literal before reading that sibling, but the preflight continues and throws the shared RangeError; KeyedArchiveReader.ts:233-235 then reports the malformed archive as reason: "limit" instead of "format". Validate the data token enough to stop preflighting when the pinned decoder will reject it.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not changing this. With the pinned plist 5.0.0, parseData does not validate hex: '()' decodes without error and '(,' plus 130 opening parens is read through to its end-of-input syntax error, so the decoder does not reject the literal before the sibling. Validating hex in the preflight would add a rule the decoder lacks. The preflight treats <...> as an opaque scalar, as the decoder does, and the depth limit applies to that suffix.

@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Oct 14, 2026
morluto added a commit that referenced this pull request Oct 14, 2026
Preserve XML and Interface Builder identity at their parsing boundary, retain usable Objective-C slots with precise coverage, and keep native trace failures distinct from absence. Add caller-selected Interface Builder summaries backed by complete retained Evidence, and preserve comparison limitations.

Reviewed fixes: #1969, #2088, #2108, #2513, #2639, #2684, #2731, #2759, #2875, #2888, #2889, #2970, #2971, #3002.

Validation: relevant native/domain focused lane passed 142 tests; earlier Interface Builder/MCP checks passed 24 tests. Real native UI and Ghidra producer coverage was not repeated.
@kaoru0822-kitauji kaoru0822-kitauji added the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

CI-fix track: this change is already on main. Merging current main into this branch yields a tree identical to main. 55dd21a lists #2970 among its reviewed fixes and carries the same propertyListKeys.ts preflight and tests, and those tests pass (54). The failing Static checks (format), Docs Generation (facts drift) and productCatalog jobs reflected main's state at the time; this PR's own files are formatted. I didn't push an empty merge. This PR looks safe to close as superseded.

@kaoru0822-kitauji kaoru0822-kitauji removed the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
@CassieFox23

Copy link
Copy Markdown
Contributor

Heads up: main already has this change in 55dd21a. The code is in src/domain/propertyListKeys.ts, and OpenStep plist nesting preflight covers it. It is listed on tracker #3582. If this PR still adds something main doesn't have, please say so here and I'll take it off the list. Thanks for the fix!

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@rudycelekli

Copy link
Copy Markdown
Author

Closing: main already contains this change, so this PR is superseded. Thanks for the review.

@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for finding that malformed OpenStep closers could be mistaken for a nesting-depth limit. Main now stops at the first impossible token while preserving the valid deep-input limit check (main).

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

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants