Skip to content

P5 O3-F and O3-G: spike findings - #289

Merged
SSFSKIM merged 3 commits into
masterfrom
p5-o3-spikes
Oct 28, 2026
Merged

SSFSKIM merged 3 commits into
masterfrom
p5-o3-spikes

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Findings only, never a merge. These are O3-F and O3-G of O3's composite spec (docs/doperpowers/plans/2026-10-28-p5-o3-spine.md, document blob 67da2f63a at master 1d1d71937; parent P5, Decision Log 101). Both ran on one throwaway devcloud VM (GCE e2-custom-4-8192, Ubuntu 24.04, kernel 7.0), which has since been deleted. Nothing ran on the MacBook.

O3-F: native rewind across --resume (RL §12.3, U6's half)

spikes/protocol-probe/findings-p5-o3-rewind-resume.txt

Verdict: not broken on 2.1.283. A rewind to a message from before the resume behaves like one inside a launch:

  • the engine cuts the target and what follows, and appends its rewind anchor at once;
  • the next turn, and every turn after a further release and resume, carries the kept prefix exactly once;
  • rewindFiles restores the earlier process's checkpoint;
  • MAWS's live events and its disk follower hide the rewound turns across the launch boundary.

No block appeared twice in 136 request bodies across nine arms. The control (a target after the resume) behaves the same. The truncation spike's duplication came from re-minted record uuids beside unchanged API message ids; a rewind re-mints nothing. The stub mints unique ids per run, since a stub that reused them would fabricate that duplication.

Residuals, neither about the launch boundary:

  • A, owner O3-D. A SIGKILL within the anchor's flush window loses the rewind:

    • at 0 ms the anchor never reached disk, and the resume gave the model the rewound turn back;
    • at 200 ms and 1 s it held;
    • MAWS's event log, which derives boundary.rewind from the answer, still hides the turn.

    Proposed fix: after a launch that did not end through end_session, if its last act was a successful rewind with no later prompt, re-send that rewind on the resume, with its original target and its original last-seen cursor. A last seen equal to the target would be refused unseen_later_turn when the rewind discarded several turns. If the anchor landed, the engine answers target_not_found, a no-op; if it was lost, the rewind repairs it. The kill arms measured only a target that was the newest prompt, so the multi-turn case is inferred from source.

  • B, owner O3-C, or a tracker fix now (lane A has it today). A "Load now" rewind, in a resumed process that has taken no prompt, writes its anchor without lastPrompt. LastPromptAnchorSchema (src/shared/wire/transcript.ts:19) requires the field, so the resume chooser's preview (recentTurnsOf) shows the rewound turn as the latest until the next prompt. The chain follower is right. The fix is one line: make lastPrompt optional.

  • Tracker row. currentChain (used only by the replay sources) ignores rewound anchors between a rewind and the next prompt.

Fixtures are under spikes/protocol-probe/fixtures/p5/. Scenario: scenarios/pass3/p5-o3-rewind-resume.mjs. The MAWS-side replay is p5-o3-rewind-resume-maws.ts (the normaliser per launch, the reducer, ChainFollower, recentTurnsOf). Tests: p5-o3-rewind-resume.test.mjs, 15 pass.

O3-G: the recursive repository watch on Linux

research/org/p5-o3-linux-repo-watch.md; scripts and raw results in spikes/linux-repo-watch/.

On Linux, Node 24.21.0's fs.watch(root, { recursive: true }) is a synchronous JavaScript walk:

  • it puts a watch on every file as well as every directory;
  • each event rescans the whole directory, and each removal scans every watched path;
  • errors during the walk are swallowed.

Measured on the image (max_user_watches 64,104, max_user_instances 128):

  • MAWS with node_modules: 52,174 watches (81% of the per-user budget) and 171 MiB of RSS. 2,000 files created in one directory held the event loop for 33 s.
  • Linux kernel tree: exhausted the budget silently. No throw and no error at start; the later half of the tree was never reported. In the part that was watched, a new file was announced once and then went silent.
  • At max_user_instances: the call watched nothing, and never said so.
  • Node's ignore option fixes the count and the memory, but not the stalls (35 to 40 s for the same burst).
  • A directory-only watch tree: 1,081 to 6,359 watches, 1 to 14 MiB, bursts of 2,000 files fully heard within 0.37 s with the loop held at most 0.18 s, and a failure that throws at the directory where it happens.

Recommendation for O3-E: ignore rules, applied by a directory-level watch tree MAWS owns. It:

  • skips what git ignores, and .git/objects and .git/lfs, keeping every ancestor of a path the watcher classifies;
  • walks asynchronously;
  • polls git status for a root when a watch call fails;
  • re-walks and runs a status on a slow timer and after bursts, since Node cannot report an inotify queue overflow (libuv drops IN_Q_OVERFLOW). macOS keeps FSEvents. Leave devenv/setup.sh's limit alone: it is not what bounds the costs.

Adjacent finding: the engine host's store watcher (src/engine-host/fs/watcher.ts:137) makes the same recursive call over ~/.claude/projects. In a synthetic 5,000-transcript directory that costs 20 ms per transcript append, against 0.4 ms for the tree.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…283 (nine arms on the stub API, fixtures, MAWS-side replay); residuals: a crash in the anchor's flush window (O3-D), the Load now anchor's missing lastPrompt in LastPromptAnchorSchema (O3-C)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…s recursive fs.watch watches every file, stalls the loop quadratically and fails silently at inotify exhaustion; recommend git-ignore rules on a directory-level watch tree, polling at exhaustion)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T13:03:09.994014Z f9a6461 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9a646172e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +231 to +232
while (events.length - e0 < n && now() < deadline) await delay(50);
const heard = now();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count distinct filenames before declaring a burst fully heard

For directory-tree creation bursts, a single file produces both rename and change notifications—the recorded directory-tree runs contain 400 events for 200 files and 4,000 for 2,000 files. Comparing the total notification count with n therefore does not establish that every file was reported: duplicate notifications can conceal missing files or end the wait before the remaining files are heard. This undermines the experiment's allHeardMs measurement and no-loss conclusions. Track distinct expected filenames within the burst directory, and explicitly report incomplete coverage when the deadline expires rather than returning it as an all-heard time.

Useful? React with 👍 / 👎.

… cursor; Node drops inotify overflow, so the tree reconciles on a timer; prune only objects and lfs; exhaustion announces a new file once; burst completion by distinct files, directory-tree runs re-recorded)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit e949d75 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…air, O3-E's watch tree; two tracker rows

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…nchor (#292); master's unit suite red from #289 until it; the currentChain row takes the index summary

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…ixtures #289, CI #288 and #290; wire minor stays 5)

replay-fixtures.test.ts: master's p4/p5 listing, which already reads O2's Stop-hook probe
journals under fixtures/p5; its comment names both P5 sets. Master's wire is still 4, and
the regenerated manifest is unchanged.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant