Skip to content

Reuse verified sources in staged replan reads - #8304

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/replan-read-reuse-20261107
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/replan-read-reuse-20261107

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Problem context

A captured replan view verifies the original decision before exposing review, acceptance, or writeback. The legacy Turn path then recomputes the same complete hash while building several reader commands. Large Goals also pay for allocating code-point arrays while hashing outcomes.

Change

Reuse the source hash only within the read that verified it. Build the action projection's reader commands once. Share the existing Unicode code-point comparator and index an identical captured outcome object once per projection. Distinct objects keep their own validation and hashing, including different revisions of the same outcome.

Validation

  • In the synthetic populated fixture (1.06 MB), the median TypeScript writeback projection was 57.1 → 3.3 ms. Median real CLI writeback was 151.2 → 96.1 ms across five paired samples. Timings were recorded before the latest main integration on base 8225c89ceaea. All eight staged File/SQLite, populated, and unbound review results matched byte for byte, with equal RPC payload sizes, including replay on the final head. These measurements cover local reads and projection time. Model adoption and task-level costs are unmeasured.
  • Real File and SQLite fixtures cover the original review → writeback identity. The captured-source reader rejects replacement entries and recovers the original. An independent Unicode oracle passes against the original digest and fails under a deliberate JS default-sort mutation.
  • Final source suite 164 passed, 4 failed on 046c5aceef69bf5f562b6ed874e7753a352a47cc. The same four preflight cases fail at the same --decision-output-root assertion on the exact base dee54966327e09406b3f7b17d155b03cd633b234. TypeScript 102 passed, isolated wheel 7 passed, and the installed TypeScript source matched the commit byte for byte. Type checking and Ruff passed. Standard local premerge ran 5 direct and 16 selected checks with zero blocking failures.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify

mergify Bot commented Nov 7, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant