Skip to content

refactor(types): drain chained-assertion ledger — extensions - #124378

Merged
steipete merged 5 commits into
mainfrom
steipete/chained-drain-g3
Aug 16, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/chained-drain-g3

Conversation

@steipete

@steipete steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The no-chained-type-assertions guard still excluded every bundled plugin scope, leaving 124 findings in 82 extension files outside enforcement.

Why This Change Was Made

This drains the extension portion of the burn-down ledger. Twenty-one fixable assertions now retain type evidence through boundary parsers, schema validation, owner return types, or typed reconstruction. The remaining 103 assertions are narrowed to 70 exact files, each with a reviewable reason describing the dependency, SDK, lifecycle, test-support, or protocol seam that still requires the assertion.

Notable owner fixes include a Zod-owned QA bus request envelope, validated Matrix/Chrome/Zalo/Reef boundary objects, typed provider doctor migrations, and reuse of Discord's canonical persisted-binding normalizer. No public Plugin SDK shape changes.

User Impact

No user-facing feature change. Extension code now gets the chained-assertion guard by default, while malformed external inputs are parsed before entering typed runtime paths.

Evidence

  • node scripts/run-oxlint.mjs --openclaw-focused-config --config config/oxlint/boundary-guards.json extensions — pass
  • node scripts/run-oxlint.mjs --openclaw-focused-config --config config/oxlint/boundary-guards.json src extensions packages ui/src — pass
  • node scripts/run-vitest.mjs test/scripts/oxlint-boundary-guards.test.ts — 4 tests pass
  • Focused plugin tests for browser, DeepInfra, Discord, Google Chat, LongCat, Matrix, Microsoft Foundry, QA Lab, Reef, Tlon, and Zalo — pass; the exact Chrome MCP regression file has 87 passing tests and the final Matrix shard has 147
  • node scripts/check-changed.mjs — changed production/test typechecks and extension/script lint pass; final unrelated runtime-sidecar guard cannot run in this linked worktree because local node_modules/playwright-core is intentionally absent (remote ci-fast backend was unavailable)
  • .claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings
  • Initial inventory: 124 findings / 82 files. Result: 21 fixed / 103 ledgered in 70 exact files with reasons; zero extension scope exclusions
  • LOC: production +357/-42 (net +315, primarily runtime boundary schemas/parsers); tooling ledger +70/-32; tests +0/-0

Codex-backed seams were checked directly against upstream app-server protocol ownership in codex-rs/app-server-protocol/src/protocol/v2/model.rs, protocol/v2/thread.rs, and protocol/event_mapping.rs; the Codex assertions remain exact-file entries for transcript and staged lifecycle bridges.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: tlon Channel integration: tlon channel: zalo Channel integration: zalo scripts Repository scripts extensions: qa-lab extensions: deepinfra extensions: longcat LongCat provider plugin channel: reef Channel integration: reef extensions: browser extensions: microsoft-foundry labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 03:24
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 16, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. 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 Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:47 PM ET / August 16, 2026, 03:47 UTC.

ClawSweeper review

What this changes

Enables chained-type-assertion enforcement for bundled extensions, replaces selected assertions with parsing or typed reconstruction, and narrows remaining exceptions to documented files.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-authored PR open. The prior browser depth-truncation finding appears addressed, but repository policy requires a direct sibling Codex protocol inspection for the retained Codex-specific ledger entries; that checkout and GitHub network access are unavailable here.

Priority: P2
Reviewed head: d7c48d141920ab93dbbc32577c36871c8809585b

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The prior browser issue appears repaired, but the required Codex dependency-contract review is unavailable for a complete exact-head assessment.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is outside the external-contributor proof gate; reported static checks remain supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal refactor is outside the external-contributor proof gate; reported static checks remain supplemental evidence.
Evidence reviewed 4 items Prior finding addressed: The current head uses an iterative pending-stack traversal when normalizing Chrome MCP snapshots, preserving descendants rather than discarding them at a parser depth cap.
Caller and downstream truncation owner: The normalized snapshot feeds Chrome MCP snapshot actions; the downstream renderer owns and reports its own depth/size truncation result.
Required Codex contract unavailable: The PR explicitly bases retained Codex exception rationales on app-server protocol ownership, but ../codex is absent and GitHub cannot be reached to obtain it.
Findings None None.
Security None None.

How this fits together

Bundled extensions convert channel, provider, webhook, and MCP input into typed plugin runtime values. The boundary guard and exception ledger control where assertion-based conversions are prohibited or explicitly justified.

flowchart LR
  A[Channel provider and tool data] --> B[Bundled extension]
  B --> C[Boundary parser]
  C --> D[Typed plugin runtime]
  D --> E[Extension behavior]
  F[Assertion guard ledger] --> B
Loading

Before merge

  • Resolve merge risk (P1) - The retained Codex app-server exception rationales cannot be checked against their authoritative upstream source in this environment.
  • Complete next step (P2) - A merge verdict is blocked by the repository-required direct Codex protocol inspection, not by a narrow automatable repair.
Agent review details

Security

None.

PR surface

Source +315, Other +38. Total +353 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 12 357 42 +315
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 70 32 +38
Total 13 427 74 +353

Review metrics

Metric Value Why it matters
Production versus test LOC production +315 net; tests +0 net The refactor adds runtime boundary parsers across extensions without adding regression coverage for those changed paths.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/deepinfra/doctor-contract-api.ts, migration/backfill/repair: extensions/longcat/doctor-contract-api.ts, migration/backfill/repair: extensions/reef/src/doctor-durable-state.ts, serialized state: extensions/discord/src/monitor/thread-bindings.state.ts, unknown-data-model-change: extensions/reef/src/doctor-durable-state.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete Codex contract review (recommended)
    Verify the retained Codex app-server exception rationale against the sibling protocol source before merging this broad ledger change.

Technical review

Best possible solution:

Re-run the exact-head review with the sibling Codex checkout available, validate the retained Codex exception entries against its app-server protocol, and retain the iterative Chrome snapshot conversion.

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

Not applicable: this is an internal assertion-safety refactor; the repaired browser path was source-checked but not executed in the read-only checkout.

Is this the best way to solve the issue?

Unclear: the iterative browser conversion resolves the prior concrete concern, but the overall solution cannot be confirmed without the directly cited Codex protocol source.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 057f98359eb0.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor is outside the external-contributor proof gate; reported static checks remain supplemental evidence.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a broad internal safety refactor across bundled extension boundaries with limited direct user-facing impact.
  • merge-risk: 🚨 other: Multiple parser conversions and guard exceptions change together, while a stated dependency contract remains unverified.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor is outside the external-contributor proof gate; reported static checks remain supplemental evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Recent commits cover both the extension boundary-guard work and the follow-up browser snapshot repair; older ownership history was not locally available in this partial checkout. (role: recent area contributor; confidence: medium; commits: d2cd94601cc1, d7c48d141920; files: scripts/oxlint-boundary-guards.mjs, extensions/browser/src/browser/chrome-mcp-result.ts)

Rank-up moves

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

  • Re-review with the sibling Codex source available and validate the retained Codex exception contracts.

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 (1 earlier review cycle)
  • reviewed 2026-08-16T03:31:22.965Z sha 438090d :: needs changes before merge. :: [P2] Preserve the depth-truncation signal

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 16, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready follow-up on the latest ClawSweeper moves:

  • Preserved the browser depth contract by replacing the capped recursive parser with an iterative normalizer. The full 50,000-node structured snapshot chain is retained, so the existing renderer remains the truncation owner.
  • Reproduced the prior failure on extensions/browser/src/browser/chrome-mcp.test.ts; the repaired head passes all 87 tests in that file.
  • node scripts/run-oxlint.mjs --openclaw-focused-config --config config/oxlint/boundary-guards.json extensions and the full src extensions packages ui/src lane pass.
  • Personally checked upstream Codex app-server contracts in codex-rs/app-server-protocol/src/protocol/v2/model.rs, protocol/v2/thread.rs, and protocol/event_mapping.rs; the three Codex entries remain exact-file lifecycle/transcript seams.
  • Final branch autoreview is clean with no accepted findings.
  • Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/31924854044

The old review referenced extensions/browser/src/browser/chrome-mcp-result.test.ts, which does not exist; chrome-mcp.test.ts is the existing end-to-end structured-result/ref-rewrite coverage and contains the 50,000-depth regression.

@steipete
steipete merged commit acbbff1 into main Aug 16, 2026
136 checks passed
@steipete
steipete deleted the steipete/chained-drain-g3 branch August 16, 2026 03:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…w#124378)

* refactor(types): drain chained-assertion ledger — extensions

* fix(types): parse Matrix summary events at the boundary

* style(types): satisfy extension map lint

* style(types): name the Tlon image marker cleanly

* fix(browser): preserve deep MCP snapshots iteratively
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: reef Channel integration: reef channel: tlon Channel integration: tlon channel: zalo Channel integration: zalo extensions: browser extensions: deepinfra extensions: longcat LongCat provider plugin extensions: microsoft-foundry extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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