Skip to content

test(macos): preserve remote hosts and presence assertions - #170938

Merged
steipete merged 2 commits into
mainfrom
dbasync/redmain-macos-presence-loopback
Oct 13, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/redmain-macos-presence-loopback

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Scheduled main run 38378024699, macos-swift tests job 115231436768, reports five issues in three test functions after #170823 (1e9431b71fea74688132412f995f32cf88ba863e).

The direct-URL test gained IPv4 and IPv4-mapped IPv6 loopback cases, but its persisted-config assertion still expected the first host literal. Match that expectation to each input, preserving the existing command-output, authentication, local-port and SSH-cleanup assertions.

The presence tests began passing an optional delivery-state initializer directly through Swift Testing's captured function expression when their forwarding wrapper was removed. The three negative expectations fail with a () outer diagnostic and an unevaluated inner call, although the unchanged production predicate returns false for each supplied input. Evaluate the predicate before #expect; retain the original throttle, refresh, saturation and keepalive inputs and all five assertions. The exact native replay now passes all original inputs and assertions. Macro/call capture remains the suspected mechanism; this patch does not claim a proven compiler defect.

Evidence

  • Two test-only commits, one per root: 2 files, +16/-11 (net +5); no production, security, configuration, timing or timeout changes.
  • Culprit attribution: refactor: deslop old Apple shared/macOS and Control UI code #170823 parameterized the URL input without updating the persisted expectation and removed the presence forwarding wrapper without changing the production throttle predicate.
  • One Codex review per focused commit through P2, within the two-round cap. Both reviews are scoped-clean with no actionable findings.
  • git diff --check passes; normal commit hooks pass. Local tests/builds were not run under compute conservation. Swift format/lint and runtime proof are delegated to CI.
  • No SQL, request-count or T1 change is claimed; no SQL harness was run. No checks or security boundaries were removed. Update/migration compatibility proof is not applicable.

Validation

Ordinary PR CI passed but omitted Swift. A focused native replay passed on exact candidate a27178926a65099dd748643746d2964cf7786052: continuous activity 0.018 seconds, idle keepalive 0.016 seconds, and direct private URL with all three host arguments 0.027 seconds; three tests/two suites passed in 0.029 seconds, launcher exit 0. Source and test blobs were recorded before execution. The proof used the canonical disposable xcode-27 macOS runner, scripts/lib/swift-toolchain.sh to select /Applications/Xcode.app, and the locked native asset preparation from CI. Required toolchain is Swift 6.3+ / Xcode 26.4+.

swift build --package-path apps/macos --build-system native \
  --enable-code-coverage --disable-index-store -Xswiftc -gline-tables-only --build-tests
node scripts/test-macos-native.mts default \
  --package-path apps/macos --build-system native \
  --enable-code-coverage --disable-index-store -Xswiftc -gline-tables-only --skip-build \
  --filter 'MacNodePresenceReporterTests/`(continuous activity is throttled and then refreshed|idle presence gets a sparse keepalive)`|ConfigureRemoteCommandTests/`configure remote can write direct private url`'

The filter selects only the three failing functions, including all three direct-host arguments. The native launcher owns the isolated home, profile, state and keychain; it must run on disposable macOS CI, never on an operator desktop. No local native build or test ran. The temporary proof workflow is not part of this PR.

Match the persisted URL assertion to the parameterized host, just as the command output assertion already does. Preserve the direct URL, authentication, local port and SSH cleanup checks.
Keep the real throttle and keepalive predicate calls outside Swift Testing expression capture. Preserve all original inputs and the three negative and two positive boundary assertions.
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T10:13:17.185505Z a271789 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.

@steipete
steipete merged commit 54a7183 into main Oct 13, 2026
75 checks passed
@steipete
steipete deleted the dbasync/redmain-macos-presence-loopback branch October 13, 2026 10:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
## What Problem This Solves

Scheduled main run [38378024699](https://github.com/openclaw/openclaw/actions/runs/38378024699), macos-swift tests job [115231436768](https://github.com/openclaw/openclaw/actions/runs/38378024699/job/115231436768), reports five issues in three test functions after openclaw#170823 (`ff203514f5a27662658d66ed6c815d978137d7c2`).

The direct-URL test gained IPv4 and IPv4-mapped IPv6 loopback cases, but its persisted-config assertion still expected the first host literal. Match that expectation to each input, preserving the existing command-output, authentication, local-port and SSH-cleanup assertions.

The presence tests began passing an optional delivery-state initializer directly through Swift Testing's captured function expression when their forwarding wrapper was removed. The three negative expectations fail with a `()` outer diagnostic and an unevaluated inner call, although the unchanged production predicate returns false for each supplied input. Evaluate the predicate before `#expect`; retain the original throttle, refresh, saturation and keepalive inputs and all five assertions. The exact native replay now passes all original inputs and assertions. Macro/call capture remains the suspected mechanism; this patch does not claim a proven compiler defect.

## Evidence

- Two test-only commits, one per root: 2 files, +16/-11 (net +5); no production, security, configuration, timing or timeout changes.
- Culprit attribution: openclaw#170823 parameterized the URL input without updating the persisted expectation and removed the presence forwarding wrapper without changing the production throttle predicate.
- One Codex review per focused commit through P2, within the two-round cap. Both reviews are scoped-clean with no actionable findings.
- `git diff --check` passes; normal commit hooks pass. Local tests/builds were not run under compute conservation. Swift format/lint and runtime proof are delegated to CI.
- No SQL, request-count or T1 change is claimed; no SQL harness was run. No checks or security boundaries were removed. Update/migration compatibility proof is not applicable.

## Validation

Ordinary PR CI passed but omitted Swift. A focused [native replay](https://github.com/openclaw/openclaw/actions/runs/38382317749/job/115245520688) passed on exact candidate `a27178926a65099dd748643746d2964cf7786052`: continuous activity 0.018 seconds, idle keepalive 0.016 seconds, and direct private URL with all three host arguments 0.027 seconds; three tests/two suites passed in 0.029 seconds, launcher exit 0. Source and test blobs were recorded before execution. The proof used the canonical disposable `xcode-27` macOS runner, `scripts/lib/swift-toolchain.sh` to select `/Applications/Xcode.app`, and the locked native asset preparation from CI. Required toolchain is Swift 6.3+ / Xcode 26.4+.

```bash
swift build --package-path apps/macos --build-system native \
  --enable-code-coverage --disable-index-store -Xswiftc -gline-tables-only --build-tests
node scripts/test-macos-native.mts default \
  --package-path apps/macos --build-system native \
  --enable-code-coverage --disable-index-store -Xswiftc -gline-tables-only --skip-build \
  --filter 'MacNodePresenceReporterTests/`(continuous activity is throttled and then refreshed|idle presence gets a sparse keepalive)`|ConfigureRemoteCommandTests/`configure remote can write direct private url`'
```

The filter selects only the three failing functions, including all three direct-host arguments. The native launcher owns the isolated home, profile, state and keychain; it must run on disposable macOS CI, never on an operator desktop. No local native build or test ran. The temporary proof workflow is not part of this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant