[PR #2901] [MERGED] fix(managed): share native verification input diagnostics #5481

Closed
opened 2026-10-31 01:06:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2901
Author: @ShitK
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/managed-native-verification-diagnostics


📝 Commits (1)

  • 25478e8 fix(managed): share native verification input diagnostics

📊 Changes

3 files changed (+86 additions, -43 deletions)

View changed files

📝 src/contracts/managed/managedWorkflowToolContracts.ts (+2 -30)
📝 src/contracts/workflowInputContracts.test.ts (+80 -12)
📝 src/domain/managed/managedNativeVerificationSchemas.ts (+4 -1)

📄 Description

Summary

Fixes #2621.

A single native observation that reuses the managed boundary's Evidence ID now reports only the role-distinctness error. Genuine duplicate native observations still report the uniqueness error.

Problem and expected behavior

The request validator seeded its native-ID set with the managed boundary ID, so one observation could incorrectly produce both diagnostics. The domain validator already distinguished these rules correctly.

Change and scope

Use managedNativeVerificationInputSchema directly in the tool contract, removing the duplicate validator and its superseded export. Move the existing native-observation field description to that canonical schema to preserve caller guidance. The domain owns validation for both the workflow and its advertised request contract.

Contract and boundary impact

  • Request fields, strictness, accepted inputs, and output contracts are unchanged; invalid-input diagnostics are corrected.
  • This is an ordinary validation fix within existing scope; a separate maintainer scope decision is not applicable.
  • Provider protocols, Evidence provenance, target authority, cleanup, packaging, and installation are unchanged. No generated outputs are committed.
  • This diagnostic correction introduces no target interaction.

Evidence and regression coverage

The updated contract test asserts exact messages and paths for one observation reusing the boundary, repeated native observations, repeated observations also reusing the boundary, and valid distinct observations. It exercises the domain schema, named tool contract, and metadata-wrapped Standard Schema validator.

On base 7e3a19863835215491b55fba7127a78bad6a7709, the updated test reproduced the bug: 2 failed, 4 passed. With the fix, the four selected files passed 35 tests, including existing managed verification and in-memory MCP SDK coverage.

Validation performed

macOS arm64, Node.js 24.18.0, npm 11.16.0:

  • Direct Vitest run of src/contracts/workflowInputContracts.test.ts, src/contracts/toolInputReferences.test.ts, tests/conformance/providers/managed/managedNativeVerification.test.ts, and tests/boundary/mcp/managedMcp.test.ts — 35 passed (6 + 16 + 11 + 2).
  • Touched-file lint/format, knip, module-boundary and architecture guards, test discovery (1,108 files exactly once), git diff --check, and the normal pre-commit hook — passed.
  • npm run test:focused and npm run docs:check — blocked by existing SupportedClients.ts TS2322 errors at lines 542, 744, and 809 (devin format).
  • npm run check — stopped on existing formatting failures in functionComparison.test.ts and IdaOperationRunner.ts.
  • Full TypeScript checking also reported existing TS2345 in clientProfileLifecycle.test.ts:297 and duplicate join imports (TS2300) in ghidraInventoryMcp.test.ts:4,17.

These blockers were independently reproduced on an exported pristine copy of the base revision with the same runtime. The standard checks remain blocked. The normal pre-push hook also failed on the unchanged duplicate join import; this branch was pushed with a one-command HUSKY=0 override.

Compatibility, safety, and release

No migration or release metadata change is needed. The executed MCP tests use an in-memory transport; compiled CLI, stdio transport, real engines, and CI results are not claimed. This fix was prepared with AI assistance.

Before merge

  • Focused fix linked to its issue, with regression coverage for observable diagnostics.
  • Canonical validation ownership and existing caller guidance are preserved.
  • Standard checks and CI pass; resolve or re-evaluate the documented base failures.

🔄 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/2901 **Author:** [@ShitK](https://github.com/ShitK) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/managed-native-verification-diagnostics` --- ### 📝 Commits (1) - [`25478e8`](https://github.com/morluto/rea/commit/25478e89cd0ec6b789230508f96ad624ad2e283b) fix(managed): share native verification input diagnostics ### 📊 Changes **3 files changed** (+86 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/managed/managedWorkflowToolContracts.ts` (+2 -30) 📝 `src/contracts/workflowInputContracts.test.ts` (+80 -12) 📝 `src/domain/managed/managedNativeVerificationSchemas.ts` (+4 -1) </details> ### 📄 Description ## Summary Fixes #2621. A single native observation that reuses the managed boundary's Evidence ID now reports only the role-distinctness error. Genuine duplicate native observations still report the uniqueness error. ## Problem and expected behavior The request validator seeded its native-ID set with the managed boundary ID, so one observation could incorrectly produce both diagnostics. The domain validator already distinguished these rules correctly. ## Change and scope Use `managedNativeVerificationInputSchema` directly in the tool contract, removing the duplicate validator and its superseded export. Move the existing native-observation field description to that canonical schema to preserve caller guidance. The domain owns validation for both the workflow and its advertised request contract. ## Contract and boundary impact - Request fields, strictness, accepted inputs, and output contracts are unchanged; invalid-input diagnostics are corrected. - This is an ordinary validation fix within existing scope; a separate maintainer scope decision is not applicable. - Provider protocols, Evidence provenance, target authority, cleanup, packaging, and installation are unchanged. No generated outputs are committed. - This diagnostic correction introduces no target interaction. ## Evidence and regression coverage The updated contract test asserts exact messages and paths for one observation reusing the boundary, repeated native observations, repeated observations also reusing the boundary, and valid distinct observations. It exercises the domain schema, named tool contract, and metadata-wrapped Standard Schema validator. On base `7e3a19863835215491b55fba7127a78bad6a7709`, the updated test reproduced the bug: **2 failed, 4 passed**. With the fix, the four selected files passed **35 tests**, including existing managed verification and in-memory MCP SDK coverage. ## Validation performed macOS arm64, Node.js 24.18.0, npm 11.16.0: - Direct Vitest run of `src/contracts/workflowInputContracts.test.ts`, `src/contracts/toolInputReferences.test.ts`, `tests/conformance/providers/managed/managedNativeVerification.test.ts`, and `tests/boundary/mcp/managedMcp.test.ts` — **35 passed** (6 + 16 + 11 + 2). - Touched-file lint/format, `knip`, module-boundary and architecture guards, test discovery (1,108 files exactly once), `git diff --check`, and the normal pre-commit hook — passed. - `npm run test:focused` and `npm run docs:check` — blocked by existing `SupportedClients.ts` TS2322 errors at lines 542, 744, and 809 (`devin` format). - `npm run check` — stopped on existing formatting failures in `functionComparison.test.ts` and `IdaOperationRunner.ts`. - Full TypeScript checking also reported existing TS2345 in `clientProfileLifecycle.test.ts:297` and duplicate `join` imports (TS2300) in `ghidraInventoryMcp.test.ts:4,17`. These blockers were independently reproduced on an exported pristine copy of the base revision with the same runtime. The standard checks remain blocked. The normal pre-push hook also failed on the unchanged duplicate `join` import; this branch was pushed with a one-command `HUSKY=0` override. ## Compatibility, safety, and release No migration or release metadata change is needed. The executed MCP tests use an in-memory transport; compiled CLI, stdio transport, real engines, and CI results are not claimed. This fix was prepared with AI assistance. ## Before merge - [x] Focused fix linked to its issue, with regression coverage for observable diagnostics. - [x] Canonical validation ownership and existing caller guidance are preserved. - [ ] Standard checks and CI pass; resolve or re-evaluate the documented base failures. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:06:59 +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#5481
No description provided.