Skip to content

fix(herdr): detect socket replacement after inode reuse - #4745

Open
Yeachan-Heo wants to merge 5 commits into
devfrom
fix/herdr-socket-reassert-repair
Open

fix(herdr): detect socket replacement after inode reuse#4745
Yeachan-Heo wants to merge 5 commits into
devfrom
fix/herdr-socket-reassert-repair

Conversation

@Yeachan-Heo

@Yeachan-Heo Yeachan-Heo commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • retains fix(herdr): re-report pane agent state when the Herdr server is replaced #4744’s server-replacement re-assertion and fixes the Linux inode-reuse hole
  • watches the real Unix socket, treats matching directory rename events as replacement evidence, and rejects symlink paths
  • preserves the setup-race repair and adds a deterministic injected same-identity-plus-rename regression without changing product behavior

Verification

  • bun test packages/coding-agent/test/herdr-pane.test.ts — 52 passed
  • bun --cwd=packages/coding-agent run check — passed
  • bun run build:native — passed
  • bun --cwd=packages/coding-agent run build — passed
  • bun run ci:test:install-methods — passed
  • bun scripts/ci-gjc-state-gates.ts — passed
  • bun test scripts/ci-virtual-integration.test.ts — passed
  • affected-path plan validated for the three touched paths
  • exact base: 21ed9bdea02ca6da712091b5d593374b5507ab70
  • exact head: 217062b3de87fffbd6a7a1e35cb2bc445eb33fca
  • exact base...head binary diff digest: de3f0428e6017752e99099325a8bc01118fa20db6c64b53c53064a0cc0b7b853

Risk classification

  • regression-risk

The prior approval is stale by construction after this current-dev rebase; the verdict remains blocked until an independent exact-head approval is reaffirmed.

gajae.pr-review-verdict.v1 merge-blocked sha256:de3f0428e6017752e99099325a8bc01118fa20db6c64b53c53064a0cc0b7b853 reviewer:human reviewer-id:probepark evidence:exact-head-217062b3-current-dev-replacement-awaiting-independent-reaffirmation

@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.

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Supersession evidence: this is the sole canonical successor to #4744. It contains the external contributor’s original 5704de400914d16ab8fd541a24c01af46997e170 implementation plus repair b0f0f0e0c77c2b474197cae68a3f7b4cacbfc234; comparison against #4744 current head 9e68a134 is +52/-26 in the two Herdr files. Credit for the original re-assert feature remains with @nahyeongjin1 / #4744.

Current-head evidence: bun test packages/coding-agent/test/herdr-pane.test.ts passed 20 fresh processes (50 tests each); bun --cwd=packages/coding-agent run check passed. The canonical exact-head verdict names independent requested reviewer @probepark.

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Independent maintainer review at exact head b0f0f0e0merge blocked.

the identity mechanism is the right one

Detection uses lstatSync socket identity ${dev}:${ino}, with a matching directory rename event to cover inode reuse. That is a real identity rather than a pathname/mtime/existence comparison, which is the usual mistake here. Good starting point.

major 1 — two windows remain, and the connection is not bound to the checked identity

utils/herdr-pane.ts:647-670. The initial idle report is sent before the watcher is installed, and watchSocketReplacement snapshots identity before registering fs.watch. So a handoff that happens after the old server accepts the initial report but before watcher registration is missed entirely — the new socket silently becomes the baseline and never gets a re-report. That is the exact bug this PR exists to fix, surviving in its own setup path.

Second window: identity is checked with lstat, then a separately spawned herdr CLI process connects by pathname. Nothing carries the verified identity into that connection, so a swap in between is undetected.

Install the watch first and compare identities before and after registration, and bind the connection to the checked identity (or authenticate at the connection level).

major 2 — every error collapses to undefined

:396-427. All lstat errors and all non-socket objects return undefined. ENOENT, EACCES/EPERM, ENOTDIR/ELOOP, symlink or regular-file replacement, and transient absence are then indistinguishable — same retries, same eventual silent stop. An existing but unreachable stale socket also reads as healthy identity.

This is the error-distinction collapse that has been a blocking finding on several PRs in this repo. Use a discriminated result: retry only ENOENT, preserve diagnostics for permission and other errors, and fail closed when the replacement is not a socket.

trust boundary — worth stating explicitly

On detection the code spawns fresh CLI processes using the pathname from HERDR_SOCKET_PATH, and production never verifies the owner or mode of dirname(HERDR_SOCKET_PATH). Any principal with write+execute on that directory can unlink and rebind the name, and then receives the automatic state/title reassertion. The test directory is mkdtemp-private, but that says nothing about the production path. Validate a user-private directory, or authenticate the connection.

major 3 — the real-socket test does not pin the fix

test/herdr-pane.test.ts:902-950 replaces a real Unix socket while the reporter is live and exercises the production watcher, which is genuinely good integration coverage. But it never asserts that (dev, ino) was reused — when the filesystem hands out a different inode, the pre-head implementation passes too. And spawn is mocked, so it does not prove connection to the new server either.

Add an injected watcher/identity test with identical dev:ino snapshots plus a rename event, and keep the real handoff as integration coverage.

nit

:408 introduces ReturnType<typeof setTimeout>. The repo contract forbids ReturnType<>; write the concrete timer type.

coverage

Fake-watcher tests pin callback behavior properly: current-state re-report, sequence increase, title resend, disposer behavior, no-watch behavior, environment propagation.

Uncovered: replacement during watcher setup, a swap between identity check and CLI connect, ENOENT versus EACCES, invalid or symlink replacement, and an existing stale/unreachable socket. The first two are majors 1 and the third is major 2.

Reviewed by @probepark — method: detached worktree at b0f0f0e0, ordering analysis of initial report versus watcher registration and of identity snapshot versus fs.watch, error-classification sweep of the identity helper, trust analysis of the socket directory and the spawned CLI connection, per-test discrimination including inode-reuse dependence. Tests not executed.

gajae.pr-review-verdict.v1 merge-blocked sha256:08e24ac547ec33ad2bbfa20c43a7078e2ae5ec6277579d6d8e2cdfe7af49ed02 reviewer:human reviewer-id:probepark evidence:exact-head-b0f0f0e0-replacement-during-watcher-setup-is-missed-and-connection-is-not-bound-to-checked-identity

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from b0f0f0e to fe13b52 Compare August 20, 2026 05:06
@Yeachan-Heo
Yeachan-Heo requested a review from probepark August 20, 2026 05:10
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Claim: project-all-open-pr-rebase-20260820 — I am rebasing #4745 onto current upstream-yeachan/dev d97b79eff2be5f25bf3ae253de72430e2e2fab1b, resolving the exact-head probepark blockers, and will force-with-lease this branch. Do not push this PR branch concurrently.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from fe13b52 to 12911ba Compare August 20, 2026 06:09
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Rebase lane completed on exact head 12911ba4e587c464cb124557d5d5f5c50032131a, containing base d97b79eff2be5f25bf3ae253de72430e2e2fab1b. Force-with-lease used the required old remote head fe13b52653987e05dbf6253b8e04e1602da92037.

Exact diff digest: 00999c11ecbd9257a9f7d0d3c78209a4de7e770d1237041b62746a618758a728. The sole PR-body verdict is now needs-human for independent requested reviewer @probepark and validates locally against the exact base/head.

Current-head validation: bun test packages/coding-agent/test/herdr-pane.test.ts ×20 fresh processes (51/51 each), bun --cwd=packages/coding-agent run check passed. Dev CI run 32338444480 is exact-head; every executed product gate passed. Its only failure is the intentional PR contract bootstrap rejection of needs-human; virtual integration was consequently cancelled. No merge performed.

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review at exact head 12911ba4approved. Both behavioral majors are fixed.

the setup windows are closed

herdr-pane.ts:715-721 now calls watch(...) before report("idle"), and :467-509 takes beforeWatch and afterWatch identities around fs.watch registration, scheduling a reassert when the path changed or was temporarily absent between them.

That closes both halves of my first finding: a handoff during watcher installation is no longer missed, and a swap after installation is caught by the directory rename watcher so the pathname-spawned CLI connection is followed by a reassert to the replacement server.

errors are discriminated

:396-409 now returns { kind: "socket" | "absent" | "invalid" } with code === "ENOENT" ? { kind: "absent" } : { kind: "invalid", ... }. Only absent retries (:447-452); permission errors, symlinks and non-sockets are rejected and logged. ENOENT, EACCES and a symlink replacement are now three different outcomes instead of one silent undefined.

the trust boundary got tightened beyond what I asked

:412-428 additionally requires the socket directory to be owned, non-symlink, and not group- or world-writable. I raised the directory-ownership concern as context rather than a required change, so this is more than the finding asked for and it is the right call.

nit fixed

:432 uses NodeJS.Timeout | undefined rather than ReturnType<typeof setTimeout>.

minor — the inode-reuse test still does not pin inode reuse

test/herdr-pane.test.ts:916-963, named "detects ... even when Linux reuses its inode", never captures or compares (dev, ino). When the filesystem hands out a fresh inode the old implementation passes too.

Not blocking, because I checked the implementation rather than trusting the test: :479-487 sets replacementPending = true on a matching rename, and :457-461 reasserts even when current.value === seen. The same-inode branch is correct — it is just unproven. A deterministic same-identity plus rename-event test would close that.

Reviewed by @probepark — method: detached worktree at 12911ba4, ordering check of watcher installation against the initial report and of the identity snapshots around fs.watch, read of the discriminated identity result and its retry policy, directory-permission validation, and inspection of the same-inode path to decide whether the unpinned branch is actually correct. Tests not executed.

gajae.pr-review-verdict.v1 merge-approved sha256:00999c11ecbd9257a9f7d0d3c78209a4de7e770d1237041b62746a618758a728 reviewer:human reviewer-id:probepark evidence:exact-head-12911ba4-watcher-precedes-report-identity-snapshotted-both-sides-and-errors-discriminated

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from 12911ba to 0638e8b Compare August 20, 2026 07:08
@Yeachan-Heo
Yeachan-Heo requested a review from probepark August 20, 2026 07:09
@probepark

Copy link
Copy Markdown
Collaborator

Merging. My approval at 0638e8be (06:36:02Z) was never reflected in the verdict line — it still read needs-human with an otherwise fresh digest, so the contract gate kept blocking on my own stale line. Corrected it, and Validate exact-head PR contract re-ran on the resulting event at 12:11:26Z and passed.

PR contract bootstrap still shows its 07:09:47Z failure because that job does not re-run on pull_request: edited — same behavior I hit on #4617. The authoritative exact-head gate is green and mergeStateStatus is UNSTABLE rather than BLOCKED, so it is not a required check.

The minor from my review stands as a follow-up, not a blocker: the inode-reuse case is verified correct in the implementation but not pinned by a test.

@probepark

Copy link
Copy Markdown
Collaborator

Correction to the comment above: the merge did not go through. mergeStateStatus is DIRTY — this now conflicts with dev.

dev moved four times in the last hour (#4617, #4642, #4750, #4732), which is what put it behind. Rebase and it should go straight in: the verdict line is corrected, Validate exact-head PR contract passes, and 15 checks are green.

The approval stands at 0638e8be; if the rebase is content-neutral I will reaffirm against the new digest without re-deriving findings.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from 0638e8b to f7a5375 Compare August 21, 2026 17:46
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Fix-forward is pushed to the existing PR head without opening a duplicate PR.

Exact evidence:

  • base: 0ada2f4
  • head: f7a5375
  • binary diff digest: 7aad7d6f08927fc798b615bfea4eadde93a17820abe92ca9837aedd94251b87e

The three attributed semantic commits are preserved via cherry-pick provenance, the current-dev checks are green, and the deterministic injected same-identity-plus-rename regression is included. The previous approval was intentionally invalidated by the new head; please reaffirm the implementation at this exact head with an APPROVED review.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from f7a5375 to 217062b Compare August 21, 2026 17:49
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

The PR is now rebased onto the current dev base so exact-head CI can validate the replacement cleanly.

Current exact evidence:

  • base: 21ed9bd
  • head: 217062b
  • binary diff digest: de3f0428e6017752e99099325a8bc01118fa20db6c64b53c53064a0cc0b7b853

The focused Herdr test, coding-agent check, native build, package build, install-method smoke, state gates, virtual integration validation, and affected-path plan all passed against this head. Please reaffirm the prior review with an APPROVED review targeting this exact commit.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

The PR body now carries exactly one regression-risk classification, matching the required independent-review path. The exact base/head/digest remain unchanged, and the blocked verdict stays bound to the current head until probepark reaffirms approval.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Bounded blocker: all implementation and current-head verification evidence is green, but terminal integration cannot proceed until the required independent maintainer approval is recorded against exact head 217062b3de87fffbd6a7a1e35cb2bc445eb33fca.

Current bound evidence:

  • base: 21ed9bdea02ca6da712091b5d593374b5507ab70
  • head: 217062b3de87fffbd6a7a1e35cb2bc445eb33fca
  • diff digest: de3f0428e6017752e99099325a8bc01118fa20db6c64b53c53064a0cc0b7b853
  • exact-head PR contract: red only because the body is intentionally merge-blocked and the authenticated approval still targets the superseded 0638e8be head
  • review request for probepark is active; no exact-head reaffirmation has arrived yet

No duplicate PR was opened and PR #4745 remains open under active maintainer ownership.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch 2 times, most recently from acfe8e0 to ee34d01 Compare August 22, 2026 04:54
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Replacement head is pushed to the existing PR branch; no duplicate PR.

Exact evidence:

  • base: acb94f146968a5320f1140be300012f918b7c825 (current dev tip; dev advanced past the prior base fd700948 during verification, so the head was rebased — content-neutral for the herdr files, same 3-file diff +415/-3)
  • head: ee34d0179c8a6483c947dad9e43de11074166dd5
  • binary diff digest: f9ca0f564b6938088da9df92266b527c745c99d0d8fb5c00afb05ed3537cf0ec
  • force-with-lease used required old remote head acfe8e02935a21cff022f6e5e59a7f5e556be88f (which itself replaced 217062b3de87fffbd6a7a1e35cb2bc445eb33fca under lease)

What changed vs the last-reviewed implementation: nothing in the herdr files. The four attributed commits are the same implementation probepark approved at 12911ba4 and re-reviewed through the 217062b3d cycle; this cycle adds only the current-dev rebase.

New adversarial verification performed at the identical product diff (pre-rebase head, byte-identical herdr hunks):

  • socket-lifecycle architect: CLEAR/APPROVE, 0 major (setup-race close re-verified; Bun FSWatcher.unref PRESENT)
  • platform-security architect: CLEAR/APPROVE, 0 major (trust gate confirmed load-bearing against local spawn amplification; macOS//tmp and Windows no-op paths confirmed graceful; live A-F repro matches predictions, G diverged in the safe direction — dir replacement still detected within the ~3s armed retry)
  • empirical inode/race suite on ext4: immediate inode reuse 199/199 (100%) — the hole is real; real-watcher same-inode replacement re-asserted +181ms with raised seq and title re-send; 3.4s absent-window recovered on late bind; 100-cycle storm bounded to 5 reports, 0 noise triggers; 8/8 reporter installs during live 4ms child-process churn observed >=1 re-assert; every report spawns a fresh herdr CLI (5/5 distinct PIDs)
  • observation scenarios 1-7 green incl. claimed release (release-agent + clear-title, marker deleted, idempotent, zero post-release spawns) and child-process postmerge continuity (child seq above parent max)

All attributable gates green locally (focused suite x4, package check, native build, package build, install-methods, state gates, virtual integration, state-writers gate, affected plan). The prior approval is intentionally invalidated by the new head; @probepark please reaffirm with an APPROVED review against this exact head ee34d0179c8a6483c947dad9e43de11074166dd5.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Bounded blocker: all implementation and current-head verification evidence is green; terminal integration cannot proceed until the required independent exact-head approval is recorded.

Current bound evidence:

  • base: acb94f146968a5320f1140be300012f918b7c825 (dev tip at push)
  • head: ee34d0179c8a6483c947dad9e43de11074166dd5
  • diff digest: f9ca0f564b6938088da9df92266b527c745c99d0d8fb5c00afb05ed3537cf0ec
  • exact-head CI on ee34d01: herdr-pane shard, install-methods, ts-build coding-agent, affected plan (+ changelog-history-guard), native-build, darwin-arm64 tab-worker smoke, gjc-state-gates (static/runtime/integrity/read + aggregate), Local public surfaces, Virtual integration — all green; the only red checks are the two contract jobs, which are intentionally red on the pre-approval needs-human verdict line
  • adversarial verification at the identical product diff: socket-lifecycle CLEAR/APPROVE (0 major), platform-security CLEAR/APPROVE (0 major), empirical inode/race suite (ext4 100% immediate reuse rate; real-watcher same-inode re-assert +181ms; absent-window recovery; bounded storm; 8/8 installs under live churn; fresh CLI process per report), observation scenarios 1-7 green, red-team suite green (hostile env, seq monotonicity, ownership, injection, e2e)
  • review request for @probepark is active on this head; no exact-head review has arrived yet

If dev advances before the approval lands, the head will be rebased onto the new tip, the digest regenerated, and reaffirmation re-requested — the prior commitment was that a content-neutral rebase is reaffirmed without re-deriving findings.

No duplicate PR will be opened.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

nahyeongjin1 and others added 5 commits August 22, 2026 06:06
A Herdr server restart or `herdr update --handoff` replaces the server
under live panes and starts with an empty agent registry. The reporter
deduplicates against the last state it sent, so a session sitting at its
prompt never reports again and stays invisible in Herdr's sidebar until
it happens to change state — for an idle session, that means until the
user types into it.

Watch the pane's API socket and re-assert on replacement. Replacement is
unlink-then-bind on the same path, so the socket's inode is the signal,
and the watch is on the containing directory because the socket itself
is recreated. The event usually arrives while the path has no inode at
all, so an event schedules a bounded re-check instead of deciding at
once. The last reported title is re-sent with the state, since the
replaced server's metadata store is empty too and nothing else would
ever resend it.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 741dce2324ef7d47fce4707e5a69a435ea13fc03)
Linux can reuse a Unix socket inode during an immediate handoff.
Treating inode equality as continuity made the reporter miss the replacement.

Confidence: high
Scope-risk: narrow
Reversibility: revert
Tested: bun test packages/coding-agent/test/herdr-pane.test.ts x20; bun --cwd=packages/coding-agent run check
(cherry picked from commit bd516bd8efeca59efecf79749c8ad2bd2ef23c47)
Install and verify the socket watcher before the initial report.
Classify socket identity failures and accept only a user-private socket directory.

Confidence: high
Scope-risk: narrow
Reversibility: revert
Tested: bun test packages/coding-agent/test/herdr-pane.test.ts x20; bun --cwd=packages/coding-agent run check
(cherry picked from commit cac7ef4f3ec9b9d5effea92f4f5cd92382cf8521)
The real socket handoff test cannot force Linux to reuse an inode. An injected watcher now pins the rename evidence path deterministically without changing product behavior.

Confidence: high
Scope-risk: narrow
Reversibility: revert
Tested: bun test packages/coding-agent/test/herdr-pane.test.ts
Replacement detection treated the directory rename event as the only
evidence when Linux recycles the socket inode: if that single event is
not delivered — fresh watchers are not guaranteed to observe events
raised in their registration window, and a witness watcher in testing
received events the product watcher never saw — the re-assert is lost
with no trace, because the settled inode number compares equal.

The socket identity now carries the inode's ctime, so a rebound path is
a different identity even when its inode number was recycled, and one
deferred identity re-check after registration closes the window without
needing the event at all. An unchanged identity makes the re-check a
no-op, so installs that observe nothing pay one lstat.

Verified with a per-trial child-process racer whose replacements are
confirmed on the reporter's own lstat before judging: 50/50 confirmed
replacements re-asserted at randomized 0-3ms post-install offsets.

Lore-id: 4745-activation-window
Constraint: must not fire on unchanged identity (no spurious reports)
Rejected: relying on rename events alone | single lost event = silent miss
Rejected: connect-probing the socket | cannot distinguish reused inodes either
Confidence: high
Scope-risk: narrow
Reversibility: revert
Tested: bun test packages/coding-agent/test/herdr-pane.test.ts (53)
Tested: bun artifacts/pr4745/ground-truth-race.ts (50/50 confirmed, 0 misses)
Not-tested: macOS FSEvents delivery in the registration window
Supersedes: none
@Yeachan-Heo
Yeachan-Heo force-pushed the fix/herdr-socket-reassert-repair branch from ee34d01 to 0cf6687 Compare August 22, 2026 06:07
@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

Second replacement head pushed (fix-forward; still the existing PR, no duplicate).

Exact evidence:

  • base: 6b3a437ab (current dev tip)
  • head: 0cf66874933da474bb3d47df33bd78d623968da2
  • binary diff digest: 177060ee0877a3fe5dd5b0826ee5141e019db97e83e3991dc56c04bf06f954d2
  • force-with-lease used required old remote head ee34d0179c8a6483c947dad9e43de11074166dd5

What changed since ee34d0179: exactly one commit, fix(herdr): survive a lost socket watch event (+59/-1 across the two herdr files). The four previously attributed commits are unchanged.

Why: continued adversarial verification traced a real fragility in the recycled-inode path. When Linux rebinds the socket path to a recycled inode number, the directory rename event is the only replacement evidence — and event delivery to a freshly registered watcher is not guaranteed (a witness watcher registered earlier received events the product watcher never did in repeated instrumented trials). One lost event = silent miss with identical settled identity. The fix makes the identity carry the inode's ctime (a recycled number is a new inode with a new ctime) and schedules one deferred identity re-check after registration; an unchanged identity no-ops it, so a quiet install pays one lstat and zero extra reports.

Validation of the new head: focused suite 53/53 fresh processes (includes a new regression pinning an immediate post-install replacement); a ground-truth race harness — per-trial child-process racer, every replacement confirmed on the reporter's own lstat before the trial is judged — re-asserted 50/50 and 20/20 confirmed replacements at randomized 0-3ms post-install offsets with 0 misses; package check green. A worker-thread racing harness that initially suggested misses was itself disqualified: it produced physically impossible observations (a socket resurrecting with identical inode AND ctime after a confirmed unlink+rebind), and the disk-confirmed child harness shows no miss in the same window.

@probepark the delta from your last-reviewed implementation is the single commit above (identity gains :${ctimeMs}, one schedule() after the afterWatch comparison, the regression test). Please reaffirm with an APPROVED review against exact head 0cf66874933da474bb3d47df33bd78d623968da2.

Signed-off-by: gaebal-gajae (clawdbot) 🦞

@Yeachan-Heo

Copy link
Copy Markdown
Owner Author

@chatgpt-codex-connector — requesting an adversarial code review of exact head 0cf66874933da474bb3d47df33bd78d623968da2 (base 6b3a437ab2072af0a87b3ddbf0389dce75a67120). This PR carries regression-risk (touches live socket-replacement detection), so an independent machine review is being requested in addition to the pending human exact-head review.

Review scope, in priority order:

  1. packages/coding-agent/src/utils/herdr-pane.tswatchSocketReplacement(): identity now dev:ino:ctimeMs; trust gate on the socket directory; settle/retry state machine; the deferred post-registration re-check; teardown.
  2. The adversarial question that matters: is there any remaining sequence of filesystem events under which a Herdr server replacement is silently missed (no re-assert) or spuriously amplified (re-assert storm)? ext4 recycles socket inode numbers ~100% on this class of box, so identity-without-ctime is insufficient and ctime is now load-bearing.
  3. reassert() correctness: dedup-memo clear, seq watermark monotonicity, title re-send, released guard.
  4. Test sufficiency in packages/coding-agent/test/herdr-pane.test.ts (53 tests incl. the lost-event regression).

Context for reviewers: commit fix(herdr): survive a lost socket watch event is the only delta from the implementation probepark previously approved; ground-truth validation is 50/50 + 20/20 disk-confirmed replacements re-asserted at randomized 0-3ms post-install offsets (harness: artifacts/pr4745/ground-truth-race.ts in the owner worktree).


[repo owner's gaebal-gajae (clawdbot) 🦞]

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 0cf6687493

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

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.

3 participants