Skip to content

refactor(transcripts): extract connection-bound mutation kernels - #147375

Merged
steipete merged 1 commit into
mainfrom
codex/meeting-transcript-worker-audit-20260913
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/meeting-transcript-worker-audit-20260913

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #144592
Related: #146547

What Problem This Solves

Meeting transcript persistence needs connection-bound operations before its writes can move into the shared SQLite worker.

User Impact

Normal transcript capture, summaries, and exports retain their existing behavior. Unsupported export metadata containing valid JSON with the wrong shape now throws TypeError instead of flowing through casts and potentially being rewritten. JSON syntax errors still propagate unchanged. No data repair, coercion, schema, retention, or Doctor detection behavior changes.

Why This Change Was Made

Session, summary, and export bookkeeping mutations now use connection-bound kernels, with one shared owner for domain errors and typed export-state decoding. The store still owns connection acquisition, schema ensuring, transaction admission, and caller checks. Session ID origin, selector conflicts, utterance deduplication, and revision checks remain intact.

This is preparation for worker execution; native SQLite still runs through the existing facade. The read-worker work in #146547 remains separate.

Evidence

Four existing isolated SQLite cases passed, covering session/utterance persistence, ordered tails, empty nullable text, and summary/export/reopen (29.35 seconds total wrapper time). A pure decoder check confirmed valid-data equivalence, wrong-shape TypeError rejection, and unchanged SyntaxError propagation.

The full changed-file gate passed, including core production/test types, all three unused-export scans with zero entries, typed lint, and repository guards. Fresh review found no actionable issues. Existing assertion allowances only shrink to match removed casts.

@clawsweeper

clawsweeper Bot commented Sep 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 agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 20:18
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 4:26 PM ET / 20:26 UTC.

ClawSweeper review

What this changes

Extracts meeting transcript writes into helpers that use an existing database connection, centralizes errors, and validates export bookkeeping JSON.

Merge readiness

✅ Ready for maintainer review

Keep open as a useful prerequisite for the ongoing SQLite worker work. No blocking introduced defect was found, and this protected maintainer PR is not a cleanup candidate.

Priority: P3
Reviewed head: d2aef8996a0d3f346c456a51aa0393cce75744a5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extraction with preserved invariants, existing behavioral coverage, and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply; reported SQLite and decoder checks support the extraction but were not independently executed here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply; reported SQLite and decoder checks support the extraction but were not independently executed here.
Evidence reviewed 8 items Pinned extraction preserves transaction checks: The complete local introduced diff preserves synchronous transaction admission and caller assertions in the store; revision checks, selector conflicts, and admitted ID-origin preservation move into the connection-bound helpers.
Decoder matches existing producers: Runtime writes and legacy migration initialize manifests as objects and pending exports as arrays; subsequent bookkeeping writes string hashes and filenames. The new decoder rejects unsupported shapes without coercion. The PR explicitly documents this behavior.
Shared normalization contract inspected: The new decoder directly imports the repository-owned normalization package. Its isStringRecord implementation requires a non-array object whose enumerable own values are strings; no Codex runtime or protocol dependency is involved.
Findings None None.
Security None None.

How this fits together

Meeting transcript storage receives captured speech, session metadata, and generated notes and persists them in OpenClaw’s shared SQLite database. Explicit export operations turn that stored content into files.

flowchart TD
  A[Meeting capture and notes] --> B[Transcript store]
  B --> C[Write admission and caller checks]
  C --> D[Connection-bound writes]
  D --> E[Shared SQLite database]
  E --> F[Export ownership validation]
  F --> G[Transcript and summary files]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +122, Tests +1, Other -1. Total +122 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 9 276 154 +122
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 2 -1
Total 11 279 157 +122

Review metrics

Metric Value Why it matters
Production versus test growth Production net +122 lines; tests net +1 line The growth establishes typed connection-bound mutation boundaries for the explicitly linked worker-storage effort.

Root-cause cluster

Relationship: partial_overlap
Canonical: #144592
Summary: This is a mutation-kernel prerequisite within the broader asynchronous storage effort, separate from the transcript read-worker conversion.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one transcript store responsible for admission and lifecycle, with synchronous connection-bound mutations ready for a separately proven worker conversion.

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

Not applicable: this PR prepares an internal storage boundary rather than reporting a runtime defect; review found no introduced failing path.

Is this the best way to solve the issue?

Yes: extracting the existing mutations while preserving their transaction owner follows the documented storage pattern without adding a parallel implementation or public API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6f58faf3eb0d.

Labels

Label changes:

  • add P3: This is a bounded internal preparation refactor with no demonstrated urgent user-facing failure.
  • 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 supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply; reported SQLite and decoder checks support the extraction but were not independently executed here.

Label justifications:

  • P3: This is a bounded internal preparation refactor with no demonstrated urgent user-facing failure.
  • 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 supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply; reported SQLite and decoder checks support the extraction but were not independently executed here.

Evidence

What I checked:

  • Pinned extraction preserves transaction checks: The complete local introduced diff preserves synchronous transaction admission and caller assertions in the store; revision checks, selector conflicts, and admitted ID-origin preservation move into the connection-bound helpers. (src/transcripts/store.ts:367, d2aef8996a0d)
  • Decoder matches existing producers: Runtime writes and legacy migration initialize manifests as objects and pending exports as arrays; subsequent bookkeeping writes string hashes and filenames. The new decoder rejects unsupported shapes without coercion. The PR explicitly documents this behavior. (src/transcripts/store-export-state.ts:3, d2aef8996a0d)
  • Shared normalization contract inspected: The new decoder directly imports the repository-owned normalization package. Its isStringRecord implementation requires a non-array object whose enumerable own values are strings; no Codex runtime or protocol dependency is involved. (packages/normalization-core/src/record-coerce.ts:46, d2aef8996a0d)
  • Existing behavioral coverage retained: The store tests cover persistence, ID-origin retention through reopen and Doctor restoration, selector conflicts, summary exports, and interrupted manifest recovery. The lifecycle test changes only its error import and retains stale-caller and historical-revision assertions. Tests were inspected, not executed. (src/transcripts/store.test.ts:120, d2aef8996a0d)
  • Current main still contains inline mutations: Fetched main and the PR merge base have identical store.ts blobs. Main still implements session writes inline, and the extracted write module is absent from both fetched main and the supplied latest release commit. This remains distinct preparatory work. (src/transcripts/store.ts:426, 6f58faf3eb0d)
  • Related work does not supersede this patch: Complete asynchronous runtime storage boundaries while retaining SQLite #144592 explicitly requests small SQLite boundary conversions. refactor(transcripts): run stored lookups in the shared SQLite worker #146547 remains open and explicitly leaves capture writes for follow-up; its read-worker proof is not proof for this branch.

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 1ed4f2f into main Sep 13, 2026
257 checks passed
@steipete
steipete deleted the codex/meeting-transcript-worker-audit-20260913 branch September 13, 2026 20:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
steipete added a commit that referenced this pull request Sep 18, 2026
…#146547)

Related: #144592
Related: #147375
Related: #147246
Dependency: #151816

## What Problem This Solves

Stored transcript detail and note lookups return promises but still execute SQLite on the Gateway event loop.

## User Impact

Transcript identity, descriptor, note, summary, and utterance lookups execute in the shared SQLite worker. Existing selectors, content, ordering, limits, and error responses are preserved. No schema migration or configuration change is required.

Chronological list queries and streaming/export snapshots retain their current owners. Capture appends are a separate stacked change in #151760.

## Why This Change Was Made

Eleven typed commands call the existing read kernels through the canonical shared-state worker. Compound enumeration, matching, and library reads keep one deferred snapshot. First-use schema creation finishes before those reads, canonical close drains accepted work, and existing-only task inspection stays non-creating. Meeting fixtures stop producers before asynchronous database cleanup, and canonical test routing keeps worker consumers in their owning processes.

The composition preserves Doctor's device-token dispatch alongside all eleven transcript commands, shared transaction-settlement checks, plugin-reload ownership, and current test-routing changes. Chronological reads preserve their parent-timezone date function; exports preserve their snapshot lifetime.

Qualified dependency history from #151816 is incorporated through normal merge ancestry. It pins the deprecated message facade at its published exports, aligns three global surface limits with the resulting smaller counts, and carries the canonical catalog-materialization prerequisite with its strict 18-read assertion. The per-entry SDK compatibility limit remains unchanged. This does not claim that dependency PR #151816 has merged.

## Evidence

The current catalog carry passed a fresh normal production build in 319.083 seconds and all five real transcript/Doctor SQLite worker controls in 21.595 seconds. Fresh independent P2 review found no actionable issues. These checks cover the changed Gateway and shared-worker import closures. All 58 non-doc meeting feature files, including the combined Doctor/transcript dispatcher, remain byte-identical to `6b3c5acb8634`; storage docs only gain the qualified upstream task paragraph.

The SDK owner's strict catalog control and 25 archived-list/backfill controls are reused for matching owner inputs. The strict assertion retains three binding-authority checks and zero plugin-state worker operations while accounting for 18 SQLite reads after canonical materialization changes. The shared worker composition is separately covered by the five fresh controls above.

Retained compiled child CLI/Gateway proof belongs to the earlier captured-main `6c6dc44250d` composition: the test body passed in 21.539 seconds under its unchanged 180-second bound, with 404.282 seconds for the supported wrapper and private-QA build. It checks canonical SQLite state, delegated missing-session cleanup while the isolated Gateway stays alive, transcript list/show/path commands, and exported bytes. This compiled scenario was not rerun on the latest catalog carry.

The preceding combined 62-file gate passed in 966.651 seconds, including production/test types, SDK/storage boundaries, formatting, lint, and three unused-export scans with zero findings. Six SDK facade tests and independent P2 review passed. The subsequent exact three SDK ratchet decreases passed all ten existing reporter tests, the canonical surface check, the changed-script gate, and fresh P2 review. Earlier reload and routing controls remain attributed to their qualified inputs.

CI at `6b3c5acb8634` completed with 140 successful jobs, 14 skipped, and one substantive failure plus its aggregate gate: the shared catalog benchmark expected 20 reads but the CI main composition performed 18. That matched the SDK owner's independently reproduced prerequisite issue. This carry includes its qualified canonical prerequisite and strict assertion correction; strict equality, authority-count, and zero-I/O checks remain intact, with unchanged deadlines. The new head requires its own hosted CI before landing.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…openclaw#146547)

Related: openclaw#144592
Related: openclaw#147375
Related: openclaw#147246
Dependency: openclaw#151816

## What Problem This Solves

Stored transcript detail and note lookups return promises but still execute SQLite on the Gateway event loop.

## User Impact

Transcript identity, descriptor, note, summary, and utterance lookups execute in the shared SQLite worker. Existing selectors, content, ordering, limits, and error responses are preserved. No schema migration or configuration change is required.

Chronological list queries and streaming/export snapshots retain their current owners. Capture appends are a separate stacked change in openclaw#151760.

## Why This Change Was Made

Eleven typed commands call the existing read kernels through the canonical shared-state worker. Compound enumeration, matching, and library reads keep one deferred snapshot. First-use schema creation finishes before those reads, canonical close drains accepted work, and existing-only task inspection stays non-creating. Meeting fixtures stop producers before asynchronous database cleanup, and canonical test routing keeps worker consumers in their owning processes.

The composition preserves Doctor's device-token dispatch alongside all eleven transcript commands, shared transaction-settlement checks, plugin-reload ownership, and current test-routing changes. Chronological reads preserve their parent-timezone date function; exports preserve their snapshot lifetime.

Qualified dependency history from openclaw#151816 is incorporated through normal merge ancestry. It pins the deprecated message facade at its published exports, aligns three global surface limits with the resulting smaller counts, and carries the canonical catalog-materialization prerequisite with its strict 18-read assertion. The per-entry SDK compatibility limit remains unchanged. This does not claim that dependency PR openclaw#151816 has merged.

## Evidence

The current catalog carry passed a fresh normal production build in 319.083 seconds and all five real transcript/Doctor SQLite worker controls in 21.595 seconds. Fresh independent P2 review found no actionable issues. These checks cover the changed Gateway and shared-worker import closures. All 58 non-doc meeting feature files, including the combined Doctor/transcript dispatcher, remain byte-identical to `6b3c5acb8634`; storage docs only gain the qualified upstream task paragraph.

The SDK owner's strict catalog control and 25 archived-list/backfill controls are reused for matching owner inputs. The strict assertion retains three binding-authority checks and zero plugin-state worker operations while accounting for 18 SQLite reads after canonical materialization changes. The shared worker composition is separately covered by the five fresh controls above.

Retained compiled child CLI/Gateway proof belongs to the earlier captured-main `a16c8616eac` composition: the test body passed in 21.539 seconds under its unchanged 180-second bound, with 404.282 seconds for the supported wrapper and private-QA build. It checks canonical SQLite state, delegated missing-session cleanup while the isolated Gateway stays alive, transcript list/show/path commands, and exported bytes. This compiled scenario was not rerun on the latest catalog carry.

The preceding combined 62-file gate passed in 966.651 seconds, including production/test types, SDK/storage boundaries, formatting, lint, and three unused-export scans with zero findings. Six SDK facade tests and independent P2 review passed. The subsequent exact three SDK ratchet decreases passed all ten existing reporter tests, the canonical surface check, the changed-script gate, and fresh P2 review. Earlier reload and routing controls remain attributed to their qualified inputs.

CI at `6b3c5acb8634` completed with 140 successful jobs, 14 skipped, and one substantive failure plus its aggregate gate: the shared catalog benchmark expected 20 reads but the CI main composition performed 18. That matched the SDK owner's independently reproduced prerequisite issue. This carry includes its qualified canonical prerequisite and strict assertion correction; strict equality, authority-count, and zero-I/O checks remain intact, with unchanged deadlines. The new head requires its own hosted CI before landing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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: M 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