Skip to content

[v0.17 PERF-Q] Replace broad store reads with selective lookups #1661

Description

@TheGreenCedar

Package PERF-Q in the v0.17.0 consolidated remediation program.

Contract

Deliver W6.2 and W6.3 without changing packet/search semantics:

  • add raw selective edge access for route metadata, preserving every edge field,
    uncertainty value, and deterministic row order;
  • keep the three production get_edges() consumers that genuinely require the
    complete workspace graph (index_freshness, affected-state loading, and
    report-source export) on the broad accessor;
  • replace only the route-handler broad scan used by node-details/affected route
    metadata, including canonical/OpenAPI variants;
  • restrict indexed-symbol name lookup to the bounded candidate IDs before the
    existing final stable sort;
  • decorate-sort-undecorate retrieval candidates and packet citations so path
    resolution and citation rank are computed once while equal/NaN ordering stays
    unchanged;
  • batch child-existence checks after symbol sort/dedupe/truncation.

The existing get_edges_for_node_id[s] accessor is not a valid substitute for
the new raw route accessor: it applies trail policy that can clear uncertain or
common-call resolution, confidence, and certainty.

Dependencies and order

ANNO-A / #1697 precedes this layer. PERF-Q precedes ANNO-B / #1698 so the
storage_impl/mod.rs order remains:

ANNO-A → PERF-Q → ANNO-B → SRC-C → STORE

EV-5 / #1701 must land before the accepted PERF-Q candidate because it owns the
schema-v2 verdict counters and the retrieval/orchestrator hotspots touched here.
EV-5's live calibration is currently pending, so PERF-Q must record an explicit
same-publication schema-v2 before/after report; a normal non-live
packet_search_eval pass alone is not the zero-movement proof.

Program boundaries

  • The implementation PR uses a codex/* branch, targets the ANNO-A branch as a
    native upper layer, and carries Closes #1661.
  • Keep source, package, protected-host, installed-runtime, and publication proof
    distinct.
  • Preserve atomic publication, pinned readers, crash recovery, freshness,
    fail-closed evidence, observational status/doctor, accelerated embedding,
    proof-owned cleanup, and serial Cargo execution.
  • Do not touch product version surfaces, schema.rs, packet_search_eval.rs, or
    its checked-in baseline.
  • Do not replace a genuinely global graph read with a selective query.

Done when

  • Raw selective route results are field-for-field and order-for-order identical
    to filtering the broad edge result, including uncertain resolved calls.
  • Query-plan/progress proof shows indexed route access and materially fewer VM
    steps on the representative high-edge fixture.
  • Batched child presence matches the old per-node behavior with one statement
    per SQLite bind-limit chunk.
  • Candidate/citation sort keys are evaluated once and preserve stable equal-score
    and NaN ordering.
  • Node-details and affected route metadata remain exact.
  • packet_search_eval.rs and its baseline are byte-identical, and the
    same-publication schema-v2 before/after report records zero verdict/count/cause
    movement.

Refs #1179

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p2Important follow-up for next release wavetype:refactorBehavior-preserving code reduction and refactoring work

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions