Skip to content

Follow-ups from #107 review: touch() byte drift, shared walk epoch, sort write-back #108

Open

Description

@shuv1337

Follow-ups from the post-merge review of #107 (70c9d0109). The verdict was DEPLOY: nothing here returns wrong data. Full report on shuvdev: ~/.cache/agent-ws/executor-pr107-review-opus-r1.md.

  • M1 (new in Follow-ups to #105 and #106: walk-cache shared values, never evict a search in use #107, fix forward): packages/sdk/src/implementation/tool-search-store.ts:217-226: touch() can put back an order that was evicted or replaced while its page was being read, without counting its bytes. The 6 MB bound can drift toward about 64 MB (32 × 2 MB). Fix: touch only when orders.get(key)?.order === order. Add a model or e2e of the admit/touch interleavings (rat-stack model-a-protocol).
  • M2: the walk-cache epoch is shared by every program on the server, so stores from one program can push another correct program back over the step budget. It never costs more than before Follow-ups to #105 and #106: walk-cache shared values, never evict a search in use #107.
  • M3 (already in production): Array.prototype.sort with a comparator writes elements back without the cycle check. Programs can build cycles that later stores accept. The result boundary rejects them cleanly.
  • NITs: running mcp-search-kept-orders right before mcp-search-walk on the same worker can make the walk scenario flaky; a few doc statements are inaccurate (see the report).

Activity

  1. shuv1337 commented on Nov 20, 2026

    @shuv1337
    OwnerAuthor

    M1 is addressed by #111. N1 is not a bug: the self-host scenario lifecycle starts a fresh server per scenario, so kept-orders and walk do not share the kept-order map. N2 is a doc correction in #111. M2/M3 remain open.

  2. shuv1337 commented on Nov 20, 2026

    @shuv1337
    OwnerAuthor

    M1 fixed by #111 (merged as b51071ab): a later-page read now refreshes or forgets only the exact order it read. Three E2E race scenarios (mcp-search-kept-order-races.spec.ts) each failed on the old store and pass with the fix, and fork CI now runs them with the existing kept-orders and walk scenarios.

    The other findings:

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions