Skip to content

perf(gateway): keep migration preflight imports light - #188876

Merged
steipete merged 4 commits into
mainfrom
dbasync/boottime-b
Oct 31, 2026
Merged

steipete merged 4 commits into
mainfrom
dbasync/boottime-b

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem and change

Gateway config preflight imports session migration execution/recovery although it only needs the migration-complete assertion. Keep that assertion as one leaf implementation and move the byte-identical execution body to its runtime owner. Move two shared helpers to their existing owners to remove eager backedges, and update callers/mocks without a compatibility reexport.

Plugin readiness reads all pending/deferred obligations first and returns when empty. Nonempty startup still reads pending status separately: decoded obligations do not retain status and cannot replace that query. Admitted live reads, leases, inspection, config publication, settlement, warnings, legacy/deferred receipts, ambiguity refusal and profile-aware Doctor guidance remain. No schema, integrity, identity, transaction, security or MAIN-floor change. C and E remain held.

Acceptance and measured work

Acceptance was published before measurement: committed teamBoot workload, compiled isolated Gateway, eight synthetic agents / 10,000 sessions / at least 5 GiB of synthetic state on internal disk, real authenticated WebSocket reads, plugin post-bind and cleanup. Intended cohorts: cloned/unsealed and retained boots, with empty/pending/deferred obligations kept separate. Win: shrink the static eager graph with four heavy owners absent; empty readiness two reads→one, no attributable MAIN increase or extra nonempty request. Any adverse cell of at least 20% stops for attribution. Timing requires the shared lock, load1 <24 and at least five interleaved pairs on the same platform; otherwise counts only, no latency/CPU or percentile claim.

Config-preflight static eager closure Base Candidate
Source modules 1,616 958
Source bytes 12,072,562 7,335,026
Compiled chunks 778 424
Compiled bytes 8,576,941 4,871,168

These are static graph counts, not evaluated imports or a latency measurement. Four heavy owners are absent: session-accessor.sqlite-import.ts, deferred-plugin-session-empty.ts, deferred-plugin-session-verification.ts, openclaw-agent-db.ts. Base is bdb7d4ad4afb4b337e9908b752d663bcffa48624; candidate graph was measured at 7b8bc57fc19e96a0dfb129749dc3ee690cc35216, whose production/scripts match final fe80c3bb52aea1aee49a3d8b85be7c61d8140596.

Empty pending-only SELECTs fell 1→0 in both native states; existing all-obligation reads remain unchanged. SQL shapes still select id, report_json, status from migration_runs with id LIKE ?, status IN (?) or IN (?,?), ordered by id. Before: pending-only then all obligations. After: all obligations, then pending-only iff nonempty. No write intervenes; SQL text and write envelopes are unchanged.

Adverse raw counts and attribution

The one-pair whole-flow cohort is nonpassing and confounded: fresh all-process SQL/requests 3,407/682→5,116/856, Gateway MAIN 1,151→1,153; retained SQL 4,047→6,866. These values are retained, not averaged away, and establish no total-work or retained-seal improvement.

Fresh MAIN adds two existing legacy scans: six→eight distinct agents, one scan each, no duplicates. Retained scans reached eight→five agents. All 3,234 retained-candidate shutdown payload reads come from unchanged usage-rollup backfill. The moved execution body and 13 relevant owner files are unchanged; plugin post-bind does not drain the independent canonical/transcript/usage owners. Two independent audits found no B/D-created invocation or added-work path.

The coordinator accepted qualification on the narrow import/read counts after this attribution. Separate native pending/deferred arms were not run; their behavior is covered by focused owner tests and PostgreSQL conformance. No total SQL, MAIN, CPU, latency or size-scaling improvement is claimed. An optional fixture-completion experiment was discarded without a production or benchmark commit and is not acceptance evidence.

Behavior, review and size

Owner/runtime 214 + Doctor 49 tests passed. Three missing-import fixture errors were corrected and replayed; nine source-recovery, fourteen prefix, readiness/import regressions and four final benchmark cases passed. Read-count/import regressions fail on base. Two isolated production reviews plus correction/workload/CI-fixture delta reviews are clean. Assertions remain; mock-baseline change is shrink-only.

Production +11 LOC, tests/helpers −3 LOC, tooling +195 LOC, other −1 LOC. The module boundaries require modest production growth. Source-based worker and dialect ratchets remain active; unrelated generated Markdown drift was excluded. The benchmark adds two synthetic preparation transactions, not Gateway runtime work.

Final qualification and overlap

Exact final head fe80c3bb52aea1aee49a3d8b85be7c61d8140596: qualification 41151959662 passed types, all five typed-lint shards, lint, dependencies/Knip, source contracts, architecture/Madge and ratchets. All three actual PostgreSQL conformance steps passed: jobs 124390684084, 124390684129, 124390684061.

The actual published-driver update job 124392608480 passed, including the executed Run targeted Docker E2E lanes step. Its source is 7b8bc57fc19e96a0dfb129749dc3ee690cc35216; the final-head delta is only three test-fixture lines and removal of an obsolete mock-baseline line. All production and benchmark scripts are byte-identical, so the update result is reused under the test-only rule.

A nonrequired SDK documentation contract test fails identically on main a32d79a2c763: exec-approvals-runtime is documented without its typed public declaration. All six inputs are byte-identical. This is an attributed inherited failure, not a passing test. Other unrelated nonrequired broad failures are not claimed as inherited or repaired. Fail-closed scripts verify the exact head, required checks, named static gates, actual PG/update execution and current indexed overlaps before the merge.

Six-item PG review: unchanged SQL/write envelopes; same result sets/decoding; no cache/generation shortcut; unchanged schema/admission/integrity; no work moves to MAIN; focused red/green owner proof plus three actual PG shards. Exact-head coordinator approval is recorded for fe80c3bb52aea1aee49a3d8b85be7c61d8140596.

Paired base-only/base+candidate merge trees across 92 indexed open-main peers add zero conflict paths or blocks. The exact peer identities and source proof hashes are recorded in the local final overlap report; no exception applies.

Open PR overlap inventory (all: zero added paths/blocks)

#188890, #188577, #188492, #188479, #188397, #188063, #187924, #187824, #187495, #187281, #187269, #187268, #187104, #186896, #186891, #186793, #185928, #185841, #185615, #184863, #184750, #184370, #183825, #183729, #183696, #182701, #181807, #181303, #181057, #180539, #180286, #180233, #177351, #177190, #175490, #174972, #174943, #172313, #171189, #170165, #169241, #168956, #168615, #168054, #167706, #167703, #167471, #167292, #166965, #166488, #166166, #166140, #165824, #165766, #165486, #165039, #164229, #163835, #163377, #163267, #161997, #161339, #160332, #159569, #158723, #158419, #158030, #157679, #157292, #156344, #155106, #153511, #149906, #149882, #149241, #147932, #147886, #145895, #144065, #141004, #140609, #137788, #137594, #137435, #136554, #136476, #136274, #135296, #129388, #129191, #126924, #101294

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts commands Command implementations labels Oct 31, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T00:48:10.551761Z fe80c3b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@steipete
steipete merged commit 72bddb6 into main Oct 31, 2026
303 of 316 checks passed
@steipete
steipete deleted the dbasync/boottime-b branch October 31, 2026 01:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Keep the existing migration assertion as a leaf and move its unchanged execution to the direct runtime owner. Move two shared helpers to their existing owners to remove eager backedges. Read all plugin migration obligations first and skip the pending-only read when empty, retaining separate pending-status handling otherwise.

Synthetic graph counts: 1616 to 958 source modules and 778 to 424 compiled chunks. Empty pending-only reads: 1 to 0. The raw whole-flow cohort is confounded by unchanged startup/usage work; no total-work or latency improvement is claimed. Exact-head PostgreSQL approval, two isolated production reviews, focused regressions, CI/three PostgreSQL shards, and published-driver update qualification are recorded in the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. commands Command implementations gateway Gateway runtime scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant