Skip to content

fix: keep refusal reasons and recovery actionable - #10499

Merged
N0zoM1z0 merged 24 commits into
mainfrom
fix/actionable-recovery
Nov 14, 2026
Merged

N0zoM1z0 merged 24 commits into
mainfrom
fix/actionable-recovery

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Eleven refusals or diagnostics that hid the reason, named the wrong limit, or pointed agents at the wrong recovery. Each commit keeps its contributor's authorship, so merge with rebase.

Fixes #7569
Fixes #8844
Fixes #9879
Fixes #7651
Fixes #8366
Fixes #7628
Fixes #7442
Fixes #7570
Fixes #7595
Fixes #9227
Fixes #7330

Issue Change From
#7569 A relative Wireshark tool refusal keeps the configured value in its diagnostics #7577, Harshit Sharma (+ morluto test)
#8844 binary_session registration compares entrypoint file identity (dev+ino), so a symlink or .. spelling of the same Bun entry matches #8849, 1052326311
#9879 Hopper Apple Events denial is a typed launch rejection whose message and recovery name the entitlement and the Automation setting, with retry turned off #9916, TwotNguyenVN (+ morluto)
#7651 Dispatch metadata keeps the unsupported-width reason when the symbol fallback also fails #8036, Zhaowei Gu
#8366 A byte-search cursor mismatch returns its own bridge code with conformsToInputContract, not schema-repair advice #8420
#7628 Native export allowance recovery names its units (bytes vs entries) from the parser's tagged limit #7754, ayobamiseun (+ morluto test)
#7442 analyze --snapshot keeps the first schema issue's location and message, not a constant reason #7875, wunianze666-netizen (+ morluto test)
#7570 Native UI refusal of both capture sources keeps its reason, and the contract says one must be enabled #7589, Harshit Sharma (+ morluto)
#7595 A relative REA_WABT_BIN_DIRECTORY refusal carries the rejected value as diagnostics.configured; unset stays distinct reimplemented; credit #7753, ayobamiseun
#9227 A padded PE inflate refusal says the enforced allowance comes from the padded storage size reimplemented
#7330 A noncanonical Evidence bundle names the sections that differ (records, providers, ...) instead of always blaming manifests reimplemented; credit #7358, zzrs-xxxr

Change and scope

Each item was checked against current main before it was taken (all were still present). Changes made while rebasing:

Contribution scope: ordinary fixes within existing boundaries; maintainer scope decision not applicable.

  • Read existing files or captured data.

Evidence and regression coverage

  • Contributor regression tests are kept for each item.
  • New cases: a relative WABT directory with configured (WabtArtifactProvider.test.ts), the padded-storage inflate message (RustAuditableReader.test.ts), and the providers and providers, records attribution cases (evidenceBundle.test.ts).
  • The existing message expectations in the ledger CLI/MCP and readiness tests now name records/providers.

Validation performed

Compatibility, safety, and release

  • Breaking changes: none to schemas. The noncanonical bundle message text changes, from "Evidence bundle manifests are not canonical" to "Evidence bundle sections are not canonical: ". The Hopper Apple Events denial is no longer retryable.

Author readiness

Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).

Supersedes #7577, #8849, #9916, #8036, #8420, #7754, #7875, #7589, #7753 and #7358.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T08:57:34.971045Z
We couldn’t complete this review. Comment @codex review to try again.
e4ee169 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.

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

Comment thread src/serverIdentity.ts Dismissed
@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] Appears safe to merge, with one non-blocking edge case in Bun registration reports.

Findings

  1. P2 Bun registrations can look aligned ▶
Fix with agent prompt
### Issue 1
src/serverIdentity.ts:34
`compareServerPaths` now applies Node's path shortcut to Bun too. If Bun runs `/work/rea.mjs`, but the expected registration is `/work/link/../rea.mjs` where `link` points to `/other/scripts`, that registration selects `/other/rea.mjs`. The shortcut still returns `aligned` and skips the file check. This hides the mismatch from `binary_session` and leaves the user without a reason to fix the registration.

Use the existing runtime-aware `normalizeEntrypointPath` so the Node fix preserves Bun's filesystem traversal.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Keeps refusal reasons and recovery details intact across CLI and MCP errors.

  • Ghidra search cursors point to the search context they belong to.
  • Hopper launch errors explain when Apple Events authorization blocks a retry.
  • Analysis snapshot errors retain the first schema issue and its location.
  • Native dispatch errors keep the binary reader’s reason when symbol fallback fails.
  • Native export refusals name whether the limit counts entries or bytes.
  • Native UI capture errors say that one capture source must stay enabled.
  • Evidence bundle errors name every section that differs from canonical form.
  • Wireshark and WABT refusals retain the rejected relative tool path.
  • Padded PE inflate errors explain the storage-based allowance they report.
  • Server identity recognizes the same entrypoint through symlink and parent paths.

Reviews (6) · Last reviewed commit: "test(native): pair the truncated export ..." · Reviewed by Greptile

Comment thread src/rust/RustAuditableReader.ts Resolved
Comment thread src/serverIdentity.ts Resolved
@gensokyo-dev
gensokyo-dev force-pushed the fix/actionable-recovery branch from ccc88aa to a7d29fc Compare November 14, 2026 10:50
Comment thread src/serverIdentity.ts Outdated
): "aligned" | "mismatch" | "unknown" => {
// The runtime normalizes its entrypoint lexically, so a lexical match stays
// aligned even when the spelling crosses a symlink before `..`.
if (resolve(expected) === observed) return "aligned";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Bun registrations can look aligned

compareServerPaths now applies Node's path shortcut to Bun too. If Bun runs /work/rea.mjs, but the expected registration is /work/link/../rea.mjs where link points to /other/scripts, that registration selects /other/rea.mjs. The shortcut still returns aligned and skips the file check. This hides the mismatch from binary_session and leaves the user without a reason to fix the registration.

Use the existing runtime-aware normalizeEntrypointPath so the Node fix preserves Bun's filesystem traversal.

Knowledge Base Used: MCP client registration

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/serverIdentity.ts
Line: 34

Comment:
**Bun registrations can look aligned**

`compareServerPaths` now applies Node's path shortcut to Bun too. If Bun runs `/work/rea.mjs`, but the expected registration is `/work/link/../rea.mjs` where `link` points to `/other/scripts`, that registration selects `/other/rea.mjs`. The shortcut still returns `aligned` and skips the file check. This hides the mismatch from `binary_session` and leaves the user without a reason to fix the registration.

Use the existing runtime-aware `normalizeEntrypointPath` so the Node fix preserves Bun's filesystem traversal.

**Knowledge Base Used:** [MCP client registration](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fmcp-client-registration.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@gensokyo-dev
gensokyo-dev force-pushed the fix/actionable-recovery branch from c378453 to f682d80 Compare November 14, 2026 11:47
harshitethic and others added 20 commits November 14, 2026 12:51
Fixes #8844
Supersedes #8849

Co-Authored-By: gensokyo-dev <[email protected]>
A hardened-runtime client without the Apple Events automation
entitlement got generic Automation advice, and the projection kept
retryable: true, so agents retried from the same unauthorized client.
The denial is now a typed launch rejection whose message and recovery
name the entitlement and the Automation setting, with retry turned off.

Fixes #9879

Squashed from #9916 and rebased onto main.

Co-Authored-By: morluto <[email protected]>
Co-Authored-By: gensokyo-dev <[email protected]>
…ack fails

When the byte reader for inspect_native_dispatch_metadata refuses a target
(for example a 32-bit Mach-O) and the list_names symbol fallback then fails
or returns an invalid inventory, only the fallback's error reached the
caller. Retain the reader failure under diagnostics.binary_metadata_failure.

Fixes #7651.

Carries forward e7884a7 (by @morluto, on @dreinst's #7701).

Signed-off-by: Zhaowei Gu <[email protected]>

Supersedes #8036

Co-authored-by: morluto <[email protected]>
Co-Authored-By: gensokyo-dev <[email protected]>
The darwin-only acceptance test passes the caller's environment to the CLI
and points only Hopper, Ghidra and Java at missing paths. On macOS the
list_names fallback has four candidates (ghidra, hopper, ida, kuna), so a
REA_IDA_MCP_CONFIG or REA_KUNA_COMMAND set in the developer's shell still
reaches it: with REA_KUNA_COMMAND set, kuna is no longer rejected as
not_configured. Point both at missing paths, as
tests/acceptance/nativeDispatchSnapshot.test.ts does, so the test always
exercises the unavailable fallback.

Signed-off-by: Zhaowei Gu <[email protected]>

Refs #7651

Co-Authored-By: gensokyo-dev <[email protected]>
A cursor for another target, profile, pattern, mask, bounds, or document
was reported as invalid input and pointed at schema repair. Name the
binding, attribute the issue to the cursor, and leave the differing
component unknown.

Fixes #8366
Supersedes #8420

Co-Authored-By: gensokyo-dev <[email protected]>
The native export parser throws one BinaryResourceFailure for both its
262144-entry inventory ceiling and its 16 MiB retained-text byte budget, and
NativeExportsProvider mapped every such refusal to the fixed-count recovery.
A PE whose export names exhaust the byte budget therefore reported
reported_limits.maximum 16777216 next to "is a fixed count".

Tag each parser allowance at the producing boundary (NativeExportLimitFailure
with limit "rows" or "retained_text") and let the provider select count,
byte, or structural-decoding recovery from that tag instead of from message
text. The refusal code, non-retryable flag, message, and reported maximum are
unchanged.

Fixes #7628
Supersedes #7754

Co-Authored-By: gensokyo-dev <[email protected]>
A relative REA_WABT_BIN_DIRECTORY was refused with only the setting
name, and an unset value was indistinguishable from an empty one. The
admission refusal now carries the rejected value as
diagnostics.configured when it is set.

Fixes #7595

The idea and original report are from #7753 by ayobamiseun, which
targeted a message that WabtAdmissionError has since replaced.

Co-Authored-By: ayobamiseun <[email protected]>
Co-Authored-By: gensokyo-dev <[email protected]>
A padded PE dependency section that overflowed inflate allocation
reported the storage-based allowance (section size x 64) as the
generic size limit, which reads as the smaller limit the docs derive
from the consumed stream. The stream length is unknown when inflate
stops, so the enforced bound stays the reported maximum_bytes and the
message now says it was derived from the padded storage size.

Fixes #9227

Co-Authored-By: gensokyo-dev <[email protected]>
Any canonical-form mismatch reported "Evidence bundle manifests are not
canonical", so a bundle whose records were out of order, or whose
unknowns differed, blamed unchanged manifests. The error now names the
top-level sections that differ from canonical form, for example
"Evidence bundle sections are not canonical: records".

Fixes #7330

Based on #7358 by zzrs-xxxr, which split records from manifests; this
reports every differing section instead, so unknowns or several
sections are attributed correctly.

Co-Authored-By: zzrs-xxxr <[email protected]>
Co-Authored-By: gensokyo-dev <[email protected]>
MCP errors now also carry open-session facts (selection and target at
failure), so the CLI/MCP comparison checks that MCP keeps the CLI's
snapshot details rather than requiring identical objects.

Refs #7442

Co-Authored-By: gensokyo-dev <[email protected]>
Merging the native export capacity tests made one describe block exceed
the lint function-length limit.

Refs #7628

Co-Authored-By: gensokyo-dev <[email protected]>
Each snapshot entry is validated alone, so its schema issue path started at
the entry. Prefix it with entries or workflow_entries and the entry index so
the reason names the entry to repair, and match the header case's issue
count without freezing the whole sentence.

Co-Authored-By: gensokyo-dev <[email protected]>
gensokyo-dev and others added 4 commits November 14, 2026 12:51
A padded PE section above 128 KiB derives an allowance larger than the fixed
8 MiB cap, so the cap is what inflate enforces. Name the padded storage size
only when its allowance is below the cap.

Co-Authored-By: gensokyo-dev <[email protected]>
Keep the bridge cursor-mismatch code check without copying its message, and
let the pcap relative-tool diagnostic use the shared child deadline, which it
does not test.

Co-Authored-By: gensokyo-dev <[email protected]>
… does

Node resolves its script entrypoint lexically, so a registered spelling that
crosses a symlink before `..` names the running file lexically, while Bun
follows native traversal (#8844). Select the expected server path with the
shared runtime-aware entrypoint normalizer before comparing it with the
running entrypoint, and fall back to file identity only when they differ.

Co-Authored-By: gensokyo-dev <[email protected]>
Add a PE whose section stores every declared export slot, so the entry
allowance refusal is also shown for a structurally possible table, and use it
over MCP. Leave dispatch-test directory removal to its temporary fixture.

Co-Authored-By: gensokyo-dev <[email protected]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Re the Bun registration finding in the latest summary: valid. compareServerPaths now selects the expected path with the shared runtime-aware normalizeEntrypointPath (lexical for Node, native traversal for Bun) before comparing it with the running entrypoint, then falls back to file identity. createServerIdentity takes the selecting runtime (defaulting to the current one), and the test checks both: scratch/link/../rea.mjs is aligned under Node and registration_path_mismatch under Bun, and #8844's Bun symlink/.. spelling stays aligned.

@gensokyo-dev
gensokyo-dev force-pushed the fix/actionable-recovery branch from f682d80 to e967bac Compare November 14, 2026 12:51
@N0zoM1z0
N0zoM1z0 merged commit a6f98e7 into main Nov 14, 2026
55 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/actionable-recovery branch November 14, 2026 13:06
@morluto morluto added the bug Something isn't working label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment