Skip to content

refactor(gateway): share placement move matching - #140569

Merged
steipete merged 1 commit into
mainfrom
steipete/deslop-production-move-predicates
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deslop-production-move-predicates

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Placement-move error recording and deletion duplicate the same complete move-identity predicate, including three nullable-field branches. This is a maintainer-requested production simplification in the #135868 split campaign.

Why This Change Was Made

Share the nine-field match and let the existing Kysely object predicate choose equality or IS NULL. The same operation ID, session ID, source generation, environment, owner epoch, target kind/ID/machine class, and abandonment value remain required by both mutations.

Deletion evidence: Kysely's existing filter-object parser uses IS for null and equality for strings/numbers. fromRow, targetValues, and abandonSourceValue produce all nine defined values, so no criterion is omitted. The 1/NULL abandonment encoding, synchronous transaction owner, state checks and affected-row checks are unchanged.

User Impact

No behavior change. Stale placement moves still fail their exact identity checks, and error recording and completion retain the same persistence behavior.

Evidence

  • Real SQLite owner suites before: 3 files, 31 cases, 35.54s; after: 3 files, 31 cases, 19.99s. Move, abandonment and schema-compatibility cases are unchanged.

  • A compiler comparison covered 16 target/flag/update/delete encodings: predicate SQL matches apart from one grouping parenthesis, with identical bound parameters. The changed map preserves that field order.

  • Production +19/−38 = −19. Tests/tooling/docs zero; no tests removed.

  • No schema, protocol, migration, retention or transaction change.

  • Full node scripts/check-changed.mjs: exit 0, including both typecheck lanes, lint and all selected guards.

  • Independent autoreview: scoped-clean, no accepted/actionable findings.

  • No build required: internal query construction only; no packaging, lazy-loading or public API changes.

@clawsweeper

clawsweeper Bot commented Sep 7, 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 the gateway Gateway runtime label Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 01:14
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 7, 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 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 9:21 PM ET / September 7, 2026, 01:21 UTC.

ClawSweeper review

What this changes

Shares the database identity check used when recording errors or deleting pending moves of sessions between the Gateway and workers.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, behavior-preserving simplification with no actionable defect found. Current main retains the duplicated predicates, and the maintainer-owned PR is protected from cleanup closure.

Priority: P3
Reviewed head: 267626f32bacc4ef4c2b0880a74c66c4376352ad

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable refactor with preserved matching semantics and relevant reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored cleanup is exempt from external contributor proof requirements and does not materially change authority. Reported SQLite-owner and compiler comparisons support the changed query construction; this review inspected source and existing tests without executing them.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored cleanup is exempt from external contributor proof requirements and does not materially change authority. Reported SQLite-owner and compiler comparisons support the changed query construction; this review inspected source and existing tests without executing them.
Evidence reviewed 7 items Verified introduced change: The pinned base-to-head diff changes only predicate construction in deletion and error recording. All nine fields, their order, synchronous write callbacks, and affected-row checks remain intact.
Dependency contract applies: The changed predicates use Kysely through getNodeSqliteKysely; package.json pins Kysely 0.29.5. The row decoder and target/abandonment encoders supply defined strings, numbers, or null for every criterion.
Exact dependency NULL semantics: Inspected the published v0.29.5 parser: parseFilterObject excludes undefined values, chooses IS for null/boolean values and equality otherwise, and combines entries with the requested conjunction. This supports equivalence for the PR's numeric abandonment encoding and nullable target fields. Source: https://raw.githubusercontent.com/kysely-org/kysely/v0.29.5/src/parser/binary-operation-parser.ts.
Findings None None.
Security None None.

How this fits together

The Gateway persists session-move intentions while coordinating transfers between local execution and workers. Error recording, cancellation, and completion match the stored move identity before updating or removing that record.

flowchart TD
 A[Session move request] --> B[Persisted move intention]
 B --> C[Error or completion handling]
 C --> D[Shared nine-field identity check]
 D --> E[Update error or delete intention]
 E --> F[Verify affected row count]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -19. Total -19 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 19 38 -19
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 1 19 38 -19

Review metrics

None.

Technical review

Best possible solution:

Use one complete move-identity predicate while preserving existing encodings, transaction ownership, and stale-move rejection.

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

Not applicable: this PR proposes deduplication rather than a reported behavioral defect; the duplicated current-main predicates are directly observable.

Is this the best way to solve the issue?

Yes: sharing the complete value map removes duplication while retaining the existing Kysely path and NULL/1 encoding, without introducing another abstraction or migration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0cd1ca7552a0.

Labels

Label changes:

  • add P3: This is bounded internal cleanup with equivalent database matching and no intended user-visible 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: The maintainer-authored cleanup is exempt from external contributor proof requirements and does not materially change authority. Reported SQLite-owner and compiler comparisons support the changed query construction; this review inspected source and existing tests without executing them.

Label justifications:

  • P3: This is bounded internal cleanup with equivalent database matching and no intended user-visible 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: The maintainer-authored cleanup is exempt from external contributor proof requirements and does not materially change authority. Reported SQLite-owner and compiler comparisons support the changed query construction; this review inspected source and existing tests without executing them.

Evidence

What I checked:

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit daffa68 into main Sep 7, 2026
246 checks passed
@steipete
steipete deleted the steipete/deslop-production-move-predicates branch September 7, 2026 01:27
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 7, 2026
…137098

* commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits)
  perf(plugins): keep bundled catalog lookups lightweight (#140597)
  refactor: streamline skills JSON serialization (#140581)
  fix(feishu): expand quoted merged-forward messages (#136231)
  fix(talk): keep opaque realtime routes out of public config (#129144)
  fix(ci): avoid Linux packaging on pull requests (#140589)
  fix(usage): release completed request payloads (#140588)
  fix(tooling): omit Trae machine squash credit (#140562)
  fix(ui): stop catalog paging in hidden tabs (#140583)
  fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580)
  fix(transcripts): preserve fixed and legacy capture history (#140563)
  fix(ui): prevent Talk E2E audio capture stalls (#138803)
  fix(media): release completed document source buffers (#140561)
  fix(anthropic): preserve resumed CLI caches across Git changes (#140566)
  chore(ui): refresh control ui locales (#140586)
  fix(ui): keep usage exports bound to their session instance (#140573)
  refactor(exa): test response readers through tool execution (#140572)
  fix(macos): omit incompatible worker binaries from app bundles (#140557)
  fix: avoid retaining discarded tool output (#140570)
  refactor(gateway): share placement move matching (#140569)
  fix(gateway): preserve child turns during systemd drain (#140568)
  ...

# Conflicts:
#	.agents/skills/release-openclaw-maintainer/SKILL.md
#	docs/reference/RELEASING.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR 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