Skip to content

refactor(state): keep read worker within lint limit - #158661

Merged
fuller-stack-dev merged 1 commit into
mainfrom
codex/main-state-read-lint-repair
Sep 26, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
codex/main-state-read-lint-repair

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes the core lint failure when the shared-state read worker exceeds its 700-line limit.

User Impact

No runtime behavior change. The worker returns the same profile authority and display facts from the same admitted read-only connection.

Why This Change Was Made

Move the existing transactional profile-authority query into the existing profile identity read module. Keep the absent-table guard, alias ordering, transaction boundary, and reply shape unchanged. No lint limits or suppressions change.

This is separate from #158625, which owns the gateway test-file lint repairs.

Evidence

  • Fresh main at 5da1262bc896b89b283788be96b0efa70a5cb647 reproduces eslint(max-lines) in the worker: 714 counted lines against 700.
  • The same lint check passes after extraction. The worker is now 685 counted lines.
  • 27 focused tests passed across the worker reply/admission, user-channel identity, and profile-alias suites.
  • Core production typecheck, import-cycle check, formatting, and git diff --check passed.
  • Independent Codex AutoReview at P0–P2 found no actionable defects.

@clawsweeper

clawsweeper Bot commented Sep 26, 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.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 26, 2026 05:01
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 1:08 AM ET / 05:08 UTC.

ClawSweeper review

What this changes

Moves the profile authority query from OpenClaw’s shared-state read worker into its profile identity reader, preserving the role, alias, and display reply while reducing the worker’s lint line count.

Merge readiness

✅ Ready for maintainer review

Current main still has the reported over-limit worker code, and the proposed repair has no evident behavioral regression. This member-authored PR remains useful and is not eligible for automatic closure.

Priority: P3
Reviewed head: 7503c86c16adc6e9a0ec2fef5271cef85593cfbe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, source-equivalent repair with relevant reported validation and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal lint repair moves an unchanged query within the admitted read-worker path. The reported lint and focused-test results are supplemental, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal lint repair moves an unchanged query within the admitted read-worker path. The reported lint and focused-test results are supplemental, and no stored-data contract changes.
Evidence reviewed 9 items Lint contract: Production TypeScript files have a 700-line limit that skips blank lines and comments.
Current main still needs the repair: Fetched main retains the inline transactional profile authority query; the new helper is absent there.
Introduced helper: The extracted reader retains the table guard, deferred transaction, ordered aliases, role, and display projection shown in the original worker query.
Findings None None.
Security None None.

How this fits together

The shared-state read worker receives profile authority requests and reads an admitted SQLite connection. It returns current profile facts that the caller checks against its authorization context.

flowchart LR
A[Profile authority request] --> B[Shared-state read worker]
B --> C[Admitted SQLite connection]
C --> D[Profile identity reader]
D --> E[Role, aliases, and display reply]
E --> F[Caller authority check]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +3. Total +3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 34 31 +3
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 34 31 +3

Review metrics

Metric Value Why it matters
Worker lint budget 714 → 685 counted lines reported; limit 700 The reported reduction addresses the existing rule without changing its threshold.

Technical review

Best possible solution:

Keep the profile query in the existing admitted read-worker path and land the focused extraction once the native review and check gates pass.

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

Yes, at source level: current main retains the original worker query and the repository enforces a 700-line limit; the PR reports 714 counted lines. This review did not run lint.

Is this the best way to solve the issue?

Yes. Moving the unchanged query into the existing profile reader is a narrow way to reduce the worker’s line count while retaining its admitted connection and reply contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8279835741d0.

Labels

Label changes:

  • add P3: This is a focused internal lint repair with no reported user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored internal lint repair moves an unchanged query within the admitted read-worker path. The reported lint and focused-test results are supplemental, and no stored-data contract changes.

Label justifications:

  • P3: This is a focused internal lint repair with no reported user-visible behavior change.
  • 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: This MEMBER-authored internal lint repair moves an unchanged query within the admitted read-worker path. The reported lint and focused-test results are supplemental, and no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Avant: 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.

@fuller-stack-dev
fuller-stack-dev enabled auto-merge (squash) September 26, 2026 05:12
@fuller-stack-dev
fuller-stack-dev merged commit 2d61c98 into main Sep 26, 2026
270 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/main-state-read-lint-repair branch September 26, 2026 05:18
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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