Skip to content

fix(ci): repair SQLite exclusion proof and orphaned media exports - #199571

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-session-exact-read-exports-20261115
Nov 15, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-session-exact-read-exports-20261115

Conversation

@steipete

@steipete steipete commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repairs inherited main failures in the SQLite exact-exclusion test and the unused-export gate, reproduced on 3bbf67501123a640c4634f782ba56aac6050dd3c.

Why This Change Was Made

The exclusion contract is exact membership in the keys returned by SQLite. #138470 (93450a667d2ab1e747db303de86ab02737c18dda) introduced an expectation that every UTF-16 database replaces U+FFFE/U+FFFF; #179786 (08d77cab4373900582329c2ddb2992c3fb224900) moved that assertion unchanged. Node 26.12.1 / SQLite 3.54.1 preserves those characters, so the owner correctly excludes two rows the test expected to retain. Keep the test, compare against an independent native SELECT plus exact Set membership, and restore UTF-16be to the table. The original PR explicitly preserves returned-key membership; no retention behavior was intentionally removed or needs changing.

#199529 (e6265d6f2a8c36448a0f07f611aada8b4022cb09) intentionally removed the cron media wait and continuation tests. That left onMediaGenerationOperationChanged and invokeGatewaySuspendPrepare with no callers. Remove the unused listener registration/state/notifications and test helper, and update the fixture's state-reset inventory. No test cases or behavior assertions are deleted.

The initially reported #199338 export is already fixed by #199553 (8d04ce01ad17844fde652145fa5ddac5ec90e161) on this base; this PR does not duplicate that UI repair. The two new unused exports are separately attributed main regressions.

User Impact

Restores the existing checks without changing session retention, stored data, media ownership, completion delivery, configuration, or schema. The test still rejects incorrect exclusions across all three encodings. Production LOC decreases by 12; test/support LOC decreases by 29. No assertions, skips, budgets or scan configuration are weakened.

Evidence

  • Before: pnpm test src/config/sessions/session-accessor.sqlite-exact-read.test.ts fails only the UTF-16le case (30 passed, 1 failed). Direct native SQLite probes confirm intact noncharacters and exact exclusion of those returned keys. History identifies the assertion's introduction/move; this is not a claim to have bisected the first SQLite runtime version changing conversion.
  • Exact red/green scan: pnpm dlx --package [email protected] knip --config config/knip.all-exports.config.ts --no-progress --reporter compact --include exports,nsExports,types,nsTypes,enumMembers,namespaceMembers --no-config-hints: two unused symbols before, zero after.
  • pnpm test src/config/sessions/session-accessor.sqlite-exact-read.test.ts src/config/sessions/session-accessor.sqlite-maintenance-cap.test.ts src/agents/media-generation-activity.test.ts src/gateway/server-methods/agent.test.ts src/gateway/server-methods/suspend.test.ts: 435 passed across five files/three shards; no skips.
  • Final independent Codex autoreview, complete four-file diff through P2: scoped-clean, no actionable findings.
  • pnpm check:changed: passed, including all type graphs, all three zero-export scans, lint/format and policy guards. The final fixture delta also passed separate lint/format. git diff --check passed.
  • Exact-head CI run 43707387349 and security gate workflow 43707387478 completed successfully on d2f119d92d27dd9c009209928f572f77f930415d. No reruns or inherited-infrastructure exception were needed.
  • ClawSweeper final-head review: zero findings, before-merge items and open checkboxes. Hosted Codex review also completed without findings.

The first post-fix focused run caught a real incomplete fixture cleanup: the reset helper still named the deleted listener set. The final patch removes that entry and strengthens its guard to the remaining Map state; the failure is retained as evidence, not labeled inherited.

@clawsweeper

clawsweeper Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Nov 15, 2026
@steipete
steipete marked this pull request as ready for review November 15, 2026 11:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T11:09:32.099324Z d2f119d Draft marked ready
ℹ️ 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.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Please review final head d2f119d92d27dd9c009209928f572f77f930415d. The SQLite case retains exact returned-key membership using an independent native SELECT, with UTF-16be restored. The other changes delete unused media listener machinery and a suspend fixture orphaned by #199529; the fixture reset now matches the remaining maps. No tests, assertions or skips were removed. All 435 focused tests, all three Knip scans, check:changed and final Codex autoreview passed locally. Exact-head CI is running.

@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR corrects the SQLite exclusion test oracle and removes unused media notifications and a Gateway test helper.

Example: A UTF-16le database preserves the session key agent:main:a\uFFFE.

  • Before: The test expects id-1 to survive despite its returned key being explicitly excluded.
  • After: The expected result follows exact membership of the keys returned by SQLite.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, contract-preserving repair supported by source inspection and reported native-owner validation; broad exact-head CI is still running.
Proof confidence 🐚 platinum hermit (4/6) This test repair and removal of unconsumed internal code introduce no user-visible behavior requiring shipped-entry-point proof; the inspected screenshots concern the separate Connected apps change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Maintainers encounter failing validation despite correct session exclusion behavior and retired media consumers.
Reason: The maintainer-authored direction restores meaningful checks while reducing obsolete code and preserving runtime contracts.

Merge readiness

✅ Ready for maintainer review

This PR is a focused repair of inherited check failures; the pinned diff introduces no actionable correctness or security findings, and exact-head CI remains pending.

Priority: P2
Reviewed head: d2f119d92d27dd9c009209928f572f77f930415d

Before merge

None.

Findings

None.

Agent review details

How this fits together

Session maintenance reads SQLite rows and filters excluded keys before selecting cleanup candidates; the separate media registry tracks process-local generation activity and completion ownership.

flowchart TD
  A[SQLite session rows] --> B[Maintenance candidate owner]
  C[Excluded key set] --> B
  B --> D[Surviving session candidates]
  A --> E[Independent native SELECT oracle]
  C --> E
  E --> F[Encoding regression assertions]
  D --> F
Loading

Technical review

Best possible solution:

Retain exact returned-key exclusion semantics and complete the obsolete notification cleanup as this patch does.

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

Source confirms the orphaned exports and the runtime-dependent hardcoded expectation; the author supplies focused red/green results, which were not rerun during this read-only review.

Is this the best way to solve the issue?

The patch is the smallest complete repair: use an independent native-row oracle, retain encoding coverage, and delete notifications and fixture code whose consumers were intentionally retired.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8f9bd10825ff.

Provenance checked

  • SQLite exclusion expectation keeps the original intent (93450a6: The original optimization preserved exact JavaScript membership of returned keys across text conversions; the expectation was later carried into the consolidated suite.)
  • Media change notifications and reset inventory changes intended behavior with a stated reason (1a1db58: Notifications replaced periodic completion-wait polling; the merged cron repair subsequently retired that waiting consumer.)
  • Gateway suspend fixture keeps the original intent (507038c: The suite split retained shared test setup and ordering; removing a helper after its continuation tests were retired preserves that purpose.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -12, Tests -29. Total -41 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 0 12 -12
Tests 3 11 40 -29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 11 52 -41

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Repairs inherited validation failures without changing user-facing runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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:

  • P2: Repairs inherited validation failures without changing user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 November 15, 2026, 6:14 AM ET / 11:14 UTC.

@steipete
steipete merged commit eb0a30b into main Nov 15, 2026
225 of 231 checks passed
@steipete
steipete deleted the steipete/fix-session-exact-read-exports-20261115 branch November 15, 2026 11:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. 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