Skip to content

O16 gate and reap: monotonic silence with same-connection heal, no signal without a confirmed live lease, acknowledged renewals (D70) - #449

Merged
SSFSKIM merged 11 commits into
masterfrom
o16-gate-reap
Nov 2, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

This branch contains #448's head (o16-veto-mcp, 6996d57), merged in at bbf3133. #448's descendant-veto entry keeps D69 in the O16 plan, and this branch's entry is D70, right after it.

A post-landing fix to O16's gate and reap, from the architect's rulings, recorded as D70 in docs/doperpowers/plans/2026-10-31-p5-o16-holder.md. It lands before O12 M4a builds sminos's observer for this gate. There is no wire change: no frame and no field added.

The three defects, as fixed

  1. Observer health never healed on the same connection.
    • Silence is now judged on a monotonic clock: Gate's default now is performance.now(), and it is the silence's only reader. A sleep is not a silence.
    • A later hb on the same unbroken connection heals the row. The stale heartbeat reports the silence before it heals, so an arm in flight is cancelled, and healing re-arms nothing.
    • A closed connection is healed only by a reconnect's hello.
  2. No confirmed lease before the reap's signals.
    • A confirmed live lease means: the latest arm for the fence was answered by its own armed on the observer's present connection, and the larger of the wall-clock and monotonic elapsed times since that arm's send is below LEASE_MS - LEASE_MARGIN_MS.
    • The step's end_session requires one. So does an idle reap's SIGTERM, through mayTerm.
    • When the SIGTERM is due without a confirmed lease, the reap re-arms and sends the SIGTERM at that arm's armed. Otherwise it sends none and disarms, and the reap goes idle with the row's clock restarted.
    • The SIGTERM's last read, on every idle reap whether fenced or not, is the host's own turn state: turnUnderWay in budget.ts, which isIdleRow now calls too. A turn under way also withholds the SIGTERM.
    • A withheld SIGTERM journals reap {phase: 'term_withheld'}. The stop reason stays idle until the next Stop, and no unknown work is set.
    • A budget reap's later ladder rungs remain a forced release by design.
  3. Renewals while signalled went unacknowledged.
    • Renewals now await armed, as the first arm does.
    • armed names only the fence, so the gate pairs each one with the oldest unanswered arm of that fence on the same connection. Each arm has an id, and GateChannel.acknowledged(id) reads the pairing.
    • An answer counts only while its connection is still the observer's. A fence's pending arms are dropped when it is disarmed.

Docs

  • §E's settlement sentence is replaced: receipts are settled at the first admitted model request for a gate process, and a legacy process keeps today's handoff settlement.
  • §E's Rules gain the renewal acknowledgement, the pairing and the SIGTERM's gate.
  • §F gains the withheld transition and lists the journal's reap phases.
  • Two of M5's bullets now point at D70.

Fixture

spikes/protocol-probe/fixtures/p5/p5-o16-gate.jsonl:

  • heartbeat-loss now heals by an hb on the same connection, with no second hello.
  • New cases:
    • turn-armed-proceed and turn-proceed-armed: an arm met by a turn, with the late armed in either order.
    • sigterm-confirmed
    • sigterm-withheld
    • sigterm-rearmed: the older arm's answer confirms nothing.
  • The header gains endSessionGraceMs.

Tests

Regression tests failed first and run on fake timers over the real gate socket at production timings:

  • a sleep (a wall-clock jump) is not silence;
  • a 20 s loop stall makes the row unhealthy, then heals on the next hb with the fence still disarmed;
  • the lease reads expired on a forward wall jump and on a backward wall step;
  • the SIGTERM is withheld when the renewal is unanswered, and sent when it is answered;
  • the earlier arm's answer does not confirm the re-arm;
  • a turn admitted while the lease had lapsed withholds the SIGTERM, with or without a fence;
  • a dispose during the wait withholds at once;
  • the process table's own wiring withholds an idle reap's SIGTERM.

Gates

All on tree b7552ae44 (head 4c34181), with 0 flaky: lines in each:

  • Class 1a (static, unit, probes on the pool, macOS lane): run 41475717816, green.
    • The earlier run 41474154159 failed only on master's TestASignalAfterTheReapIsRefused, a race in the Go session host's test. This branch touches no native/ file.
  • --gates all --class1a pool --runner macos: run 41477297736, green, 55 jobs.

After the merge of #448's head: class 1a on tree a11ddea50 (head bbf3133): run 41498674129, green, 0 flaky: lines. --gates all is left to the landing gate on the final merge tree.

Review: doperpowers:reviewer-high on 2423754..4c34181 returned "correct", with no material findings.

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

…with ${CLAUDE_PLUGIN_ROOT} expanded (2.1.283, 2.1.316); servers are claude's direct children spawned within a second of it, an exec keeps pid and start; a killed server stays connected and is not respawned; the bridge child names the session id

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…v route stays where it matches; the rest are bound by count once mcp_status names no stdio server pending, when the unbound non-wrapper children are exactly the connected servers not yet bound, each started within 60 s of claude (a killed server stays connected, so nothing later fills its place). The bindings are kept per launch in the state file and restored at adoption, so a bare command or an exec'd launcher no longer holds its session for life; a background Bash still counts

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… names it (interim). A direct child of claude, never a Bash wrapper, whose argv has a sminos or sminos.py word first or second, then bridge --session S with S one of the row's engine session ids; bound by pid and start at first match, one at a time, persisted with the server bindings, and superseded by any hello that names a pid

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ct, the probe's four findings, p4-r8-owner.jsonl's curated reading corrected, the identity rule as built with its spawn window, the interim bridge rule until O12 M4, the alternatives rejected, the respawn window's cost deferred, caffeinate kept as work from source); §F points to it

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…tatus types it (optional), and the reused-pid case builds a tree rather than writing into a read-only one

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…s whose bridge never says hello (no observer, an older sminos, or a process O12 M4 records as legacy), superseded by hello.childPid where the bridge does; nothing retires it (the architect's ruling); comments and D69 say so

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…'s first turn (restored by an adopter's fold), so a teammate or a turn's hook never fills a dead server's slot; the bridge's script must be the plugin's own (its root from system/init, its layout before that); an answer's ask is keyed by the tree it was counted on and cleared when that tree could not be read

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…nic clock and healed by a later hb on the same connection; no end_session or idle SIGTERM without a confirmed live lease (the latest arm answered by its own armed on the observer's present connection, both clocks inside the lease less its margin), the SIGTERM re-armed for or withheld (term_withheld), and withheld too while the host's own status shows a turn (turnUnderWay, shared with isIdleRow); renewals awaited, armed paired to arms by fence and order on the connection; the gate fixture gains the heal, both orders of an arm met by a turn, and the SIGTERM under the lease; §E's settlement and Rules amended

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…turn's own lstart second (it may have started after the turn); the bridge's layout fallback holds only until the engine has reported its plugins, and an init without sminos leaves no bridge by argv

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… own (toFake was readonly)

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

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 ⚠️ Failed 2026-11-02T18:09:42.615838Z
We couldn’t complete this review. Comment @codex review to try again.
4c34181 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…descendant-veto entry keeps D69, this branch's gate and reap entry becomes D70 (the plan's conflict resolved, every reference of this branch renumbered; #448's D69 references untouched)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM SSFSKIM changed the title O16 gate and reap: monotonic silence with same-connection heal, no signal without a confirmed live lease, acknowledged renewals (D69) O16 gate and reap: monotonic silence with same-connection heal, no signal without a confirmed live lease, acknowledged renewals (D70) Nov 2, 2026
@SSFSKIM
SSFSKIM merged commit 6271908 into master Nov 2, 2026
SSFSKIM added a commit that referenced this pull request Nov 2, 2026
…merge 6271908); Decision Log 205 (D69 and D70 as built, the joint race proof, the hold on the owner's machines lifted, O17 after the sitting)

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