Skip to content

test(plugins): canonicalize native resolver fixtures - #118174

Merged
steipete merged 1 commit into
mainfrom
codex/qa-plugin-resolver-realpath
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-plugin-resolver-realpath

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • canonicalize the shared Plugin SDK native-resolver fixture root on macOS
  • restore shared-cache, host-isolation, and lifecycle-invalidation assertions
  • leave production resolver and cache behavior unchanged

Root cause and fix

The test fixture retained the lexical /var/... path returned by mkdtemp, while the production resolver canonicalizes the loader package root to /private/var/... before scanning internal package aliases. Three spy expectations therefore compared different spellings of the same source files.

The fixture now resolves its temporary root once before creating the fake package. Production delta is 0 lines.

Closes #118172

Proof

Exact candidate head: 48714e7eb80e2e3b21545d8354912c0c32ea799e

  • Current-main reproduction: 3 failures in shared-host, isolated-host, and lifecycle-invalidation cases
  • node scripts/run-vitest.mjs src/plugins/plugin-sdk-native-resolver.test.ts — 15/15 passed after final rebase
  • stress loop — 30/30 complete shard runs passed
  • node scripts/check-changed.mjs -- src/plugins/plugin-sdk-native-resolver.test.ts — passed on Blacksmith Testbox tbx_01kz217pdg6671tfqv64fw9trm (run)
  • Codex autoreview — clean, no accepted/actionable findings, overall confidence 0.99
  • exact-head hosted CI — green (run)

macOS before/after terminal proof

Host: Darwin, macOS 27.0. Only the random per-user temporary-directory component is redacted below.

The candidate and current origin/main are byte-identical in the resolver surface except for this fixture line. Restoring the exact current-main line on the candidate checkout reproduces the defect:

$ node -e 'const fs=require("node:fs"),os=require("node:os"); console.log(JSON.stringify({platform:process.platform,tmpdir:os.tmpdir(),realTmpdir:fs.realpathSync(os.tmpdir())}))'
{"platform":"darwin","tmpdir":"/var/folders/<macos-user-temp>/T","realTmpdir":"/private/var/folders/<macos-user-temp>/T"}

$ node scripts/run-vitest.mjs src/plugins/plugin-sdk-native-resolver.test.ts
FAIL  src/plugins/plugin-sdk-native-resolver.test.ts > shares one internal core alias scan across importers from the same host package
expected: /var/folders/<macos-user-temp>/T/.../packages/markdown-core/src/code-spans.ts
received: /private/var/folders/<macos-user-temp>/T/.../packages/markdown-core/src/code-spans.ts

FAIL  src/plugins/plugin-sdk-native-resolver.test.ts > keeps internal core alias registration isolated between host modules
FAIL  src/plugins/plugin-sdk-native-resolver.test.ts > rescans internal core aliases after plugin metadata lifecycle invalidation
Test Files  1 failed (1)
Tests       3 failed | 12 passed (15)

Restoring the candidate line on the same checkout and host fixes all three path-identity assertions:

$ node scripts/run-vitest.mjs src/plugins/plugin-sdk-native-resolver.test.ts
Test Files  1 passed (1)
Tests       15 passed (15)
[test] passed 1 Vitest shard in 2.74s

Changelog

Not required: test-only reliability fix with no runtime behavior change.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete steipete self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 4:19 PM ET / 20:19 UTC.

ClawSweeper review

What this changes

This PR canonicalizes the temporary root used by Plugin SDK native-resolver fixtures so macOS assertions use the same real filesystem path as the resolver.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

The one-line fixture change matches the native resolver’s existing canonical filesystem-identity contract and introduces no code-level defect. Keep this PR open under its protected maintainer label; before merge, add inspectable macOS before/after terminal evidence because the current proof only summarizes test and CI results.

Priority: P3
Reviewed head: 48714e7eb80e2e3b21545d8354912c0c32ea799e

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is a clean, narrow test repair, but the real macOS after-fix behavior has not been directly evidenced.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused tests, a stress loop, and CI, but it does not include inspectable after-fix macOS terminal or live output for the path-identity behavior; add redacted before/after terminal proof and update the PR body for re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused tests, a stress loop, and CI, but it does not include inspectable after-fix macOS terminal or live output for the path-identity behavior; add redacted before/after terminal proof and update the PR body for re-review.
Evidence reviewed 5 items Fixture and resolver use different path identities on current main: The fixture retains mkdtempSync’s lexical path, while the resolver canonicalizes filesystem boundaries with fs.realpathSync; the proposed change aligns the fixture producer with that existing boundary contract.
Canonical host root is the resolver cache key: The resolver resolves the loader package root through normalizePathForBoundary, stores that canonical root in its host cache, and uses it to register internal-package aliases.
Affected coverage exercises the reported cache behaviors: The shared fixture drives cache sharing between installers, same-host reuse, host isolation, and lifecycle-invalidation assertions, all of which observe source paths built below the fixture root.
Findings None None.
Security None None.

How this fits together

The Plugin SDK native resolver maps imports from approved plugin and OpenClaw package roots to local SDK and internal-package files. Its tests construct fake OpenClaw package roots, then verify alias scanning, cache reuse, host isolation, and lifecycle invalidation.

flowchart LR
  A[Temporary test fixture] --> B[Fake OpenClaw package]
  B --> C[Native resolver host-root identity]
  C --> D[Internal package alias scan]
  D --> E[Cache and lifecycle assertions]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused tests, a stress loop, and CI, but it does not include inspectable after-fix macOS terminal or live output for the path-identity behavior; add redacted before/after terminal proof and update the PR body for re-review.
  • Resolve merge risk (P1) - The PR body summarizes focused test, stress-loop, and CI success but does not provide inspectable macOS before/after terminal output for the /var versus /private/var path-identity behavior.
  • Complete next step (P2) - The protected maintainer label requires human handling, and the remaining action is contributor-owned macOS evidence rather than an automated code repair.
Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

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

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #118172
Summary: This PR is the focused candidate fix for the related macOS native-resolver fixture failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve production resolver behavior and land the fixture-only canonicalization after a redacted macOS terminal transcript shows the original focused failure and the repaired focused run.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve production resolver behavior and land the fixture-only canonicalization after a redacted macOS terminal transcript shows the original focused failure and the repaired focused run.

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

Yes, source-reproducible: on macOS the resolver canonicalizes the fake host root while the current fixture and spy expectation retain the lexical temporary path. A direct current-main run requires a macOS host.

Is this the best way to solve the issue?

Yes: canonicalizing the fixture at its path producer mirrors the resolver’s real-path boundary, preserves production behavior, and avoids weakening assertions that protect cache identity.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3a2337ece4f9.

Labels

Label changes:

  • add P3: This is a narrowly scoped test-fixture reliability repair with no production runtime change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, a stress loop, and CI, but it does not include inspectable after-fix macOS terminal or live output for the path-identity behavior; add redacted before/after terminal proof and update the PR body for re-review.

Label justifications:

  • P3: This is a narrowly scoped test-fixture reliability repair with no production runtime change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, a stress loop, and CI, but it does not include inspectable after-fix macOS terminal or live output for the path-identity behavior; add redacted before/after terminal proof and update the PR body for re-review.

Evidence

What I checked:

Likely related people:

  • Shakker: Current-main blame assigns both the fixture and canonical host-root cache logic to the commit that introduced the resolver and its test suite. (role: introduced current resolver and test coverage; confidence: high; commits: c0104d567582; files: src/plugins/plugin-sdk-native-resolver.ts, src/plugins/plugin-sdk-native-resolver.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted macOS terminal transcript showing the current-main failures and the repaired focused test run.
  • Update the PR body with that proof; if a fresh review does not trigger, ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head landing proof for 48714e7eb80e2e3b21545d8354912c0c32ea799e.

  • Symptom: on a real macOS host, the current-main fixture produces 3 failures in shared-host cache reuse, host isolation, and lifecycle invalidation because the fixture expects /var/... while the resolver scans /private/var/....
  • Root cause and owner: the shared fixture retained mkdtempSync's lexical path even though the native resolver canonicalizes filesystem identity at its package-root boundary.
  • Canonical fix: canonicalize the fixture root once at creation. Production resolver behavior is unchanged; production LOC delta is 0. Test delta is +1/-1 in one file.
  • Real macOS before/after proof: the PR body now contains the redacted terminal transcript. Restoring the exact current-main fixture line yields 3 failed | 12 passed; restoring this head yields 15 passed on the same host.
  • Focused proof: node scripts/run-vitest.mjs src/plugins/plugin-sdk-native-resolver.test.ts — 15/15 passed.
  • Stress proof: 30/30 complete focused shard runs passed.
  • Changed gate: node scripts/check-changed.mjs -- src/plugins/plugin-sdk-native-resolver.test.ts passed on Blacksmith Testbox tbx_01kz217pdg6671tfqv64fw9trm (run).
  • Exact-head hosted CI: openclaw/ci-gate and selected checks passed (run).
  • Repository prepare gates: OPENCLAW_TESTBOX=1 scripts/pr prepare-gates 118174 and prepare-push 118174 passed; the remote PR branch already matched the prepared head.
  • Final autoreview: autoreview --mode branch --base origin/main — clean, no accepted/actionable findings, confidence 0.99.
  • ClawSweeper: latest comment reviewed. Both rank-up moves were applied by adding the redacted macOS transcript and updating the PR body. No move was skipped.
  • External live boundary: none; this is a test-only fixture correction. The real macOS current-main/fixed terminal run is the closest behavior proof.
  • Model-identifier gate: not applicable; neither the one-line path fixture diff nor the public proof contains model identifiers.

Ready to land through the repository-native merge gate.

@steipete
steipete merged commit 57809f4 into main Aug 2, 2026
110 of 115 checks passed
@steipete
steipete deleted the codex/qa-plugin-resolver-realpath branch August 2, 2026 20:26
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 2, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (#118193)
  fix(config): preserve secret ownership when configuration rows move (#118149)
  fix(cron): deliver failure alerts after persistence (#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (#118098)
  perf(gateway): remove streaming hot-path rescans (#118192)
  test(gateway): use in-memory task registry (#118191)
  test(macos): fix three races in the bounded process suites (#118196)
  refactor(migrate-hermes): consolidate test fixtures (#118182)
  test(android): share Wear transport fixtures (#118177)
  test(ui): deduplicate control UI e2e setup (#118180)
  fix(plugins): unblock prerelease validation (#118103)
  test(cli): reduce redundant process launches (#118141)
  test(gateway): compact terminal observer fixtures (#118179)
  fix(agents): make requested threads sidebar-visible (#118073)
  test(plugins): canonicalize native resolver fixtures (#118174)
  test: deduplicate agent runner fixtures (#118176)
  refactor(policy): consolidate doctor test fixtures (#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (#118127)
  refactor(matrix): consolidate monitor test fixtures (#118175)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* origin/main:
  feat(gateway): track event-loop degradation persistence and add concurrency benchmark (openclaw#118193)
  fix(config): preserve secret ownership when configuration rows move (openclaw#118149)
  fix(cron): deliver failure alerts after persistence (openclaw#118200)
  chore(lint): clear 172 lint:all baseline violations in five batches (openclaw#118098)
  perf(gateway): remove streaming hot-path rescans (openclaw#118192)
  test(gateway): use in-memory task registry (openclaw#118191)
  test(macos): fix three races in the bounded process suites (openclaw#118196)
  refactor(migrate-hermes): consolidate test fixtures (openclaw#118182)
  test(android): share Wear transport fixtures (openclaw#118177)
  test(ui): deduplicate control UI e2e setup (openclaw#118180)
  fix(plugins): unblock prerelease validation (openclaw#118103)
  test(cli): reduce redundant process launches (openclaw#118141)
  test(gateway): compact terminal observer fixtures (openclaw#118179)
  fix(agents): make requested threads sidebar-visible (openclaw#118073)
  test(plugins): canonicalize native resolver fixtures (openclaw#118174)
  test: deduplicate agent runner fixtures (openclaw#118176)
  refactor(policy): consolidate doctor test fixtures (openclaw#118173)
  fix(plugins): remove disabled channel plugin configuration on uninstall (openclaw#118127)
  refactor(matrix): consolidate monitor test fixtures (openclaw#118175)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: Plugin SDK resolver expectations use noncanonical macOS paths

1 participant