Skip to content

fix(windows): preserve process identity probes across clock changes - #190236

Merged
roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-184162
Nov 1, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-184162

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #184162, thanks @SunnyShu0925.

Human credit in replacement commit d31ec002facd: Co-authored-by: SunnyShu <0668000539@local>. The native squash policy removed this local-domain address from the landed commit; the original human attribution is retained here and in the replacement commit.

What Problem This Solves

Windows process identity probes can expire early or run beyond their timeout when the system clock changes during Gateway lifecycle checks.

User Impact

Windows operators retain the requested process-verification time budget across clock corrections. No configuration, identity format, or migration changes.

Why This Change Was Made

Use the existing performance.now() convention for the shared native/PowerShell/WMIC deadline and round remaining subprocess budgets up to integer milliseconds. This is a maintainer-owned reimplementation; the contributor branch was read through GitHub and was never checked out or executed.

Production LOC: +3/-3 (net 0). Regression tests: +23, with a dedicated 23-line allocation protecting both clock-jump directions and fractional subprocess timeouts. Simplification retained only the three owner expressions and one parameterized regression.

Evidence

  • Base: 29526f13194aa8b214a40879b477215f16effad4. Both new cases fail before the fix: a backward jump grants WMIC 21,000 ms within a 1,000 ms request; a forward jump returns no identity before probing.
  • After the fix: 139 tests pass across seven focused owner/consumer files; one Windows-only native case is skipped on Linux. The changed file alone completed in 0.664 seconds (1.87 seconds runner wall time); all focused shards completed in 45.08 seconds. Exact-head broad CI passed in 468 seconds.
  • Targeted typecheck, oxlint, oxfmt, and git diff --check pass. Broad validation is delegated to PR CI.
  • Independent Codex autoreview of the complete local candidate against the above base: scoped-clean, no actionable P0–P2 findings. Review snapshot matches head d31ec002facd84d7de5eb6c169bc63fae0a67932. Hosted ClawSweeper review also reports no findings. No findings remain.
  • This Linux proof exercises the production identity owner with controlled clocks and fixed external-I/O fixtures; it does not claim a live Windows Gateway stop or upgrade test. Contributor code was not run anywhere.

Co-authored-by: SunnyShu <0668000539@local>
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 1, 2026 10:25
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Credited replacement for #184162. Focused red-before/green-after clock regression, consumer proof, and local P0–P2 autoreview are complete; evidence is in the PR body.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR measures Windows process-identity probe deadlines with a monotonic clock and rounds subprocess timeouts to integer milliseconds.

Example: A 1,000 ms identity probe encounters two backward wall-clock steps of 10 seconds while native lookup and PowerShell fail.

  • Before: The WMIC fallback can receive a 21,000 ms timeout.
  • After: With 625.5 ms of monotonic time elapsed, WMIC receives a 375 ms timeout.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal, useful repair with applicable shipped-CLI evidence, focused regressions, and no actionable findings; required CI is still pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The credited PR supplies Windows Node 24 Scheduled Task Gateway installation and shipped CLI stop output under injected forward clock skew, with paired pre-fix failure, post-fix termination, and unstepped controls; its production-reader blob matches this PR exactly, so that proof remains applicable alongside the replacement's reported red-before/green-after regressions.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Windows process verification can return unknown prematurely or block beyond its requested budget when the wall clock changes.
Reason: The maintainer-authored direction restores an existing timeout contract with three expression changes and no new settings or persisted state.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused correction to a current Windows timeout defect, with no actionable patch findings; CI remains pending.

Priority: P2
Reviewed head: d31ec002facd84d7de5eb6c169bc63fae0a67932

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway lifecycle and file-lock checks pass a PID and timeout to the shared Windows identity reader, which queries native identity or PowerShell and WMIC and returns a creation timestamp or null.

flowchart TD
 A[Gateway lifecycle checks] --> C[Windows identity reader]
 B[File lock checks] --> C
 C --> D[Native process identity]
 C --> E[PowerShell fallback]
 E --> F[WMIC fallback]
 D --> G[Creation timestamp or null]
 E --> G
 F --> G
Loading

Technical review

Best possible solution:

Land the focused monotonic-clock correction in the existing Windows identity reader once required CI passes.

Do we have a high-confidence way to reproduce the issue?

Current source establishes the clock-domain mismatch, and the credited PR supplies paired Windows CLI failure and recovery traces; this review executed no target code.

Is this the best way to solve the issue?

Changing all three elapsed-time expressions together and rounding subprocess budgets is the smallest complete repair, preserving existing ownership, fallbacks, and timestamp semantics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f83363193ffb.

Provenance checked

  • Shared Windows deadline and WMIC fallback keeps the original intent (97bc908: Unify Windows identity reads and preserve both fallback attempts within one caller deadline.)
  • Native initialization charged to the deadline keeps the original intent (baa836b: Avoid unnecessary startup subprocesses while retaining bounded shell fallback and sealed-helper independence.)
  • Consolidated identity regression suite keeps the original intent (7b95dbd: Remove duplicated test layers while retaining owner-boundary checks.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +23, Other +1. Total +24 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 23 0 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 27 3 +24

Root-cause cluster

Relationship: canonical
Canonical: #190236
Summary: This maintainer-owned replacement carries the same production repair as the credited contributor PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Clock corrections can suppress or prolong Windows process-verification fallback probes, with limited platform-specific impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Clock corrections can suppress or prolong Windows process-verification fallback probes, with limited platform-specific impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 1, 2026, 5:30 AM ET / 10:30 UTC.

@roboclaw-bot
roboclaw-bot merged commit f7d6774 into main Nov 1, 2026
231 of 232 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-184162 branch November 1, 2026 10:35
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant