Skip to content

fix(kuna): keep the real lane's wide-string marker independent of layout - #4116

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/kuna-lane-wide-marker-layout
Oct 15, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/kuna-lane-wide-marker-layout

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

npm run verify:kuna fails on macOS arm64 since the string feature (#4095), which was verified on Linux only ("No macOS/Windows … runtime claims"). The lane's fixture places a UTF-8 marker right before a UTF-16LE array. That marker's last byte (r) and its NUL decode as a valid UTF-16LE unit, so Kuna reports the wide run as "rREA wide marker". The lane requires the exact "REA wide marker". Refs #1957.

Problem and expected behavior

On main e598b46, real Kuna 1.833, macOS arm64:

$ REA_KUNA_COMMAND=… node scripts/verify-real-kuna.mjs
AssertionError: Required string "REA wide marker" was not recovered   (exit 1)

Root cause, with the fixture compiled by cc -O1: the UTF-8 marker occupies 0x100000598–0x1000005b9, NUL included, and the UTF-16 array starts at 0x1000005ba. kuna strings --json --encoding all reports:

0x100000598 utf8  "_φ( °-°)/ REA unicode marker"
0x1000005b8 utf16 "rREA wide marker"       ← starts at the bytes 72 00 of the UTF-8 marker's tail

Kuna's reading is valid for these bytes, so this is not a Kuna bug. REA's answer reports Kuna's observation as-is, as it should. The fixture's layout determines whether the exact marker can be recovered at all: on the Linux layout something else preceded the array.

Change and scope

The fixture's UTF-16 array starts with a NUL unit ({0,'R','E','A',…,0}), with a comment saying why. Whatever bytes precede it now end at that NUL, and the marker is recovered exactly on any layout. With the same compiler, Kuna reports 0x1000005bc utf16 "REA wide marker". No product code changes.

Scope: test-lane fix within the existing Kuna provider boundary; no maintainer scope decision applies.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the real-lane fixture source in scripts/verify-real-kuna.mjs.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: makes the lane pass on macOS arm64.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: none.
  • Generated metadata, package, or installation impact: none.

Expected effects:

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

(Test fixture only.)

Evidence and regression coverage

  • Tests added or updated: the real lane is the coverage. kunaVerifier.test.ts (9 tests) still passes.

  • Base reproduction: the lane exits 1 on main with the assertion above (observed twice).

  • After the fix: verify:kuna passed twice on macOS arm64 with real Kuna 1.833, status: "passed", cleanup: "complete".

  • Remaining proof gaps: not re-run on Linux. The change only adds a leading NUL unit, which cannot form part of a printable run; Linux behavior is source-derived.

  • 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

  • REA_KUNA_COMMAND=… node scripts/verify-real-kuna.mjs on main: exit 1, "Required string "REA wide marker" was not recovered".
  • The same with this change: passed, twice.
  • kuna strings --json --encoding all on the fixture before and after, as quoted above.
  • npm run test:focused -- tests/boundary/providers/kuna/kunaVerifier.test.ts: 9 passed.
  • npm run check:fast: typecheck and lint passed.
  • npm run docs:check: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: real Kuna on macOS arm64.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

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

🤖 Generated with Claude Code

On macOS arm64 the lane's UTF-8 marker ends right before the UTF-16 array,
and its last byte plus NUL decode as the UTF-16LE unit 'r'. Kuna therefore
reports "rREA wide marker", and the lane, which requires the exact text,
failed with "Required string \"REA wide marker\" was not recovered". A
leading NUL unit now ends any run the preceding bytes start, so the marker
is recovered exactly on any layout.

Refs #1957

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added bug Something isn't working track:kuna Kuna decompiler provider series (#1957) labels Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T13:18:18.006152Z d318b52 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 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The fixture-only change appears safe to merge.

Summary

Adds a leading NUL to the real Kuna fixture’s UTF-16 marker so preceding bytes cannot become part of the expected string.

  • The real Kuna fixture keeps its wide marker clear of earlier bytes.

Reviews (1) · Last reviewed commit: "fix(kuna): keep the real lane's wide-str..." · Reviewed by Greptile

@kaoru0822-kitauji
kaoru0822-kitauji merged commit cfd3c35 into main Oct 15, 2026
39 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/kuna-lane-wide-marker-layout branch October 15, 2026 14:38
@morluto morluto added the provider: kuna Analysis provider / engine: kuna label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: kuna Analysis provider / engine: kuna track:kuna Kuna decompiler provider series (#1957)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants