Skip to content

fix(claws): review verified manifests and respect host plugin policy - #166798

Closed
Patrick-Erichsen wants to merge 16 commits into
codex/claw-1093-v2-29-mcp-recovery-stackfrom
codex/claw-1093-publish-13-manifest-host-policy
Closed

Patrick-Erichsen wants to merge 16 commits into
codex/claw-1093-v2-29-mcp-recovery-stackfrom
codex/claw-1093-publish-13-manifest-host-policy

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Publication Refresh: October 7

Layer 13/16. Previous: #163307 | Next: #166799. Published checkpoint: e05149e2b6b4.

Full stack tip: #166801. Earlier local-ClawHub lifecycle evidence remains in #163307, tied to its recorded revision.

What Problem This Solves

A Claw review could omit the exact grouped manifest, and installation could proceed despite host plugin policy or leave workspace ownership difficult to reconcile.

User Impact

Users can inspect the verified manifest before Add or Update. Host-disabled, denied, or unlisted plugins stop before installation. Re-adding a removed Claw selects a fresh workspace, and verified exports preserve their package license.

Why This Change Was Made

Bind manifest disclosure and reviewed workspace facts to the accepted plan, retain the verified archive for later source checks, and use existing plugin and agent ownership checks before effects. This layer contains the previously local source, export, removal, policy, and manifest-review follow-ups.

Evidence

  • Combined stack at 9e653a8ed286: 100 focused backend tests passed on October 7 in 64.75 seconds, including exact artifact resolution, manifest projection, host plugin policy, staged capability recheck, Remove authority, and approval request routing.
  • Combined stack browser checks: 13/13 passed in 28.51 seconds across mobile through desktop, using the real built Control UI with a mocked Gateway. These are UI boundary checks, not a production registry or chat canary.
  • Before screenshot: the prior local stack checkpoint 2ab926ce8c93 exposes action/capability review. After screenshot: the combined stack also exposes the exact grouped manifest. Captures use synthetic package data.
  • The prior pnpm check:changed result applies to the unchanged combined tip; it was not rerun after a rebase because no new rebase was performed.

Publication Scope

Related: #163946. This is a draft layer in the Claws Labs stack. The stack retains its previously tested base and currently conflicts with newer main; this publication does not resolve that drift or authorize a release. Production ClawHub support, the compatible published Lobster artifact, official catalog security review, and RFC acceptance remain release gates. The local-source CLI and official-only launch scope are unchanged.

Before: review at the original stack checkpoint

After: exact manifest and artifact review

@clawsweeper

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

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed October 7, 2026, 7:27 PM ET / 23:27 UTC.

ClawSweeper review

What this changes

The PR exposes verified Claw manifests before Add and Update, enforces host plugin policy, preserves export licenses, and adjusts workspace selection and removal cleanup.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 6 items remain

This layer contains useful work absent from current main and should remain open. A delayed Remove result can clear a recreated agent’s directory ownership, and authority-boundary and existing-cache compatibility evidence remain incomplete.

Priority: P2
Reviewed head: e05149e2b6b4b4bda711f86c933ff849a9ae1793

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful implementation and inspected visual evidence are limited by a replacement-ownership defect and missing authority and upgrade proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Pinned introduction: Reviewed the merge-base-to-head introduced hunks. The checkout is the original PR head, whose raw commit records parent 5fce40f; the supplied test merge belongs to the pinned stack base, not fetched current main.
Still necessary on current main: Fetched main has none of the Gateway Add planning, manifest-disclosure, or retained-source-artifact modules checked here. No merged fixing PR is established by the related context.
Latest release check: The supplied latest release revision contains neither new manifest-disclosure nor retained-source-artifact module; this review does not establish a shipped equivalent fix.
Findings 1 actionable finding [P2] Preserve directory ownership when the agent has been recreated
Security None None.

How this fits together

Claws package agent configuration, workspace files, and optional plugins for installation. The Gateway turns verified packages into reviewed plans, while the Control UI collects consent and lifecycle owners apply or remove the resources.

flowchart TD
  A[Official package archive] --> B[Verify package and manifest]
  B --> C[Gateway review plan]
  D[Host policy and ownership] --> C
  C --> E[Control UI review and consent]
  E --> F[Revalidate live authority]
  F --> G[Install update or remove resources]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve directory ownership when the agent has been recreated (P2) - The child completes its deletion journal and releases the lifecycle lease before runClawRemoveCli settles. During that interval, another request can recreate the same agent and register the same directory. This new unconditional unregister then removes the replacement’s registration because the registry distinguishes only ID and path; input.assertCurrent() validates the requester, not the agent incarnation. Reverse directory consumers such as session suspension and provider/auth preparation can consequently lose the replacement’s scope. Retire only the removed incarnation under the owning lifecycle/config boundary, and cover delayed child completion after recreation.
  • Resolve merge risk (P1) - The changed policy and cleanup boundaries lack after-fix final-effect evidence showing that denied or revoked installation authority and reassigned workspace ownership stop effects safely.
  • Resolve merge risk (P1) - Previously downloaded official Claws without retained archives can become unexportable; recovery for those existing caches and real upgrade compatibility have not been demonstrated.
  • Complete next step (P2) - Reconcile the draft stack with current main and satisfy its recorded launch gates before marking this layer ready; update the PR body with redacted evidence, which should trigger re-review automatically, or ask a maintainer to comment @clawsweeper re-review.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P2] Preserve directory ownership when the agent has been recreated — src/claws/gateway-remove-apply.ts:218-222
Agent review details

Security

None.

PR surface

Source +666, Tests +1088, Docs +13, Other 0. Total +1767 across 52 files.

View PR surface stats
Area Files Added Removed Net
Source 26 896 230 +666
Tests 23 1215 127 +1088
Docs 2 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 3 0
Total 52 2127 360 +1767

Review metrics

Metric Value Why it matters
Production versus test growth production +666 net; tests/support +1088 net; docs +13 net The stated verification, disclosure, and cleanup responsibilities explain the production growth, while focused boundary and compatibility coverage accounts for most test growth.

Stored data model

Persistent data-model change detected: database schema: ui/src/pages/agents-home/claws-manifest-review.ts, serialized state: src/claws/gateway-add-apply.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve ownership and verify existing-state recovery (recommended)
    Bind directory retirement to the removed incarnation, provide verified recovery for older archive-less caches, and attach final-effect authority and upgrade evidence.

Technical review

Best possible solution:

Keep one verified lifecycle owner that binds consent to exact artifacts, preserves replacement-agent ownership, and can recover older verified source caches without discarding license integrity.

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

Yes, source establishes a focused PR regression scenario: complete child removal, recreate the same agent and directory before child settlement, then let the old Gateway completion unregister that directory. This was not executed, and it is not a current-main reproduction.

Is this the best way to solve the issue?

Partly: reusing canonical policy, consent, and cleanup owners is appropriate, but directory retirement needs incarnation protection and archive verification needs an existing-cache recovery path.

Full review comments:

  • [P2] Preserve directory ownership when the agent has been recreated — src/claws/gateway-remove-apply.ts:218-222
    The child completes its deletion journal and releases the lifecycle lease before runClawRemoveCli settles. During that interval, another request can recreate the same agent and register the same directory. This new unconditional unregister then removes the replacement’s registration because the registry distinguishes only ID and path; input.assertCurrent() validates the requester, not the agent incarnation. Reverse directory consumers such as session suspension and provider/auth preparation can consequently lose the replacement’s scope. Retire only the removed incarnation under the owning lifecycle/config boundary, and cover delayed child completion after recreation.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is bounded experimental lifecycle hardening with a replacement-ownership defect, rather than an established urgent production outage.
  • add merge-risk: 🚨 compatibility: Export now depends on archive verification that older downloaded source caches may be unable to satisfy.
  • add merge-risk: 🚨 session-state: A delayed completed Remove can erase directory ownership belonging to a recreated agent.
  • add merge-risk: 🚨 security-boundary: The patch changes host-policy enforcement and cleanup authority, whose denied, revoked, and reassigned cases still need final-effect evidence.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is bounded experimental lifecycle hardening with a replacement-ownership defect, rather than an established urgent production outage.
  • merge-risk: 🚨 session-state: A delayed completed Remove can erase directory ownership belonging to a recreated agent.
  • merge-risk: 🚨 security-boundary: The patch changes host-policy enforcement and cleanup authority, whose denied, revoked, and reassigned cases still need final-effect evidence.
  • merge-risk: 🚨 compatibility: Export now depends on archive verification that older downloaded source caches may be unable to satisfy.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Authority-chain proof required: inspected before/after images demonstrate manifest presentation in the built UI with a mocked Gateway, but the changed plugin-policy and removal owners lack allowed, denied, revoked, and reassigned final-effect traces. The linked real lifecycle run predates this layer. Existing-cache export compatibility is also unproven.

Evidence

What I checked:

  • Pinned introduction: Reviewed the merge-base-to-head introduced hunks. The checkout is the original PR head, whose raw commit records parent 5fce40f; the supplied test merge belongs to the pinned stack base, not fetched current main. (e05149e2b6b4)
  • Still necessary on current main: Fetched main has none of the Gateway Add planning, manifest-disclosure, or retained-source-artifact modules checked here. No merged fixing PR is established by the related context. (40d735e451b1)
  • Latest release check: The supplied latest release revision contains neither new manifest-disclosure nor retained-source-artifact module; this review does not establish a shipped equivalent fix. (fc23bc864e45)
  • Manifest review and consent: The production projection validates artifact identity and serializes the grouped manifest/profile. Add and Update include that disclosure in the consent projection; the UI renders package text through escaped Lit interpolation and refuses incomplete disclosures. (src/claws/gateway-manifest-disclosure.ts:8, e05149e2b6b4)
  • Host-policy enforcement: Plugin preflight now applies canonical enable-state policy to fresh installs and version conflicts as well as reuse. Added managed-installer tests cover explicit disablement, global disablement, denylist/allowlist rejection, and default-policy success; these are supplemental tests rather than live final-effect proof. (src/claws/plugin-capability-probe.ts:256, e05149e2b6b4)
  • Replacement ownership race: The newly introduced serving-process unregister runs after awaiting the removal subprocess. The child completes its deletion journal and releases its lease before subprocess settlement; agent creation accepts a completed tombstone. The unregister operation checks only agent ID and directory, while the RPC assertion checks client authority rather than the target’s incarnation. (src/claws/gateway-remove-apply.ts:222, e05149e2b6b4)

Likely related people:

  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Gio Della-Libera: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Protect a recreated agent’s directory registration from delayed Remove completion.
  • Attach redacted final-effect traces for allowed, denied, revoked, and reassigned authority at the changed production boundaries.
  • Demonstrate fresh archive retention and upgrade/export recovery from a previously downloaded official cache without its original archive.

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.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Closing as superseded: #171623 replaced the Claws plan/review/update/remove lifecycle with a one-way Add operation, and main no longer has the lifecycle modules this layer changes. Any hardening here that still matters should be redone against the new Add flow.

Closed by Roboclaw at the author's request after an audit of his open PRs. The branch is kept, so this can be reopened if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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.

2 participants