Skip to content

fix(tooling): separate deprecated SQLite compatibility from live T1 debt - #169610

Merged
steipete merged 6 commits into
mainfrom
dbasync/t1compat
Oct 12, 2026
Merged

steipete merged 6 commits into
mainfrom
dbasync/t1compat

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The SQLite worker inventory kept counting deprecated synchronous SDK compatibility implementations as live T1 debt after bundled callers migrated, so its headline did not reliably show the remaining cutover work.

User Impact

No runtime behavior, SQL, schema, SDK export, or update behavior changes. Released synchronous APIs remain available. The inventory now distinguishes conservatively live/unproven T1 from mechanically verified deprecated-only T1-compat.

Why This Change Was Made

A small reviewed operation registry plus TypeScript symbol resolution checks the actual source snapshot, including import/reexport aliases, SDK subpaths, namespace access, dynamic imports, and escaped callbacks. A bundled value reference fails the existing worker ratchet even when another SQL call is removed in the same patch. Missing deprecation markers fail; deleting a retired API removes its compatibility count. Type-only uses and pure reexports preserve the released contract.

The initial registry deliberately covers only executeSqliteQueryTakeFirstSyncLegacy and deleteSessionUpstreamLink. The general query wrapper still has bundled migration/diagnostic callers, and returned-method families or mixed kernels need stronger boundary proof; these remain T1. This replaces the ratchet's ad hoc forwarding allowance. The worker-access guide documents removal at the next Plugin SDK major with replacement release notes.

Evidence

On integrated main baseline cde0f8844503f332dcdc1aa1a5453a9a7294d6b8, the old accounting versus the new classifier on the same source reports:

Metric Before After
Live/unproven T1 call expressions 607 605
Deprecated-only T1-compat call expressions Not separated 2
Combined T1 + T1-compat 607 607
All tiers 2,414 2,414

The two compatibility expressions are one per listed API. The new classifier applied identically to both sides reports T1 605 → 605, T1-compat 2 → 2. This is a classification correction, not a query saving. No product paths or ordinary-path authority checks are removed; accepted runtime edge cases are unchanged. Warmed statements/requests and MAIN statements are unchanged by construction; the runtime SQL harness is not used for this tooling-only lane.

  • 25 inventory/ratchet and symbol-graph regressions passed before the lint-only correction: 15.00 seconds Vitest duration, 27.66 seconds wrapper wall (pnpm test test/scripts/check-database-worker-ratchet.test.ts test/scripts/database-worker-compat.test.ts --maxWorkers=1). Coverage includes caller reintroduction without total growth, aliases, namespaces, dynamic imports/rest/computed bindings, escaped callbacks, type-only references, deprecation removal, API deletion, and staged snapshots. CI owns the final-head test run under the coordinator's relaxed testing v6 policy.
  • Local final-head basic validation: Oxfmt, Oxlint for changed scripts/tests, and git diff --check. Earlier integrated proof passed inventory verification, Madge (0 cycles), export-name guard, script types, T1 and dialect ratchets. The local root-type runner exited 137 after all four partitions reported passing; final-head CI owns the complete type gates.
  • The first CI run caught one PR-caused lint finding (sort → toSorted), now fixed. Its other type failures came from main's missing OptionCard export; the fix and the coordinator's known-clean typecheck baseline are now integrated. No rerun of the old head was requested.
  • Knip's script export scan passed. Production/full-tree scans found the same unused exports on the PR and main, in untouched files: agentRunHasVisibleReply, retireOpenClawStateReadConnectionAfterCorruption, ApprovalPage, CustodianPage, QuestionPage (production scan), and SkillWorkshopViewProps. These are inherited, not exclusions added by this PR.
  • Two Codex autoreview rounds completed. Object-method escape findings were addressed by narrowing the registry; dynamic rest and computed-destructuring findings were addressed in the guard and regressions. No third review round.
  • Product LOC: 0 changed. Tooling/tests/docs: approximately +709 / −201 lines, including the generated inventory refresh.

Remote capacity was full for more than 33 minutes. Earlier validation used the then-authorized local proof-slot fallback after the 1-minute load average fell to 47.88. No remote lease was created; the slot is released. Final validation follows relaxed testing v6 (local basic lint, PR CI).

Final head efe7760ca7d9eac4c272b338903bc9c263d22929: CI run 38208282861 passed, including all production/test type jobs, lint jobs, source contracts, guard jobs, docs, and the required CI gate. The native workflow was attempted but hit an orphaned lock and missing Git objects in its scratch clone; both locks were recovered, with no merge submitted. Landing uses the campaign-authorized SHA-pinned REST squash fallback.

@clawsweeper

clawsweeper Bot commented Oct 12, 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 docs Improvements or additions to documentation scripts Repository scripts size: L labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR separates verified deprecated SQLite compatibility calls from live T1 debt and rejects bundled references to those APIs.

Example: Inspect the reported source snapshot containing 607 T1 call expressions.

  • Before: The headline includes two deprecated compatibility expressions alongside remaining migration debt.
  • After: The inventory distinguishes 605 live/unproven T1 expressions and 2 T1-compat expressions, preserving the combined count.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The scoped patch is useful and has no actionable finding; supplied behavioral validation is primarily reported harness coverage.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored tooling PR is outside the contributor proof gate; supplied evidence reports same-source inventory results and real symbol-resolution harness coverage, without a demonstrated CLI rejection trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Developers cannot distinguish remaining worker-migration debt from retained deprecated compatibility implementations in the inventory headline.
Reason: The existing feature-history owner proposes a bounded accounting correction that preserves runtime contracts and strengthens the existing guard.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides a useful, owner-backed accounting correction that current main lacks, with no actionable regression found.

Priority: P3
Reviewed head: efe7760ca7d9eac4c272b338903bc9c263d22929

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate a shipped ratchet CLI rejecting a reintroduced bundled caller or an original-fails regression run.
Agent review details

How this fits together

Repository tooling reads working-tree, staged, or committed source snapshots and produces SQLite migration inventories and CI ratchet results.

flowchart TD
  A[Source snapshot] --> B[Compatibility symbol scan]
  A --> C[SQLite call parser]
  B --> D[Tier classification]
  C --> D
  D --> E[Generated inventory]
  D --> F[Head and baseline ratchet]
Loading

Technical review

Best possible solution:

Use the shared classifier for reviewed deprecated boundaries while preserving released APIs and conservative T1 accounting elsewhere.

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

Current-main source includes the two deprecated implementations in raw T1 accounting; the PR reports their separation on identical source, and no target code was executed during this review.

Is this the best way to solve the issue?

A shared symbol-backed classifier consistently handles current, staged, and baseline snapshots while the narrow registry avoids relabeling mixed kernels without caller evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 952d3ac4dcb4.

Provenance checked

  • SDK forwarding allowance changes intended behavior with a stated reason (a17bd67: Preserve released synchronous wrappers while discounting their exact forwarding expressions.)
  • Inventory source discovery and total-growth ratchet keeps the original intent (3e0672a: Compare total T1 growth against the fork base while permitting file splits and shrinkage.)
  • Generated worker inventory keeps the original intent (b082302: Document remaining database-worker migration work through a reproducible source inventory.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3e0672a adds scripts/check-database-worker-ratchet.mts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3e0672a03521; files: scripts/check-database-worker-ratchet.mts)

PR surface

Tests +158, Docs +41, Other +309. Total +508 across 7 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 206 48 +158
Docs 2 131 90 +41
Config 0 0 0 0
Generated 0 0 0 0
Other 3 372 63 +309
Total 7 709 201 +508

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This improves developer inventory and guard accuracy without changing runtime behavior or stored data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-12T04:45:27.173Z sha 8847327 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 1:36 AM ET / 05:36 UTC (Revision 2).

@steipete
steipete merged commit a49b2ac into main Oct 12, 2026
106 checks passed
@steipete
steipete deleted the dbasync/t1compat branch October 12, 2026 05:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…ebt (openclaw#169610)

Distinguish proven deprecated-only SQLite compatibility from live or unproven T1 sites. Reject bundled runtime references to registered compatibility APIs, preserving released SDK implementations until the next major.

Add symbol-graph and ratchet regressions and document the SDK-major removal path. No product or runtime SQL changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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