Skip to content

fix(javascript): hash graph and evidence JSON incrementally - #646

Merged
N0zoM1z0 merged 1 commit into
mainfrom
fix/large-javascript-evidence-digests
Oct 6, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
fix/large-javascript-evidence-digests

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Hash canonical JSON incrementally for shared graph/comparison digests and Evidence IDs, preserving the canonicalize byte sequence and existing identifiers.
  • Preserve unexpected JavaScript analysis failures as typed provider errors with caller-visible input path, error name, and message; known filesystem failures retain the existing I/O classification.
  • Add compatibility/property regressions and an opt-in verify:javascript:digests lane that crosses Node's actual single-string limit without adding that workload to routine tests.

Refs #623. The maintainer's 4.0.1 comment prompted verification: the current main still fails both production hash paths with RangeError: Invalid string length for an aggregate beyond the engine limit.

Verification

  • Focused domain/service/CLI/MCP/acceptance suite: 9 files, 62 tests passed. Final added compatibility/negative cases: 2 files, 9 tests passed.
  • npm run check:fast: passed; typecheck, lint, formatting and metadata passed in the static gate; npm run knip passed after registering the opt-in verifier.
  • npm run docs:check: passed.
  • node scripts/verify-large-javascript-digests.mjs: passed for 537,921,040 serialized bytes against a 536,870,888 engine string limit on a 1 GiB heap; peak RSS 76,720 KiB. The unchanged production graph and Evidence digest paths both throw on the equivalent fixture.
  • Actual CLI on a generated public 32-file, 6,304,960-byte JavaScript fixture: complete 27,928,234-byte JSON result, no truncated scopes.
  • Actual stdio MCP with the pinned client SDK: complete 98,173,521-byte response, authenticated Evidence and the same ID as CLI. The SDK's default 10 MiB read buffer correctly rejects this response; the verification uses its explicit 128 MiB maxBufferSize option.
  • An unchanged smaller application retains its exact pre-fix Evidence ID.

No real Hopper/Ghidra run was performed for this provider-neutral hashing change.

Remaining coverage

This PR removes aggregate string assembly from hashing. Incur output formatting and MCP JSON serialization still assemble whole strings, so full results beyond the engine's string limit remain a separate output-boundary limitation; this PR leaves the issue open for the remaining output work. CLI field filtering happens before formatting and remains available. The repository's full dist/ reproduction is additionally blocked earlier by an existing empty-endpoint graph schema failure, which is recorded separately rather than folded into this change.

@N0zoM1z0
N0zoM1z0 merged commit 9f42495 into main Oct 6, 2026
19 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/large-javascript-evidence-digests branch October 6, 2026 03:54
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants