Repository navigation
Description
Refs #5901. Slice 4 of 9 (parallel with slices 1, 2 and 3; slice 8 waits for it).
Problem
The third verifier on #5891 found two soundness gaps in the parser reader's flow check. Both are still open on origin/main (f177191):
- Engine-implicit lookups are not trusted.
Flow.valuereturns on a spread into an array or call without trusting@@iterator(plugins/harness-ops/skills/inventory/scripts/js/parser_helper.cjs:497-500).Flow.membertrusts only the called method's name (parser_helper.cjs:568-586), notconstructor/@@speciesforslice,map,filter,concat,flatandflatMap, nor@@isConcatSpreadableforconcat. Probes, each with an importer of the exportedpY, readliteralunder the parser:var c=[...pY];beside a module runningArray.prototype[Symbol.iterator]=function*(){yield "B"};var c=pY.map(function(e){return e});beside a module definingArray[Symbol.species]with a getter that pushesB
- Reads that the writes op deems safe never reach the sink check. A value-only member read (
var z=pY.zz) with a getter onArray.prototype.zzthat pushesBreadsliteral.
The finding also states the cost: 2.1.287's yallist writes e.prototype[Symbol.iterator] on a receiver the sink rule cannot prove is no built-in, so trusting @@iterator makes every spread-built list read partial under the parser. That is fail-closed. Slice 8 removes that cost.
Fix
In parser_helper.cjs Flow:
- A spread of the array trusts
@@iteratorandnext. slice,map,filter,concat,flatandflatMapalso trustconstructorand@@species.concatalso trusts@@isConcatSpreadable.- A value-only member read trusts its key name, so
_sink_hitruns for it.
In plugins/harness-ops/skills/inventory/scripts/inventory.py, _parsed_written_elsewhere (:2265-2282) runs the trusted-name sink check whenever such a read exists, not only when a mutation does.
Pin the probes in test_reader_findings.py as partial: test_a_patched_iterator_leaves_a_spread_partial, test_a_patched_species_leaves_a_mapped_list_partial, test_a_patched_concat_spreadable_leaves_the_list_partial and test_a_prototype_getter_leaves_a_member_read_partial. Keep test_a_known_safe_read_keeps_the_literal (test_reader_findings.py:182) passing for a bundle with no sink. Update the TestInstalledBuilds docstring if the trusted set it lists changes. Add a fragment under .changes/harness-ops/.
Done when
-
python3 plugins/harness-ops/skills/inventory/scripts/parser_reader.py --installexits 0 -
python3 -m pytest -q plugins/harness-ops/skills/inventory/scripts/test_reader_findings.py -k "test_a_patched_iterator_leaves_a_spread_partial or test_a_patched_species_leaves_a_mapped_list_partial or test_a_patched_concat_spreadable_leaves_the_list_partial or test_a_prototype_getter_leaves_a_member_read_partial or test_a_known_safe_read_keeps_the_literal"exits 0 with 5 passed -
scripts/run-test-file.sh plugins/harness-ops/skills/inventory/scripts/test_reader_findings.pyexits 0 -
scripts/run-test-file.sh plugins/harness-ops/skills/inventory/scripts/test_inventory_under_parser.pyexits 0 -
git diff --name-only origin/main...HEAD -- .changes/harness-ops/lists one new fragment -
ci-statusis green on the PR head
Activity
github-actions commentedon Oct 25, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
Understood: the parser reader's flow check in harness-ops reports
literalfor reads that engine-implicit lookups (@@iterator,constructor/@@species,@@isConcatSpreadable, prototype getters) can change. The issue asks that these be trusted so the sink check runs and the reads come outpartial. It also asks for four pinned probe tests, an update to_parsed_written_elsewhere, and a change fragment. The approach and done-when checks are explicit, so nothing is missing. I found no likely duplicates among the open issues.Automated triage, applied by the lanes App.