Skip to content

fix(runtime-core): give macOS owner-lease tests polling slack (HACK-2741, HACK-2751) - #1280

Open
roodboi wants to merge 7 commits into
nextfrom
kit/hack-2741-owner-lease-macos
Open

roodboi wants to merge 7 commits into
nextfrom
kit/hack-2741-owner-lease-macos

Conversation

@roodboi

@roodboi roodboi commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Failures

  • On next at 682a02964, Candidate core (macos-latest) returned provider_busy in the Compose dependency-refresh selection fixture in both feature modes (HACK-2741). The failure recurred in the all-features run at cd2e21fd. First failed job
  • On next at cd2e21fd, the authored exec fixture returned provider_busy with the project stop named in both feature modes, before it could check that the requester released the lock (HACK-2751). Failed job

Cause and fix

The tests reduced a 30 s stop to 600 ms and a 35 s deadline to 700 ms. The actual polling backoff still caps at 50 ms per sleep, and filesystem work and scheduling can delay a retry. The loop checks the deadline before it tries again. In an instrumented Darwin run of the authored fixture, a delayed holder unlocked at 690.155 ms. The requester woke and reported provider_busy at 707.524 ms. The same delayed hold passed with a 1,100 ms deadline. Per-poll timing is unavailable in the hosted failures.

On Apple Silicon, the unchanged authored exec entry point acquired and released a real flock after a 31 s stop. It reached the missing-owner diagnostic at 31.014 s, inside the real 35 s budget, and the next acquisition succeeded. The Compose refresh and service-exec requester functions also passed real 31 s holds in the HACK-2741 probe. These fixtures exercise the production wait before owner transport or guest execution.

#1286 landed the equivalent authored and engine requester fixes on next at eeea55cb7. The merge into this branch keeps those tests exactly as landed, including their 500 ms polling margin and the authored expiry assertion.

This PR completes the Compose dependency-refresh fixture (HACK-2741). It keeps the 600 ms stop, allows 500 ms of slack for scheduling and up to ten capped poll intervals, and checks that the independent 300 ms expiry returns the exact raw provider_busy, project-stop message and absent cause. The authored release and expiry behavior (HACK-2751) is verified alongside it on the merged branch. Existing tests separately pin the 35 s requester and 15 s owner budgets.

The combined engine test exposed a separate timing assumption on 061af8f. The owner returned the exact project-stop refusal, then its test failed the assertion that less than 600 ms had elapsed. Both original regressions passed in both macOS feature modes. The engine test now holds the actual lock through owner expiry and releases it on the requester's first retry. It still verifies the exact owner refusal and the first post-acquisition diagnostic. macOS failure

Verification

  • Apple Silicon macOS with pinned Rust and nextest. Both regressions passed 20 isolated nextest rounds per feature mode with zero retries. The focused lease and dependency-refresh suites and default/all-features Clippy also passed.
  • Linux runtime-core passed 1,920 default-feature and 2,276 all-feature tests. Rustfmt and both Clippy checks passed.
  • Frontend lease, dependency-refresh, Compose exec and authored exec contract tests passed with 76 passes and 7 expected skips.
  • Standard PR CI defers macOS Candidate core (HACK-2474). This PR opts in with ci:mac so both tests run on the PR head. The merged next run remains the final integration check for both issues.

Refs HACK-2741, HACK-2751
Follow-up to HACK-2729 (#1276) and HACK-2739 (#1278)


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@roodboi roodboi added the ci:mac Run macOS checks for this pull request label Nov 26, 2026
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 27, 2026 1:54am UTC

Request Review

@linear-code

linear-code Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

HACK-2741

HACK-2751

@roodboi

roodboi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T01:55:20.540764Z 3895a36 Manual request
🔒 Security Review ✅ Completed 2026-11-27T01:57:21.556447Z 3895a36 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 41453b3ff2

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 41453b3ff2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review the exact updated head 2c32e6ec1bc19abb7364814128d827900071172d after merging next (#1277, HACK-2740).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 2c32e6ec1b

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2c32e6ec1b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi roodboi changed the title fix(runtime-core): owner-lease requested selection waits out a project stop on macOS (HACK-2741) fix(runtime-core): give macOS owner-lease tests polling slack (HACK-2741, HACK-2751) Nov 26, 2026
@roodboi

roodboi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 3cd1589316ce6a79e076aa4ff95b26c2a8b31650 for HACK-2741 and HACK-2751, including the authored exec and Compose owner-lease regression changes after merging cd2e21fd.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 3cd1589316

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3cd1589316

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

roodboi added a commit that referenced this pull request Nov 27, 2026
…dline (HACK-2742)

As in #1280 and #1286: the expiry cases this branch added (the interactive
requester's checked wait and the owner's wait per command) now assert that
their deadline passed before they check the exact refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 777335bfd180b32086479342f4736ca06684992e after merging next at 22355a64. This PR covers HACK-2741 and HACK-2751.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 777335bfd1

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 777335bfd1

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

roodboi added a commit that referenced this pull request Nov 27, 2026
…(HACK-2741) (#1286)

Part of HACK-2741. Same fix as #1280, for the tests #1278 added (and one
#1276 test in the same file). #1280's
`dependency_refresh::owner_lease_tests` test is not touched.

## Problem

`next` is red: hosted `Candidate core (macos-latest)` (nextest) fails
`provider::engine::command_lease_tests::the_authored_exec_request_waits_out_a_project_stop_and_releases_the_lease`
with `provider_busy` after about 0.75 s, at cd2e21f.

## Root cause

The test holds the lease for 600 ms against a 700 ms bound, so it has
about 100 ms of slack. The shared retry loop (`state::wait_quietly`)
sleeps up to 50 ms between attempts, and it checks the deadline before
each attempt. On a loaded hosted runner the holder thread's unlock, plus
the last sleep, can land past the deadline, and the waiter gives up just
as the lock is freed. The bound was scaled from the 35 s wait; the 50 ms
backoff cap was not.


`a_requested_command_waits_out_a_project_stop_that_the_owner_bound_refuses`
(#1276), in the same file, has the same 600 ms against 700 ms shape.

## Change

- Both positive cases keep the 600 ms hold. Their deadline becomes
`started + hold + 500 ms`: ten capped poll intervals for the holder to
run, unlock, and be seen.
- The expiry case
`the_authored_exec_request_refuses_a_stop_past_its_bound_naming_it`
asserts that the deadline has passed before it checks the exact refusal.
- Test code only. No product change.

## Evidence

On the M5 (macOS arm64), under the native-bench lock, with `--features
native-config-plan`, filtered to `command_lease`:

- `cargo nextest run` (0.9.151), 20 runs: 0 failures (14 tests each
run).
- `cargo test`, 20 runs: 0 failures.
- `cargo +1.97.1 fmt --check`, and clippy `--all-targets -D warnings`
with default features and with `--all-features`.
- `privacy:check` after staging, and gitleaks.

Labelled `ci:mac` so hosted macOS Candidate core runs on this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- codesmith:footer -->
---
<a
href="https://dashboardbackend.blacksmith.sh/track/run-proof?expires=1798329234&installation_model_id=17053&pr_number=1286&ref=codesmith_pr_footer&repository=hack-dance%2Fhack&return_to=https%3A%2F%2Fgithub.com%2Fhack-dance%2Fhack%2Fpull%2F1286&variant=get_evidence&signature=e84ee032cf7565fc42c0c01ebc79a0ec5fd30503041d25156d21ccd4c4b15243"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-get-evidence-v2-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/proof-get-evidence-v2-light.svg"><img
alt="Get evidence"
src="https://pr-comments-assets.blacksmith.sh/codesmith/proof-get-evidence-v2-dark-3x.png"
width="123" height="28"></picture></a>
<sup><a
href="https://app.blacksmith.sh/hack-dance/codesmith/hack/pr/1286?autoLogin=true&ref=codesmith_pr_footer">Open
in [code]smith</a> · Need help on this PR? Tag
<code>@codesmith-bot</code> with what you need.</sup>

<!-- codesmith:autofix:disabled -->
<!-- /codesmith:footer -->

Co-authored-by: Dimitri Kennedy <344842+roodboi@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 061af8f709e52d95293937559057d8d6af28d5c8 after merging next at 9241fa528. The merge takes the engine lease tests from #1286 and preserves the Compose dependency-refresh fixture.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 061af8f709

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 061af8f709

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 3895a3650db2d039b815da2cd7a4f9738c781434. The engine fixture now keeps the real stop lock through owner expiry and releases it on the requester's retry to remove the failing timing assumption.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3895a3650d

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3895a3650d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

This branch has not been deployed

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

Labels

ci:mac Run macOS checks for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant