Repository navigation
feat(lint): enforce no-chained-type-assertions in clean owner scopes - #124119
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 15, 2026, 5:11 AM ET / 09:11 UTC. ClawSweeper reviewWhat this changesAdds an Oxlint rule that rejects chained TypeScript assertions in clean production scopes and runs it in supplemental CI. Merge readinessKeep open: the new rule has a P2 syntactic bypass through TypeScript non-null assertions, so it does not yet enforce its stated ratchet. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s local Oxlint plugin defines repository-specific boundary rules. Its configuration enables those rules, and the supplemental boundary runner executes them in CI against selected production roots. flowchart LR
A[Production TypeScript] --> B[Boundary guard configuration]
B --> C[Local Oxlint plugin]
C --> D[Assertion-chain detection]
D --> E[Lint diagnostics]
E --> F[Supplemental CI]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceTests +21, Config +1, Other +181. Total +203 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Treat non-null assertions as transparent in both chain walks, add a regression fixture for the bypass, then validate the corrected rule on the rebased head. Do we have a high-confidence way to reproduce the issue? Yes, from source: linting a clean-scope Is this the best way to solve the issue? No: the existing local-rule approach is appropriate, but both assertion walks must treat TypeScript non-null wrappers as transparent before the guard is complete. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 447393dc3221. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Resolved the remaining ClawSweeper rank-up move with direct inspection of the installed Oxlint 1.75.0 dependency contract:
No code change was needed; the dependency-layer verification gap is closed on reviewed head |
|
Merged via squash.
|
What Problem This Solves
OpenClaw had no automated boundary guard preventing new chained TypeScript assertions in owner scopes that have already burned this pattern down. Without a ratchet, constructs such as
value as unknown as Targetcould return silently while the remaining legacy findings were being removed elsewhere.Why This Change Was Made
This vendors anti-slop's
no-chained-type-assertionsrule into the existingopenclaw-boundariesoxlint plugin and enables it only across the clean owner scopes. The rule reports the outermost assertion once for nestedasand angle-bracket chains, permits single assertions and all-constchains, skips test/mock/harness paths, and keeps the explicit boundary-guard fixture root linted.The broad roots stay maintainable (
src,extensions,packages,ui/src, plus the fixture root), whileexcludedRootsrecords the 50 dirty scopes as a shrink-only burn-down ledger.src/runtime.tsis excluded as a file, not as all ofsrc; the scanner'suiscope maps toui/src.User Impact
No user-visible runtime change. Contributors get an immediate lint failure when a new chained type assertion enters a clean owner scope, while existing test fixtures/mocks and the remaining dirty production scopes are unaffected until their dedicated burn-downs land.
Evidence
Fixture behavior reports exactly the three intended chains—two-step, three-step, and mixed angle/as syntax—once each. The legal single assertion and all-
constchain produce no diagnostic:The production scan is clean with the 50-scope ledger active:
Negative control: temporarily removing only
ui/srcfromexcludedRootsmakes the same package script fail with 37 diagnostics; the exclusion was then restored and the full scan returned to exit 0:Focused tests:
Changed-file checks:
Autoreview:
Provenance: rule semantics adapted from
dmmulroy/anti-slopcommit446268e5d15baa968eaec669ff65358d36ae6259, MIT licensed.The prior burn-downs #124060, #124073, #124079, and #124082 are landed. The remaining follow-up is 252 findings across these 50 excluded scopes; this ledger is shrink-only:
Dirty-scope ledger (50)