Skip to content

test: regression guard for heterogeneous schema-less ingest (#1282) - #1284

Merged
kriszyp merged 2 commits into
mainfrom
kris/1282-heterogeneous-ingest-regression-test
Jun 16, 2026
Merged

kriszyp merged 2 commits into
mainfrom
kris/1282-heterogeneous-ingest-regression-test

Conversation

@kriszyp

@kriszyp kriszyp commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Adds an integration test (integrationTests/database/heterogeneous-ingest.test.ts + fixture) that inserts 2,000 distinct-shape records into an open (non-@sealed) table and asserts all 2,000 read back intact, plus an exact deep-equal round-trip of one deep record. No production code change.

Why

#1282 reported the vast majority of heterogeneous-ingest records decoding as null (#1163 "shared structure missing") on a single node. Investigation traced this to a stale structon (< 1.0.7) in node_modules — not a defect in harper main. harper pins structon ^1.0.7, and with that pinned version the real RecordEncoder reads back 50,000/50,000 (the catastrophic 6/50,000 only reproduces against structon 1.0.4). structon ≥ 1.0.7 both bounds the typed-structure dictionary (the CDI-OOM cap) and correctly handles the two-byte-record path that RecordEncoder's maxOwnStructures = 256 engages.

This test pins the data-integrity invariant so a future structon regression — or an accidental downgrade — can't silently reintroduce the loss.

Where to look

Notes

  • Cross-model review: Codex found no issues; the Gemini (agy) leg hung and was skipped (caveat). Harper-domain review surfaced only that this guards forward-looking integrity and does not recover any data already written under a stale-structon install.
  • Generated by an LLM (Claude Opus 4.8).

Adds an integration test that inserts 2000 distinct-shape records into an open
(non-@Sealed) table and asserts every record reads back intact (and that a deep
record round-trips exactly), guarding the high-shape-cardinality record-encoder path.

#1282 reported most such records decoding as null (#1163 "shared structure missing")
on a single node. That was traced to a stale structon (< 1.0.7) in node_modules, not a
defect in harper main: with the pinned structon ^1.0.7 the real RecordEncoder reads back
50,000/50,000. This test pins the invariant so a structon regression or accidental
downgrade can't silently reintroduce the loss. No production code change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a regression test suite to guard against schema-less heterogeneous ingest data loss (#1282). It adds a test that ingests 2,000 highly varied record shapes into an open table and verifies they can all be read back intact. The review feedback suggests two improvements: mapping over the filtered 'intact' array instead of 'rows' to safely build the 'byId' map without throwing a TypeError on null values, and adding an assertion to verify that the table becomes ready within the polling timeout to improve test debuggability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread integrationTests/database/heterogeneous-ingest.test.ts Outdated
Comment thread integrationTests/database/heterogeneous-ingest.test.ts
@claude

claude Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

@kriszyp kriszyp added this to the v5.1 milestone Jun 14, 2026
@kriszyp
kriszyp marked this pull request as ready for review June 14, 2026 22:34
- Map over `intact` (not raw `rows`) when building the byId lookup to avoid
  TypeError on null/malformed decode entries
- Add `tableReady` flag + `ok()` assertion after the polling loop so a 30 s
  timeout produces a clear failure instead of a confusing generic error on the
  subsequent insert

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp
kriszyp merged commit 4786f4b into main Jun 16, 2026
86 of 89 checks passed
@kriszyp
kriszyp deleted the kris/1282-heterogeneous-ingest-regression-test branch June 16, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants