Skip to content

refactor(core): deslop core runtime states - #165288

Merged
steipete merged 6 commits into
mainfrom
deslop/l374-impossible-states-core-20261004
Oct 5, 2026
Merged

steipete merged 6 commits into
mainfrom
deslop/l374-impossible-states-core-20261004

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Core runtime paths repeatedly revalidate facts already established by their parser, schema, registrar, or lifecycle owner. This batch removes those redundant paths and makes internal settlement and publication states explicit.

User Impact

CLI runs now reject undefined, null, 0, and false failures after cleanup instead of silently returning an undefined success or replacing the primary failure with a cleanup error. Current config keys, wire formats, persisted SQLite state, model-facing descriptions, and visible output otherwise remain unchanged.

Under the approved July 2026 migration cutoff, this retires the June JSON dedupe import functions migratePersistentDedupeLegacyJsonFile and listPersistentDedupeLegacyJsonFileEntries, plus their two migration-only types. The JSON writer moved to SQLite on June 7 (bab18d567b0); current SQLite replay protection, claims, namespaces, and the import-entry helper remain.

Why This Change Was Made

936 net production lines removed (+684/−1,620), excluding tests, fixtures, generated files, docs, and ratchets. No code was moved out of the monorepo.

  • Agents consume concrete settings, required publications, canonical tool content, normalized model/auth facts, and discriminated settlement results.
  • Gateway metadata uses the production model-publication lifecycle, removing the alternate test-only refresh algorithm. RPC helpers consume admitted values; node work and acknowledgements use explicit completed states.
  • Infrastructure reuses canonical parsing and matching helpers and removes write-only state and impossible fallback branches. Authority, binding, rollback, and durable-state checks remain with their owners.
  • Plugin consumers use registrar-normalized facts and required registry collections. SDK internals use their host/runtime contracts directly, alongside the explicitly retired June importer.

Fixes found along the way

CLI settlement used error truthiness to distinguish failure from success. Its explicit outcome preserves falsy rejections, cleanup completion, and primary-error precedence. Eight regression cases cover successful and failed cleanup.

The reset-concurrency fixture raced a non-cancelling RPC deadline against accepted handler work. It now controls that clock and joins the existing async-work owner before retiring resources, preserving authority and durable-state assertions.

CI also exposed contracts that the cleanup must retain: missing-origin auth-choice precedence, bounded usage refresh, pin-presence short circuits, lifecycle-owned publication subscriptions, canonical descriptors in Gateway fixtures, and prepared model reads without hidden fixture discovery. Those corrections preserve the existing assertions.

Evidence

Current head: 7eac9aec48ea0d126cc8df9018c811d6cf31de13.

Conflict-only integration onto 5b618f2d8cb89a491d3131ede74e5f49a7fdc04a preserves newer main implementations and deletions. Overlapping cleanup already on main was dropped; no new deslop work was added. The resulting production reduction is 936 lines. Integration review identified a duplicate abort-helper import and combined SDK-budget mismatch; both are corrected, and the correction review is scoped-clean at P2. The canonical SDK report confirms 3,651 public exports / 2,114 callable exports, an exact decrease of four / two from the new base.

  • Independent review covered the core batch and fixture follow-ups. Nine initial findings were rejected with producer/caller evidence. Both CI correction reviews reported no actionable P0–P2 findings.
  • The old CLI settlement owner failed all eight new falsy-error cases for the intended reason; the candidate's full settlement file passed all 31 tests. A later six-file focused run passed 127 tests.
  • Linux production typecheck and changed-file lint passed. Focused Gateway-methods test types, correction lint, and seven metadata lifecycle conflict cases passed after integration.
  • The model/voicewake file passed all six tests after removing the fixture-only models.list warmup (230.76 seconds including local preparation).
  • Final infrastructure conflict proof passed all 53 command-extraction, image-migration, and recovery-receipt tests.
  • Linux reset-concurrency proof passed all 12 tests. Linux plugin contracts previously passed 48 files / 1,135 tests. No claim is made for unfinished repeated-stability or full-build proof.
  • The earlier SDK API comparison acknowledged the four June export removals, with no entrypoint changes. Its 127 reachable records retained their top-level declarations; conservative internal dependency-closure hashes account for those differences. Acknowledgement digest: 4e1f2845. The corrected surface-budget suite passed locally (10 passed, 1 platform-specific skip).

After integration, the complete CLI settlement suite passed all 31 tests, including the eight falsy-rejection regressions (150.15s file wall time). Update-command tests passed 4/4; SDK surface tests passed 10 with one existing Linux-only skip. The combined three-file invocation took 552.44s including cold subprocess compilation. No tests, assertions, timeouts, or retry settings were weakened.

A/B attribution of the two hosted failures

Hosted run 37268623844 tested the previous head 84b7e1ccd901. Each failing file was then run three times on detached merge-base, frozen current main, and PR-head checkouts on the same Mac/Node 26.5.0, using identical commands and per-revision clean CI-style QA runtime builds. All 18 invocations completed. Full A/B evidence.

Revision Telegram missing-method failure Scheduler lock failure Scheduler readiness inconclusive
Base c908806c87dd 3/3 2/3 1/3
Main 9151e48c4f9c 3/3 1/3 2/3
PR 84b7e1ccd901 3/3 2/3 1/3

Every scheduler attempt reaching the assertion failed identically: base 2/2, main 1/1, head 2/2. Readiness failures are inconclusive, not passes. Both original failures are inherited: Telegram's mock omitted deleteMyCommands, and the scheduler fixture opened a second service while the first retained exclusive database custody. The PR does not alter those owners.

Newer main already repaired these fixtures: #165430 supplies the Telegram stub; #165505 consolidates the old Telegram file; #165457 stops the Gateway before transferring scheduler database custody. This conflict-only rebase preserves all three upstream changes. The old A/B results establish historical attribution; they are not claimed as new-head CI or current failures.

Current-tree checks: core production typecheck and focused core/script lint passed; plugin contracts passed 48 files / 1,140 tests (443.82s Vitest, 501s wrapper). Runtime value cycles: zero. Madge reports one 17-module component, with every component module byte-identical to base 5b618f2d8cb; it is retained as an inherited failure, not relabeled green. The original two hosted failures were independently attributed by the requested A/B runs, qualifying the coordinator-authorized exact-head admin merge route. The 18-run comparison is not claimed as CI for the rebased head.

Protected heartbeat/Automations and PR-tooling paths are untouched. No live Gateway, deployment, or release was changed.

Post-merge follow-through: new-head CI run 37304487248 completed red. The one lane-attributable consolidated wait-fixture failure was corrected directly on main in 223f6e441ecb9bb80bbd80d885997a8ecc7270db, with five focused cases, Gateway test types, lint, and independent review passing. Production LOC is unchanged. Final CI evidence records the remaining Madge, Codex, and Copilot failures and the source-attribution limits.

@clawsweeper

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

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 7eac9aec48ea0d126cc8df9018c811d6cf31de13
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/store.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/harness/prompt-tool-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/model-auth-availability.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/docker-backend.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/remote-shell-command.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sessions/auth-storage-projection.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/methods/registry.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server-methods.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/infra/exec-approval-channel-runtime.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approvals-allowlist.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 5, 2026
@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. 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. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

This PR simplifies agent, Gateway, infrastructure, and plugin runtime states, preserves falsy CLI failures after cleanup, and removes retired JSON dedupe import APIs.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: the CLI correctness fix remains absent from main, and no blocking introduced defect was found. The documented retirement policy resolves the earlier migration concern; enforced CI still blocks landing.

Priority: P2
Reviewed head: 84b7e1ccd9015e204cb245d8f8840636deec069d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent cleanup with a focused correctness fix and substantial supplemental validation; ordinary CI remains a separate landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified repository-admin authorship exempts ordinary contributor runtime proof. Reported settlement regressions and metadata lifecycle checks are supplemental validation, not live execution evidence. Source comparison establishes unchanged supported SQLite contracts and intentional retirement of pre-July JSON imports.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified repository-admin authorship exempts ordinary contributor runtime proof. Reported settlement regressions and metadata lifecycle checks are supplemental validation, not live execution evidence. Source comparison establishes unchanged supported SQLite contracts and intentional retirement of pre-July JSON imports.
Evidence reviewed 11 items Pinned introduction and merge identity: Reviewed the introduced merge-base-to-head delta. Raw test-merge records confirm base f27df1d followed by the pinned PR head; base-only channel changes were not attributed to this PR.
Useful fix remains missing on main: Fetched main still distinguishes run failure by error truthiness. The branch records success or failure explicitly, preserves primary-error precedence, and retains the current-authority check before credential settlement.
Latest-release comparison: GitHub’s v2026.9.8 source also contains the truthiness-based settlement implementation, so the central correctness fix is not already shipped.
Findings None None.
Security None None.

How this fits together

OpenClaw’s runtime turns validated requests and prepared plugin/model facts into agent execution, session updates, and replies. These changes simplify internal state handling and completion without adding configuration.

flowchart TD
  A[Validated requests] --> B[Prepared runtime facts]
  B --> C[Agent and Gateway execution]
  C --> D[Result or failure]
  D --> E[Cleanup and settlement]
  E --> F[Replies and session updates]
  B --> G[Metadata publication]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Retired SDK exports 2 functions and 2 types removed These shipped migration-only exports are intentionally retired under the documented cutoff.
Falsy-error regression coverage 4 rejection values × 2 cleanup outcomes The cases protect failure preservation and primary-error precedence.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugin-sdk/migration-runtime.ts, unknown-truncated-pull-files. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep decisions with their validated runtime owners and preserve supported SQLite behavior while retiring the approved pre-July imports.

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

Yes, from source: a falsy rejection entering main’s CLI settlement can escape its truthiness-based failure check. The supplied regression evidence covers all four values; this review did not execute them.

Is this the best way to solve the issue?

Yes. Explicit settlement outcomes repair the failure distinction directly, and the cleanup consumes existing validated owners rather than adding competing behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The bounded CLI settlement correction and internal cleanup have normal maintainer priority; CI failures alone do not escalate it.
  • merge-risk: 🚨 compatibility: Four shipped migration exports disappear intentionally under the accepted retirement policy, affecting plugins that still import them.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Verified repository-admin authorship exempts ordinary contributor runtime proof. Reported settlement regressions and metadata lifecycle checks are supplemental validation, not live execution evidence. Source comparison establishes unchanged supported SQLite contracts and intentional retirement of pre-July JSON imports.

Evidence

What I checked:

  • Pinned introduction and merge identity: Reviewed the introduced merge-base-to-head delta. Raw test-merge records confirm base f27df1d followed by the pinned PR head; base-only channel changes were not attributed to this PR. (7e08af03cf3c)
  • Useful fix remains missing on main: Fetched main still distinguishes run failure by error truthiness. The branch records success or failure explicitly, preserves primary-error precedence, and retains the current-authority check before credential settlement. (src/agents/cli-runner/cli-run-settlement.ts:196, 84b7e1ccd901)
  • Latest-release comparison: GitHub’s v2026.9.8 source also contains the truthiness-based settlement implementation, so the central correctness fix is not already shipped. (src/agents/cli-runner/cli-run-settlement.ts, fc23bc864e45)
  • Accepted migration retirement: The maintainer-authored PR explicitly retires two June JSON import functions and two migration types. The repository’s July 1 cutoff permits retiring formats last written before that date; GitHub verifies the SQLite writer cutover as bab18d5 on June 7. Removed APIs existed in v2026.9.8, so plugins importing them must stop using them when upgrading; this intentional limitation remains compatibility context rather than a renewed acceptance request. Public docs: docs/gateway/doctor/config-migrations.md. (docs/gateway/doctor/config-migrations.md:33, 84b7e1ccd901)
  • Supported dedupe state preserved: The introduced dedupe change deletes retired JSON import code without changing SQLite replay storage, namespaces, claim handling, or the retained import-entry helper. No bundled production caller of either removed function remains; supported existing SQLite state needs no migration. (src/plugin-sdk/persistent-dedupe.ts:29, 84b7e1ccd901)
  • Security boundary retained: Plugin registration already creates canonical method descriptors with normalized scopes. Consuming those descriptors removes an internal handler-only fallback without changing the supported registration API. Question schemas retain the removed duplicate name, host-count, and mention-bound checks; execution approval analysis still rejects unsuccessful authorization plans. (src/plugins/registry-registrars-network.ts:79, 84b7e1ccd901)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • hannnnn-l: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-10-05T02:48:58.787Z sha ebe3468 :: blocked before merge. :: [P2] Migrate the remaining usage test off the removed refresh limit
  • reviewed 2026-10-05T04:06:54.642Z sha 4aa76691a4a5449ee54c4ed2237d1abc9af5575d :: blocked before merge. :: none
  • reviewed 2026-10-05T04:35:12.658Z sha d683dd7a0cddfebafea32b637a25d5e4558ec76a :: blocked before merge. :: none
  • reviewed 2026-10-05T05:05:30.951Z sha 8423727 :: blocked before merge. :: [P2] [P2] Reuse published catalog owners before preparing RPC fixtures
  • reviewed 2026-10-05T05:47:10.409Z sha 84b7e1c :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 5, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Oct 5, 2026
@steipete
steipete force-pushed the deslop/l374-impossible-states-core-20261004 branch 2 times, most recently from d683dd7 to 8423727 Compare October 5, 2026 04:44
@steipete
steipete enabled auto-merge (squash) October 5, 2026 04:48
@steipete
steipete disabled auto-merge October 5, 2026 05:05
@steipete
steipete force-pushed the deslop/l374-impossible-states-core-20261004 branch from 7a1bd8e to 84b7e1c Compare October 5, 2026 05:37
@steipete
steipete enabled auto-merge (squash) October 5, 2026 05:40
@steipete

steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Exact-head landing evidence for 84b7e1ccd9015e204cb245d8f8840636deec069d and CI run 37268623844.

Hosted CI cleared the cleanup-related failures from earlier runs, including the canonical Gateway descriptor fixtures, model-publication lifetime, and prepared model reads. Passing focused proof also includes the falsy CLI settlement regression and SDK surface ratchet. The full model/voicewake file passes all six tests; the final infrastructure conflict proof passes 53 tests. Independent reviews of both CI corrections found no actionable P0–P2 findings. Production reduction is 1,006 net lines (+751/−1,757), excluding tests, fixtures, generated files, docs, and ratchets.

Two E2E jobs still fail on this head:

  • checks-node-changed-1: Telegram media fixtures log bot.api.deleteMyCommands is not a function, then fail the no-error assertions. Main PR refactor(runtime): deslop impossible internal states #165236 removed the fallback while the unchanged fixture still omits that method. The failing Telegram call path is outside this PR's changes. This establishes a source-level inherited mismatch, but a matching hosted-main or unrelated-current-PR failure has not been found.
  • checks-node-changed-6: test/gateway.multi.e2e.test.ts fails “preserves scheduler runtime across a scheduler-disabled Gateway edit” because its separate scheduler encounters file_lock_timeout on openclaw.sqlite.cron-authority. The direct scheduler, receipt-custody, lock, and test owners are unchanged. Matching hosted baseline failure evidence is still missing; this remains unqualified for the inherited-failure merge exception.

The final runtime check reports zero value cycles. The final local Madge check reports two components covering 258 unchanged base modules. An earlier 48-module SQLite component was independently observed in main architecture CI; that evidence is not relabeled as proof of the expanded final components. No cycle module differs from the latest base c908806c87d.

Squash auto-merge is pinned to the head above. No admin merge has been submitted because the required hosted baseline qualification for the remaining E2E failures is absent. All lane cloud leases are released; later capacity failures allocated no lease.

@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

A/B attribution completed

All 18 requested invocations completed on one macOS arm64 host using Node 26.5.0, isolated detached checkouts, and frozen dependency installs. Each revision received its own pnpm build qaRuntime preparation; both build stamps matched its exact commit with clean inputs. The common test environment used CI's OPENCLAW_E2E_USE_PREBUILT_DIST=1. Tests, timeouts, retries, and assertions remained unchanged.

Each command ran three times per revision, with revision order rotated across rounds:

node scripts/run-vitest.mjs extensions/telegram/src/bot.media.downloads-media-file-path-no-file-download.e2e.test.ts
node scripts/run-vitest.mjs test/gateway.multi.e2e.test.ts
Revision Telegram missing-method failure Scheduler lock failure Scheduler attempt blocked at readiness
Merge-base c908806c87dd 3/3 2/3 1/3
Frozen current main 9151e48c4f9c 3/3 1/3 2/3
PR head 84b7e1ccd901 3/3 2/3 1/3

The scheduler's other attempts timed out before Gateway readiness and never reached the lock assertion; they are not counted as reproductions or passes. Every attempt that reached the scheduler assertion failed with the same file_lock_timeout: base 2/2, main 1/1, PR 2/2. Base and PR also have identical raw reproduction rates. Additional readiness/clock or media-test timeouts are retained in the logs as separate outcomes.

Telegram cause: bot construction starts native command-menu synchronization. The fixture's mocked bot supplies setMyCommands but lacks deleteMyCommands; clearing the default and group command scopes produces two runtime errors. The fixture and failing menu path are byte-identical in all three revisions. Main change ae6676dc252 removed the old fallback; this PR's guards do not control that setup path.

Scheduler cause: disabling automatic scheduling does not prevent an awaited cron.add from acquiring host-owned receipt custody. The test leaves that manager alive, then starts another CronService against the same database. The second process encounters the live exclusive .cron-authority lock. Custody is released with the database resource, rather than after each RPC or by stopping the timer. The relevant acquisition/release path is unchanged across the three revisions.

Both hosted failures therefore reproduce without this PR at comparable rates. This evidence qualifies the coordinator-authorized inherited-failure merge route; no corrective source or test change is needed for these two failures.

Full pinned revisions:

  • Base: c908806c87dd1f06d63934f4b35854e5f0c4b429
  • Main at comparison start: 9151e48c4f9cf6c2a306535aa295e9a967518585
  • Reviewed PR head: 84b7e1ccd9015e204cb245d8f8840636deec069d

The reported hosted failures remain visible in run 37268623844. They are classified as inherited, not relabeled green.

@steipete
steipete disabled auto-merge October 5, 2026 10:37
Consume typed and validated owner facts directly, strengthen internal state
unions, and remove redundant normalization and forwarding paths. Preserve
external-input validation and live authority at their existing boundaries.

Retire the pre-July JSON dedupe migration APIs and run chat metadata tests
through the normal publication lifecycle instead of an alternate refresh path.

Fix CLI settlement swallowing falsy thrown values after cleanup. Preserve
error formatting and primary-failure precedence.
Join accepted reset-handler work before fixture teardown and control the unrelated RPC response clock. Preserve authority and durable-state assertions. Remove redundant fixture setup and unused overrides, and shrink assertion budgets to the measured production counts.
Retain native listener-array copying, preserve command-error precedence, and resolve scoped lint findings without changing assertions or boundary validation.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Conflict-only integration is pushed as 7eac9aec48ea0d126cc8df9018c811d6cf31de13 after the completed 18-run A/B attribution.

Revision Telegram missing method Scheduler lock Scheduler readiness inconclusive
Base c908806c87dd 3/3 2/3 1/3
Main 9151e48c4f9c 3/3 1/3 2/3
Tested PR 84b7e1ccd901 3/3 2/3 1/3

Both original failures are inherited. The new base also incorporates their upstream fixture repairs (#165430, #165457, and the Telegram consolidation in #165505), which remain untouched by this PR.

Integration review caught and corrected one duplicate abort-helper import and combined SDK-budget counts. Correction review is scoped-clean at P2. The final tree passed 31 CLI settlement tests (including all eight falsy-error regressions), four update-command tests, ten SDK surface tests with one platform skip, 1,140 plugin contract tests across 48 files, core types, and focused lint. Runtime cycles are zero. Madge still reports one 17-module component; every component file is byte-identical to the new base 5b618f2d8cb. That failure is explicitly retained as inherited.

Final production reduction is 936 lines (+684/-1,620); overlapping cleanup already landed upstream was dropped, with no new deslop work. The original A/B run is historical evidence for its exact tested head, not a claim of new-head hosted CI. Proceeding with the maintainer-authorized inherited-failure merge exception pinned to the exact API head.

@steipete
steipete merged commit bd64d93 into main Oct 5, 2026
62 of 63 checks passed
@steipete
steipete deleted the deslop/l374-impossible-states-core-20261004 branch October 5, 2026 11:42
steipete added a commit that referenced this pull request Oct 5, 2026
Restore the successful completion fixture after test consolidation reintroduced a legacy raw status. The real agent.wait owner already normalizes completed to ok. Type the table so invalid mock states cannot recur; keep assertions and the normalization owner regression unchanged. Follow-up to #165288.
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Post-merge CI follow-through: run 37304487248 completed with four failed non-aggregate jobs. The one integration failure attributable to this lane is now corrected directly on main in 223f6e441ecb9bb80bbd80d885997a8ecc7270db, following the red-main repair policy.

Upstream test consolidation (#165438) reintroduced the raw completed fixture into server-plugins.test.ts. The real in-process agent.wait owner already normalizes that status to ok before returning. The fix restores the valid success fixture and types the table as AgentWaitResult; assertions, timeout/error cases, and production behavior remain unchanged. Five selected cases passed, including the existing real normalization-owner regression (239.42s wrapper, 211.17s Vitest). Gateway test types, focused lint, and independent P2 review passed. Runtime cycles remain zero; the same inherited 17-module Madge component remains. Production delta is unchanged at -936 lines.

Remaining failures for the main-CI coordinator:

Job Failure Source attribution
check-guards Madge: one 17-module deferred-migration/state-reader cycle All component files unchanged by this PR; registration edge introduced by #165498.
checks-node-changed-extensions-bundle-3-1 extensions/codex/src/app-server/run-attempt-thread-cleanup.test.ts: three cases observe unexpected thread/unsubscribe Earlier main #165487 deliberately moved unsubscribe to cleanup authority; these assertions still expect foreground-cancellation retirement. Relevant path is unchanged by this PR.
checks-node-changed-extensions-bundle-3-2 extensions/copilot/harness.test.ts: cancellation-boundary case observes one send instead of zero Earlier main #165340 queues the start microtask before the timeout helper installs the listener; the test queues abort during that listener registration. Relevant boundary/helper path is unchanged by this PR.

The last two are source-attributed to pre-existing main commits; no separate matching hosted-baseline reproduction was found, and none is claimed. No extension repair, unrelated main fix, additional PR, or CI rerun was introduced in this lane. The failed aggregate gate remains historical evidence, not a green CI claim.

steipete added a commit that referenced this pull request Oct 5, 2026
Keep the single-message sanitizer private and exercise its production
array API from the existing tests. Remove the unused BranchSummaryResult
re-export from the internal runtime facade; retain its public SDK export.
The last production consumers were removed in bd64d93 (#165288).

Both named Knip findings reproduce three times before this change and
are absent in three scans afterward. The 55 sanitizer/persistence tests
pass three times, and display-projection siblings pass. Production
typechecks and touched-file lint pass; neither cycle check adds a component.
Unrelated Knip findings in CLI root help and media-understanding defaults,
and the inherited 17-file migration component, remain outside this fix.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
* refactor(core): deslop core runtime states

Consume typed and validated owner facts directly, strengthen internal state
unions, and remove redundant normalization and forwarding paths. Preserve
external-input validation and live authority at their existing boundaries.

Retire the pre-July JSON dedupe migration APIs and run chat metadata tests
through the normal publication lifecycle instead of an alternate refresh path.

Fix CLI settlement swallowing falsy thrown values after cleanup. Preserve
error formatting and primary-failure precedence.

* test(core): stabilize cleanup fixtures and tighten ratchets

Join accepted reset-handler work before fixture teardown and control the unrelated RPC response clock. Preserve authority and durable-state assertions. Remove redundant fixture setup and unused overrides, and shrink assertion budgets to the measured production counts.

* fix(core): keep native listener descriptors type-safe

Retain native listener-array copying, preserve command-error precedence, and resolve scoped lint findings without changing assertions or boundary validation.

* fix(core): preserve runtime and fixture contracts during cleanup

* test(gateway): preserve prepared model read ownership

* fix(core): reconcile imports and SDK budgets after rebase
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Restore the successful completion fixture after test consolidation reintroduced a legacy raw status. The real agent.wait owner already normalizes completed to ok. Type the table so invalid mock states cannot recur; keep assertions and the normalization owner regression unchanged. Follow-up to openclaw#165288.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Keep the single-message sanitizer private and exercise its production
array API from the existing tests. Remove the unused BranchSummaryResult
re-export from the internal runtime facade; retain its public SDK export.
The last production consumers were removed in ed04ab7 (openclaw#165288).

Both named Knip findings reproduce three times before this change and
are absent in three scans afterward. The 55 sanitizer/persistence tests
pass three times, and display-projection siblings pass. Production
typechecks and touched-file lint pass; neither cycle check adds a component.
Unrelated Knip findings in CLI root help and media-understanding defaults,
and the inherited 17-file migration component, remain outside this fix.
steipete added a commit that referenced this pull request Oct 8, 2026
…a dated compat record (#167036)

Related: #166404

## What Problem This Solves

Fixes: shipped Plugin SDK subpaths and exports could be removed without the surface check noticing, which broke published third-party plugins such as `@tencent-weixin/openclaw-weixin` on 2026.10.1-beta.1.

## User Impact

User impact: the stable Plugin SDK surface can no longer silently disappear. Removing a subpath or named export that shipped in the latest stable release now fails `pnpm plugin-sdk:surface:check` unless a compatibility record covers it with a final compatibility day that has passed. No runtime behavior changes; nothing is restored here (restoring the removed subpaths for #166404 is a separate product decision).

## Why This Change Was Made

`plugin-sdk:surface:check` only enforced maximum export-count budgets, and the API baseline diff is report-only. The commits that retired `config-runtime`, `infra-runtime`, `channel-message`, `command-auth` and four other subpaths (912+ named exports that shipped in v2026.9.8) lowered those budgets in the same change, so the check passed. A ceiling cannot detect a removal.

This adds a committed inventory of the latest stable release's typed public surface (`scripts/lib/plugin-sdk-shipped-surface.json`, pinned to the current npm `latest` v2026.9.9: 158 typed subpaths, 4,591 named exports, identical to v2026.9.8). It is generated from the release tag's package exports and declarations by `pnpm plugin-sdk:shipped-surface:gen -- --release <tag>`, reusing the existing tagged-revision renderer from `plugin-sdk:api:diff`, and is regenerated during stable closeout (documented in RELEASING.md). The surface check compares the current tree against it:

- A missing shipped subpath, or a missing name in a surviving subpath, needs a compat record whose `surfaces` names `openclaw/plugin-sdk/<subpath>` (whole subpath) or the qualified `openclaw/plugin-sdk/<subpath>.<Name>`. Bare names do not count.
- The record must be `deprecated`, `removal-pending`, or `removed` with a `removeAfter` strictly before the current UTC date (the date is the final compatibility day). A `removalGate` alone or a future date does not authorize; budgets play no role.
- Packaged private runtime facades without a `types` condition are excluded: they are not a declared contract.

To make current `main` pass without restoring anything, the already-landed removals are recorded honestly:

- Dated tombstones for the five subpaths retired under the Sept 30 owner decision (`removeAfter` 2026-09-30) and new tombstones for `command-auth`, `discord`, `telegram-account`, whose records were deleted in 0d530ea (`removeAfter` 2026-10-01).
- 14 later named-export removals from surviving subpaths (2fec39f #165431, bd64d93 #165288, f2de06b #163587) recorded retroactively per owner decision; each release note states the export was removed without a compatibility window.
- The Skill Workshop proposal-hook types removed by cfee851 (#161057) already had a tombstone; its surfaces are now qualified and dated.

Release-note context: Plugin SDK authors get a migration-guide row for each of the 14 retroactively recorded exports in `docs/plugins/sdk-migration/removed-surfaces.md`.

## Evidence

- Inventory generation from tag `v2026.9.8` (fc23bc8): 158 typed subpaths, 4,591 names; `config-runtime` 115, `infra-runtime` 583, `channel-message` 136, `command-auth` 78 names.
- Historical transition, guard + inventory overlaid on throwaway worktrees with `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-01`: `e649be31^` shows only pre-existing gaps; `e649be31` additionally fails on exactly `channel-lifecycle` (23), `channel-message` (136), `channel-reply-pipeline` (12), `config-runtime` (115), `infra-runtime` (583) despite its lowered budgets.
- Final tree: `pnpm plugin-sdk:surface:check` → `shipped Plugin SDK v2026.9.8: no unauthorized removals`. Reverting the tombstone dates re-reports all eight subpaths; pinning `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-07` re-reports the eight Skill Workshop types (strict date semantics).
- The guard already caught a live regression during this PR: cfee851 landed on main mid-review and the rebased check failed on its eight unqualified types until the record was fixed.
- Regenerated against v2026.9.9 (bcfc888) after it went stable mid-review: zero subpaths or names added or dropped versus v2026.9.8; check still clean.
- PR wrapper inventory lists the new compat-record module (first CI run failed `eager-import-closure` / `pr-worktree-provision` on its absence).
- Focused tests (`--maxWorkers=1`): `test/scripts/plugin-sdk-shipped-surface.test.ts` 20 passed (~2.2 s wall), `src/plugins/compat/registry.test.ts` 12 passed, `test/scripts/plugin-sdk-surface-report.test.ts` 11 passed / 1 Linux-only skip; all three ~11.7 s wall. Pure evaluator tests, no TS project boots, no timers.
- `node scripts/check-changed.mjs`: every lane passed except two inherited from `main`: the dead-export scan (`observePlacementAuthority`, already fixed on main by 0178423) and core lint on three over-length files this PR does not touch. Direct oxlint on all changed `.ts`/`.mts` files is clean.
- Autoreview (Codex, P2 threshold): scoped-clean.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…a dated compat record (openclaw#167036)

Related: openclaw#166404

## What Problem This Solves

Fixes: shipped Plugin SDK subpaths and exports could be removed without the surface check noticing, which broke published third-party plugins such as `@tencent-weixin/openclaw-weixin` on 2026.10.1-beta.1.

## User Impact

User impact: the stable Plugin SDK surface can no longer silently disappear. Removing a subpath or named export that shipped in the latest stable release now fails `pnpm plugin-sdk:surface:check` unless a compatibility record covers it with a final compatibility day that has passed. No runtime behavior changes; nothing is restored here (restoring the removed subpaths for openclaw#166404 is a separate product decision).

## Why This Change Was Made

`plugin-sdk:surface:check` only enforced maximum export-count budgets, and the API baseline diff is report-only. The commits that retired `config-runtime`, `infra-runtime`, `channel-message`, `command-auth` and four other subpaths (912+ named exports that shipped in v2026.9.8) lowered those budgets in the same change, so the check passed. A ceiling cannot detect a removal.

This adds a committed inventory of the latest stable release's typed public surface (`scripts/lib/plugin-sdk-shipped-surface.json`, pinned to the current npm `latest` v2026.9.9: 158 typed subpaths, 4,591 named exports, identical to v2026.9.8). It is generated from the release tag's package exports and declarations by `pnpm plugin-sdk:shipped-surface:gen -- --release <tag>`, reusing the existing tagged-revision renderer from `plugin-sdk:api:diff`, and is regenerated during stable closeout (documented in RELEASING.md). The surface check compares the current tree against it:

- A missing shipped subpath, or a missing name in a surviving subpath, needs a compat record whose `surfaces` names `openclaw/plugin-sdk/<subpath>` (whole subpath) or the qualified `openclaw/plugin-sdk/<subpath>.<Name>`. Bare names do not count.
- The record must be `deprecated`, `removal-pending`, or `removed` with a `removeAfter` strictly before the current UTC date (the date is the final compatibility day). A `removalGate` alone or a future date does not authorize; budgets play no role.
- Packaged private runtime facades without a `types` condition are excluded: they are not a declared contract.

To make current `main` pass without restoring anything, the already-landed removals are recorded honestly:

- Dated tombstones for the five subpaths retired under the Sept 30 owner decision (`removeAfter` 2026-09-30) and new tombstones for `command-auth`, `discord`, `telegram-account`, whose records were deleted in bc7ecd0 (`removeAfter` 2026-10-01).
- 14 later named-export removals from surviving subpaths (936fe5d openclaw#165431, ed04ab7 openclaw#165288, 0e5b206 openclaw#163587) recorded retroactively per owner decision; each release note states the export was removed without a compatibility window.
- The Skill Workshop proposal-hook types removed by 1991553 (openclaw#161057) already had a tombstone; its surfaces are now qualified and dated.

Release-note context: Plugin SDK authors get a migration-guide row for each of the 14 retroactively recorded exports in `docs/plugins/sdk-migration/removed-surfaces.md`.

## Evidence

- Inventory generation from tag `v2026.9.8` (fc23bc8): 158 typed subpaths, 4,591 names; `config-runtime` 115, `infra-runtime` 583, `channel-message` 136, `command-auth` 78 names.
- Historical transition, guard + inventory overlaid on throwaway worktrees with `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-01`: `3be7252f^` shows only pre-existing gaps; `3be7252f` additionally fails on exactly `channel-lifecycle` (23), `channel-message` (136), `channel-reply-pipeline` (12), `config-runtime` (115), `infra-runtime` (583) despite its lowered budgets.
- Final tree: `pnpm plugin-sdk:surface:check` → `shipped Plugin SDK v2026.9.8: no unauthorized removals`. Reverting the tombstone dates re-reports all eight subpaths; pinning `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-07` re-reports the eight Skill Workshop types (strict date semantics).
- The guard already caught a live regression during this PR: 1991553 landed on main mid-review and the rebased check failed on its eight unqualified types until the record was fixed.
- Regenerated against v2026.9.9 (bcfc888) after it went stable mid-review: zero subpaths or names added or dropped versus v2026.9.8; check still clean.
- PR wrapper inventory lists the new compat-record module (first CI run failed `eager-import-closure` / `pr-worktree-provision` on its absence).
- Focused tests (`--maxWorkers=1`): `test/scripts/plugin-sdk-shipped-surface.test.ts` 20 passed (~2.2 s wall), `src/plugins/compat/registry.test.ts` 12 passed, `test/scripts/plugin-sdk-surface-report.test.ts` 11 passed / 1 Linux-only skip; all three ~11.7 s wall. Pure evaluator tests, no TS project boots, no timers.
- `node scripts/check-changed.mjs`: every lane passed except two inherited from `main`: the dead-export scan (`observePlacementAuthority`, already fixed on main by 6dfbb46) and core lint on three over-length files this PR does not touch. Direct oxlint on all changed `.ts`/`.mts` files is clean.
- Autoreview (Codex, P2 threshold): scoped-clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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