Skip to content

P5 O3-E: the execution document (git, scm and files in mawsd) - #375

Merged
SSFSKIM merged 8 commits into
masterfrom
p5-o3-e-plan
Oct 30, 2026
Merged

SSFSKIM merged 8 commits into
masterfrom
p5-o3-e-plan

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

O3-E's standalone execution document, docs/doperpowers/plans/2026-10-30-p5-o3-e-checkout.md, per doperpowers:execspec's "A child of a composite spec": it cites docs/doperpowers/plans/2026-10-28-p5-o3-spine.md (child O3-E, parent pin blob a64a1c549 at master 39e9acf47). Document only; nothing is built.

The split judgement (D2): no cut. The retag and the move are one invalid-intermediate pair on the daemon shape (main's router binds machine as host, so a retagged git.* with no server in mawsd breaks between them); the Linux watch tree is a module with injected fs whose different verification (a devcloud VM run) is a milestone boundary inside one spec; the composite binds the Linux watch into O3-E's acceptance.

Milestones. M1 the watch tree (src/shared/fs/watch-tree.ts, shared by the repository watcher and the engine host's store watcher; VM-verified over O3-G's repositories); M2 the wire and the move (the retag, MACHINE_EVENTS + 3, files.readResolved for library.read over main's own route, the checkouts composed inside startSpine, per-client watches over the front, the reconnect replay with per-unit ClientRefs, budgets summed per command with a bounded admission for queued scm mutations); M3 files.upload (O7's C8; lane A's directory layout and safety rules with lane B's own file grammar, bounds in the schema, under the ledger); M4 scenes and landing (B's branch card per D22, cross-build, --gates all, the measured series on the mini on the architect's go, reviewer-high).

Reviews (R1 to R6 in the Decision Log). Round 1: an independent spec review (19 findings, 1 P1) and doperpowers:adversarial-reviewer on the execution section (8, 2 P1). Round 2: 13 (3 P2) and 5 (1 P1). Rounds 3 to 6, the adversarial reviewer narrowed to the changed sections: 3, 2, 3, then 1 P2 and one editorial, the last round changing two sentences and no mechanism; converged. Every finding adopted.

Shared files with in-flight branches: src/shared/ipc/wire.ts and wire-manifest.json (both wire branches); src/services/spine-root.ts and its test (fix/api-error-items); possibly e2e/cross-build.spec.ts's INPUTS and vitest.config.ts. O3-E touches no file under src/engine-host/fs/ but watcher.ts.

Gates: static on the pool, green on 4b5eb34 (41135981039), 9f040dc (41137237699) and c6b7c56; the final head's run in the report.

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

…ilestones, the split judgement, the Linux watch tree, the upload, the measured and VM plans

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
….read's adapter, per-command budgets, a status on every slow reconcile, the completion-aware replay with files invalidated, the upload's schema bounds and lane B's file grammar, the store prune corrected)

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

chatgpt-codex-connector Bot commented Oct 30, 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-30T21:51:44.889834Z 434b2be 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: 434b2be8e9

ℹ️ 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".

stop(): void;
}

Entries are keyed by the page's `ClientRef` id and dropped at its `onGone`; an `unwatch` drops its entry at once. A replay sends `git.watch {directory}` through `hosts.dispatch('machine', …, client)` with the page's ref, tagged with the replay's generation; when a sent watch answers and its entry is gone (an `unwatch` arrived while it was in flight), main sends `git.unwatch {directory}` for it, since the daemon's `unwatch` before the hold existed was a no-op (`src/services/git/watcher.ts`, `unwatch`); an answer of an older generation is ignored. A watch the page sends during a replay is forwarded as any command and is not doubled, since the watcher counts per (owner, directory). For files the replay emits, per distinct live `(appSessionId, path)`, `files.changed {appSessionId, path, kind: 'invalidated'}` through main's `emit`, and the renderer's files store re-lists and re-installs its watch (`src/renderer/src/tools/code/files/store.ts`); main keeps no files entry for the daemon beyond that set. `startDaemonSpine` composes it beside the mirror, feeds both from its one `forwarded` hook, and calls `replay()` from the same `onStreaming('machine')` the mirror uses. A replayed watch that fails (the directory gone) is logged and its entry dropped. The O6 link's watches for another machine's session are not replayed here (O7's, with the link's reconnect).

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 Explicitly deduplicate watches forwarded during replay

If a page sends git.watch for a directory whose replay is still in flight, forwarding both calls does double the hold: GitWatcher.adopt() in src/services/git/watcher.ts increments both the root count and the existing (owner, directory) entry's count on every call; it is ref-counted, not idempotent. For example, an unwatch followed by a remount while replay is pending can leave a replacement entry present when the replay completes, bypassing the proposed compensation and retaining an extra hold after the replacement unmounts. That keeps filesystem watches and periodic status reads alive until the page disconnects. Specify explicit coalescing or entry-identity-aware compensation rather than relying on the watcher's key to prevent duplicates.

Useful? React with 👍 / 👎.

export type WatchFn = (path: string, options: { recursive: boolean; prune?: WatchTreeOptions['prune'] }, listener: WatchListener) => WatchHandle;
export function recursiveWatch(platform: NodeJS.Platform = process.platform): WatchFn;

`watchTree` places the root's watch synchronously (so a caller's `ENOENT` at the root throws from the call, as `fs.watch` does) and walks the rest asynchronously. A directory first seen after the walk (its parent's `rename` event, or a reconcile) is held until `prune` answers, then watched and reported once as an event naming the directory itself (its relative path), so the caller's classifier runs a status or a rescan over what was written there before the watch. Every slow reconcile and every burst settle ends in one event with `filename` null. Every error but the root's `ENOENT` reaches `on('error')`; an exhaustion code (`ENOSPC`, `EMFILE`) closes the tree first. `close()` closes every watch, cancels the timers and emits nothing more. Both watchers' `WatchFn` types (`src/services/git/watcher.ts`, `src/engine-host/fs/watcher.ts`) are satisfied by `recursiveWatch()`; the git watcher passes its prune per call.

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 Rescan newly watched store directories beyond their own names

On Linux, if an engine creates jobs/<id>/state.json or tasks/<list>/1.json before the asynchronous tree installs that new directory's watch, the prescribed directory-only notification does not recover the missed write. classifyStoreEvent() in src/engine-host/fs/watcher.ts returns null for both a bare job directory and a bare task-list directory; only their child-file paths trigger updates. Consequently, a newly created job or a previously queried task list can remain stale until the 120-second reconciliation, and the service's existing 30-second timer only reconciles sidecars. Emit discovered child-file notifications or a root rescan when adopting a populated directory, and cover these store-specific cases rather than assuming every directory name causes a rescan.

Useful? React with 👍 / 👎.


#### H. Budgets (`src/services/command-budgets.ts`)

Derived per command from its own waits, as the table's existing entries are, each pinned: `scm.commit`: `COMMIT_TIMEOUT_MS + GIT_TIMEOUT_MS + MARGIN_MS` (the hooks' 60 s, the reads after, the margin: 80 s); every other `git.*` and `scm.*` of §C, `git.lsFiles` included: `GIT_TIMEOUT_MS + MARGIN_MS` (20 s; `scm.push` and `scm.pr.create` answer at their run's start after reads bounded alike, and `scm.pr.state`'s `gh` reads are bounded by the runner's collect timeout, which the executor reads and adds if it exceeds `GIT_TIMEOUT_MS`); `files.upload`: `GIT_TIMEOUT_MS + MARGIN_MS` (the exclude's git read, as `laneA.media` budgets it). The other `files.*` keep the default 10 s.

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 Budget the complete command path rather than one Git invocation

For a slow repository, the specified 20-second budget can expire even though every constituent Git call succeeds within its 10-second limit. For example, GitService.status() in src/services/git/service.ts sequentially awaits rev-parse, the parallel status/stash phase, and the remote-URL read; three successful eight-second phases already exceed this budget. SCM mutations additionally perform pre- and post-mutation status reads, and scm.commit also reads the resulting commit, so its 80-second formula likewise does not cover the stated waits. Moving these handlers from main onto the daemon host introduces this outer deadline, causing legitimate operations to report timeout while the daemon continues, including mutations that can then be retried. Derive budgets from the complete sequential call paths and test those paths with delayed reads, not just a delayed commit subprocess.

Useful? React with 👍 / 👎.

…mand's chain with a bounded admission for queued mutations, the replay's desired-against-installed accounting, a late directory's listing reported entry by entry, the inner-facts re-stat on reconcile, the store's open-time exhaustion, nested checkouts pruned, main's own ClientRef)

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

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…both scm queues with the token consumed once admitted; the replay's counter transitions for unwatches and held sends)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…page's git.watch and git.unwatch on the daemon shape and serializes sends per page and directory; the mixed-units proof corrected)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ntRef: an unwatch, a timeout and a page's end release through the daemon's owner release; a detach requeues)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…by its connection, not its code; an in-flight unit's unwatch answered by its send); the review converged

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit a64687e into master Oct 30, 2026
SSFSKIM added a commit that referenced this pull request Oct 30, 2026
…ntal search text (#374); O3 Decision Log 20: O3-E's document landed (#375), executing

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