Repository navigation
Fix FI sidecar conformance: array indices past 0 rejected by Node runner - #408
Merged
StepenkoAnatoli merged 1 commit intoOct 14, 2026
Conversation
jay23606
deleted the
pr-scout/337-fi-sidecar-conformance-mjs-refuses-every
branch
October 14, 2026 21:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
research-kit/lib/fi-sidecar-conformance.mjschecked JSON-pointer array indices with the regex literal/^0$|^[1-9]\d*$/. Inside a regex literal\dis a literal backslash followed byd*, so only"0"ever matched. Any patch addressing/entries/1/...or later threwVECTOR-PACKETin Node, while the Python runner (fi_sidecar_conformance.py, usingisdigit()) 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 accepts0and any index without leading zeros, as the issue specifies.Test
A new test in
research-kit/test/fi-sidecar-conformance-vectors.test.mjsbuilds a two-entry manifest packet in a temporary directory, withX-IDX1removing/entries/1/sha256andX-IDX0removing/entries/0/sha256, both expectingSCHEMA-REQUIRED. It asserts that the Node and Python runners both observeSCHEMA-REQUIREDfor each vector. On the unfixed code it fails withexpected "SCHEMA-REQUIRED", got "VECTOR-PACKET"forX-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).VECTOR-PACKETmessage 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