Repository navigation
P5 O3-F and O3-G: spike findings - #289
Conversation
…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)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| while (events.length - e0 < n && now() < deadline) await delay(50); | ||
| const heard = now(); |
There was a problem hiding this comment.
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)
…air, O3-E's watch tree; two tracker rows Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…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)
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 blob67da2f63aat master1d1d71937; parent P5, Decision Log 101). Both ran on one throwaway devcloud VM (GCEe2-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.txtVerdict: not broken on 2.1.283. A rewind to a message from before the resume behaves like one inside a launch:
rewindFilesrestores the earlier process's checkpoint;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:
boundary.rewindfrom 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 refusedunseen_later_turnwhen the rewind discarded several turns. If the anchor landed, the engine answerstarget_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: makelastPromptoptional.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 isp5-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 inspikes/linux-repo-watch/.On Linux, Node 24.21.0's
fs.watch(root, { recursive: true })is a synchronous JavaScript walk:Measured on the image (
max_user_watches64,104,max_user_instances128):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.max_user_instances: the call watched nothing, and never said so.ignoreoption fixes the count and the memory, but not the stalls (35 to 40 s for the same burst).Recommendation for O3-E: ignore rules, applied by a directory-level watch tree MAWS owns. It:
.git/objectsand.git/lfs, keeping every ancestor of a path the watcher classifies;git statusfor a root when a watch call fails;IN_Q_OVERFLOW). macOS keeps FSEvents. Leavedevenv/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)