Skip to content

test(native-accounts): pin the platform for the accepted-work fence test - #7753

Closed
JasonBuildAI wants to merge 1 commit into
loopx-project:mainfrom
JasonBuildAI:codex/agent-k3n8
Closed

JasonBuildAI wants to merge 1 commit into
loopx-project:mainfrom
JasonBuildAI:codex/agent-k3n8

Conversation

@JasonBuildAI

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Closes [Bug]: required test-shard is red on main - the accepted-work fence test asserts macOS-only behavior on Linux #7752.
  • Goal/source and gap: the required Python Tests → test-shard lane fails deterministically on main because the accepted-work fence test is collected on every POSIX host but never pins the macOS-only host platform; all six accepted-work cases stop at HostError("platform_unavailable") instead of exercising the fence. This fails test-shard (1), (3), (4) and (6) across the two completed main runs at 04c5799b8 and the earlier 26f73056c, so every open PR (55 at report time) inherits a red required lane and a failing merge gate, and the only automated proof that an account handoff refuses to quit a client with accepted work never executes.
  • Observable before → after, with the validation row that proves it: python3 -m pytest tests/presentation/test_codex_accounts.py -k native_restart -q reports 6 failed with Expected regex: 'waiting_for_idle' / Actual message: 'platform_unavailable' before, and the six cases reach restart_guard and pass after (hosted test-shard row below).
  • Issue/task and intended base: [Bug]: required test-shard is red on main - the accepted-work fence test asserts macOS-only behavior on Linux #7752, base loopx-project/loopx:main at 04c5799b8.

Author Declaration

  • Written by: model_agent — DeepSeek (deepseek-v4.1-flash) through the DeepSeek Harness, at the human operator's request.

AI disclosure: this change was drafted with AI assistance at my request, under my direction and review. The operator set the scope constraints for this submission (one upstream issue and PR, minimal diff, no product behavior change) and reviewed the submitted result.

Implemented against

Criterion (spec clause) Disposition Symbol / path Test or command
The fence case must not fail on non-macOS POSIX hosts (#7752 Expected behavior) implemented tests/presentation/test_codex_accounts.py::test_native_restart_uses_real_accepted_work_fence_before_app_quit focused pytest -k native_restart
The accepted-work fence itself must still be exercised, not skipped implemented NativeHost.switch → restart_guard → managed_chat_activation_guard same focused test; six statuses
No product behavior change implemented test-only diff git diff (1 file, +4)
  • Self-check before submission: read NativeHost.switch (platform guard, then restart_guard), managed_chat_activation_guard (chat_runtime_activation_lock + chat_runtime_activation_state), and the existing client_host tests that pin the same platform on Linux. I verified the six cases fail before the pin and reach restart_guard after it; the green assertion is left to the hosted Linux lane because the local Windows host stops one step later at the package's POSIX-only trusted_file check. Deliberately not changed: the unrelated lane failures named below.

Scope And Continuation

Validation

  • Tested revision: d11b0e500cd03fc58d968c2a9eadff7c3364717c
  • Run state: finished (local) / running (hosted lane)
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
static passed ruff check on the changed file reports the same five pre-existing findings as the untouched base file and no new finding.
unit passed Before/after probe with the module's non-POSIX skip disabled: six failures with platform_unavailable before, six reaching restart_guard after. On this Windows host the package then stops at its POSIX-only trusted_file check; with that trust check emulated, the same six pass. The real green run is the hosted Linux row.
regression_parity passed The six JUnit cases named in #7752 fail at base 04c5799b8 with the CI-reported message and no longer stop at the platform check with this head.
integration running Hosted Python Tests test-shard at d11b0e500; result will be recorded here when the lane finishes.
  • Coverage and gaps: the changed line is the platform guard for the mocked host; the store, ingress lock and activation guard remain real code. Not covered locally: a real macOS run of the native handoff, which the existing opt-in drill owns.

Frontend / Visual Evidence

  • UI impact: none

Type of Change

  • Test update

LoopX Area

  • Build, packaging, installer, or CI

Technical Direction

  • Direction / acceptance reference, when applicable: N/A (test-only lane repair).

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A
  • Provider conformance arms run: N/A
  • Read-only legacy/file/PostgreSQL three-arm rehearsal (required for promotion, runtime-routing, or compatibility-projection changes): N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • Existing English/Chinese RFC pairs (including ledger entries) both have a diff, and the local premerge check python3 scripts/check_rfc_bilingual.py --base origin/main --head HEAD passes, or no paired RFC changed.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

The fence test added in b95e42f calls NativeHost.switch, which returns
platform_unavailable outside macOS. The module is collected on every POSIX
host, so all six parametrizations failed before restart_guard and the
required test-shard lane has been red since the test merged.

Pin the mocked host platform to darwin, following the existing client_host
fixture in the same module, so Linux exercises the platform-neutral guard
and store reader instead of stopping at the platform check.

Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
@JasonBuildAI

Copy link
Copy Markdown
Contributor Author

Closing to avoid a duplicate fix: an earlier parallel contribution registered this exact test and defect before this PR was opened. The reproduction and impact evidence remain in #7752.

@JasonBuildAI

Copy link
Copy Markdown
Contributor Author

Update: the earlier parallel registration was released without an issue or PR. This PR remains closed because the required lane is also dominated by the 60-minute shard timeout (four of six test-shard jobs were cancelled at 60.3 min on https://github.com/loopx-project/loopx/actions/runs/41146897061) and by other independent failures, so this test-only repair cannot restore the merge gate by itself. The reproduction and CI evidence remain in #7752.

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.

[Bug]: required test-shard is red on main - the accepted-work fence test asserts macOS-only behavior on Linux

1 participant