Skip to content

v1.93.28.0 fix(flaky): cso-snapshot-state resumes a paused contender only once it has stopped (GSTA-199) - #3716

Merged
capy-ai[bot] merged 5 commits into
mainfrom
capy/gsta199-cso-sigcont
Nov 3, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
capy/gsta199-cso-sigcont

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3716,
  "head": "746e3ab046fc54823dedf9fcb05166ba0fae9e67",
  "version": "1.91.378.0",
  "base": "main",
  "gate": {
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    },
    "cso-snapshot": {
      "pass": 88,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "a4834df5417c3ad8d950ee5684101a074574c1cf",
  "product_patch_id": "none",
  "gstack_version": "1.93.22.0",
  "review_depth": {
    "depth": "light",
    "class": "tests",
    "runtime_lines": 0,
    "rules": "b2272efd321ce7cb",
    "base": "f1cbdbb48313957613bafb2d05346afc876fed89",
    "registry": "f1cbdbb48313957613bafb2d05346afc876fed89",
    "gate_scan": {
      "tagged": 0,
      "head": "746e3ab046fc54823dedf9fcb05166ba0fae9e67"
    },
    "reasons": [
      "runtime=0"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @a4834df5417c (1 checks, current for 746e3ab046fc)",
  "requires_remote": [
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41541707970/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a4834df5417c tests=207"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, docs/ (base 3bfe5667..a9fbd09c plus the unstaged changelog.d fragment)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 2,
    "fixed": 3,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "est_input_tokens": 18151,
    "dispatches": {
      "specialist-batched": 2,
      "red-team": 2,
      "fix-check": 1
    }
  }
}

What changed

With a 200 ms delay injected between a contender's pause marker and its SIGSTOP, main loses the wakeup in all five paused-contender tests; this branch passes all five

With a 200 ms delay injected between a contender's pause marker and its SIGSTOP, main loses the wakeup in all five paused-contender tests. This branch passes all five.

Before/after as text: With a 200 ms delay injected between a contender's pause marker and its SIGSTOP, main loses the wakeup in all five paused-contender tests; this branch passes all five
--- Before · sig-before.txt · captured output
+++ After · sig-after.txt · captured output
+(pass) equal ticket decisions use token order and a late withdrawal cannot revoke the active winner
+(pass) a paused candidate is fenced so a progressing ticket wins within the bound
+(pass) a paused earlier ticket bounds later contenders without withdrawing the winner
+(pass) a paused loser cleanup leaves only an ineligible decision and cannot block the winner
+(pass) a paused later contender cannot turn a cached lower ticket into an all-loser outcome
+ 5 pass
+ 0 fail
-(fail) equal ticket decisions use token order and a late withdrawal cannot revoke the active winner
-(fail) a paused candidate is fenced so a progressing ticket wins within the bound
-(fail) a paused earlier ticket bounds later contenders without withdrawing the winner
-(fail) a paused loser cleanup leaves only an ineligible decision and cannot block the winner
-(fail) a paused later contender cannot turn a cached lower ticket into an all-loser outcome
- 0 pass
- 5 fail
 

Why

Free Tests went red on a correct run in test/cso-snapshot-state.test.ts, and its retry passed. Now the test resumes a paused child only after it sees the child has stopped, which closes the race behind that red.

Blast radius

This changes one test file and adds a changelog fragment. It touches no product code, timing bound or retry. resumeStopped runs only inside the five paused-contender tests, and those already return early on Windows. On Linux it reads /proc/<pid>/stat, and on macOS it reads ps -o stat= (script ran; CI passed at this head on Linux, macOS and Windows).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-02 review_loop_grant 2f078e0: one scoped fix-check after round 2 for adversarial-native#1 on PR #3716 “Fall back to option A only if the tooling refuses that exception. Paste the refusal verbatim in your report. A means: on Linux, resumeStopped reads the state field of /proc/<pid>/stat; macOS keeps ps. Then run one opus-5-5 medium fix-check on that hunk only and finish Steps 11.5…” (GStack Minder (relayed by the GSTA-199 parent)) approved review_loop_grant at stop head 2f078e0: one scoped fix-check on the /proc hunk of test/cso-snapshot-state.test.ts none

Source: gstack-approvals record for capy/gsta199-cso-sigcont (display only; not an approval citation).

Plan gate: approved with the owner reply "do it" from GStack Minder (autoplan eng-only, fix lane).

Summary

Each paused-contender child writes its pause marker and then sends itself SIGSTOP, as two separate steps. The test used to send SIGCONT as soon as it saw the marker. A SIGCONT that landed between those two steps did nothing, so the child stayed stopped until the test timed out. The new helper resumeStopped waits until the process table shows the child stopped, and only then sends SIGCONT. All 7 resume sites now use it. A child that exits, gets killed, or never stops within 2 s now fails with a named error instead of hanging. This re-ship ran at full review depth, after train build raised the required depth. Review moved the stop check from ps to /proc/<pid>/stat on Linux, kept ps on macOS, and checks for child exit before reading state.

Test Coverage

Regression proof: fails at main · passes after fix. The proof is a scratch copy of the file with a 200 ms delay injected between mark('paused-'+id) and the SIGSTOP, running the five contender tests selected by name. On origin/main 82db89a it failed 5 of 5 (0 pass). At this branch's fix heads it passed 5 of 5 (QA passes 1–3). The unmodified file passes 88 of 88.

Tests ran: typecheck count unavailable
Tests ran: cso-snapshot 88
Tests ran: remote pregate 207 (0 failed, tree a4834df5417c)

Pre-Landing Review

Pre-Landing Review: 4 issues — 3 fixed, 1 noted. All 4 came from the native adversarial pass, whose reviewer rated each one "Severity: Low, Blocks: no". #2 (a clearer exit error) and #3 (check exit before reading state) were fixed in 2f078e0. #1 (the dependency on ps) was fixed in a9fbd09 under GStack Minder's scoped fix-check grant. #4 (timing) is a note.
REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=2 fixed=3 scope=frozen fix_checks=1 dispatches=5 est_input_tokens=18151
REVIEW_DEPTH: full runtime_lines=0 rules=b2272efd321ce7cb reasons=runtime=0,floor:full codes=none
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol (certified), "I found no issues", Recommendation: approve.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL test/cso-snapshot-state.test.ts:11 The 2 s stop budget plus the next 5 s waitForPath can reach Bun's 5 s per-test timeout under CI load, so the failure reads as a plain timeout instead of the named error. Timing bounds are unchanged from base.
  • INFORMATIONAL test/cso-snapshot-state.test.ts:11 Linux branch treats only ENOENT as the child being gone; an ESRCH read during exit throws 'stop check failed' instead of looping to the exited error. Only on an already-failing path; changes the message, not the verdict.
  • WORDING changelog.d/capy-gsta199-cso-sigcont.md says main failed "3 and then 5" of the 5 tests. The 3 came from a run whose name filter selected only four of the five tests. Today's run on main 82db89a failed 5 of 5.

Exploratory QA

Pass. Three QA passes reran the file at 88/88 and the injected-delay test at 5/5. The merge base passed 0 of 5 on that same test, as the red control. QA also confirmed that removing the SIGSTOP makes resumeStopped fail with its named error.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Greptile Review

No Greptile comments.

Plan Completion

The plan (autoplan eng-only, fix lane) is complete: 4 items DONE and 1 CHANGED. The CHANGED item is the 2 s stop-check deadline from eng review.

Verification Results

VERIFY_RESULT: pass. At 746e3ab, every PR check is green: 56 pass, 0 fail, 0 pending. That includes Free Tests and Windows Smoke.

TODOS

No TODO items completed in this PR.

Documentation

Status: current — the release changes no user-facing documentation, and no authored doc needed an edit.

Audited scope: base 3bfe5667..HEAD a9fbd09c on capy/gsta199-cso-sigcont (3 commits), plus the unstaged edit to changelog.d/capy-gsta199-cso-sigcont.md. Nothing was staged and there were no untracked files. The selected files are one test (test/cso-snapshot-state.test.ts: a new resumeStopped helper that sends SIGCONT only once the child shows as stopped, via /proc/<pid>/stat on Linux and ps on macOS) and its CHANGELOG fragment. I searched every tracked and nonignored file for cso-snapshot-state, SIGCONT, paused contender, resumeStopped and GSTA-199. Outside the changed files, the only hits are tests, scripts/free-test-durations.json and one unrelated released CHANGELOG line, so no authored doc or .tmpl describes the changed behavior. gstack-banned-terms: none (the repo keeps no list).

Documentation health:

  • README.md: Current (the test-only change doesn't touch it)
  • ARCHITECTURE.md: Current (no diagram entities touched)
  • CONTRIBUTING.md: Current (test commands and tiers are unchanged)
  • CLAUDE.md / AGENTS.md: Current (no commands, paths or conventions changed)
  • docs/flaky.md, docs/TESTING_INTERNALS.md: Current (neither names this test)
  • CHANGELOG.md: Current (not modified; the parent owns the fragment)
  • TODOS.md: Current (not modified)

Coverage: this release ships no public surface (no command, flag, export, env var or skill), so it adds no coverage debt. Diagram drift: none.

Test plan

  • bun run typecheck: exit 0
  • bun test test/cso-snapshot-state.test.ts: 88 pass, 0 fail
  • Injected 200 ms delay: main 82db89a fails 5 of 5, this branch passes 5 of 5
  • Remote pregate (Ubicloud): 207 tests, 0 failed, tree a4834df5417c

🤖 Generated with Claude Code

…s shows it stopped (GSTA-199)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 2, 2026 22:30
resumeStopped checks for an exited child before reading ps and names that
exit in its error, separately from the 2 s never-stopped timeout.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The stop check no longer needs a ps binary on Linux. A missing /proc entry
(the child was already reaped) loops to the exit check instead of failing.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gstack: ok 1.93.22.0 for=ship
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot changed the title fix(flaky): cso-snapshot-state resumes a paused contender only once ps shows it stopped (GSTA-199) fix(flaky): cso-snapshot-state resumes a paused contender only once it has stopped (GSTA-199) Nov 2, 2026
@github-actions github-actions Bot changed the title fix(flaky): cso-snapshot-state resumes a paused contender only once it has stopped (GSTA-199) v1.93.28.0 fix(flaky): cso-snapshot-state resumes a paused contender only once it has stopped (GSTA-199) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 14035cc into main Nov 3, 2026
58 checks passed
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