Skip to content

fix(test): create private Gateway artifact fixtures - #201763

Merged
vincentkoc merged 1 commit into
mainfrom
fix/gateway-artifact-private-fixtures
Nov 19, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/gateway-artifact-private-fixtures

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Gateway artifact integration tests can fail during startup when the ambient file-creation policy permits group or other users to write their fixture directories. The runtime correctly refuses the unsafe state directory before the tests can exercise message publication.

Related prerequisite for #200486; this change does not close that PR.

User Impact

No production behavior changes. Developers can exercise the existing artifact-publication assertions with fixture directories that satisfy the runtime's private-storage contract.

Why This Change Was Made

Both callers of the Gateway artifact fixture now request mode 0700 when creating their state and workspace directories. The runtime safety guard, test assertions, timeouts, internal scenarios and cleanup remain unchanged. The change is two test lines (+2/-2), with no production changes.

The observed failure identified an unsafe state directory; it did not record that directory's exact mode or the original process umask. This fix does not attribute the failure to a particular runner or numeric umask.

Evidence

Current signed source: ad5cd4fc02f2220275fc7826e246e3b510818095. Independent source review accepted the exact two-line change.

The bounded native run completed all 30 cases with no failures or skips: caption on Node and Bun, canonical-publication on Node, and all 27 existing temp-root tests on Node. Each test child recorded an isolated umask 000; the parent process and runtime safety checks were unchanged. The real unsafe-ancestor rejection passed. Runtime pins were Node 24.22.1, Bun 1.4.4-canary.1+191755ec1, pnpm 12.15.0 and Vitest 5.0.5 on Linux.

Targeted formatting and type-aware lint passed for both changed files, as did the canonical core-test-gateway-server type graph. The source/tree remained unchanged; child processes and output streams joined, and native resource settlement completed.

Carrier: https://github.com/openclaw/openclaw/actions/runs/44499535745. Its cancelled Actions conclusion records normal one-shot Testbox closure after the native workload exited 0; it is not a green whole-workflow CI result. The actual carrier checkout and all 931 reviewed workflow inputs matched. Independent workload and custody reviews accepted these receipts.

The complete committed range 4a7ee1f66aec5c8e27c7291a83c47ecc20a5169c → ad5cd4fc02f2220275fc7826e246e3b510818095 passed local autoreview with P0-only coverage and zero findings, including final source verification. This used the documented fallback because the local ClawSweeper runner checkout was divergent. Independent broader source review is separate from that severity-limited result. Exact-head PR CI, hosted ClawSweeper review, Security and native landing gates remain pending. No inherited-CI exception is requested. Parent PR #200486 remains unqualified.

@vincentkoc vincentkoc self-assigned this Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 19, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 19, 2026 10:09
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Please review exact head ad5cd4f. Both Gateway artifact fixtures now request private directories at creation; production guards, assertions, timeouts, and cleanup remain unchanged. Exact-head proof passed 30 tests (Node and Bun caption, Node canonical-publication, and 27 temp-directory guards) under an isolated permissive creation policy, plus targeted formatting, type-aware lint, and the core-test-gateway-server type graph. The committed-range local fallback review was P0-only with zero findings; broader independent source review is separate. The PR body records proof scope and the cancelled one-shot carrier; required CI and final native gates remain independent.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR creates both Gateway artifact tests’ state and workspace directories with mode 0700.

Example: Run either artifact integration test on Linux with umask 000.

  • Before: The fixture mkdir calls can create mode 0777 directories that violate runtime storage safety checks.
  • After: The fixture mkdir calls request mode 0700 so the existing publication assertions can run.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-supported test repair with focused validation recorded and no introduced defect found.
Proof confidence 🐚 platinum hermit (4/6) This test-only fixture repair requires no separate shipped-entry-point demonstration; focused Gateway and guard results are recorded in the maintainer’s evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers can encounter fixture startup rejection before the artifact-publication assertions execute.
Reason: The maintainer-authored repair makes existing fixtures satisfy the storage contract while preserving their intended coverage.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, useful fixture repair with no actionable findings; current main still needs the change, and exact-head CI remains pending.

Priority: P3
Reviewed head: ad5cd4fc02f2220275fc7826e246e3b510818095

Before merge

None.

Findings

None.

Agent review details

How this fits together

The integration fixtures supply isolated storage and synthetic provider responses to a real Gateway, then verify message history and authorized artifact downloads.

flowchart LR
  A[Test fixture] --> B[Private state and workspace]
  B --> C[Gateway storage admission]
  D[Synthetic provider] --> E[Message execution]
  C --> E
  E --> F[History and artifact assertions]
Loading

Technical review

Best possible solution:

Retain the two explicit directory modes and land through the existing exact-head gates.

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

Source establishes that an unqualified mkdir under umask 000 can create writable fixture directories; no tests were executed during this read-only review, and the original failure’s exact mode remains unknown.

Is this the best way to solve the issue?

Explicit modes at the two creation sites are the smallest complete repair using the existing fixture owners, with no new helper, global umask change, or weakened runtime check.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 23092d5 adds src/gateway/server.chat.canonical-publication.test.ts:83 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 23092d5817d4; files: src/gateway/server.chat.canonical-publication.test.ts)
  • Dallin Romney: Raw commit 8c4fcb8 adds src/gateway/server.message-buffer-caption.test.ts:198 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8c4fcb863256; files: src/gateway/server.message-buffer-caption.test.ts)

PR surface

Tests 0. Total 0 across 2 files. Added test files: 0.

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

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This repairs developer test fixtures without changing production behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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:

  • P3: This repairs developer test fixtures without changing production behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 November 19, 2026, 5:13 AM ET / 10:13 UTC.

@vincentkoc
vincentkoc merged commit 00f49d8 into main Nov 19, 2026
191 checks passed
@vincentkoc
vincentkoc deleted the fix/gateway-artifact-private-fixtures branch November 19, 2026 10:21
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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.

1 participant