Skip to content

docs(sqlite): design transferable writer admission authority - #170440

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-admission-authority-program-20260919
Oct 13, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-admission-authority-program-20260919

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Writer admission waits for the Gateway main thread even when the SQLite worker and physical writer are ready. The previous chat.send investigation traced 673 of 765 ms of one ACK to admission; a plain shared snapshot was fast but incorrectly survived policy revocation.

Related: #170376. Retention dependency: #170423.

User Impact

This is the documentation phase of the requested redesign. It changes no runtime behavior, schema, permissions, configuration, or update path. Production LOC delta: 0. No new performance result is claimed.

Why This Change Was Made

The architecture proposal inventories admission authority and mutation points against source commit 4ca02f6c720e6346a0d57b158cc38484fdf5c8da, defines owner-written shared revisions and typed policy/preparation operations, and preserves final host COMMIT authorization and native receipt settlement. It names the residual host waits and the released SDK callback contract that still requires a host adapter.

The first implementation slice transfers profile authority and its existing pre-COMMIT fence, followed by one owner per PR. The design reuses #170423's open-time generation reconciliation rather than introducing a second retention protocol. It includes independent service-crash refusal, owner-specific rollback semantics, adversarial tests, and the before/after measurement protocol.

Evidence

  • Source audit covers physical/logical/borrower generation, creation/deletion/readiness, broker jobs, maintenance/process custody, request/source/run/operator authority, profile/session/config policy, caller preparation and settlement.
  • Changed-file oxfmt, repository Markdown lint rules scoped to this file, MDX compilation, source-path/line-bound checks and git diff --check pass. The default docs lint command expanded to the whole tree and was stopped; the scoped run passed.
  • Independent review: scoped-clean through P2; one completed isolated review, no accepted/actionable findings.
  • No focused runtime tests apply to this documentation-only change. Exact-head PR CI passed: run 38326802747, including docs, security, PostgreSQL conformance and the required gate. Runtime lanes were skipped by the docs-only plan; no local build/typecheck/suites and no Testbox/Crabbox allocation.
  • Measurement before/after: not applicable to the docs-only diff. Prior ACK p50/p99 1,209/1,693 ms and the 0.064 ms unsafe snapshot diagnostic are background evidence, not measurements of this candidate. Executable owner PRs must run the specified four ABBA blocks on the constrained synthetic sandbox, reporting admission/FIFO/queue/ACK/CPU/allocation plus failures.

@clawsweeper

clawsweeper Bot commented Oct 13, 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 size: XS labels Oct 13, 2026
@steipete
steipete marked this pull request as ready for review October 13, 2026 00:21
@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 Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR documents a staged design for moving SQLite writer admission to a dedicated worker while preserving live authority and commit settlement.

Example: The reported chat.send investigation attributed 673 of 765 ms of one acknowledgment to admission waits.

  • Before: Admission decisions require delivery to the Gateway host thread.
  • After: Runtime behavior is unchanged; the document proposes transferring eligible decisions and defines validation for future implementation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful documentation with explicit ownership, compatibility, failure, and validation contracts; source review found no actionable defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The patch adds only a proposed architecture document; runtime behavior proof belongs to the future executable slices and no candidate performance result is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Docs · Worth it: Yes
User problem: Gateway host scheduling can delay acknowledgment of database-backed chat requests.
Reason: The maintainer-authored proposal records the intended direction, inventories existing authority owners, and explicitly avoids claiming a runtime fix or speedup.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it provides a coherent, source-grounded design for reducing admission waits, and no actionable defect was found in the documentation change.

Priority: P3
Reviewed head: b607da34ba62c00af89bf31208de462397b932a0

Before merge

None.

Findings

None.

Agent review details

How this fits together

The SQLite broker coordinates queued database operations, policy-owner admission, native execution, and committed receipts; the proposed worker would evaluate transferable admission facts while host COMMIT authorization remains.

flowchart TD
A[Gateway write request] --> B[SQLite broker FIFO]
B --> C[Native SQLite worker]
D[Existing authority owners] --> E[Proposed admission worker]
C --> E
C --> F[Host COMMIT authorization]
F --> G[Native commit and receipt settlement]
Loading

Technical review

Best possible solution:

Land the documentation through normal checks, then implement the specified owner slices with measured benefit and preserved authority contracts.

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

No runtime reproduction applies to this documentation-only patch; current source supports the host admission boundary, while the reported latency measurements remain historical context.

Is this the best way to solve the issue?

The staged proposal is a reasonable documentation step because it preserves existing owners, commit authorization, retention, and SDK behavior while requiring implementation-specific correctness and performance proof.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 81e2765b2658.

Security

None.

Evidence

What I checked:

PR surface

Docs +184. Total +184 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 184 0 +184
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 184 0 +184

Labels

Label changes:

  • add P3: This is architecture documentation with no runtime, configuration, schema, or 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.

Label justifications:

  • P3: This is architecture documentation with no runtime, configuration, schema, or 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.

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 October 12, 2026, 8:26 PM ET / October 13, 2026, 00:26 UTC.

@steipete
steipete merged commit 78c03ce into main Oct 13, 2026
128 of 129 checks passed
@steipete
steipete deleted the steipete/perf-micro-admission-authority-program-20260919 branch October 13, 2026 00:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
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: 🐚 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.

1 participant