Skip to content

refactor(lint): stop counting owner pass-throughs as owner producers - #205206

Merged
obviyus merged 2 commits into
mainfrom
refactor/oa2-owner-sweep
Nov 25, 2026
Merged

obviyus merged 2 commits into
mainfrom
refactor/oa2-owner-sweep

Conversation

@obviyus

@obviyus obviyus commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

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 (refactor(gateway): decide automations rights once, as the turn grant #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.

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]>
@clawsweeper

clawsweeper Bot commented Nov 25, 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Nov 25, 2026
@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label Nov 25, 2026
A method or function value is truthy whatever it returns, so it stays an owner producer.

Co-authored-by: obviyus <[email protected]>
@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. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR recognizes owner-bit pass-through expressions and getters, removes their files from the producer allowlist, and lowers its ceiling.

Example: A contributor writes { senderIsOwner: input.senderIsOwner === true } outside the allowlist.

  • Before: The rule reports owner production even when input.senderIsOwner is false and the expression remains false.
  • After: The rule accepts the narrowing expression while still reporting input.senderIsOwner ?? true.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused tooling fix with appropriate lint-boundary fixtures, reported focused-test success, passing exact-head CI gate, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) This is lint tooling only; the supplied runtime Q/R/S claims do not exercise the changed classifier and are unnecessary for this scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors see safe owner-bit narrowing classified as owner production, obscuring which files still derive authority.
Reason: The original rule owner authored this focused correction, which restores its pass-through contract and makes the remaining allowlist more meaningful.

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: 2957b3a3841dc1a03d677593c1e1e63876109704

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 3358612 adds scripts/lib/no-turn-authority-derivation.mjs:153 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 33586124338a; files: scripts/lib/no-turn-authority-derivation.mjs)

PR surface

Tests +28, Other +16. Total +44 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 33 5 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 75 59 +16
Total 3 108 64 +44

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 25, 2026, 3:19 AM ET / 08:19 UTC.

@obviyus
obviyus merged commit da3479a into main Nov 25, 2026
110 checks passed
@obviyus
obviyus deleted the refactor/oa2-owner-sweep branch November 25, 2026 08:21
@obviyus

obviyus commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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