[PR #708] [MERGED] fix(reconstruction): accept function comparison source parameters #2188

Closed
opened 2026-10-16 21:15:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/708
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/function-verification-source-parameters


📝 Commits (1)

  • 7a96391 fix(reconstruction): accept function comparison source parameters

📊 Changes

3 files changed (+699 additions, -3 deletions)

View changed files

➕ src/domain/reconstructionVerification.functionSources.test.ts (+554 -0)
📝 src/domain/reconstructionVerification.ts (+20 -2)
📝 tests/boundary/mcp/functionComparisonMcp.test.ts (+125 -1)

📄 Description

Summary

Allow the exact Evidence returned by compare_functions to be used in structural-function reconstruction claims.

No separate issue: this is a reproduced producer/consumer parameter mismatch.

Problem and expected behavior

The public function-comparison tool emits left_evidence_id and right_evidence_id. The reconstruction verifier requires plural arrays for every non-behavioral claim, so both unchanged and changed comparisons fail with invalid_request before their results can be assessed.

The verifier should accept the producer's current singular pair while retaining the previously accepted plural representation.

Change and scope

Update only structural-function source-parameter parsing:

  • Accept a complete singular pair and project each ID into a singleton side array.
  • Preserve complete plural-only arrays, including ordered multi-ID sides.
  • Retain redundant dual aliases only when both plural arrays exactly match the corresponding singular singleton.
  • Reject mixed, partial, malformed, contradictory and reversed alias declarations without falling back to a different representation.

Behavioral and structural-artifact parameter parsing stay unchanged. Unrelated parameter metadata and the original comparison Evidence are preserved.

Contract and boundary impact

  • Semantic owner: reconstruction verification's function-comparison source binding.
  • CLI/MCP: current public comparison Evidence composes with verify_reconstruction; no tool/schema/catalog changes.
  • Evidence/provenance: existing identity, authority, digest, uniqueness, source-kind/schema, exact top-level closure and selected-dimension citation checks remain in place.
  • Unknowns: insufficient source authority or identity and active relevant residual unknowns still yield unknown.
  • Provider/process/authorization/cleanup: unchanged; no provider execution is added.
  • Generated metadata/package/installation: unchanged.

This correction does not add comparison-subject hash cross-checks or change the existing overall-dimension citation behavior.

Evidence and regression coverage

On unchanged main ab5a1c6, the new domain suite has 21 expected failures and 44 passing controls. The public MCP suite has two invalid_request regressions and three passing controls.

The in-memory MCP SDK tests pass exact compare_functions output into verify_reconstruction: unchanged pseudocode passes and changed pseudocode fails. They verify exact left/right IDs, retained comparison Evidence and zero provider launches.

Domain tests cover singular/plural/coherent dual inputs, side ordering, unrelated metadata, malformed/partial/mixed/reversed aliases, duplicate/cross-side IDs, source closure, source schemas, comparison identity/authority, selected-dimension citations and conservative unknowns. Negative admission records are independently rehashed and their Evidence/bundle validity is asserted before the targeted rejection; digest tampering is tested separately.

Validation performed

  • Focused function/reconstruction domain and MCP suites, including merged process-provider identity regressions: 145 tests passed across seven files.
  • Build and npm run check: passed; all five check tasks succeeded (107 existing warnings, zero errors).
  • npm run jscpd (2.36%), npm run scan:todos, and git diff --check: passed.
  • Independent review completed before publication with no blocking findings.

Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Optional Turbo telemetry was disabled for local verification. Hosted CI is tracked separately; no full local-suite pass is claimed.

Compatibility, safety, and release

No schema, dependency or package changes. This is retained-Evidence domain and in-memory MCP integration coverage; no real Hopper/Ghidra, browser, compiled CLI or package-install lane was run.

Prepared with AI assistance.


🔄 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/708 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/function-verification-source-parameters` --- ### 📝 Commits (1) - [`7a96391`](https://github.com/morluto/rea/commit/7a96391001780012f704f4ef5cb6597baa590b7d) fix(reconstruction): accept function comparison source parameters ### 📊 Changes **3 files changed** (+699 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/reconstructionVerification.functionSources.test.ts` (+554 -0) 📝 `src/domain/reconstructionVerification.ts` (+20 -2) 📝 `tests/boundary/mcp/functionComparisonMcp.test.ts` (+125 -1) </details> ### 📄 Description ## Summary Allow the exact Evidence returned by `compare_functions` to be used in structural-function reconstruction claims. No separate issue: this is a reproduced producer/consumer parameter mismatch. ## Problem and expected behavior The public function-comparison tool emits `left_evidence_id` and `right_evidence_id`. The reconstruction verifier requires plural arrays for every non-behavioral claim, so both unchanged and changed comparisons fail with `invalid_request` before their results can be assessed. The verifier should accept the producer's current singular pair while retaining the previously accepted plural representation. ## Change and scope Update only structural-function source-parameter parsing: - Accept a complete singular pair and project each ID into a singleton side array. - Preserve complete plural-only arrays, including ordered multi-ID sides. - Retain redundant dual aliases only when both plural arrays exactly match the corresponding singular singleton. - Reject mixed, partial, malformed, contradictory and reversed alias declarations without falling back to a different representation. Behavioral and structural-artifact parameter parsing stay unchanged. Unrelated parameter metadata and the original comparison Evidence are preserved. ## Contract and boundary impact - Semantic owner: reconstruction verification's function-comparison source binding. - CLI/MCP: current public comparison Evidence composes with `verify_reconstruction`; no tool/schema/catalog changes. - Evidence/provenance: existing identity, authority, digest, uniqueness, source-kind/schema, exact top-level closure and selected-dimension citation checks remain in place. - Unknowns: insufficient source authority or identity and active relevant residual unknowns still yield unknown. - Provider/process/authorization/cleanup: unchanged; no provider execution is added. - Generated metadata/package/installation: unchanged. This correction does not add comparison-subject hash cross-checks or change the existing overall-dimension citation behavior. ## Evidence and regression coverage On unchanged main `ab5a1c6`, the new domain suite has 21 expected failures and 44 passing controls. The public MCP suite has two `invalid_request` regressions and three passing controls. The in-memory MCP SDK tests pass exact `compare_functions` output into `verify_reconstruction`: unchanged pseudocode passes and changed pseudocode fails. They verify exact left/right IDs, retained comparison Evidence and zero provider launches. Domain tests cover singular/plural/coherent dual inputs, side ordering, unrelated metadata, malformed/partial/mixed/reversed aliases, duplicate/cross-side IDs, source closure, source schemas, comparison identity/authority, selected-dimension citations and conservative unknowns. Negative admission records are independently rehashed and their Evidence/bundle validity is asserted before the targeted rejection; digest tampering is tested separately. ## Validation performed - Focused function/reconstruction domain and MCP suites, including merged process-provider identity regressions: 145 tests passed across seven files. - Build and `npm run check`: passed; all five check tasks succeeded (107 existing warnings, zero errors). - `npm run jscpd` (2.36%), `npm run scan:todos`, and `git diff --check`: passed. - Independent review completed before publication with no blocking findings. Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Optional Turbo telemetry was disabled for local verification. Hosted CI is tracked separately; no full local-suite pass is claimed. ## Compatibility, safety, and release No schema, dependency or package changes. This is retained-Evidence domain and in-memory MCP integration coverage; no real Hopper/Ghidra, browser, compiled CLI or package-install lane was run. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:25 +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#2188
No description provided.