[PR #6269] [MERGED] fix(kuna): name the rejected address in list_strings input errors #7243

Closed
opened 2026-11-01 21:46:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6269
Author: @Abelo9996
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: fix-5980-list-strings-address-issue


📝 Commits (1)

  • 12c3f13 fix(kuna): name the rejected address in list_strings input errors

📊 Changes

2 files changed (+13 additions, -6 deletions)

View changed files

📝 src/kuna/KunaStringQueries.ts (+5 -3)
📝 tests/boundary/providers/kuna/kunaStrings.test.ts (+8 -3)

📄 Description

Summary

Fixes #5980.

Kuna list_strings rejected a malformed or out-of-range address with the right invalid_request code, message and recovery, but without details.issues. The remediation told the caller to correct the listed fields while listing none. The error now carries {"path":["address"],"reason":"invalid_format"}, the same issue the sibling Kuna address_name check already reports for the same normalizer failure.

Problem and expected behavior

KunaStringQueries.execute in src/kuna/KunaStringQueries.ts built AnalysisInputError for a failed normalizeKunaAddress without the issues argument. The constructor defaults issues to [], and the projector only emits input details for a nonempty list, so list_strings with address: "not-an-address" or "0x1ffffffffffffffff" projected to:

{"code":"invalid_request","category":"invalid_input","message":"Use an explicit hexadecimal u64 string address.","retryable":false,"remediation":{"action":"Read the declared input schema or CLI usage for list_strings; if using MCP and the catalog may be stale, call tools/list. Correct the listed fields, then retry. Do not repeat the unchanged call."},"recovery":{"kind":"inspect_input_contract","operation":"list_strings"}}

Expected: same rejection, message and recovery, plus a details.issues entry naming address.

Change and scope

Pass [{ path: ["address"], reason: "invalid_format" }] as the issues argument, matching #addressName in KunaSessionClient.ts. The message, recovery and rejection rules are unchanged. The rejected value is not echoed, and overflow is not distinguished from bad format, which the issue says is not required.

Follow the contribution scope.
Scope decision: not applicable (ordinary fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: KunaStringQueries.execute, request validation for list_strings.
  • Contribution scope fit and linked maintainer decision: ordinary bug fix, not applicable.
  • CLI and MCP/tool-catalog contract: no schema change. Invalid list_strings addresses on Kuna now project details: {"operation":"list_strings","issues":[{"path":["address"],"reason":"invalid_format"}]}.
  • Provider, bridge, target-format, or platform compatibility: none. Kuna only.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged. The rejection still happens before the string scan.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

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.

(Diagnostic metadata only; the rejected request never reaches Kuna.)

Evidence and regression coverage

  • Tests added or updated: tests/boundary/providers/kuna/kunaStrings.test.ts. The existing invalid list_strings assertion now runs for "invalid" and the overflowing "0x1ffffffffffffffff" and checks issues: [{ path: ["address"], reason: "invalid_format" }].

  • Base reproduction (executed): with the test change and without the fix:

    FAIL  tests/boundary/providers/kuna/kunaStrings.test.ts > shares a typed string scan across concurrent searches and exact address reads without analysis
    -     "issues": [
    -         "reason": "invalid_format",
    +     "issues": [],
          Tests  1 failed | 18 passed (19)
    

    With the fix: 19 passed.

  • User-visible CLI/MCP output (if applicable): projectAnalysisError on the simulated Kuna session for both addresses, before as shown above, after:

    {"code":"invalid_request","category":"invalid_input","message":"Use an explicit hexadecimal u64 string address.","retryable":false,"remediation":{"action":"Read the declared input schema or CLI usage for list_strings; if using MCP and the catalog may be stale, call tools/list. Correct the listed fields, then retry. Do not repeat the unchanged call."},"recovery":{"kind":"inspect_input_contract","operation":"list_strings"},"details":{"operation":"list_strings","issues":[{"path":["address"],"reason":"invalid_format"}]}}
    
  • Remaining proof gaps: no real Kuna engine. MCP transport and CLI delivery were not separately run; the projection above is the shared projector they both use.

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

Run with the pinned Node 24.18.0 on macOS arm64.

  • npm run test:focused -- tests/boundary/providers/kuna/kunaStrings.test.ts: 19 passed (1 failed without the fix, shown above)
  • npm run check tasks: typecheck, lint:built (0 errors), knip, metadata:check and verify:architecture-guards passed. format:check was run as oxfmt --check on the two changed files (clean), because the repo-wide run in my checkout also picked up unrelated untracked local notes.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. details is optional and is now present for this rejection.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS only, simulated Kuna executable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the issue only names the field and a fixed reason; the rejected value is not echoed.

Author readiness

Human owner: @Abelo9996

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6269 **Author:** [@Abelo9996](https://github.com/Abelo9996) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix-5980-list-strings-address-issue` --- ### 📝 Commits (1) - [`12c3f13`](https://github.com/morluto/rea/commit/12c3f13f04b94f503bcee06292fa81f648ec3427) fix(kuna): name the rejected address in list_strings input errors ### 📊 Changes **2 files changed** (+13 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/kuna/KunaStringQueries.ts` (+5 -3) 📝 `tests/boundary/providers/kuna/kunaStrings.test.ts` (+8 -3) </details> ### 📄 Description ## Summary Fixes #5980. Kuna `list_strings` rejected a malformed or out-of-range `address` with the right `invalid_request` code, message and recovery, but without `details.issues`. The remediation told the caller to correct the listed fields while listing none. The error now carries `{"path":["address"],"reason":"invalid_format"}`, the same issue the sibling Kuna `address_name` check already reports for the same normalizer failure. ## Problem and expected behavior `KunaStringQueries.execute` in `src/kuna/KunaStringQueries.ts` built `AnalysisInputError` for a failed `normalizeKunaAddress` without the issues argument. The constructor defaults issues to `[]`, and the projector only emits input `details` for a nonempty list, so `list_strings` with `address: "not-an-address"` or `"0x1ffffffffffffffff"` projected to: ```json {"code":"invalid_request","category":"invalid_input","message":"Use an explicit hexadecimal u64 string address.","retryable":false,"remediation":{"action":"Read the declared input schema or CLI usage for list_strings; if using MCP and the catalog may be stale, call tools/list. Correct the listed fields, then retry. Do not repeat the unchanged call."},"recovery":{"kind":"inspect_input_contract","operation":"list_strings"}} ``` Expected: same rejection, message and recovery, plus a `details.issues` entry naming `address`. ## Change and scope Pass `[{ path: ["address"], reason: "invalid_format" }]` as the issues argument, matching `#addressName` in `KunaSessionClient.ts`. The message, recovery and rejection rules are unchanged. The rejected value is not echoed, and overflow is not distinguished from bad format, which the issue says is not required. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Scope decision: not applicable (ordinary fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: `KunaStringQueries.execute`, request validation for `list_strings`. - Contribution scope fit and linked maintainer decision: ordinary bug fix, not applicable. - CLI and MCP/tool-catalog contract: no schema change. Invalid `list_strings` addresses on Kuna now project `details: {"operation":"list_strings","issues":[{"path":["address"],"reason":"invalid_format"}]}`. - Provider, bridge, target-format, or platform compatibility: none. Kuna only. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged. The rejection still happens before the string scan. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. 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. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. (Diagnostic metadata only; the rejected request never reaches Kuna.) ## Evidence and regression coverage - Tests added or updated: `tests/boundary/providers/kuna/kunaStrings.test.ts`. The existing invalid `list_strings` assertion now runs for `"invalid"` and the overflowing `"0x1ffffffffffffffff"` and checks `issues: [{ path: ["address"], reason: "invalid_format" }]`. - Base reproduction (executed): with the test change and without the fix: ``` FAIL tests/boundary/providers/kuna/kunaStrings.test.ts > shares a typed string scan across concurrent searches and exact address reads without analysis - "issues": [ - "reason": "invalid_format", + "issues": [], Tests 1 failed | 18 passed (19) ``` With the fix: 19 passed. - User-visible CLI/MCP output (if applicable): `projectAnalysisError` on the simulated Kuna session for both addresses, before as shown above, after: ```json {"code":"invalid_request","category":"invalid_input","message":"Use an explicit hexadecimal u64 string address.","retryable":false,"remediation":{"action":"Read the declared input schema or CLI usage for list_strings; if using MCP and the catalog may be stale, call tools/list. Correct the listed fields, then retry. Do not repeat the unchanged call."},"recovery":{"kind":"inspect_input_contract","operation":"list_strings"},"details":{"operation":"list_strings","issues":[{"path":["address"],"reason":"invalid_format"}]}} ``` - Remaining proof gaps: no real Kuna engine. MCP transport and CLI delivery were not separately run; the projection above is the shared projector they both use. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Run with the pinned Node 24.18.0 on macOS arm64. - `npm run test:focused -- tests/boundary/providers/kuna/kunaStrings.test.ts`: 19 passed (1 failed without the fix, shown above) - `npm run check` tasks: `typecheck`, `lint:built` (0 errors), `knip`, `metadata:check` and `verify:architecture-guards` passed. `format:check` was run as `oxfmt --check` on the two changed files (clean), because the repo-wide run in my checkout also picked up unrelated untracked local notes. ## Compatibility, safety, and release - Breaking changes or migration steps: none. `details` is optional and is now present for this rejection. - Real Hopper/Ghidra, browser, or OS coverage: macOS only, simulated Kuna executable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: the issue only names the field and a fixed reason; the rejected value is not echoed. ## Author readiness Human owner: @Abelo9996 - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7243
No description provided.