Skip to content

Fix FI sidecar conformance: array indices past 0 rejected by Node runner - #408

Merged
StepenkoAnatoli merged 1 commit into
StepenkoAnatoli:mainfrom
jay23606:pr-scout/337-fi-sidecar-conformance-mjs-refuses-every
Oct 14, 2026
Merged

StepenkoAnatoli merged 1 commit into
StepenkoAnatoli:mainfrom
jay23606:pr-scout/337-fi-sidecar-conformance-mjs-refuses-every

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

The bug

research-kit/lib/fi-sidecar-conformance.mjs checked JSON-pointer array indices with the regex literal /^0$|^[1-9]\d*$/. Inside a regex literal \d is a literal backslash followed by d*, so only "0" ever matched. Any patch addressing /entries/1/... or later threw VECTOR-PACKET in Node, while the Python runner (fi_sidecar_conformance.py, using isdigit()) ran the same vector. The shipped packet only patches /entries/0/..., so the suite did not catch it.

The change

Both occurrences (the intermediate-segment check in patch() and the removal check) now use /^(?:0|[1-9]\d*)$/, which accepts 0 and any index without leading zeros, as the issue specifies.

Test

A new test in research-kit/test/fi-sidecar-conformance-vectors.test.mjs builds a two-entry manifest packet in a temporary directory, with X-IDX1 removing /entries/1/sha256 and X-IDX0 removing /entries/0/sha256, both expecting SCHEMA-REQUIRED. It asserts that the Node and Python runners both observe SCHEMA-REQUIRED for each vector. On the unfixed code it fails with expected "SCHEMA-REQUIRED", got "VECTOR-PACKET" for X-IDX1. After the change the whole file passes.

Checks run

  • node research-kit/bin/selftest.mjs fi-sidecar-conformance-vectors: 5 passed, 0 failed (after the fix).
  • node research-kit/bin/selftest.mjs fi-sidecar-conformance-vectors conformance-hostile: 13 passed, 0 failed, all tests passed (after the fix).
  • The same group before the fix: the new test failed with the VECTOR-PACKET message above.

The runner filters by file name only, so the command above runs the whole vectors file, including the new test.

Regression test: fails on base twice (/got "VECTOR-PACKET"/), passes on fix twice (node research-kit/bin/selftest.mjs fi-sidecar-conformance-vectors)

Fixes #337

@StepenkoAnatoli
StepenkoAnatoli merged commit 0dc3ff0 into StepenkoAnatoli:main Oct 14, 2026
0 of 7 checks passed
@jay23606
jay23606 deleted the pr-scout/337-fi-sidecar-conformance-mjs-refuses-every branch October 14, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants