[GH-ISSUE #1036] [Bug] Preserve prototype-named JSON members through Evidence boundaries #377

Closed
opened 2026-10-15 18:24:26 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @N0zoM1z0 on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1036

Before submitting

  • Searched open and closed issues for a related report.
  • This report uses only synthetic JSON and public source references.

Area

Evidence, artifacts, or reconstruction

Observed behavior

The shared jsonValueSchema uses Zod z.json(). An own producer property named __proto__ disappears during parsing. This is an evidence integrity problem if a provider accepts such JSON and a downstream schema silently projects it away.

Reproduction

Run with the repository-pinned Zod:

import { z } from 'zod';
const input = Object.fromEntries([
  ['__proto__', { preserved: 7 }],
  ['constructor', 'ordinary'],
]);
console.log(Object.hasOwn(input, '__proto__')); // true
console.log(JSON.stringify(z.json().parse(input))); // {"constructor":"ordinary"}

Expected behavior

Preserve ordinary own JSON member names and values through validated provider replies, shared application composition, Evidence hashing/serialization, and CLI/MCP output. Avoid prototype setters or inherited properties. Any temporary unsupported representation must be explicit before a successful result.

Impact and scope

The traced #992 call path is decoder reply validation -> historical capture projection -> shared Evidence normalized_result/raw_result -> CLI/MCP. #992 deliberately reports an unsupported boundary for __proto__ members in HAR and native captures; original files are unchanged and no partial success is returned. This issue records removal of that limitation. Other JSON consumers require individual call-path audits; this report does not establish that every tool is affected.

REA version

Source 6a1266653f; shared schema inherited from main.

Runtime and platform

Node.js 24.18.0, Linux x64, repository-pinned Zod.

Target and artifact context

Synthetic JSON own properties, HAR extensions, native capture metadata.

Interface

CLI and MCP

Earliest failure stage

Transport or result projection

Analysis

The upstream parser and downstream JSON-schema validator have different materialization behavior. A safe parser alone cannot establish that the next boundary preserves the same representation.

Acceptance

  • Trace the affected producer/consumer paths before changing the shared schema.
  • Preserve __proto__, constructor, prototype, escaped names, arrays and nested objects without prototype mutation.
  • Validate the converted MCP schema against its declared dialect and exercise the actual SDK client.
  • Keep Evidence semantic IDs aligned with preserved normalized and raw data.
  • Replace #992's explicit unsupported cases with installed CLI/MCP preservation regressions only after the shared boundary is fixed.
Originally created by @N0zoM1z0 on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1036 ### Before submitting - [x] Searched open and closed issues for a related report. - [x] This report uses only synthetic JSON and public source references. ### Area Evidence, artifacts, or reconstruction ### Observed behavior The shared `jsonValueSchema` uses Zod `z.json()`. An own producer property named `__proto__` disappears during parsing. This is an evidence integrity problem if a provider accepts such JSON and a downstream schema silently projects it away. ### Reproduction Run with the repository-pinned Zod: ```js import { z } from 'zod'; const input = Object.fromEntries([ ['__proto__', { preserved: 7 }], ['constructor', 'ordinary'], ]); console.log(Object.hasOwn(input, '__proto__')); // true console.log(JSON.stringify(z.json().parse(input))); // {"constructor":"ordinary"} ``` ### Expected behavior Preserve ordinary own JSON member names and values through validated provider replies, shared application composition, Evidence hashing/serialization, and CLI/MCP output. Avoid prototype setters or inherited properties. Any temporary unsupported representation must be explicit before a successful result. ### Impact and scope The traced #992 call path is decoder reply validation -> historical capture projection -> shared Evidence normalized_result/raw_result -> CLI/MCP. #992 deliberately reports an unsupported boundary for `__proto__` members in HAR and native captures; original files are unchanged and no partial success is returned. This issue records removal of that limitation. Other JSON consumers require individual call-path audits; this report does not establish that every tool is affected. ### REA version Source 6a1266653fd44715b4044fee788326e92efddb75; shared schema inherited from main. ### Runtime and platform Node.js 24.18.0, Linux x64, repository-pinned Zod. ### Target and artifact context Synthetic JSON own properties, HAR extensions, native capture metadata. ### Interface CLI and MCP ### Earliest failure stage Transport or result projection ### Analysis The upstream parser and downstream JSON-schema validator have different materialization behavior. A safe parser alone cannot establish that the next boundary preserves the same representation. ### Acceptance - Trace the affected producer/consumer paths before changing the shared schema. - Preserve `__proto__`, `constructor`, `prototype`, escaped names, arrays and nested objects without prototype mutation. - Validate the converted MCP schema against its declared dialect and exercise the actual SDK client. - Keep Evidence semantic IDs aligned with preserved normalized and raw data. - Replace #992's explicit unsupported cases with installed CLI/MCP preservation regressions only after the shared boundary is fixed.
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#377
No description provided.