Skip to content

feat: add readiness conditions and providers - #104018

Closed
giodl73-repo wants to merge 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/readiness-profiles-upstream
Closed

giodl73-repo wants to merge 6 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/readiness-profiles-upstream

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Related RFC: openclaw/rfcs#33

Maintainer Decision Requested

Should V1 include the public, activation-scoped api.registerReadinessCriterion Plugin SDK contract together with operator selection through gateway.readiness?

The proposed answer is yes: plugins already own runtime resources that core cannot observe correctly, registration does not select or require a criterion, callbacks are observational and bounded by core, and invalid or stalled providers become structured Unknown results instead of stalling /readyz. Approving this means treating the callback and selection identifiers as supported compatibility surface.

If maintainers do not want that public commitment in V1, the separable fallback is to land the canonical core evaluator and core-owned conditions first, then defer plugin registration. Subject identity remains useful in either shape.

Problem

OpenClaw exposes Gateway /ready and /readyz, but readiness is a fixed set of Gateway observations. Hosts cannot select the additional facts their deployment requires, plugins cannot contribute bounded observations, and CLI, health, and status do not share one canonical structured result. Operators therefore reconstruct "ready to serve" with private scripts.

Proposal

Implement RFC 0018 as an opt-in readiness contract:

  • preserve the existing Gateway lifecycle and channel decision when gateway.readiness is absent
  • normalize lifecycle, drain, channel, event-loop, config, plugin, and workspace evidence into structured required or advisory conditions
  • fail readiness for required False or Unknown conditions
  • let operators select registered core and plugin criteria through gateway.readiness
  • let activated plugins register namespaced observational criteria without selecting them
  • bound provider callbacks and whole-result evaluation, coalesce concurrent work, cache briefly, validate and redact output, and fail closed instead of hanging
  • fence late provider and filesystem results by runtime generation
  • project the same canonical result through /ready, /readyz, Gateway ready, Gateway health/status projections, and openclaw ready --json; keep HTTP /health and /healthz as shallow liveness
{
  gateway: {
    readiness: {
      requiredCriteria: ["openclaw.workspace-writable", "plugin.storage.backend"],
      advisoryCriteria: ["plugin.metrics.exporter"],
    },
  },
}

Subject Identity

A readiness decision can cover a Gateway, active config, plugin set, workspace, nodes, and plugin-owned resources at once. Canonical results declare those subjects once and each condition references the object it describes. Across polls, (subjectRef, type) is the stable condition key: a changed condition on the same Gateway ID is a state transition, while a changed Gateway ID is replacement.

IDs renew with the lifecycle owned by each subject. OpenClaw generates process and Gateway IDs. A host may provide OPENCLAW_INSTANCE_ID only as a fingerprinted host-workload parent, never as the Gateway ID. Config reload and drain do not rotate the Gateway ID; disposal and restart do. OpenClaw retains no history, but Docker, Kubernetes, OCC, telemetry, or another host can store and diff these bounded results.

Plugins receive a namespaced subject collector rather than inventing global references. Core reconciles declarations and fails closed on unresolved references, namespace conflicts, parent cycles, excess subjects, or duplicate (subjectRef, type) pairs. This is readiness attribution, not a general resource store, tenant identity, or control-plane model.

The focused subject-identity contract is included in RFC 0018's Readiness Subjects v1 sidecar.

Upgrade Compatibility

Absence of gateway.readiness is the compatibility boundary: /ready and /readyz call only the legacy checker, so runtime or plugin evaluator failure cannot introduce a new 503. Presence of the section, including {}, opts into bounded canonical evaluation. /healthz remains shallow liveness.

This PR does not add Hosting Profiles, Lobster/OCC concepts, Policy or Doctor dependencies, or a second health service.

Implementation Stack

The complete upstream landing stack is:

RFC 0018 - Readiness Conditions

  1. PR 104018 adds the readiness framework, providers, canonical projections, CLI, and subject identity at exact head a8098928a6b. It is restacked on upstream/main 9ef94e4ef93.
  2. PR 113421 adds reusable OpenClaw-owned conditions for core runtime owners at exact head a53f16878cc. It depends on PR 104018 and has been restacked after this parent baseline fix.

RFC 0023 - Standard Hosting Profiles

  1. PR 113422 adds the four Standard Hosting Profiles and their package-installed scenario matrix at exact head 18c42a7f26a. It depends on PRs 104018 and 113421.
  2. PR 114636 adds profile catalog inspection, live validation, and package release-conformance evidence at exact head 123bae7b876. It depends on PR 113422.

This PR is step 1. It includes tests, protocol bounds, Plugin SDK types, operator documentation, and Gateway RPC wiring so HTTP, ready, health, status, and CLI consumers share the same evaluator. RFC 0018 is independently adoptable; steps 3 and 4 are optional RFC 0023 follow-ons.

Real behavior proof

Behavior or issue addressed:
Gateway readiness now has one canonical opt-in result shared by /ready, /readyz, Gateway RPC ready, health/status projections, and openclaw ready --json, while preserving legacy readiness when gateway.readiness is absent.

Real environment tested:
Ubuntu 24.04 WSL checkout /tmp/openclaw-pr104018-merge2, Node v24.15.0, pnpm 11.15.1, fork branch giodl73-repo/openclaw:enterpriseclaw/pr104018-readiness-restack at commit a8098928a6b4276a78e3b29c6db76f5aeaef2f9f.

Exact steps or command run after this patch:

  1. git fetch origin enterpriseclaw/pr104018-readiness-restack && git checkout -B pr104018-current FETCH_HEAD && git reset --hard FETCH_HEAD
  2. node scripts/run-vitest.mjs run src/gateway/server/readiness.test.ts src/gateway/server-methods/health.readiness.test.ts src/gateway/server-methods-list.test.ts src/commands/status-runtime-shared.test.ts src/commands/ready.test.ts packages/gateway-protocol/src/schema/snapshot.test.ts src/gateway/server-startup-plugin-quarantine.test.ts --reporter=verbose --maxWorkers=1
  3. PROTOCOL_SINCE_BASE_SHA=b7f9cd0a01671f7be5fc34b4bd4bf6770603f480 pnpm protocol:check
  4. node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src-pr104018-restack.tsbuildinfo
  5. pnpm deadcode:exports
  6. pnpm plugin-sdk:api:check
  7. pnpm exec oxfmt --check apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt packages/gateway-protocol/src/schema/snapshot.test.ts scripts/plugin-sdk-surface-report.mjs src/commands/health.ts src/commands/status-runtime-shared.test.ts src/commands/status-runtime-shared.ts src/commands/status-all/format.ts src/gateway/health/types.ts src/gateway/methods/core-descriptors.ts src/gateway/server-methods-list.test.ts src/gateway/server-methods.ts src/gateway/server-methods/health.ts src/gateway/server-methods/health.readiness.test.ts src/gateway/server-startup-plugin-quarantine.test.ts src/gateway/server/readiness.test.ts src/commands/ready.test.ts
  8. git diff --check

Evidence after fix:
Local WSL terminal output at commit 90c2c3530eb reported: test] passed 3 Vitest shards in 29.24s; pnpm protocol:check reported protocol since guard passed: 5 new core methods use train 2026.7 and exited 0; TypeScript exited 0; deadcode:exports reported all three Knip unused-export scans passed with 0 entries; oxfmt --check reported All matched files use the correct format; git diff --check exited 0. After the baseline fix at commit a8098928a6b, pnpm plugin-sdk:api:check reported OK docs/.generated/plugin-sdk-api-baseline.sha256, and git diff --check exited 0.

Observed result after fix:
Focused readiness, Gateway method, Gateway method-list, status, ready-command, protocol-schema, and startup-quarantine coverage passed together after the upstream/main restack; generated protocol outputs are current, including the Android Gateway method tail; the updated type surface accepts gateway probe health payloads; no dead exports, formatting drift, or whitespace errors remain.

What was not tested:
This proof did not run a packaged Docker readiness/hosting profile matrix on this parent PR. The previously linked dependent profile-stack package proof remains supporting evidence for the downstream stack, not a replacement for this PR's source-level gate.

Validation

  • Focused Vitest passed in WSL at exact head 90c2c3530eb: src/gateway/server/readiness.test.ts, src/gateway/server-methods/health.readiness.test.ts, src/gateway/server-methods-list.test.ts, src/commands/status-runtime-shared.test.ts, src/commands/ready.test.ts, packages/gateway-protocol/src/schema/snapshot.test.ts, and src/gateway/server-startup-plugin-quarantine.test.ts.
  • PROTOCOL_SINCE_BASE_SHA=b7f9cd0a01671f7be5fc34b4bd4bf6770603f480 pnpm protocol:check passed in WSL and verified generated protocol artifacts.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src-pr104018-restack.tsbuildinfo passed in WSL.
  • pnpm deadcode:exports passed in WSL with 0 unused-export entries.
  • pnpm plugin-sdk:api:check passed in WSL at exact head a8098928a6b after refreshing the intended module/plugin-entry SDK baseline hash.
  • pnpm exec oxfmt --check passed for the touched readiness/status/gateway/protocol files.
  • git diff --check passed.
  • Package-installed Docker proof on the dependent profile stack passes all 13 profile/readiness scenarios and uploads the conformance artifact.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling size: XL maintainer Maintainer-authored PR labels Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 2:03 AM ET / 06:03 UTC (Revision 53).

ClawSweeper review

What this changes

Adds operator-selected Gateway readiness conditions, bounded plugin observations, and subject identities shared by HTTP probes and ready, health, and status RPC responses.

Merge readiness

⛔ Blocked before merge - 6 items remain

This remains useful, distinct work that current main does not implement. The previous admission-refresh and SDK-documentation findings are resolved, but a callback-custody defect remains alongside unresolved public SDK acceptance and packaged compatibility evidence.

Priority: P2
Reviewed head: db02b199f9a9dbb4e1d9e4ad0cdf48cf67bf1104
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong lifecycle evidence supports useful work, but callback custody and public-contract adoption remain unresolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Recorded production-path Gateway HTTP and WebSocket fault evidence demonstrates quarantine across config and plugin replacement and rejection of retired success. That proof does not cover the newly identified physical-custody defect. Current packaged fresh-install and published-driver upgrade compatibility remain unresolved independently.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): Recorded production-path Gateway HTTP and WebSocket fault evidence demonstrates quarantine across config and plugin replacement and rejection of retired success. That proof does not cover the newly identified physical-custody defect. Current packaged fresh-install and published-driver upgrade compatibility remain unresolved independently.
Evidence reviewed 11 items Pinned scope and clean checkout: Reviewed the merge-base-to-head introduction delta. The checkout is db02b19 and remained clean; origin identifies openclaw/openclaw.
Current main does not provide the requested facility: Current main retains the fixed Gateway readiness checker and lacks readiness selection in Gateway config and registerReadinessCriterion in the plugin API. The related open implementation stack depends on this facility rather than replacing it. No merged fixing PR was established.
Earlier admission finding resolved: Canonical evaluation rereads Gateway admission after awaited runtime evaluation and refreshes failure-path evidence within the original deadline. Focused regression coverage exercises drain transitions and timeout behavior.
Findings 1 actionable finding [P2] [P2] Retain physical custody until interruptible work settles
Security None None.

How this fits together

Gateway readiness tells deployment hosts whether OpenClaw can serve work. This change combines Gateway lifecycle facts with selected workspace and plugin observations, then publishes one structured readiness result.

flowchart TD
  A[Operator readiness selection] --> D[Canonical readiness evaluator]
  B[Gateway lifecycle facts] --> D
  C[Workspace and plugin observations] --> D
  D --> E[Required conditions satisfied]
  E --> F[HTTP readiness response]
  E --> G[Ready health and status RPC results]
Loading

Decision needed

Question Recommendation
Should V1 support api.registerReadinessCriterion and its gateway.readiness selector identifiers as public plugin compatibility contracts? Accept the bounded plugin contract: Include activation-scoped plugin observations after repairing custody and establishing packaged compatibility.

Why: The PR explicitly requests this commitment; source correctness and runtime proof cannot determine the permanent SDK scope.

Before merge

  • [P2] Retain physical custody until interruptible work settles (P2) - When a readiness callback ignores abort, this listener releases its PluginInstance lease immediately. That removes its token from calls, so dispose() can finish its drain and run onModuleDispose callbacks while the original callback is still executing; the existing timedOutCalls barrier never records it. Module cleanup clears captured loaders and deregisters resolvers that pending plugin code may still use. Keep admission revocation separate from physical custody, and release the latter only when the raw callback settles. This is a late discovery: the interruptible-call blob and relevant disposal mechanism were already present at the previous reviewed head.
  • Resolve merge risk (P1) - Public readiness registration and selection identifiers create a supported plugin contract whose V1 acceptance remains undecided.
  • Resolve merge risk (P1) - Packaged fresh-install and published-driver upgrade compatibility remain unverified for the reconciled implementation, including existing plugin and readiness settings.
  • Complete next step (P2) - Record the V1 SDK decision and align the PR body with the implemented HTTP/RPC, CLI, and host-identity scope.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.

Findings

  • [P2] [P2] Retain physical custody until interruptible work settles — src/plugins/plugin-interruptible-calls.ts:33-39
Agent review details

Security

None.

PR surface

Source +2061, Tests +2670, Docs +66, Generated 0, Other +2. Total +4799 across 66 files.

View PR surface stats
Area Files Added Removed Net
Source 38 2137 76 +2061
Tests 23 2694 24 +2670
Docs 1 67 1 +66
Config 0 0 0 0
Generated 2 3 3 0
Other 2 3 1 +2
Total 66 4904 105 +4799

Review metrics

Metric Value Why it matters
Public readiness surface 1 SDK registrar, 4 exported types, 2 selection lists, 1 RPC method These additions require an explicit supported-contract decision.
Production versus test growth production/tooling +2063 net lines; tests/support +2670 net lines The stated evaluator, identity, validation, and lifecycle responsibilities explain the production growth.

Merge-risk options

Maintainer options:

  1. Repair custody and validate adoption (recommended)
    Retain physical callback custody through raw settlement, record the SDK decision, and verify packaged fresh-install and upgrade behavior.
  2. Defer plugin registration
    Narrow V1 to the core evaluator if maintainers do not want the public callback and selector commitment.

Technical review

Best possible solution:

Keep one opt-in evaluator, preserve legacy deployment behavior, and separate callback admission revocation from physical custody until pending work settles.

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

Yes, source establishes the custody trigger: hold an abort-ignoring readiness callback, then quiesce and dispose its plugin instance; abort removes the call token before raw settlement. This review did not execute that scenario.

Is this the best way to solve the issue?

Unclear pending SDK acceptance. The canonical opt-in design is coherent, but cancellation must revoke admission without falsely reporting physical callback completion.

Full review comments:

  • [P2] [P2] Retain physical custody until interruptible work settles — src/plugins/plugin-interruptible-calls.ts:33-39
    When a readiness callback ignores abort, this listener releases its PluginInstance lease immediately. That removes its token from calls, so dispose() can finish its drain and run onModuleDispose callbacks while the original callback is still executing; the existing timedOutCalls barrier never records it. Module cleanup clears captured loaders and deregisters resolvers that pending plugin code may still use. Keep admission revocation separate from physical custody, and release the latter only when the raw callback settles. This is a late discovery: the interruptible-call blob and relevant disposal mechanism were already present at the previous reviewed head.
    Confidence: 0.92
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 availability: Aborting a pending callback can let plugin disposal retire resources before that callback physically settles.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): Recorded production-path Gateway HTTP and WebSocket fault evidence demonstrates quarantine across config and plugin replacement and rejection of retired success. That proof does not cover the newly identified physical-custody defect. Current packaged fresh-install and published-driver upgrade compatibility remain unresolved independently.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a useful opt-in deployment improvement with a bounded lifecycle defect and unresolved adoption gates.
  • merge-risk: 🚨 compatibility: The PR introduces public SDK and config contracts without recorded acceptance or current packaged upgrade proof.
  • merge-risk: 🚨 availability: Aborting a pending callback can let plugin disposal retire resources before that callback physically settles.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): Recorded production-path Gateway HTTP and WebSocket fault evidence demonstrates quarantine across config and plugin replacement and rejection of retired success. That proof does not cover the newly identified physical-custody defect. Current packaged fresh-install and published-driver upgrade compatibility remain unresolved independently.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded production-path Gateway HTTP and WebSocket fault evidence demonstrates quarantine across config and plugin replacement and rejection of retired success. That proof does not cover the newly identified physical-custody defect. Current packaged fresh-install and published-driver upgrade compatibility remain unresolved independently.

Evidence

What I checked:

  • Pinned scope and clean checkout: Reviewed the merge-base-to-head introduction delta. The checkout is db02b19 and remained clean; origin identifies openclaw/openclaw. (db02b199f9a9)
  • Current main does not provide the requested facility: Current main retains the fixed Gateway readiness checker and lacks readiness selection in Gateway config and registerReadinessCriterion in the plugin API. The related open implementation stack depends on this facility rather than replacing it. No merged fixing PR was established. (src/gateway/server/readiness.ts:87, 19fdc737079c)
  • Earlier admission finding resolved: Canonical evaluation rereads Gateway admission after awaited runtime evaluation and refreshes failure-path evidence within the original deadline. Focused regression coverage exercises drain transitions and timeout behavior. (src/gateway/server/readiness.ts:603, db02b199f9a9)
  • Public SDK documentation and decision: The infrastructure guide now documents registration, operator selection, callback deadlines, cache invalidation, quarantine, output validation, and subjects. The captured PR body expressly requests V1 acceptance of registration and selector identifiers; a proposal is not recorded acceptance. Public docs: docs/plugins/sdk-overview/infrastructure.md. (docs/plugins/sdk-overview/infrastructure.md:44, db02b199f9a9)
  • Physical callback custody is released on abort: The introduced abort listener releases the ordinary call token before the raw callback settles. PluginInstance removes that token from its calls map; disposal consequently bypasses pending-call custody and reaches module cleanup. Captured artifact disposal and module resolver deregistration are registered through onModuleDispose. (src/plugins/plugin-interruptible-calls.ts:33, db02b199f9a9)
  • Late-finding continuity verification: GitHub contents inspection at the previous reviewed revision returned blob 9428fe077789a5c5e62d74c577191946a23972a4, identical to the current interruptible-call file. The previous PluginInstance source also retained the same lease-removal and physical-disposal mechanism. This concern was visible previously and is acknowledged as a late discovery. (src/plugins/plugin-interruptible-calls.ts:33, 224d35adb6cd)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: 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.

  • Prove module custody survives abort and disposal until the raw readiness callback settles.
  • Record the V1 SDK decision and update the PR body to match the implemented HTTP/RPC scope, CLI availability, and host-identity behavior.
  • Establish packaged fresh-install and published-driver upgrade compatibility for the reconciled implementation.

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.

History

Review history (52 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-01T07:54:39.961Z sha e3e51376a657437fa9a6d5d41b93fcb30ebc5303 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the new public readiness registration contract
  • reviewed 2026-10-01T11:49:35.695Z sha 48cea96c0a21a3edf7656e80e683dca01abe8519 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the new public readiness registration contract
  • reviewed 2026-10-01T13:33:06.371Z sha 1cb168d055d4338c53d240fa882b596dd64e24e9 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the public readiness registration contract
  • reviewed 2026-10-01T13:57:19.849Z sha ea1e23a441bf01bcfab027813f4a204c6096e5b3 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the public readiness registration contract
  • reviewed 2026-10-01T14:37:19.015Z sha f39345486e1c1a700120e688b5fdbea4dbd492b0 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the public readiness registration contract
  • reviewed 2026-10-01T15:40:58.893Z sha e629819201ca0031c206826bd88e86d41e665af1 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the public readiness registration contract
  • reviewed 2026-10-01T16:14:39.476Z sha e629819201ca0031c206826bd88e86d41e665af1 :: blocked before merge. :: [P2] Recheck Gateway admission after awaiting readiness providers | [P3] Document the public readiness registration contract
  • reviewed 2026-10-01T17:47:24.097Z sha 224d35adb6cdc5e4c0e66ec5d6ed107f345a6092 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 11, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Packaged Docker Crabbox proof is complete on exact head 153d413b25cefa8b44978ff16bece0604863d9af.

  • provider: aws
  • run: run_578659dd34be
  • lease: cbx_221b83795d90 (swift-krill)
  • command: pnpm test:docker:hosting-profiles
  • result: exit 0; lease stopped

The lane passed local, container ready/fail-closed, reverse-proxy ready/fail-closed, node-mode not-ready/ready, and workspace full/recovery scenarios. The run used the trusted-main --fresh-pr bootstrap with exact-head and no-IAM verification, public networking, no Tailscale, and no credential hydration.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 11, 2026
@giodl73-repo
giodl73-repo force-pushed the user/giodl/readiness-profiles-upstream branch from 153d413 to 61b6346 Compare July 14, 2026 17:44
@openclaw-barnacle openclaw-barnacle Bot removed the docker Docker and sandbox tooling label Jul 14, 2026
@giodl73-repo giodl73-repo changed the title feat: add readiness conditions and hosting profiles feat: add readiness conditions and providers Jul 14, 2026
@giodl73-repo
giodl73-repo force-pushed the user/giodl/readiness-profiles-upstream branch from 61b6346 to b9a6f19 Compare July 14, 2026 17:57
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Refreshed onto current main at 6b5d3e25a988dac8b337c8c00762c87b90952231 without merging.

The 26-commit feature series was preserved and reconciled with current HTTP probe, Gateway kernel/request-context, plugin replacement, SDK documentation, and subject-identity ownership. The refreshed head also addresses the two source-backed P1 findings:

  • provider reasons whose sensitive-text redaction changes the value are rejected before RPC/HTTP/CLI projection;
  • pending plugin evaluations are cleared and generation-fenced so an abort-ignoring retired callback cannot satisfy a replacement runtime.

Focused exact-head proof:

  • readiness conditions/providers/selection/subjects/workspace: 44 passed
  • Gateway readiness, HTTP/RPC, startup quarantine, descriptors: 106 passed
  • CLI/status command lanes: 124 passed
  • config/plugin/protocol snapshot lanes: 19 passed
  • plugin SDK surface synchronization: 4,451 exports, passed
  • core lint, targeted oxlint, formatting, and diff checks: passed

Broader Windows-only noise remains outside this patch: existing /tmp vs C:\tmp expectations and SQLite cleanup EBUSY cases. Targeted readiness cases are green.

The public Plugin SDK/config scope remains the explicit maintainer decision; this refresh does not infer that acceptance.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@giodl73-repo

giodl73-repo commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Prepared a bounded repair for the pending-callback quarantine P1 in the existing review: 76871e01ad77d2c6e178fd94897f6b38481c3ad5, based directly on this PR head 6b5d3e25a988dac8b337c8c00762c87b90952231. A test-only Gateway follow-up is now pushed at 9ef6f24b9666b621e7fe351b84a26b05fe70151c.

Latest test-only follow-up: 8d98a2229ff48372131ecb595ed040687aa3f1bf. Frozen proof caught and fixed test typing errors and a shard-capacity issue: the HTTP regression now lives at src/gateway/server/readiness.server.test.ts, preserving the Gateway runner and all assertions without raising the 720-root limit. Production repair bytes are unchanged.

Plugin-loader follow-up: 136182bb36887a68e6c22826888f14424fecb7b6. A new regression in the production loader test graph loads two real loadOpenClawPlugins registry generations, holds the retired abort-ignoring callback pending, and proves replacement returns Unknown / CriterionPreviousEvaluationPending without overlap. The replacement evaluates only after retirement settles. Production and lockfile bytes are unchanged.

Full admission-path follow-up: f177e69a2c02ec27b09a76286db10f4c176ea232. A test-only lifecycle regression starts an actual Gateway and synthetic bundled plugin, holds an abort-ignoring readiness callback, sends a real WebSocket config.patch, and crosses the production config writer, watcher transaction, plugin teardown/reload, registry replacement, runtime-policy commit, and /readyz. Replacement stays Unknown/pending without overlap; retired success never becomes readiness; after settlement only the replacement callback runs and reports failure. Production and lockfile bytes are unchanged.

The separate fork branch fix/readiness-pending-quarantine-104018 preserves same-ID raw callback ownership across config/registry replacement. Replacement polls return fresh Unknown with current-owner subject metadata until the old callback actually settles; unrelated criteria can continue. No SDK/config/dependency contract changes. This PR branch has not been changed.

Code/test evidence:

  • With the final owner regression tests retained and production restored to exact original Git bytes, the negative control produced 8 expected failures / 12 passes. Repeated replacements started four callbacks instead of one; removal/readdition also bypassed quarantine.
  • With the repair: 40 tests pass across plugin-readiness, selection, subjects, and conditions. Coverage includes config/registry/both replacement before and after timeout, success/rejection settlement, current subject metadata, removal/readdition, independent criteria, and required Unknown keeping aggregate readiness false.
  • The initial Gateway command had 35 readiness passes but could not load server-request-context.test.ts because mdast-util-from-markdown was missing. Restoring the missing workspace dependency links to the existing install resolves that load failure: the same two-file command now passes all 57 tests (35 readiness + 22 request-context).
  • The new server.readiness-replacement.test.ts starts a test Gateway, uses real HTTP /readyz, and invokes the actual startup-registered commitRuntimePolicy callback. With a required synthetic plugin callback held pending and ignoring abort, config replacement returns 503 / Unknown / CriterionPreviousEvaluationPending without overlapping callbacks. Settling the old callback with success does not publish stale readiness: the old request resolves to replacement-owner 503 / False / StorageUnavailable. Later current-owner recovery returns 200.
  • With only plugin-readiness.ts restored to exact original blob 862e4510764fc1d87a500066514ec7b7b0154eca, that same Gateway test fails at the pending-quarantine assertion (False / StorageUnavailable instead of Unknown / pending). The repair was restored to blob 36c763b783b57bc291069243ed9304a6d6e73f2f afterward; the test SHA256 stayed a82a0786a2dfa3d1dc6d179adb803cf8061efb7cc0ede2ee577b3bf32d9fc6ac.
  • Final seven-file batch: 98 passing tests (40 owner + 58 Gateway), 91.67s wrapper. This is 23 additional distinct tests beyond the earlier 75, not 98 new tests.
  • Focused type-aware lint and formatting pass for the repair and new test; diff checks pass. Fresh read-only codex review --base 6b5d3e25a988dac8b337c8c00762c87b90952231 found no actionable source or test-lifecycle defects. The reviewer did not run tests.

Final command:

node scripts/run-vitest.mjs src/readiness/plugin-readiness.test.ts src/readiness/selection.test.ts src/readiness/subjects.test.ts src/readiness/conditions.test.ts src/gateway/server/readiness.test.ts src/gateway/server-request-context.test.ts src/gateway/server/readiness.server.test.ts

Frozen follow-up:

  • Fresh pnpm install --frozen-lockfile --ignore-scripts with Node24.21.0/pnpm12.3.4; candidate execution isolated from the credentialed Testbox host. Build/tests/checks used non-root, capability-dropped, network-none containers. No local dependency tree or credentials copied.
  • Standard build passes in 3m14.1s, as does core production typechecking. Build emits a nonfatal Control UI startup-size warning: 352267 bytes vs 352235-byte limit. No budget exception or baseline change; no separate original-build comparison is claimed.
  • The exact final source tree 1da828030a0285e61dbb87d7a29df81a10e49b25 passes all 98 tests, 11.90s wrapper, focused typed lint/format, and changed-test graph validation/typechecking (gateway-other, other). It was tested as a hash-checked overlay on the frozen installation, then committed unchanged. The earlier frozen pre-relocation batch also passed98; these are reruns, not additional distinct tests.
  • Full check:changed --base 6b5d3e25a988dac8b337c8c00762c87b90952231 --head 9ef6f24b9666b621e7fe351b84a26b05fe70151c stops at the max-lines suppression ratchet for src/commands/status.summary.test.ts and src/gateway/server-http.probe.test.ts. An exact original-base checkout reproduces both failures using the same frozen dependencies; both files and the baseline have identical blobs across original/candidate. Full check is not green; later lanes were not silently skipped or reported as passed. Core and selected-test types were run separately.
  • Fresh final codex review --uncommitted exits0 with no actionable findings. Independent tracked-byte verification and source/lock checks pass; the proof lease is stopped.
  • The exact loader candidate passes all 199 loader tests, the existing 98 readiness/Gateway tests, focused typed lint/format, and plugins-platform test typing on frozen Testbox lease tbx_01m3fkbpsqy9j5expwd5bkw59k (Actions 36266500388). Independent read-only verification matched all 40,267 tracked blobs; the lease is completed and no active Testboxes remain.
  • The exact full-path candidate passes all 199 loader tests, all 9 lifecycle tests, all 98 readiness/Gateway tests, focused typed lint/format, and selected gateway-root, gateway-other, plugins-platform, and other test type graphs on frozen Testbox lease tbx_01m3fpfnk8r022t4ec8ee6nd5g (Actions 36269657263). Independent raw-object verification matched all 40,268 tracked blobs; the lease is completed and no active Testboxes remain.

Limitations: the initial evidence above used reused dependencies; the frozen reruns supersede that installation gap. The real plugin-loader replacement and full watcher/config-writer/transaction/RPC/plugin-reload paths are now proved. Full-check disposition and resolved current-main stack integration remain outstanding. Current main 65e3eecabd84876e6e32ac858aa8ce83e9d25674 does not contain the proposed selectable plugin-readiness API; related #113421 remains open. This repair is offered for incorporation; it does not establish public Plugin SDK/config acceptance, author incorporation, adopter proof, or merge readiness.

@giodl73-repo

giodl73-repo commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head code and test evidence for db02b199f9a9dbb4e1d9e4ad0cdf48cf67bf1104 on base 0b025d14d064e4bad347de6139ecfaa7f6a6e020 (tree afac3ad019e5d2084927d8e70d1b8d778a13cf81).

Current-main integration:

  • The six-commit stack was replayed without conflicts onto the recorded base.
  • Against current main d09f1dd7d43e12b10fda85a48ac883b507dbde7e, only three files overlap; git merge-tree --write-tree succeeds. Upstream's Control UI/startup-helper refactor is independent of the readiness snapshot and async readiness changes.

Blacksmith Testbox static evidence:

  • 36959897511, lease tbx_01m3xa58z8t7mkxsxraf90h03w, performed a frozen pnpm 12.5.1 install and verified all 1,709 lockfile entries against supply-chain policy.
  • Broad check:changed passed conflict markers, line-cap (62 changed source files), max-lines, assertion safety, SQLite worker, timeout-race, dependency pins, generated config, Plugin SDK exports/budget, wrapper shadowing, package patches, all selected core/extension/script/root TypeScript graphs, dead-export scans, and core/extension/script lint.
  • That run found one actionable final-lane lint error: the Discord transcript E2E fixture redeclared the already imported closeSkillsWatchers. The redundant dynamic import was removed and folded into the watcher-cleanup commit.
  • On repaired head db02b199f9a, targeted check:changed passed line-cap, formatting, dependency/package guards, core graph boundary, all four root-test TypeScript shards, dead-export scans, scripts lint, and the repaired root-test lint with 0 warnings / 0 errors.

Blacksmith Testbox exact-head runtime evidence:

  • 36969551511, lease tbx_01m3xhpsx31xnz9epekj22m8b2, verified the exact head and materialized tree before execution, then completed another frozen install and 1,709-entry supply-chain verification.
  • All 20 changed test files passed across 7 Vitest shards, including readiness/config, plugin ownership and retirement, Gateway HTTP/RPC/startup lifecycle, and the production-path Discord transcript E2E fixture.
  • The E2E fixture completed its real Gateway/model publication, routed turns, summaries, and cleanup path in 41.5s.
  • pnpm config:docs:check passed.
  • Final head, Git tree, indexed working tree, and tracked working-tree integrity checks passed. The delegated command exited zero and the lease was stopped.

No Lobster change, patch retirement, SDK/config acceptance, packaged-upgrade compatibility, or merge decision is claimed by this evidence.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: db02b199f9a9dbb4e1d9e4ad0cdf48cf67bf1104
  • Maintainer: @giodl73-repo
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/methods/core-descriptors.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Pausing this implementation as part of an author-approved reduction of the active review queue. The readiness/profile implementation stack (#104018, #113421, #113422, #114636, #121355) is being parked together; RFC discussions openclaw/rfcs#33 and openclaw/rfcs#37 remain open and unchanged. Reopen the relevant implementation slices when maintainers agree the applicable public readiness/profile scope and there is capacity to refresh exact-head conformance proof. This is a prioritization pause, not a claim that the proposal was rejected or superseded. Branch and commit history are retained.

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

Labels

docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants