Skip to content

[Repo Assist] test(exec): add tilde-expansion edge-case tests for ExecApprovalsStore#750

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-exec-approvals-store-path-expansion-2026-06-12-5b7bcffb77abea32
Draft

[Repo Assist] test(exec): add tilde-expansion edge-case tests for ExecApprovalsStore#750
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-exec-approvals-store-path-expansion-2026-06-12-5b7bcffb77abea32

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds two unit tests for ExecApprovalsStore that cover previously-untested branches of ExpandHomePrefix, complementing the path-expansion coverage added in #744.

Motivation

ExpandHomePrefix has three distinct branches:

  1. path == "~" — returns home directly (the tilde-only branch)
  2. path.StartsWith("~/") — strips prefix and joins with home
  3. otherwise — returns path unchanged

The existing tests exercise branch 2 (via ResolveAsync_HomeRelativeStateDir_UsesOpenClawHome) but leave branches 1 and the interaction between a tilde-prefixed openClawHomeOverride and stateDirOverride uncovered. A future refactor of ExpandHomePrefix (e.g. collapsing the three-way conditional) could silently break branch 1 without a failing test.

New Tests

Test What it verifies
ResolveAsync_TildeOnlyStateDir_ResolvesToEffectiveHome stateDirOverride = "~" (bare tilde) resolves to effectiveHome and the file is migrated there
ResolveAsync_TildePrefixedOpenClawHome_ExpandsRelativeToOsHome openClawHomeOverride = "~/.openclaw" is expanded relative to osHomeOverride before being used as the base for further tilde expansion in stateDirOverride

Test Status

  • ✅ New tests: 2 passed, 0 failed
  • OpenClaw.Shared.Tests: 2216 passed, 8 failed (pre-existing, unrelated to this PR)
    • Pre-existing failures: MxcPolicyBuilderTests, MxcConfigBuilderTests, McpHttpServerTests, ExecApprovalV2NormalizationTests — all fail due to Windows-specific behaviour in the Linux CI environment; not caused by this change.
  • OpenClaw.Tray.Tests: 1038 passed, 0 failed, 2 skipped

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

Add two tests that cover previously-untested branches of ExpandHomePrefix:

1. ResolveAsync_TildeOnlyStateDir_ResolvesToEffectiveHome
   - stateDirOverride == "~" (tilde alone, no trailing separator) must
     resolve to the effectiveHome directory.  This exercises the
     `path == "~"` branch of ExpandHomePrefix that is distinct from the
     `path.StartsWith("~/")` branch covered by existing tests.

2. ResolveAsync_TildePrefixedOpenClawHome_ExpandsRelativeToOsHome
   - openClawHomeOverride == "~/subdir" is itself tilde-prefixed and must
     be expanded relative to osHomeOverride before it is used as the base
     for further tilde expansion in stateDirOverride.

Both tests also verify that file migration from the legacy data path to
the resolved state path succeeds and that the migrated file content is
preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 12, 2026, 9:59 AM ET / 13:59 UTC.

Summary
Adds two unit tests for bare-tilde and tilde-prefixed home expansion in ExecApprovalsStore path resolution.

Reproducibility: not applicable. This PR adds regression coverage for source-confirmed branches rather than reporting a failing user workflow.

Review metrics: 2 noteworthy metrics.

  • Test cases: 2 added, 0 changed, 0 removed. Both additions target previously uncovered branches of the same path-resolution helper.
  • Changed surface: 1 test file, 0 production files. The patch cannot directly alter runtime behavior and has a tightly bounded review surface.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Confirm ./build.ps1 and the repository-required test gates on the exact PR head before merge.

Risk before merge

  • [P1] The provided verification does not include a result for the repository-required ./build.ps1; that normal merge gate should complete before landing the PR.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused regression tests after the required full build and test gates confirm the exact PR head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] A maintainer should complete the normal required validation and decide whether to land this clean test-only coverage improvement.

Security
Cleared: The diff changes only unit tests and introduces no dependency, workflow, secret, permission, downloaded-code, or production execution surface.

Review details

Best possible solution:

Land the focused regression tests after the required full build and test gates confirm the exact PR head.

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

Not applicable; this PR adds regression coverage for source-confirmed branches rather than reporting a failing user workflow.

Is this the best way to solve the issue?

Yes. Focused tests are the narrowest maintainable way to protect the existing bare-tilde and chained home-expansion contracts without modifying production behavior.

AGENTS.md: found, but no applicable review policy affected this item.

Codex review notes: model internal, reasoning high; reviewed against 913ba4e8f504.

Label changes

Label changes:

  • add P3: This is a low-risk regression-coverage improvement with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This automated test-only PR is not subject to the external-contributor real-environment proof gate.
  • remove rating: 🌊 off-meta tidepool: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a low-risk regression-coverage improvement with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This automated test-only PR is not subject to the external-contributor real-environment proof gate.
Evidence reviewed

What I checked:

Likely related people:

  • vincentkoc: Authored the merged state-directory migration and path-expansion behavior exercised by these tests. (role: feature owner; confidence: high; commits: 913ba4e8f504; files: src/OpenClaw.Shared/ExecApprovals/ExecApprovalsStore.cs, tests/OpenClaw.Shared.Tests/ExecApprovalsStoreTests.cs)
  • Christine Yan: Introduced most of the ExecApprovalsStore test fixture and its surrounding baseline coverage in the initial repository history. (role: original test-area contributor; confidence: medium; commits: 85445c78066b; files: tests/OpenClaw.Shared.Tests/ExecApprovalsStoreTests.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. repo-assist 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.

0 participants