Skip to content

v1.91.228.0 fix(gstack-lease): take the lease lock with mkdir, not ln -s, so Git Bash on Windows stops waiting out 300 tries (#3330) - #3424

Merged
capy-ai[bot] merged 8 commits into
mainfrom
gsta-94-lease-mkdir-lock
Oct 26, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
gsta-94-lease-mkdir-lock

Conversation

@garrytan

@garrytan garrytan commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3424,
  "head": "75d5aac95527ed13d89f72899d56ad53a889be41",
  "version": "1.91.221.0",
  "base": "main",
  "gate": {
    "tests": {
      "ran": 30298,
      "fail": 0,
      "pass": "count unavailable",
      "skip": "count unavailable",
      "shards": "17/17 PASS",
      "source": "runner per-shard summary"
    }
  },
  "session_kind": "unattended",
  "pregate": "requires-remote cleared @c4b8c35497d0 (1 checks, current for 75d5aac95527)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40255195408/job/121355431817",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40255197632",
    "pregate.json/remote_gate: remote-gate tree=c4b8c35497d0 tests=9213"
  ],
  "issues": {
    "fixes": [
      3330
    ],
    "refs": [],
    "flakes": []
  }
}

What changed

gstack-lease touch under Git Bash's ln -s semantics: before, exit 3 after 31.5 s with no lease; after, exit 0 in 0.0 s with the lease written

Before: under Git Bash's default ln -s, the old lock is never taken, so gstack-lease touch waits out its 300 tries (31.5 s here, 499 s in the #3330 report), blames a "live process" with an empty pid, and writes no lease. After: the mkdir lock is taken on the first try and the lease is written.

Before/after as text: gstack-lease touch under Git Bash ln -s semantics: before, 31.5 s and no lease, blaming a live process with an empty pid; after, the mkdir lock is taken at once and the lease is written (#3330)
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 $ BASH_ENV=<Git Bash ln -s semantics> gstack-lease touch --pid 4242   # default 300 tries
+exit 0 after 0.0 s
+lease written: yes
-gstack-lease: the lease directory is locked by live process ; lease 4242 not renewed
-exit 3 after 31.5 s
-lease written: no
 

Why

Every gstack skill starts with gstack-skill-start, which runs gstack-lease touch before it prints anything. In Git for Windows' default mode (MSYS unset), ln -s can't link to a target that doesn't exist, and the old lock's target was the holder token, which never exists as a file. So on Windows every skill start stalled for the whole retry loop (one user measured 499 s in #3330) and still wrote no lease.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-25 Fix #3330 with an atomic mkdir lock, keeping stale-lock/TTL semantics and POSIX behaviour “fix #3330 with an atomic mkdir lock keeping stale-lock/TTL semantics and POSIX behaviour; the windows-free-tests lane is the real proof” (GStack Minder (Garry's standing crew rules)) standing approval this PR merge through a train
2026-10-25 Run gstack /ship before every READY “also we should really be using the gstack ship skill before merging PRs, can you make sure we do that?” (Garry (via GStack Minder, crew rule 22)) standing approval the /ship run and receipt on this PR none

Source: gstack-approvals record for gsta-94-lease-mkdir-lock (display only; not an approval citation).

Summary

The lock is a directory. bin/gstack-lease takes .lock/ with mkdir instead of ln -s. A taker writes a claim (.lock.claim.<pid>) before its mkdir and renames it in as .lock/owner (<pid> <start identity>) after. A lock that names a holder is broken only when that holder is dead or its pid now belongs to another process, never by age. An ownerless lock is broken only once no live claimant exists and it is at least 2 s old. Breakers serialize on .lock.break and reread before removing; a directory lock is renamed aside before removal so nobody sees it half-removed. Unlock removes only the caller's own lock.

Mixed versions stay exclusive. A symlink .lock left by an older gstack is still read and broken under the same rules, and it blocks the new lock at the same path, so an old and a new gstack never both hold it.

Failures are fast and named. If the lock can't be taken while nobody holds it, touch fails after three quick retries with gstack-lease: cannot take the lease directory lock <path> instead of waiting out every try and blaming an empty pid. A dead lock that can't be renamed aside no longer spins lock() (7bef38f). gstack-skill-start stays fail-open.

/ship review hardening (a94c167, 3f6ebca, 681e92f). Three review passes fixed, among others: the break path removing the wrong generation, claim and .gone leftovers, malformed and identity-less owner files, zero-padded pids, a future owner mtime, an exclusion race between a breaker and a new taker, and an unreadable owner treated as dead. Each fix has a test.

Docs. docs/capy-install.md describes the directory lock; the "never by age" sentence is scoped to locks that name a holder (75d5aac).

Test Coverage

All new code paths have test coverage. The coverage audit found one real defect (a dead lock that can't be renamed aside made lock() spin), fixed in 7bef38f with a test that fails against the previous bin.

  • test/gstack-lease-git-bash.test.ts (new, in the curated windows-free-tests lane) launches the bin through lib/script-invocation.ts, which is Git Bash on windows-latest: touch with the default 300 tries takes the lock without a single sleep; a host whose ln -s fails like Git Bash's still takes it (with a control proving the shim really fails); a live Git Bash holder's lock is kept and named; a dead holder's lock is broken.
  • test/gstack-lease.test.ts: dead-holder, live-holder and dead-breaker cases run against both the directory lock and the legacy symlink lock. New cases cover a running gstack-lease excluding a second taker, 16 parallel touches all landing with nothing left behind, ownerless locks with and without a live claimant, an un-renamable dead lock, and each review fix above.
  • Regression proof: each new test was run against the bin before its fix and failed; on Linux, 11 cases across both files fail against the original ln -s bin. The Windows negative control (this PR's tests with the old bin, branch gsta-94-negctl-windows) is linked in the comments.
  • Lease suites: 42 pass, 0 fail.

Tests ran: tests 30298 (17/17 shards PASS, from the runner's per-shard summary; the evidence ledger recorded tests_ran: 0 because its bun parser looks for per-test N pass lines that the quiet shard runner does not print, a gstack parser defect reported separately)

Pre-Landing Review

Four /ship review passes (specialists, Claude adversarial, Red Team, Codex adversarial and Codex structured on each). Passes 1–3 auto-fixed 5 critical and 26 informational findings (commits a94c167, 3f6ebca, 681e92f). Pass 4 converged with 0 critical and 12 informational findings, all skipped as known limits or wording: an identity-less owner or an unreadable claim can wedge until it ages out; a delayed claim publisher; GSTACK_LEASE_LOCK_TRIES overflow; ownerless-lock age truncation to whole seconds; a claim with a future mtime; network-filesystem clock skew; and two comment/test-placement nits. gstack-skill-start still prints "stayed locked by a live process" for every exit 3, including the new "cannot take the lock" case; that file belongs to PR #3432, so it is left for there.

Gate edits: none detected (10 listed, 7 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Three existing race tests moved their fault injection from ln to mkdir because the lock no longer calls ln; their assertions are unchanged. No threshold, budget, timeout, trial count, case kind or assertion was weakened.

Outside review: Codex adversarial ran on every pass. Codex structured review on pass 4 returned unverified (exit 4) and is recorded as unavailable, so it counts as missing coverage for that pass, not a pass.

Exploratory QA

CLI smoke on bin/gstack-lease (functional surface, Linux), run at a94c167 and again at 681e92f, 4 of 12 budgeted probes: touch writes the lease and leaves no lock; a dead holder's directory lock is broken and the lease renewed; a live holder keeps the lock and touch exits 3 naming it without writing; list reports the renewed lease alive. All pass (gstack-qa-evidence verdict pass). Git Bash behaviour is proven by the windows-free-tests lane, not by these probes; full exploration was not run.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Greptile Review

No Greptile comments.

Issues

Fixes #3330

Verification Results

Build (bun run build) exit 0 at 75d5aac. Full free suite on Ubicloud: 17/17 shards PASS at 3f6ebca, 681e92f and 75d5aac. Remote free-tier pregate at tree c4b8c354: 9213 tests, 0 failed, $0.04. CI at 681e92f all green, including windows-free-tests; CI at 75d5aac: Free Tests green, windows-free-tests green and cleared into the pregate receipt. Not verified: Windows-lane duration packing in scripts/free-test-durations-windows.json.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual precision fix in docs/capy-install.md; no blockers.

Scope. Base c23d7d48f, head 681e92f72 (branch gsta-94-lease-mkdir-lock), mode edit. Selected release content: CHANGELOG.md, bin/gstack-lease, docs/capy-install.md and the two lease test files (committed only; no staged, unstaged or new files). Discovery inventoried 736 doc-role files (git ls-files --cached --others --exclude-standard) and searched all of them for lease and lock contract claims. Only docs/capy-install.md and docs/troubleshooting.md (the UPGRADE_BUSY section) describe the lease; README, AGENTS.md, CLAUDE.md, CONTRIBUTING.md and docs/PROJECT_STRUCTURE.md carry no lease claims. Banned-terms check: none (no list on main). The doc claims were checked against the bin/gstack-lease diff by static read; no tests were run.

Edit. docs/capy-install.md: "The lock is broken only when its holder is dead or its pid was reused, never by age" now begins "A lock that names a holder is broken only when ...". The paragraph just before it says an ownerless lock is broken once it is at least 2 s old and an identity-less claim is abandoned after 2 minutes, so the unqualified sentence contradicted it.

Documentation health:
docs/capy-install.md Updated (lock-breaking sentence now scoped to locks that name a holder; directory-lock, claim, 300 tries or 30 s bound, exit 3 and the three known limits match bin/gstack-lease)
docs/troubleshooting.md Current (UPGRADE_BUSY section does not describe the lock mechanism; 120-minute prune and gstack-lease list claims still hold)
README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md, docs/PROJECT_STRUCTURE.md Current (no lease or lock claims; searched, not read in full)
CHANGELOG.md Current (not edited per ship-owned rules; the [Unreleased] entry matches the diff)
TODOS.md Not edited (outside ship-owned scope)

Documentation coverage debt.

  • touch failure gstack-lease: cannot take the lease directory lock <path> (exit 3 with nobody holding the lock): reference in docs/capy-install.md; no docs/troubleshooting.md entry, no how-to. Common gap.
  • GSTACK_LEASE_LOCK_TRIES (default 300, non-numeric falls back to 300) and the 30 s wait bound: bin header and CHANGELOG only; the capy-install paragraph states the bound but not the variable. Common gap.
  • Diataxis explanation for why the lock is a directory: the capy-install paragraph covers it; no standalone explanation page. Low priority.

Diagram drift. None. The changed docs hold no ASCII or Mermaid diagrams naming lease entities.

Not verified. bin/gstack-skill-start prints "stayed locked by a live process" on any exit 3, including the new "cannot take the lock" case, which can mislead; it is outside the selected diff, so it is reported as a decision, not edited. Windows-lane membership of test/gstack-lease-git-bash.test.ts and scripts/free-test-durations-windows.json were not verified.

Test plan

  • env -u GSTACK_CAPY -u GSTACK_INSTALL_VERDICT -u GSTACK_SESSION_KIND -u GSTACK_STATE_ROOT -u GSTACK_EPHEMERAL bun run test:ubicloud: 17/17 shards PASS, 30298 tests, exit 0 at 75d5aac
  • bun test test/gstack-lease.test.ts test/gstack-lease-git-bash.test.ts: 42 pass, 0 fail
  • gstack-pregate --stage tests --remote: 9213 tests, 0 failed at tree c4b8c354
  • bun run build: exit 0
  • windows-free-tests (Git Bash on windows-latest): green at 681e92f and at 75d5aac

🤖 Generated with Claude Code

garrytan and others added 2 commits October 25, 2026 23:01
…Bash on Windows stops waiting out 300 tries (#3330)

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>
@trunk-io

trunk-io Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai

capy-ai Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Windows negative control: this PR's tests with the old ln -s bin, dispatched on the scratch branch gsta-94-negctl-windows (now deleted) to windows-latest: https://github.com/garrytan/gstack/actions/runs/40242990487. All three test/gstack-lease-git-bash.test.ts cases fail there, with the exact #3330 symptom: gstack-lease: the lease directory is locked by live process ; lease 4243 not renewed, and the default-tries case runs into the 30 s test timeout. With the fix, the same lane is green at a89b866 (https://github.com/garrytan/gstack/actions/runs/40243356223).

@github-actions

Copy link
Copy Markdown
Contributor

E2E Evals: ✅ PASS

[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 112/112 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 7m07s · cost $32.02 known + 54 of 136 trial(s) cost unknown

125 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $32.02 rule/judge cost | reconcile exit: 0

Profile: pr / mode dependents; selected behaviors: 112, judges: 24. Deferred to scheduled/release coverage: 138 behaviors and 0 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Derived dependents (scripts/pr-dependencies.ts):

  • bin/gstack-lease: 250 case(s), 24 judge(s)
Rule and judge shards
Shard Automated result Manual/unscored Executed Reused Status Cost
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-store 1/1 0 1 0 ✅ $0.84
e2e-review-army/skill-e2e-review-army--review-army-json-findings 1/1 0 1 0 ✅ $0.07
e2e-deploy/skill-e2e-deploy--setup-deploy-workflow 1/1 0 1 0 ✅ $0.13
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-current 1/1 0 1 0 ✅ $1.05
e2e-hermetic/skill-e2e-hermetic-canary 2/2 0 2 0 ✅ $0.03
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-completion 1/1 0 1 0 ✅ $1.02
e2e-qa-functional/skill-e2e-qa-functional 2/2 0 2 0 ✅ $0.78
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-plan-checks 1/1 0 1 0 ✅ $0.69
e2e-qa-callers/skill-e2e-qa-callers--review-exploratory-small-cli 1/1 0 1 0 ✅ $0.8
e2e-cso/skill-e2e-cso 1/1 0 1 0 ✅ $0.39
e2e/skill-e2e-ship-skip 1/1 0 1 0 ✅ $0.22
e2e/skill-e2e-shared-libs--shared-libs-read-only 1/1 0 1 0 ✅ $0.25
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-before 1/1 0 1 0 ✅ $0.36
e2e-review-army/skill-e2e-review-army--review-army-migration-safety 1/1 0 1 0 ✅ $0.34
e2e/skill-e2e-shared-libs--shared-libs-unsupported-git 1/1 0 1 0 ✅ $0.21
e2e/skill-e2e-shared-libs--shared-libs-review-lifecycle 1/1 0 1 0 ✅ $0.84
e2e-qa-workflow/skill-e2e-qa-workflow--qa-bootstrap 1/1 0 1 0 ✅ $0.08
e2e-design/skill-e2e-design--plan-design-review-no-ui-scope 1/1 0 1 0 ✅ $0.07
e2e-deploy/skill-e2e-deploy--canary-workflow 1/1 0 1 0 ✅ $0.11
e2e/skill-e2e-investigate-owned-termination 2/2 0 2 0 ✅ $0.18
e2e/skill-e2e-investigate-owned-completion 1/1 0 1 0 ✅ $0.07
e2e-review-army/skill-e2e-review-army--review-army-delivery-audit 1/1 0 1 0 ✅ $0.14
e2e-design/skill-e2e-design--design-review-detector-shim 1/1 0 1 0 ✅ $0.17
e2e-safety-pair-agent/skill-e2e-safety-pair-agent 1/1 0 1 0 ✅ $0.1
e2e-learnings/skill-e2e-learnings 1/1 0 1 0 ✅ $0.08
e2e/skill-e2e-ship-hook-refresh 1/1 0 1 0 ✅ $0.12
e2e-deploy/skill-e2e-deploy--land-and-deploy-review-gate 1/1 0 1 0 ✅ $0.25
e2e-deploy/skill-e2e-deploy--benchmark-workflow 1/1 0 1 0 ✅ $0.2
e2e/skill-e2e-shared-libs-paths--shared-libs-review-index-flags 1/1 0 1 0 ✅ $0.95
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-stale-after 1/1 0 1 0 ✅ $0.34
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-small-cli 1/1 0 1 0 ✅ $0.74
e2e-review-army/skill-e2e-review-army--review-army-perf-n-plus-one 1/1 0 1 0 ✅ $0.34
e2e-triage/skill-e2e-triage 1/1 0 1 0 ✅ $0.1
e2e-third-party-actions/skill-e2e-third-party-actions 5/5 0 5 0 ✅ $0.42
e2e-browse/skill-e2e-bws 6/6 0 6 0 ✅ $0.29
e2e-review-attribution/skill-e2e-review-attribution 3/3 0 3 0 ✅ $0.3
e2e-safety-ship-evidence/skill-e2e-safety-ship-evidence 1/1 0 1 0 ✅ $0.14
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-marker 1/1 0 1 0 ✅ $0.16
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-timeout-unsettled 1/1 0 1 0 ✅ $0.19
e2e-session-intelligence/skill-e2e-session-intelligence 4/4 0 4 0 ✅ $0.28
e2e-plan-tune/skill-e2e-plan-tune 1/1 0 1 0 ✅ $0.13
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-launch-failure 1/1 0 1 0 ✅ $0.15
e2e/skill-e2e-test-value 3/3 0 3 0 ✅ $0.73
e2e-retro/skill-e2e-retro 1/1 0 1 0 ✅ $0.32
e2e-qa-workflow/skill-e2e-qa-workflow--qa-only-no-fix 1/1 0 1 0 ✅ $0.59
e2e-qa-functional-fix/skill-e2e-qa-functional-fix 2/2 0 2 0 ✅ $0.94
e2e-review-army/skill-e2e-review-army--review-army-quality-score 1/1 0 1 0 ✅ $0.1
e2e-qa-workflow/skill-e2e-qa-workflow--qa-quick 1/1 0 1 0 ✅ $0.5
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-unavailable 1/1 0 1 0 ✅ $0.68
e2e/skill-e2e-plan--plan-review-report 1/1 0 1 0 ✅ $0.98
e2e/skill-e2e-ship-hook-consent 2/2 0 2 0 ✅ $0.21
e2e/skill-e2e-shared-libs-paths--shared-libs-review-prior-coverage 1/1 0 1 0 ✅ $0.97
e2e-deploy/skill-e2e-deploy--land-and-deploy-workflow 1/1 0 1 0 ✅ $0.41
e2e-review/skill-e2e-review 2/2 0 2 0 ✅ $0.34
e2e/skill-e2e-shared-libs--shared-libs-review-revalidation 1/1 0 1 0 ✅ $1.83
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-late-result 1/1 0 1 0 ✅ $0.33
e2e-docsync-spawned/skill-e2e-docsync-spawned 1/1 0 1 0 ✅ $0.63
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-missing-asset 1/1 0 1 0 ✅ $0.28
e2e-deploy/skill-e2e-deploy--land-and-deploy-first-run 1/1 0 1 0 ✅ $0.36
e2e-design/skill-e2e-design--design-review-plugin-handoff 1/1 0 1 0 ✅ $0.14
e2e-design/skill-e2e-design--design-review-detector-shim-dom 1/1 0 1 0 ✅ $0.23
e2e/skill-e2e-coverage-audit 2/2 0 2 0 ✅ $0.29
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-recovery 1/1 0 1 0 ✅ $0.32
llm-judge/skill-llm-eval 24/24 0 24 0 ✅ $1.44
e2e-skillify/skill-e2e-skillify 3/3 0 3 0 ✅ $0.77
e2e-ship-docsync/skill-e2e-ship-docsync--ship-docsync-failure 1/1 0 1 0 ✅ $0.47
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-late-input 1/1 0 1 0 ✅ $0.9
e2e-failure-routing/skill-e2e-failure-routing 4/4 0 4 0 ✅ $0.41
e2e-safety-codex-consult/skill-e2e-safety-codex-consult 1/1 0 1 0 ✅ $0.28
e2e/skill-e2e-workflow 4/4 0 4 0 ✅ $0.91
e2e/skill-e2e-shared-libs-paths--shared-libs-review-path-eligibility 1/1 0 1 0 ✅ $1.54
Fail-closed reconciliation
2e-design.test.ts#design-review-detector-shim-dom
  slice 13  passed             30s  test/skill-e2e-design.test.ts#design-review-plugin-handoff
  slice 14  passed             48s  test/skill-e2e-safety-ship-evidence.test.ts
  slice 14  passed             44s  test/skill-e2e-review-attribution.test.ts
  slice 14  passed             39s  test/skill-e2e-office-hours-auto-mode.test.ts
  slice 14  passed             45s  test/skill-e2e-bws.test.ts
  slice 14  passed             48s  test/skill-e2e-third-party-actions.test.ts
  slice 14  passed             24s  test/skill-e2e-plan-tune.test.ts
  slice 14  passed             20s  test/skill-e2e-triage.test.ts
  slice 14  passed             37s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-timeout-unsettled
  slice 14  passed             27s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-missing-marker
  slice 14  passed             35s  test/skill-e2e-ask-user-question-format-compliance.test.ts
  slice 14  passed             27s  test/skill-e2e-ship-docsync.test.ts#ship-docsync-launch-failure
  slice 14  passed             26s  test/skill-e2e-session-intelligence.test.ts
  slice 15  passed             24s  test/skill-e2e-investigate-owned-termination.test.ts
  slice 15  passed             35s  test/skill-e2e-design.test.ts#design-review-detector-shim
  slice 15  passed             21s  test/skill-e2e-deploy.test.ts#canary-workflow
  slice 15  passed             28s  test/skill-e2e-ship-hook-refresh.test.ts
  slice 15  passed             12s  test/skill-e2e-design.test.ts#plan-design-review-no-ui-scope
  slice 15  passed             26s  test/skill-e2e-review-army.test.ts#review-army-delivery-audit
  slice 15  passed             22s  test/skill-e2e-investigate-owned-completion.test.ts
  slice 15  passed             25s  test/skill-e2e-safety-pair-agent.test.ts
  slice 15  passed             20s  test/skill-e2e-qa-workflow.test.ts#qa-bootstrap
  slice 15  passed             12s  test/skill-e2e-learnings.test.ts
  slice 15  passed             14s  test/skill-e2e-diagram.test.ts
[test:paid] collector final outcomes: 125 executed, 0 reused; 125 passed, 0 failed, 0 manual accepted (unscored; no score-cache credit) (125 attempt records from 71 collectors; every record counts)
[test:paid] deselected testcases, zero credit (312):
[test:paid]    298  sibling case of a case shard (its own shard runs it)
[test:paid]      8  periodic-tier case (this lane runs gate)
[test:paid]      6  Bun hook placeholder of a skipped describe block (not a test)
[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 112/112 · behavior 0/0 · judge 24/24 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 7m07s · cost $32.02 known + 54 of 136 trial(s) cost unknown
[test:paid] exercised-path map (shadow, non-blocking): 6 MAP_GAP line(s) over 104 executed case(s) with recorded commands
  MAP_GAP document-release bin/gstack-banned-terms: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report bin/gstack-plan-reality: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP plan-review-report design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP review-army-migration-safety bin/gstack-approval-classes: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-docsync-current bin/gstack-banned-terms: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP test-audit-report-only design/dist/design: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
[test:paid] report: every planned shard accounted and passed

Sliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry.

Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit 42dfa7f68114c73399eff6b9c824225954a95445.

garrytan and others added 6 commits October 26, 2026 00:40
…lock()

break_lock ignored drop()'s failure and returned 0, so lock() continued past
the tries limit forever when a dead holder's .lock could not be renamed aside
(a Windows file in use). It now removes the lock in place under .lock.break,
and returns 1 when that also fails so the try is counted. touch no longer calls
a dead holder 'live' in its exit-3 message.

Adds the /ship coverage-audit tests for the lock's failure paths.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- drop() reports a lock released once it is renamed aside, so a failed
  delete of the renamed copy never makes unlock or break_lock rm -rf a new
  taker's lock at .lock.
- An ownerless lock is broken only once it is 2 s old, so a live taker whose
  claim landed after a breaker read the claims keeps the lock it is about to
  publish. An empty owner, an invalid pid or a stray file counts as ownerless.
- touch's prune stays out of the lock (top-level lease files only) and clears
  leftover renamed-aside locks; a failed claim write leaves no claim.
- Docs and CHANGELOG state the mixed-version and dead-break-lock limits
  instead of claiming exclusion that does not hold.

Tests pin each fix (each fails against the previous bin), make the exclusion
case wait on a release file, prove the parallel case is mutually exclusive,
and check the Git Bash holder keeps its lock.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- orphaned() reads the clock before the lock's mtime and requires the mtime
  unchanged at the end, so a lock made meanwhile is never removed; an mtime
  a minute or more ahead (clock skew) counts as old.
- Claims older than 2 minutes are abandoned and pruned by touch.
- A waiter skips the claim and mkdir while the lock is visibly held; the
  wait is bounded at 300 tries or 30 s; a non-numeric tries value falls back
  to 300; ten quick retries (not three) before a lock nobody holds is
  reported as untakeable; pid 1 is a valid holder again.
- Tests: deterministic young-lock clock, skew and non-numeric owner shapes,
  abandoned claims, the deadline, explicit 30 s timeouts.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- A claim is honored while its claimant lives; only a claim with no start
  identity expires after 2 minutes, so a stalled live taker keeps its lock on
  hosts that record identities (the remaining case is a documented limit).
- A late taker never overwrites an owner already in its directory, and does
  not remove a directory that has one.
- A lock whose owner file exists but cannot be read is never ownerless.
- Zero-padded owner pids count as dead; --help prints the whole usage;
  touch prunes only claims whose claimant is gone or recorded no identity.

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>
…rain slot 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(gstack-lease): take the lease lock with mkdir, not ln -s, so Git Bash on Windows stops waiting out 300 tries (#3330) v1.91.228.0 fix(gstack-lease): take the lease lock with mkdir, not ln -s, so Git Bash on Windows stops waiting out 300 tries (#3330) Oct 26, 2026
@capy-ai
capy-ai Bot merged commit e622075 into main Oct 26, 2026
62 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.

gstack-lease lock never acquired under Git Bash on Windows: every skill start waits out 300 retries

1 participant