Skip to content

test(server): wait for native-main startup in Daybreak listing - #8966

Merged
lidge-jun merged 1 commit into
devfrom
fix/new-model-policy-daybreak-startup-gate
Nov 19, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/new-model-policy-daybreak-startup-gate

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Wait for native-main startup readiness before the Daybreak Desktop listing test reads the credential and entitlement roster. Windows shard 14/14 hit the pending owner-acquisition window in release-gate run 44559432373.
  • Use the existing owned-service-home fixture for the Daybreak case so installed service registrations cannot determine the sandbox's ownership verdict. Real owner acquisition, recovery, credential admission, and HTTP listing still run.
  • Pin the entitlement version through the persisted runtime reader for both rosters and all Desktop requests in the case. Restore the reader and clear its memo at teardown.

Verification

  • bun test tests/server/server-new-model-policy-arrival.test.ts ran five times on macOS with 15 passed and 0 failed each time.
  • Temporarily held owner acquisition through the existing hardening seam on the base. The gate was recovery-pending and the first listing lacked the Daybreak alias (0 passed, 1 failed). With the readiness wait, releasing the held owner let the test pass. The same passing probe wrote a different runtime version to disk between listings and confirmed entitlement resolution stayed pinned (1 passed, 0 failed).
  • Temporarily removed the grant withdrawal. The final absence assertion failed because the fresh listing still included the Daybreak alias (0 passed, 1 failed). Both temporary probes were reverted.
  • bun test tests/ci-workflows/file-size-ratchet.test.ts tests/test-layout.test.ts reported 11 passed and 0 failed.
  • bun run typecheck reported no type errors in 2,666 files. git diff --check passed.
  • NOT RUN — Windows and the full local suite. Local verification focused on the affected regression and repository guards.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. The change is limited to a test fixture.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. The fixture uses a synthetic credential and existing test seams.

Summary by CodeRabbit

  • Tests
    • Updated server-side coverage for model arrival policies and owned service-home inspection.
    • Improved reliability of the Daybreak entitlement test by accounting for startup readiness and restoring test state afterward.

Wait for the owned fixture home to admit native-main traffic before the
first Desktop listing. Pin the entitlement version across the listing
sequence so the withdrawal assertion exercises the seeded grant.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 19, 2026 17:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 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-19T17:21:41.171153Z 4120ed1 PR opened
ℹ️ 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Daybreak arrival-policy test now seeds the gated-model version floor, waits for native startup readiness, and mocks persisted Codex runtime selection during the test.

Changes: Daybreak arrival-policy test

Layer / File(s) Summary
Configure and run the Daybreak arrival-policy test
tests/server/server-new-model-policy-arrival.test.ts
The test uses the gated-model client-version floor and passes an owned-service-home inspection callback to the server. It waits for the native startup gate, mocks persisted Codex runtime selection, and resets the runtime resolve cache during setup and cleanup.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Minimal · up to 4120e

This only makes a Daybreak desktop listing test wait for native startup readiness and pin the entitlement version. It has no production runtime impact, and no concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(server): wait for native-main startup in Daybreak listing" matches the main change. The raw summary shows the arrival-policy test now waits for native startup readiness (waitForNativeM…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(server): wait for native-main startup in Daybreak listing" matches the main change. The raw summary shows the arrival-policy test now waits for native startup readiness (waitForNativeMainStartupGate) before the Daybreak entitlement listing. The PR objectives confirm the test now waits for native-main startup readiness before reading the credential and entitlement roster. The title is short, specific, and uses a conventional commit prefix. It does not mention the entitlement version pinning or owned-service-home change, but those are secondary details.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 87edd82 and 4120ed1.

Files selected for processing: 1

  • tests/server/server-new-model-policy-arrival.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration (lidge-jun, dev-only path in MAINTAINERS.md; dev-fix freeze exception assigned by the coordinator) at head 4120ed15f6:

  • Failure: release-gate run 44559432373 on dev 62ffebbe90, windows 14/14, server-new-model-policy-arrival.test.ts:465 "superseded Desktop listing retries after a Daybreak grant is withdrawn". The test was added in feat(accounts): per-account probe and quota table, Antigravity quota-family rotation, verified Vertex ADC #8740 and had run on Windows only once.
  • Root cause: found by instrumenting a Windows host. startServer publishes the native-main startup gate as blocked (recovery-pending) until owner acquisition settles, which took about 0.6 s there. The test's first Desktop listing ran inside that window, so main credential admission was refused fail-closed, which is intended. The seeded entitlement matched exactly. Sibling tests already await the startup gate; this one did not. A second issue: later listings resolved the host's installed Codex version (0.162.1) instead of the seeded 0.144.0. That meant the final withdrawal assertion could pass on a cache-key miss rather than on the actual withdrawal.
  • Fix: test only. The test now waits for native-main readiness, using the sibling ownership fixture so real acquisition and admission still run. A spy on the persisted runtime pins the entitlement version across listings, and it is restored in finally along with a runtime-memo invalidation. There is no production change.
  • Review: an independent gpt-6.2-sol reviewer approved with no findings. With the grant kept, the final assertion fails, both with and without Codex on PATH.
  • Windows evidence (desktop-c795oh4, Bun 1.3.14): on dev 62ffebbe90 the Daybreak test failed 5/5. On this head, 5 full-file runs each had 15 passed and 0 failed. On the same host, claude-picker-trust-linux.test.ts on dev 87edd827bc (with test(claude): inject NSS stat failures across platforms #8963) had 29 passed and 0 failed.
  • CI and gates: all 27 checks succeeded on this exact head. scripts/ci/assert-mergeable-review.sh --maintainer-integration 8966 passed. On a local merge with dev 87edd827bc, structure:check and typecheck (2,666 files) passed, and 147 tests passed across the ratchet, import-cycle, structure SSOT, layout, Spanish docs and the fixed test file.

Follow-up worth a separate issue (not changed here): during the roughly 0.6 s native-main startup window, a Desktop listing returns 200 without the gated native rows rather than 503 desktop_snapshot_busy.

NOT RUN: full local suite, the lane=all Windows batch (left to the coordinator).

@lidge-jun
lidge-jun merged commit ecc9aba into dev Nov 19, 2026
31 checks passed
@lidge-jun
lidge-jun deleted the fix/new-model-policy-daybreak-startup-gate branch November 19, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant