ReviewOS

home-lang/home

Port Valkey RESP nesting-depth reliability corpus

#318
Closed chris opened this 10 days ago ·
10 days ago

Bun compatibility slice

Port js/valkey/reliability/resp-nesting-depth.test.ts at exhaustive corpus position 4074.

Required behavior

  • reject aggregate responses deeper than the 128-level RESP parser limit with ERR_REDIS_INVALID_RESPONSE;
  • accept and decode shallow nested arrays such as [[[42]]];
  • preserve clean subprocess behavior for an extremely deep response rather than crashing;
  • retain parse phase, endpoint, depth-limit, and causal stack metadata while redacting Redis credentials and paths;
  • add focused and permanent regression coverage for all three active tests.

Tracked from #66 and the shared Valkey error work in #315.

10 days ago

Implemented and pushed in 4ebfa077c.

The Valkey client corpus bridge now enforces the RESP aggregate nesting limit: depth 256 produces RedisInvalidResponseError / ERR_REDIS_INVALID_RESPONSE, while the shallow payload decodes to [[[42]]]. The depth-1000 subprocess path returns a clean success marker and exit code 0 instead of crashing.

The invalid-response component retains valkey.parse, endpoint, actual depth, limit 128, and its original RangeError cause in the stack while redacting Redis credentials, database paths, and query secrets.

Verification:

  • focused position 4074: 3 passed, 0 failed, 0 todo, 0 unsupported;
  • adjacent positions 4073–4074: 3 passed, 1 conditional todo, 0 failed, 0 unsupported;
  • permanent third-party mini-suite: passed, including 47 structured-error diagnostics;
  • formatting and diff checks: passed.

Sign in to comment on this issue.