Skip to content

refactor(state): reuse worker output contract and simplify row refresh - #159473

Merged
fuller-stack-dev merged 4 commits into
mainfrom
deslop/l84-state-lint
Sep 27, 2026
Merged

fuller-stack-dev merged 4 commits into
mainfrom
deslop/l84-state-lint

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #158940. Unblocks the inherited strict projection lint failure in #151674.

What Problem This Solves

Strict ordinary lint rejects the resident session-row projection at 701 counted lines against its existing 700-line limit. The projection has a one-use identity binding, and the shared-state dispatcher independently reconstructs an output union already owned by its backend contract.

User Impact

No intended behavior, schema, permission, protocol or configuration change. The row identity is evaluated the same number of times, in the same order, inside the same dirty-row guard. The worker reuses its existing backend output type. No limit, baseline, suppression or test assertion changes.

Why This Change Was Made

Pass the identity directly to the existing refresh operation and derive the worker return type from OpenClawStateWorkerBackend['execute']. The composed branch retains current main's canonical completion observer from #159553; there is no remaining fixture change or dependency on the closed #159550.

Evidence

Current main 7f43b351 has exactly the failing projection blob e8b90850. Strict type-aware lint reproduced 701/max700 with GITHUB_ACTIONS unset, then passed for both changed production files. Formatting and diff checks pass.

All 26 existing projection tests passed before and after, exercising dirty-key refresh, row identity, aliases, lineage and current facts. Vitest file durations were 93.35 seconds before and 59.47 seconds after on the development host; these are validation measurements, not a performance claim. No tests were added or weakened.

Node 24.21's TypeScript transform emitted byte-identical worker JavaScript before and after the output-type change: SHA-256 26e3fea827d3121765c69bbc57051002759a9afdbb59466f9b2fe7f14f143552. Fresh independent review of the complete composed diff is clean through P2. The final production hunks are unchanged from the original reviewed PR; its earlier Testbox and full-check evidence is retained. Core typechecking also passes on the final composition. Fresh CI and hosted review qualify merge head b12a1d913e5e4cb0c8c23a0c2a03f69703cbae2a before landing.

The first refreshed CI used an older merge context and exposed an inherited provider installation type error. Canonical fix 57f12db99ee3 restores the producer contract and is now an ancestor of this candidate. The PR does not introduce a separate provider repair; the failed run and its source identity remain retained.

@clawsweeper

clawsweeper Bot commented Sep 27, 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 gateway Gateway runtime size: XS labels Sep 27, 2026
@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 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 8:26 AM ET / 12:26 UTC (Revision 6).

ClawSweeper review

What this changes

The branch passes a dirty session row’s identity directly to its Gateway refresh operation and derives the shared-state worker’s result type from its backend contract.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still has the lint-triggering code, while the merged native-fixture repair addressed a separate prerequisite. The introduced changes preserve the inspected row-refresh and worker-output contracts.

Priority: P3
Reviewed head: b12a1d913e5e4cb0c8c23a0c2a03f69703cbae2a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The small patch has relevant reported before-and-after lint proof and no identified correctness or security defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed Gateway expression addresses a reported strict-lint failure: the captured PR body records a 701/700 failure before and a pass after on a development host, with the existing projection suite passing on both versions. The worker's type-only edit has reported byte-identical emitted JavaScript. The reviewer did not rerun the checks; no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed Gateway expression addresses a reported strict-lint failure: the captured PR body records a 701/700 failure before and a pass after on a development host, with the existing projection suite passing on both versions. The worker's type-only edit has reported byte-identical emitted JavaScript. The reviewer did not rerun the checks; no stored-data contract changes.
Evidence reviewed 11 items Verified target repository: The checkout origin identifies the target repository.
Introduced row-refresh change: Inside the existing dirty-row guard, the branch passes the same row identity directly to refresh before looking up the row again.
Introduced worker type change: The worker runtime now takes its return type from the existing backend execute method; its command dispatch body is unchanged.
Findings None None.
Security None None.

How this fits together

The Gateway session-row projection turns committed session changes into rows used by session reads. Separately, the shared-state worker receives state commands, performs SQLite work, and returns typed results.

flowchart LR
  A[Session changes] --> B[Dirty session rows]
  B --> C[Gateway row projection]
  C --> D[Session read response]
  E[State commands] --> F[Shared state worker]
  F --> G[SQLite state]
  F --> H[Worker result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -7. Total -7 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 10 -7
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 3 10 -7

Review metrics

None.

Technical review

Best possible solution:

Keep the single backend output contract and the existing dirty-row refresh order while restoring strict lint compliance.

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

Yes. Current main retains the reported expression under the repository's 700-line rule, and the PR body gives a specific 701/700 strict-lint result; this review did not execute lint.

Is this the best way to solve the issue?

Yes. The row identity remains evaluated inside the same guard, and the backend contract already defines the worker's output union.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 69809d7a9427.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a narrow internal lint and type-contract cleanup with no intended user-visible change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed Gateway expression addresses a reported strict-lint failure: the captured PR body records a 701/700 failure before and a pass after on a development host, with the existing projection suite passing on both versions. The worker's type-only edit has reported byte-identical emitted JavaScript. The reviewer did not rerun the checks; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Gateway expression addresses a reported strict-lint failure: the captured PR body records a 701/700 failure before and a pass after on a development host, with the existing projection suite passing on both versions. The worker's type-only edit has reported byte-identical emitted JavaScript. The reviewer did not rerun the checks; 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)
  • Galin Iliev: 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-27T06:21:07.006Z sha 57bb5dc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-27T06:35:13.625Z sha 57bb5dc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-27T06:42:32.325Z sha 57bb5dc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-27T09:12:51.411Z sha 8f2d542 :: needs changes before merge. :: none
  • reviewed 2026-09-27T11:56:30.105Z sha 0c6dbc9 :: needs maintainer review before merge. :: none

@fuller-stack-dev
fuller-stack-dev merged commit 54c0ae6 into main Sep 27, 2026
196 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the deslop/l84-state-lint branch September 27, 2026 12:35
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

steipete added a commit that referenced this pull request Sep 27, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
openclaw#159473)

* fix(codex): keep native completion fixture within lint policy

* refactor(state): reuse worker output contract and simplify row refresh
steipete added a commit that referenced this pull request Sep 28, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
steipete added a commit that referenced this pull request Sep 28, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
steipete added a commit that referenced this pull request Sep 28, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
steipete added a commit that referenced this pull request Sep 28, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
steipete added a commit that referenced this pull request Sep 28, 2026
Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.
steipete added a commit that referenced this pull request Sep 28, 2026
* refactor(infra): deslop infra fifth pass

Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by #159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in #159650.

* refactor(infra): name the directive migration parser explicitly

Distinguish the directive parser from the media-persistence parser, whose error contract differs, and update both internal callers. Preserve JSON parsing, migration errors, and persistent behavior.

Linux Testbox: exact export-collision guard, targeted lint, core types, 45 migration/archive tests, import boundaries, and build passed. Fresh Codex P0-P2 review is clean.

* refactor(infra): retain canonical reader diagnostics after rebase

* refactor(infra): retain explicit ClawHub guard entries
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
* refactor(infra): deslop infra fifth pass

Consolidate outbound, pairing, migration, lifecycle, approval, environment, and update plumbing at existing owners. Preserve storage, security, network, and update contracts. Remove 1,514 net production lines and redundant test cases.

Fix unchanged Unicode permission maps replacing pending pairing requests when key insertion order changes. The pairing entrypoint regression fails before the exact-key comparison and passes afterward.

Linux Testbox: full infra plus importers, import boundaries, builds, and focused regressions passed. Codex P0-P2 review is clean. Changed checks pass except an inherited gateway line cap already fixed by openclaw#159473 on main; rebase validation follows. Published upgrade hits the separately owned WhatsApp Doctor defect in openclaw#159650.

* refactor(infra): name the directive migration parser explicitly

Distinguish the directive parser from the media-persistence parser, whose error contract differs, and update both internal callers. Preserve JSON parsing, migration errors, and persistent behavior.

Linux Testbox: exact export-collision guard, targeted lint, core types, 45 migration/archive tests, import boundaries, and build passed. Fresh Codex P0-P2 review is clean.

* refactor(infra): retain canonical reader diagnostics after rebase

* refactor(infra): retain explicit ClawHub guard entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

2 participants