Skip to content

fix: restore projection tests for admitted operator requests - #201473

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-main-red-projection-authority-tests-20260919
Nov 18, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-main-red-projection-authority-tests-20260919

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two managed-workspace tests fail on main after #201334 because they still treat a role change as cancellation of already-admitted operator work. This maintainer-requested main repair aligns those expectations with the existing request admission contract.

User Impact

No production behavior changes. Already-admitted checkpoint settlement and guest filesystem writes remain allowed after a role change; the next admission is refused. Explicit source cancellation and Gateway shutdown still refuse privileged writes.

Why This Change Was Made

The older delegated-authority doctrine was explicitly superseded by #197557 (123f8787c4767): root AGENTS.md says authority is checked when work starts and revocation applies to the next request; the agent guide distinguishes calls already in progress from calls after lifecycle closure. #201334 (04cb8179ccd66) applies that rule to Gateway operator-derived turns, while preserving source assertions, cancellation, exact run/claim, physical-store and credential fences. Restoring role-policy reads at every checkpoint would reverse that intentional contract.

The existing boundary fixture now proves the distinction: an admitted guest filesystem write reaches canonical storage after its role changes, reauthorization refuses, and an explicit source cancellation prevents another filesystem write even after a delayed native involvement receipt arrives. Command settlement similarly survives the role edit but refuses after source cancellation. Gateway-owner closure and the surrounding Stop, disposal, replacement and recovery cases remain covered.

Thanks to @obviyus for #201334 and the request-admission contract. Production LOC delta: 0. No configuration, schema, cache, or runtime guard changes.

Evidence

Unmodified main parent d2db7b2267faf4521b3c3a08acd062edd7cbf910: the two reported cases fail, and the Gateway closure control passes. The corrected three-case selection passes (22.86 seconds Vitest time; 26.62 seconds wrapper time). The initial reproduction took 61.31/65.13 seconds including a cold worker compilation; these are test costs, not a performance comparison.

Full authority/projection selection: 270 tests passed across 15 files, with two existing environment-dependent skips, in 288.88 seconds wrapper time. This includes the entire projection suite, operator-authority policy/recovery/reconnect suites, admitted-run lifecycle and delegated-claim tests, and sandbox custody/preparation/retirement tests. The queued-admission consumer suite also passes all 27 cases. pnpm check:changed passed, including the affected test typegraph, database guards, dead-export scans and changed-file lint. Formatting and git diff --check passed.

Codex autoreview of the complete local diff against d2db7b2267faf, through P2: scoped-clean, no actionable findings. The test-audit and simplify pass retained the real boundary fixture and added no production helpers; test delta is +41/−10 lines.

No new production performance claim: this changes only tests. Existing 62,000-file/1.100 GB projection measurements from #201410 remain applicable to the unchanged runtime; they were not rerun. The fixture executes real filesystem operations and real authority/checkpoint owners with a local substitute for the container backend; it is not native-container or live-model proof.

Keep role changes scoped to the next request as established by #197557 and #201334. Prove admitted guest writes and checkpoint settlement, next-request refusal, and explicit source cancellation across late committed receipts. Credit @obviyus for the admission contract; production behavior is unchanged.
@clawsweeper

clawsweeper Bot commented Nov 18, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Nov 18, 2026
@steipete
steipete marked this pull request as ready for review November 18, 2026 21:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T21:55:35.380032Z 6864413 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. 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-environment Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Updates workspace tests to allow admitted work after role changes while preserving cancellation and Gateway-closure checks.

Example: An admitted guest writes source.txt after its role changes to denied.

  • Before: The tests expect the write to be refused.
  • After: The tests verify the saved contents, refuse reauthorization, and reject further writes after explicit source cancellation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful test repair with meaningful boundary assertions, reported baseline comparison, and no actionable finding.
Proof confidence 🌊 off-meta tidepool Not applicable: No user-visible runtime behavior changes; supplied boundary-test results exercise real authority, checkpoint, storage, and filesystem owners with a substituted container backend.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Obsolete workspace tests reject the intentionally supported completion of already-admitted operator work.
Reason: The maintainer-authored repair follows the recorded merged direction and preserves independent cancellation and resource-lifetime boundaries.

Merge readiness

✅ Ready for maintainer review

This PR repairs obsolete test expectations after the intentional request-admission change; no actionable defects were found, and exact-head CI remains pending.

Priority: P3
Reviewed head: 6864413698c6b8bd36dca8351584a8c5bfbb290b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway operator authority enters the admitted-run and managed-workspace owners, which control filesystem writes and command checkpoint settlement into canonical storage.

flowchart LR
  A[Operator admission] --> B[Captured run authority]
  B --> C[Managed workspace]
  C --> D[Filesystem bridge]
  C --> E[Command checkpoint]
  D --> F[Canonical storage]
  E --> F
Loading

Technical review

Best possible solution:

Keep the focused test repair in the existing workspace fixture and complete the ordinary exact-head CI gates.

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

Source inspection confirms that main's tests expect role changes to invalidate authority that the current owner intentionally retains; the body supplies baseline failures, and this review executed no tests.

Is this the best way to solve the issue?

The smallest complete repair is to update these existing consumer tests, verify canonical file contents after role changes, and retain distinct cancellation and Gateway-closure controls.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Role-change checkpoint expectations changes intended behavior with a stated reason (fe60f48: Protect checkpoint settlement and Stop behavior using the original operator authority; the later merged admission contract deliberately changed role-policy lifetime.)
  • Delayed involvement receipt changes intended behavior with a stated reason (5583e40: Ensure involvement publications preserve usable workspaces without reviving invalid authority.)
  • Backend fixture provisioning keeps the original intent (513e6bf: Consolidate test scaffolding while retaining distinct authority and ordering scenarios; the repair reuses that fixture and supplies its actual workspace directory for real shell-backed writes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 04cb817 adds src/gateway/operator-run-authority.ts:627 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 04cb8179ccd6; files: src/gateway/operator-run-authority.ts)

PR surface

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

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

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 test coverage without changing shipped runtime behavior.
  • 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.

Label justifications:

  • P3: This repairs test coverage without changing shipped runtime behavior.
  • 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.

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 18, 2026, 5:09 PM ET / 22:09 UTC.

@steipete
steipete enabled auto-merge (squash) November 18, 2026 22:20
@steipete
steipete merged commit 4484f83 into main Nov 18, 2026
202 of 204 checks passed
@steipete
steipete deleted the steipete/perf-micro-main-red-projection-authority-tests-20260919 branch November 18, 2026 22:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

steipete added a commit that referenced this pull request Nov 18, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.
steipete added a commit that referenced this pull request Nov 19, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…aw#201473)

Keep role changes scoped to the next request as established by openclaw#197557 and openclaw#201334. Prove admitted guest writes and checkpoint settlement, next-request refusal, and explicit source cancellation across late committed receipts. Credit @obviyus for the admission contract; production behavior is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…aw#201527)

Apply the request-start authority contract from openclaw#197557 and @obviyus’s openclaw#201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow openclaw#201473 for the stale in-process session-read expectation.
RomneyDa added a commit that referenced this pull request Nov 19, 2026
Apply the request-start authority contract from #197557 and @obviyus’s #201334. Remove the obsolete per-effect source check while preserving next-consult denial and explicit Stop. Follow #201473 for the stale in-process session-read expectation.

(cherry picked from commit ac17452)

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 20, 2026
Bounded beta2 FRV repair; preserve the existing runtime contract and original failure assertions. Combined qualification follows integration.

Selected source hunks only; unrelated source changes excluded.

(cherry picked from commit 4484f83)

Co-authored-by: RomneyDa <[email protected]>
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: S 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