Skip to content

test(apple): resolve credential fixture roots before SQLite open - #174584

Merged
steipete merged 1 commit into
mainfrom
fix3/native-credential-temp-root-20261016
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix3/native-credential-temp-root-20261016

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The new native credential tests (OpenClawClientCredentialStoreTests) pass a raw macOS temporary-directory alias to a SQLite owner that requires a resolved client root. SQLITE_OPEN_NOFOLLOW correctly rejects /var/... because it aliases /private/var/..., so credential creation fails before any operation. This reproduced all 13 issues from main hourly 38948575054.

Why This Change Was Made

Resolve only the newly created test root with realpath. Cleanup, every original assertion, and the production no-follow guard stay unchanged. PR #174294 introduced the fixture and enables no production credential readers or writers, so this change is test-only. Real app storage lives under the user Library directory, not a /var alias.

Evidence

  • The unchanged Swift package test binary failed through /var and passed all 10 tests through the same physical /private/var root.
  • After the patch, all 10 tests pass through the original aliased TMPDIR (1.508 s test time; 3.755 s process), in an OS sandbox with synthetic state, no operator-file or Keychain access and no network.
  • Package build and formatting pass. Strict SwiftLint keeps the same two pre-existing findings with no new ones. Independent P2 review of the patch was scoped-clean.
  • Direct main publication hit advancing-main ref races; this PR carries the identical proven patch. No CI rerun or manual dispatch was requested.

The new native credential suite passed a raw macOS TMPDIR path to an owner
that requires a resolved client root. SQLite's no-follow open rejects the
/var alias with SQLITE_CANTOPEN_SYMLINK, before any credential operation.
Resolve only the newly created fixture root and retain its existing cleanup.
Production path guards, credential operations and all assertions are unchanged.

The unchanged current-main suite reproduced all 13 hourly issues through
/var and passed all 10 tests through the same physical /private/var root.
The patched suite passes all 10 through the original aliased TMPDIR under
an OS sandbox (1.508s tests, 3.755s process). Package build and format pass;
strict lint retains the same two baseline findings. No app was launched,
no operator credentials were accessed, and no CI rerun was requested.

The fixture and preparatory adapter were introduced by 4706053
(#174294); the PR explicitly enables no production credential consumers.

Independent P2 review of the tracked test patch was scoped-clean.
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 16, 2026 19:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T19:23:05.162130Z 6a8d881 Draft marked ready
ℹ️ 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR resolves the temporary credential-test root with realpath before passing it to the SQLite owner.

Example: The credential suite creates its fixture beneath /var/tmp.

  • Before: SQLite's no-follow open rejects the aliased /var/tmp path before credential assertions run.
  • After: The fixture supplies the corresponding /private/var/tmp path while retaining cleanup through the original URL.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported; validation is described at the package-test boundary without inspectable execution output.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only PR changes fixture preparation rather than shipped behavior; its body reports a sandboxed ten-test pass through the original aliased TMPDIR.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: macOS credential tests fail during fixture setup instead of exercising their storage and safety contracts.
Reason: The focused repair restores existing coverage while preserving production semantics and all original assertions.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete macOS test-fixture failure without weakening production path checks or changing assertions; no actionable code findings.

Priority: P2
Reviewed head: 6a8d881d2d4ecbd6c29ae2799106a8ccfeb658df

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-entry-point scenario is needed for this fixture-only correction; the reported baseline and patched suite results have no linked raw output.
Agent review details

How this fits together

The Swift credential tests supply temporary roots to the native credential owner, which opens client/credentials.sqlite and exercises identity, token, custody, and path-safety contracts.

flowchart LR
  A[Swift credential tests] --> B[Temporary fixture root]
  B --> C[Resolve existing root]
  C --> D[Native credential owner]
  D --> E[SQLite no-follow open]
  E --> F[Credential assertions]
Loading

Technical review

Best possible solution:

Resolve the newly created fixture root once and retain the production no-follow guard and existing security assertions.

Do we have a high-confidence way to reproduce the issue?

The raw TMPDIR fixture reaches SQLITE_OPEN_NOFOLLOW unchanged on main; the author reports the same binary failing through /var and passing through /private/var, but this read-only review ran no tests.

Is this the best way to solve the issue?

The repair belongs in the fixture producer and follows the existing native realpath pattern without relaxing the credential owner's security contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8d264497042e.

Provenance checked

  • Credential-test temporary-root preparation keeps the original intent (4706053: Prepare and test the independently versioned local credential owner before activating production clients.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4706053 adds apps/shared/OpenClawKit/Tests/OpenClawNativeStateTests/OpenClawClientCredentialStoreTests.swift:215 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4706053bc398; files: apps/shared/OpenClawKit/Tests/OpenClawNativeStateTests/OpenClawClientCredentialStoreTests.swift)

PR surface

Tests +3. Total +3 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 1 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 1 +3

Labels

Label changes:

  • add P2: A concrete macOS credential-suite fixture failure blocks meaningful test coverage, with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete macOS credential-suite fixture failure blocks meaningful test coverage, with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 3:34 PM ET / 19:34 UTC.

@steipete
steipete merged commit 90f58b9 into main Oct 16, 2026
152 of 155 checks passed
@steipete
steipete deleted the fix3/native-credential-temp-root-20261016 branch October 16, 2026 19:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…nclaw#174584)

The new native credential suite passed a raw macOS TMPDIR path to an owner
that requires a resolved client root. SQLite's no-follow open rejects the
/var alias with SQLITE_CANTOPEN_SYMLINK, before any credential operation.
Resolve only the newly created fixture root and retain its existing cleanup.
Production path guards, credential operations and all assertions are unchanged.

The unchanged current-main suite reproduced all 13 hourly issues through
/var and passed all 10 tests through the same physical /private/var root.
The patched suite passes all 10 through the original aliased TMPDIR under
an OS sandbox (1.508s tests, 3.755s process). Package build and format pass;
strict lint retains the same two baseline findings. No app was launched,
no operator credentials were accessed, and no CI rerun was requested.

The fixture and preparatory adapter were introduced by a67871a
(openclaw#174294); the PR explicitly enables no production credential consumers.

Independent P2 review of the tracked test patch was scoped-clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant