Skip to content

fix(harness-ops): trust the engine's implicit lookups in the parser reader's flow check #9961

Closed

Description

@kyle-sexton

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):

  1. Engine-implicit lookups are not trusted. Flow.value returns on a spread into an array or call without trusting @@iterator (plugins/harness-ops/skills/inventory/scripts/js/parser_helper.cjs:497-500). Flow.member trusts only the called method's name (parser_helper.cjs:568-586), not constructor/@@species for slice, map, filter, concat, flat and flatMap, nor @@isConcatSpreadable for concat. Probes, each with an importer of the exported pY, read literal under the parser:
    • var c=[...pY]; beside a module running Array.prototype[Symbol.iterator]=function*(){yield "B"};
    • var c=pY.map(function(e){return e}); beside a module defining Array[Symbol.species] with a getter that pushes B
  2. Reads that the writes op deems safe never reach the sink check. A value-only member read (var z=pY.zz) with a getter on Array.prototype.zz that pushes B reads literal.

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 @@iterator and next.
  • slice, map, filter, concat, flat and flatMap also trust constructor and @@species. concat also trusts @@isConcatSpreadable.
  • A value-only member read trusts its key name, so _sink_hit runs 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 --install exits 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.py exits 0
  • scripts/run-test-file.sh plugins/harness-ops/skills/inventory/scripts/test_inventory_under_parser.py exits 0
  • git diff --name-only origin/main...HEAD -- .changes/harness-ops/ lists one new fragment
  • ci-status is green on the PR head

Activity

  1. ghost added
    needs-triage
    on Oct 25, 2026
  2. github-actions commented on Oct 25, 2026

    @github-actions
    Contributor

    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 literal for 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 out partial. 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.

  3. ghost removed
    needs-triage
    on Oct 25, 2026
  4. ghost added theissue type on Oct 25, 2026
  5. ghost added
    status: ready
    on Oct 25, 2026
  6. ghost added
    agent-ready
    on Oct 25, 2026
  7. ghost closed this as completedin #10057on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions