Skip to content

fix(windows): report trailing bytes after Shell Link TerminalID - #10350

Closed
wunianze666-netizen wants to merge 1 commit into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-idlist-terminal
Closed

wunianze666-netizen wants to merge 1 commit into
morluto:mainfrom
wunianze666-netizen:codex/shell-link-idlist-terminal

Conversation

@wunianze666-netizen

Copy link
Copy Markdown
Contributor

Summary

Report partial Shell Link coverage when a target ID list contains bytes after its TerminalID.

Problem and expected behavior

The Shell Link format ends the declared IDList with a two-byte TerminalID. REA accepted an early TerminalID, skipped to the declared boundary, and reported complete coverage even when it discarded an item-shaped tail or a single byte. MS-SHLLINK §2.2

Change and scope

Report a malformed structure at the first trailing byte. Preserve the decoded prefix and resume at the declared list boundary so later StringData and ExtraData remain available.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • The Shell Link parser owns the TerminalID check and uses the existing issue and partial coverage fields.
  • This corrects offline parsing of a caller-selected local file. The CLI and MCP schemas, artifact identity, and parser budgets are unchanged.
  • The parser retains the original artifact SHA-256, IDList item offsets, StringData and ExtraData offsets.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • On frozen main 5cddc69, both malformed inputs returned complete coverage. After the change, both return partial coverage and a malformed_structure issue at byte 83. The valid input returns the same complete result.
  • Regression tests cover an item-shaped tail and a one-byte tail before StringData. They verify that the first item, arguments and ExtraData terminal remain readable.
  • The actual CLI and MCP results agree on all three inputs. The normalized results for the malformed files match the baseline aside from issues and coverage.
  • Validation used synthetic shortcuts on Windows. Windows Shell resolution and third-party shortcut producers were outside this comparison.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

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

  • Two targeted parser cases failed on the baseline and passed on the candidate. All 50 Shell Link parser tests passed.
  • Compiled CLI and the production MCP SDK each handled the same three files on both revisions. Checked the named ToolDefinition, JSON Schema 2020-12, report shape, file hashes, offsets and MCP client close.
  • Build, formatting, Git diff checks and normal commit and pre-push checks passed.

Compatibility, safety, and release

  • A malformed list with a readable prefix now uses the existing partial report. Valid shortcuts retain their original output.
  • Windows x64 and Node 24.22.1 were used for offline inspection.

Author readiness

Human owner: @wunianze666-netizen

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

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T09:46:57.350601Z a24c3ba 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.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The code appears safe to merge; no actionable issues were found.

Summary

The parser now reports partial coverage when bytes remain after TerminalID inside the declared target ID list.

  • Shell Link reports trailing IDList bytes as partial coverage.

Reviews (1) · Last reviewed commit: "fix(windows): report trailing bytes afte..." · Reviewed by Greptile

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

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants