Repository navigation
refactor(lint): stop counting owner pass-throughs as owner producers - #205206
Conversation
The owner-production check flagged forms that can only narrow a passed-along bit: `x === true`, a choice between pass-throughs, `x && y` with one side passed along, and a getter returning a pass-through. Accept them, drop the 16 files that only did that, and give every remaining entry its reason. Co-authored-by: obviyus <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
A method or function value is truthy whatever it returns, so it stays an owner producer. Co-authored-by: obviyus <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesThis PR recognizes owner-bit pass-through expressions and getters, removes their files from the producer allowlist, and lowers its ceiling. Example: A contributor writes
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a useful, focused correction to lint precision, and no actionable introduced defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe repository’s Oxlint boundary plugin examines source AST nodes and reports owner-status production outside designated admission files. flowchart LR
A[Source files] --> B[Oxlint boundary plugin]
B --> C[Owner expression classifier]
C --> D[Producer allowlist]
D --> E[Lint diagnostics]
F[Fixture and ratchet tests] --> B
Technical reviewBest possible solution: Keep the classification fix in the existing lint owner, retain the producer rejection cases, and land through normal CI gates. Do we have a high-confidence way to reproduce the issue? The base classifier rejects binary comparisons, conditionals, logical expressions, and getter values wholesale, explaining the false positives in the inspected consumers; no target code was executed. Is this the best way to solve the issue? The patch is the smallest complete correction: it extends the existing recursive classifier, handles getters at the property boundary, and tightens the existing allowlist ratchet without adding another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9089b8b03bc4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +28, Other +16. Total +44 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 25, 2026, 3:19 AM ET / 08:19 UTC. |
|
Landed as da3479a. The owner-production lint now accepts pass-throughs that can only narrow the owner bit, so OWNER_PRODUCER_FILES goes from 49 to 33 and each remaining entry has its reason. Real owner moves stay with the area PRs listed in the body: local-host principal (after #205173), OA3 request grant, channel command owner, and cron continuations. Proof: oxlint-boundary-guards 35/35 incl. the stale-entry check, local review clean on 2957b3a, CI green, E2E Q/R/S pass. |
…penclaw#205206) > Lint-precision prerequisite for the owner-producer sweep. It moves no owner producer onto `grant.owner`; the sweep itself is parked as area PRs (see "Not in this PR"). ## Problem `no-turn-authority-derivation` (owner-production check) flagged 49 files as owner producers. 16 of them do not produce owner status: they only narrow a bit that was passed along (`x.senderIsOwner === true`, `admin ? request.senderIsOwner === true : false`, `profile === "full" ? params.senderIsOwner : undefined`, `input.senderIsOwner && externalUser`, a getter that returns `ctx.senderIsOwner`). Because they were listed, the allowlist overstated the work left and gave no reason for any entry. ## Fix - `passesOwnerAlong` now accepts the forms that cannot make an owner: `<pass> === true`, a conditional whose two branches pass along, `a && b` with one side passing along, `a || b` / `a ?? b` with both sides passing along, and a property getter whose only statement returns a pass-through. Defaults that make an owner (`x ?? true`, `x !== false`) and function or method values (truthy whatever they return) still fail (fixture lines 32-41). - `OWNER_PRODUCER_FILES` 49 → 33 (ceiling lowered). Every remaining entry is grouped with its reason: - principals admission does not see yet (Discord native/voice owner match, FaceTime caller claim, plugin ingress trust gate, CLI `--local`/`message`, standalone MCP, MCP loopback token, worker placement); - requests, not turns (OpenAI-compatible HTTP pre-run check, `conversations`, `tools.invoke`, session resource tools, Talk client tools): owner = connection admin scope, to move with the OA3 request grant; - channel command owner (`command-auth`, reply execute/source admission, message-action dispatch, `agent-run-user-turn` channel requester); - scheduled and requester-owner continuations (cron creator authority, scheduled targets, plugin tool owner continuation); - recorded data read back (protocol schema field, transcript metadata, memory lineage receipt, maintenance copy). No production code changes. `TURN_FLAG_FILES` (19), `ADMISSION_FILES` (59) and `CAPABILITY_PROVENANCE_FILES` (4) are unchanged; all lists stay shrink-only. ## Not in this PR (split) The real owner moves need principals or grants that do not exist yet, or files another open PR owns: - `automationAdmin`/`controlUiAdmin` and the cron creator `requesterOwner` continuation: owned by open OA2 PR 4c (openclaw#205173). - CLI `--local`, `message`, standalone MCP, worker: need the `local-host` principal that PR 4c adds. - RPC/HTTP request sites: need the OA3 request grant from method authorization. - Channel command owner and Discord native/voice: next channel PR, after 4c lands. ## User impact None. Lint tooling only. ## Evidence - `test/scripts/oxlint-boundary-guards.test.ts`: 35/35 pass, including the stale-entry check (every listed file still trips the rule) and the new fixture lines. - E2E Q/R/S pass (`one-admission-e2e/run.sh`, head `5d33e525`; the follow-up commit only changes the lint rule, no product code): `verdict.json` pass=true, `R.running-turn-finishes`, `Q.queued-input-refused-visibly`, `S.stop-cancels`. - Before/after `ignoreAllowlists` run over all 49 listed files: 16 stop tripping, 33 still do. Co-authored-by: Ayaan Zaidi <[email protected]>
Problem
no-turn-authority-derivation(owner-production check) flagged 49 files as owner producers. 16 of them do not produce owner status: they only narrow a bit that was passed along (x.senderIsOwner === true,admin ? request.senderIsOwner === true : false,profile === "full" ? params.senderIsOwner : undefined,input.senderIsOwner && externalUser, a getter that returnsctx.senderIsOwner). Because they were listed, the allowlist overstated the work left and gave no reason for any entry.Fix
passesOwnerAlongnow accepts the forms that cannot make an owner:<pass> === true, a conditional whose two branches pass along,a && bwith one side passing along,a || b/a ?? bwith both sides passing along, and a property getter whose only statement returns a pass-through. Defaults that make an owner (x ?? true,x !== false) and function or method values (truthy whatever they return) still fail (fixture lines 32-41).OWNER_PRODUCER_FILES49 → 33 (ceiling lowered). Every remaining entry is grouped with its reason:--local/message, standalone MCP, MCP loopback token, worker placement);conversations,tools.invoke, session resource tools, Talk client tools): owner = connection admin scope, to move with the OA3 request grant;command-auth, reply execute/source admission, message-action dispatch,agent-run-user-turnchannel requester);No production code changes.
TURN_FLAG_FILES(19),ADMISSION_FILES(59) andCAPABILITY_PROVENANCE_FILES(4) are unchanged; all lists stay shrink-only.Not in this PR (split)
The real owner moves need principals or grants that do not exist yet, or files another open PR owns:
automationAdmin/controlUiAdminand the cron creatorrequesterOwnercontinuation: owned by open OA2 PR 4c (refactor(gateway): decide automations rights once, as the turn grant #205173).--local,message, standalone MCP, worker: need thelocal-hostprincipal that PR 4c adds.User impact
None. Lint tooling only.
Evidence
test/scripts/oxlint-boundary-guards.test.ts: 35/35 pass, including the stale-entry check (every listed file still trips the rule) and the new fixture lines.one-admission-e2e/run.sh, head5d33e525; the follow-up commit only changes the lint rule, no product code):verdict.jsonpass=true,R.running-turn-finishes,Q.queued-input-refused-visibly,S.stop-cancels.ignoreAllowlistsrun over all 49 listed files: 16 stop tripping, 33 still do.