Skip to content

v1.93.2.0 GSTA-240 follow-up: native cookie cleanup waits for Edge to exit, plus three flaky-test repairs - #3805

Merged
capy-ai[bot] merged 8 commits into
mainfrom
capy/gsta240-followup
Nov 2, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
capy/gsta240-followup

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3805,
  "head": "c713fbb4f0ecae73985ea7cddab929723abed647",
  "version": "1.92.35.0",
  "base": "main",
  "gate": {
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    },
    "focused": {
      "pass": 534,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "099d1f219a1b9ef5d24d4a2883d23bc4b86a0ee2",
  "product_patch_id": "89925a888bbc9cc40f1d41a08d93ea7c188408da",
  "gstack_version": "1.92.32.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 42,
    "rules": "150435b0a543019a",
    "base": "4f5b043b3ea02f4fa9887c0122452856c045bb82",
    "registry": "4f5b043b3ea02f4fa9887c0122452856c045bb82",
    "gate_scan": {
      "tagged": 0,
      "head": "c713fbb4f0ecae73985ea7cddab929723abed647"
    },
    "reasons": [
      "gate-class",
      "runtime=42<=50"
    ]
  },
  "pregate": "requires-remote cleared @099d1f219a1b (1 checks, current for c713fbb4f0ec)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41327647805",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41327647805",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41327647738",
    "pregate.json/remote_gate: remote-gate tree=099d1f219a1b tests=6927"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, BROWSER.md, README.md, AGENTS.md, CONTRIBUTING.md, CLAUDE.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "fix_checks": 1
  }
}

What changed

Windows drops the Job's process count to zero while terminated Edge is still exiting; on the old code the two tests that model that failed, and they pass once cleanup waits on each process handle

On the old cleanup code, the two tests that model Windows dropping a Job's process count to zero while terminated Edge is still exiting both failed; with this change they pass.

Before/after as text: Windows drops the Job's process count to zero while terminated Edge is still exiting; on the old code the two tests that model that failed, and they pass once cleanup waits on each process handle
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+(pass) production Windows Job Object API contract > a member the Job no longer counts stays active until its process handle signals exit
+(pass) owned native-cookie lifecycle > cleanup waits for a member that is still exiting after the Job count reads zero
+ 45 pass
+ 0 fail
-(fail) production Windows Job Object API contract > a member the Job no longer counts stays active until its process handle signals exit
-(fail) owned native-cookie lifecycle > cleanup waits for a member that is still exiting after the Job count reads zero
- 43 pass
- 2 fail
 

Why

The 2026-11-01 flaky pass (#3804) left four repairs that needed a decision or a file another PR owned. GStack Minder picked them (3a, 2a, 4a, plus the coverage-audit and docsync items) and asked for them as one follow-up off main after #3697 merged. The main one is native cookie import on Windows: the supervisor trusted the Job's process counter, Windows drops that counter while terminated Edge processes still hold the profile's files, so cleanup returned early and the next profile reset hit a sharing violation (afterAll EPERM in 3 of 3 loaded baseline runs). No threshold, trial count, case kind or retry changed.

Blast radius

Product code is three files in browse/src/cookie-import-native*.ts, Windows-only paths. The supervisor now opens a handle to each process it sees in the import's Job and treats it as active until that handle signals exit; the cleanup budget goes from 5 s to 20 s, and the parent's kill timer is that budget plus 2 s. An idle import still returns as soon as its processes are gone (2 to 57 ms observed). .gstack/pregate.json changes the local runner string to bun test --timeout=30000 {files}, which re-records pregate trust once per machine. Everything else is tests, test helpers, two fixtures and the changelog fragment. The remote gate ran 6,927 tests with 0 failures on tree 099d1f219a1b, and PR CI is green at c713fbb.

Approvals

No approvals recorded for branch capy/gsta240-followup. Scope is GStack Minder's 1a/2a/3a/4a decisions and its later do-it (drop 1a, revert two loosenings), under the daily flaky pass's exemption from the plan step.

Summary

  • Native cookie cleanup waits for Edge to actually exit (browse/src/cookie-import-native-job.ts, -worker.ts, cookie-import-native.ts). Failing-first on Linux: with only the new constant on the old source, the two new tests fail; with the fix, every test in the file passes (image above).
  • Local pregate uses the 30 s per-test timeout that CI and the remote pregate already use (.gstack/pregate.json, docs/pregate.md).
  • The full ship-receipt write case gets 15 s (test/gstack-ship-receipt.test.ts); it makes about 62 git calls.
  • The plan-eng coverage-audit detector credits wc -c byte counts over in-cwd files the way it already credits wc -l, with a fixture from the train gate red.
  • The docsync contract names the missing documentation_section so the next paid red says which field was absent; its fixture is registered in test/helpers/free-fixtures-data.ts.

Dropped on GStack Minder's call and left Open in the flaky ledger: the autoplan-guard-pty model change (1a; its Sonnet panel failed trial 1 on ordering and trial 2 lost its machine), the coverage-audit grep | head credit, and the third-party-actions Aside-absence discount.

Review notes

Two review rounds (specialist and red team, then specialist, red team, native adversarial and an outside voice on openai/gpt-6.1-sol), plus one fix-check GStack Minder granted on the final hunks, which found nothing. The outside voice's two Medium items were about the two detector loosenings; both were resolved by reverting those loosenings. Open, not blocking:

  • A process created after the supervisor's last Job snapshot and before TerminateJobObject is never given a handle, so cleanup can still miss it. Closing that needs Job completion-port tracking; deferred.
  • Under 4 CPU burners on Windows runners, cleanup still sometimes reports native_cleanup_failed past 20 s (6 fails and 10 fails over 3 reps, against 15 fails on the old code). Those are now named failures, not afterAll EPERM (0 of 6 runs, against 3 of 3).
  • The pregate runner string is part of the trust grant, so each machine records trust again on its first run.

Exploratory QA

Not applicable: no user-facing surface beyond a Windows cleanup path covered by the tests above.

Design Review

No frontend files changed — design review skipped.

Eval Results

No skill prompt changed. The paid selector lists every gate case because test/helpers/free-fixtures-data.ts is in the paid runner's import closure; the change only registers one fixture. The local PR paid lane aborted at its preflight (no claude on PATH) and spent nothing; the train's full gate covers these cases.

Plan Completion

No plan file bound to this branch. GStack Minder's decisions: 2a, 3a, 4a done; 1a dropped by GStack Minder.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed.

Scope: base 4f5b043, head c713fbb, branch capy/gsta240-followup, mode edit. Audited the 15 committed files; there was no staged, unstaged or untracked content. The change is the Windows native cookie-import cleanup wait, the pregate runner timeout, test and helper fixes, and a changelog fragment.

Documentation health:

  • docs/pregate.md: current (the runner row already shows bun test --timeout=30000 {files})
  • BROWSER.md: current (file tree matches; no files added, removed or renamed)
  • docs/ship-policy.md: current (base_red select is unrelated)
  • changelog.d/capy-gsta240-followup.md: reviewed, left untouched
  • AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md: reviewed, no contradictions

Coverage debt and diagram drift: none. There is no new public surface, and no diagram entities changed.

Test plan

  • bun run typecheck: pass
  • focused lane, 9 files (bun test --timeout=30000, launch-file GSTACK_* unset): 534 pass, 0 fail
  • remote pregate on Ubicloud, tree 099d1f219a1b: 6,927 tests, 0 failed ($0.05)
  • Free Tests (macOS named regressions and CSO launcher) and Windows Free Tests at c713fbb: green
  • loaded Windows runs (4 CPU burners): old code, fix run 1, fix run 2

Open in Capy

… 30 s local pregate lane, receipt write timeout (GSTA-240 follow-up)

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

trunk-io Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 6 commits November 1, 2026 16:16
…en Aside absence, register docsync fixture (GSTA-240 follow-up)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…scounted only beside gstack's own browser (review pass 1)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ings (review round 2), parent kill timer gets 2 s over the cleanup budget

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

# Conflicts:
#	docs/pregate.md
@capy-ai capy-ai Bot changed the title fix(flaky): native cookie cleanup waits for exit, Sonnet guard actor, 30 s local pregate lane (GSTA-240 follow-up) GSTA-240 follow-up: native cookie cleanup waits for Edge to exit, plus three flaky-test repairs Nov 1, 2026
@capy-ai
capy-ai Bot marked this pull request as ready for review November 1, 2026 16:58
@github-actions github-actions Bot changed the title GSTA-240 follow-up: native cookie cleanup waits for Edge to exit, plus three flaky-test repairs v1.93.2.0 GSTA-240 follow-up: native cookie cleanup waits for Edge to exit, plus three flaky-test repairs Nov 2, 2026
@capy-ai
capy-ai Bot merged commit 28d0fa8 into main Nov 2, 2026
45 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