Skip to content

test(auto-reply): canonicalize session export expectations - #118138

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

steipete merged 1 commit into
mainfrom
codex/qa-session-export-realpath

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • align session-export test expectations with the canonical absolute path returned by the fs-safe Root
  • restore relative, absolute, and symlinked-workspace cases on macOS
  • leave production export policy and behavior unchanged

Root cause and fix

macOS exposes temporary directories lexically as /var/..., while fs-safe resolves the workspace to its canonical /private/var/... identity before returning absolutePath. Three assertions built their expected path from the lexical fixture, so they failed despite writing and reading the correct file.

The expectations now resolve the fixture workspace before joining the export path. Production delta is 0 lines.

Closes #118137

Proof

Exact candidate head: 57f32d62a9087c0a9c9ae60fe1eb9967a7096af6

  • Current-main reproduction: 3 failures across relative, absolute, and symlinked-workspace cases
  • node scripts/run-vitest.mjs src/auto-reply/reply/commands-export-session.test.ts — 34/34 passed after final rebase
  • stress loop — 20/20 complete shard runs passed
  • node scripts/check-changed.mjs -- src/auto-reply/reply/commands-export-session-file.test-support.ts — passed on Blacksmith Testbox tbx_01kz1xjxsy9qcwp1q5a7hb12ky (run)
  • Codex autoreview — clean, no accepted/actionable findings, overall confidence 0.99

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: 🐚 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-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, 3:13 PM ET / 19:13 UTC.

ClawSweeper review

What this changes

The PR changes two session-export filesystem test expectations so they compare against the canonical absolute workspace path returned by the fs-safe root.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

This remains necessary: current main still expects lexical temporary-directory paths while the session-export owner returns the canonical filesystem path. The two-line test-only repair matches that owner contract and introduces no correctness or security concern, but the protected maintainer label requires explicit maintainer handling rather than automated cleanup or merge.

Priority: P3
Reviewed head: 57f32d62a9087c0a9c9ae60fe1eb9967a7096af6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned test repair with supplied targeted validation and no actionable defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled, test-only repair is exempt from the external-contributor real-behavior-proof gate; its body nevertheless supplies focused post-fix test and stress-loop evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled, test-only repair is exempt from the external-contributor real-behavior-proof gate; its body nevertheless supplies focused post-fix test and stress-loop evidence.
Evidence reviewed 4 items Current-main mismatch remains: Current main still constructs expected absolute paths from the lexical temporary workspace in the relative/absolute and symlinked-workspace cases, while the production writer returns await workspaceRoot.resolve(writtenPath). The PR changes only those two expectations to resolve the workspace first.
Production owner boundary: The session-export filesystem owner creates an fs-safe Root from workspaceDir, writes through that Root, and returns the Root-resolved absolute path; the PR does not alter this production behavior.
Feature and test provenance: The test helper was introduced in Peter Steinberger's session-command consolidation commit, while the fs-safe session-export boundary originates in the earlier workspace-containment repair. This supports treating the test expectation as the faulty layer rather than changing the export policy.
Findings None None.
Security None None.

How this fits together

The auto-reply session-export command writes an HTML export through the fs-safe workspace boundary, then reports the resolved output path to the command reply. The changed helper verifies that relative, absolute, and symlinked workspace requests preserve that canonical path contract without changing production export behavior.

flowchart LR
  A[Export command request] --> B[Session export writer]
  B --> C[fs-safe workspace root]
  C --> D[Canonical filesystem path]
  D --> E[Export result]
  E --> F[Auto-reply confirmation]
  D --> G[Filesystem test expectations]
Loading

Decision needed

Question Recommendation
Should the maintainer-owned macOS test reliability repair be accepted once the exact-head required checks complete successfully? Accept the focused test repair: Merge after the remaining exact-head checks are green; this preserves the established canonical-path contract without runtime changes.

Why: Repository policy keeps maintainer-labeled items out of automated cleanup, even where the source and patch are otherwise clear.

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled, test-only repair is exempt from the external-contributor real-behavior-proof gate; its body nevertheless supplies focused post-fix test and stress-loop evidence.
  • Resolve merge risk (P1) - The provided check snapshot still had build-artifacts, extension-package-boundary, and SQLite-session-flip checks in progress; merge should wait for the exact-head required checks to finish green. The protected maintainer label also requires an explicit maintainer decision despite the narrow patch.
  • Complete next step (P2) - The patch is correct but the protected maintainer label and pending exact-head checks require explicit maintainer review rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source 0. Total 0 across 1 file.

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

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the expectation-only repair after the latest reviewable head has green required checks, retaining the fs-safe writer’s canonical-path contract and leaving production export policy untouched.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the expectation-only repair after the latest reviewable head has green required checks, retaining the fs-safe writer’s canonical-path contract and leaving production export policy untouched.

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

Yes, with medium confidence: the reported macOS path-alias reproduction uses the focused session-export test, and current source shows the lexical expected path diverging from the production Root-resolved path. This read-only review did not execute a macOS run locally.

Is this the best way to solve the issue?

Yes. Updating the two faulty test expectations is the narrowest maintainable repair because the production writer intentionally owns canonical path resolution and the patch does not weaken its workspace or symlink policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 920a265d8179.

Labels

Label changes:

  • add P3: This is a narrowly scoped test reliability correction 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 maintainer-labeled, test-only repair is exempt from the external-contributor real-behavior-proof gate; its body nevertheless supplies focused post-fix test and stress-loop evidence.

Label justifications:

  • P3: This is a narrowly scoped test reliability correction 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 maintainer-labeled, test-only repair is exempt from the external-contributor real-behavior-proof gate; its body nevertheless supplies focused post-fix test and stress-loop evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced the consolidated session-export file helper and is also the author of the candidate repair, so the current test contract history points here. (role: recent test-suite owner and current area contributor; confidence: high; commits: 58f43c703eea, 57f32d62a908; files: src/auto-reply/reply/commands-export-session-file.test-support.ts)
  • VACInc: Introduced the session-export fs-safe writer whose canonical resolved-path behavior the test must preserve. (role: filesystem-boundary introducer; confidence: medium; commits: 6f0326af3642; files: src/auto-reply/reply/commands-export-session-file.ts)

Rank-up moves

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

  • Wait for the remaining exact-head required checks before merge.

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

Land-ready proof for exact head 57f32d62a9087c0a9c9ae60fe1eb9967a7096af6:

  • Current-main macOS reproduction: relative, absolute, and symlinked-workspace cases expect lexical /var/... while fs-safe correctly returns canonical /private/var/... paths.
  • Corrected session-export shard: 34/34 passed after final rebase.
  • Stress: 20/20 complete shard runs passed.
  • Blacksmith Testbox changed gate passed: tbx_01kz1xjxsy9qcwp1q5a7hb12ky (run).
  • Hosted exact-head CI is fully green: run 30762730814.
  • Final Codex autoreview is clean with 0.99 confidence and no accepted/actionable findings.

Scope remains two test expectations with zero production LOC; workspace confinement, symlink rejection, overwrite, permissions, collision handling, docs, config, storage, and changelog behavior are unchanged.

@steipete
steipete merged commit 05ab518 into main Aug 2, 2026
100 of 106 checks passed
@steipete
steipete deleted the codex/qa-session-export-realpath branch August 2, 2026 19:25
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

Test: session export expectations use noncanonical macOS paths

1 participant