Skip to content

fix: keep session retention proofs reliable in CI - #186123

Merged
shakkernerd merged 4 commits into
mainfrom
session-collection-node-routing-584
Oct 27, 2026
Merged

shakkernerd merged 4 commits into
mainfrom
session-collection-node-routing-584

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes CI running four session forced-collection checks on Bun/JavaScriptCore even though their zero-live-target assertions use V8 heap instrumentation. In the observed bun-all job, the session row projection retention test reached its unchanged collection oracle but still saw eight live WeakRef targets.

User Impact

There is no product behavior change. Session lifecycle, retention, garbage-collection assertions, ordering, and timeouts remain unchanged; CI now evaluates these existing proofs on the Node/V8 runtime they require while nearby functional session tests continue to run on Bun.

Why This Change Was Made

The runtime selector already keeps tests that require forced WeakRef collection on Node because JavaScriptCore conservatively scans stack references and cannot provide the same zero-live-target observation. The affected session tests were missing from that literal selector list.

This change keeps the existing history and row-projection retention suites on Node, moves only the accepted-suffix and sharing discovery-context collection cases into a dedicated database-retention suite, and retains that suite's database-worker shard and protected PR selection. Their mixed parent suites remain Bun-selected, so unrelated functional assertions keep their existing Bun coverage.

The selector's direct contract and real shard-runner coverage verify both sides of the partition: only the three forced-collection retention files are assigned to Node and excluded from Bun, while both mixed parent suites remain on Bun. A shared test helper preserves the one-yield, one-V8-query collection boundary and creates synthetic controls in completed frames. No runtime mechanism, workflow, unrelated sharding rule, dependency, production source, assertion, GC sequence, or timeout changes.

Evidence

  • GitHub Actions run 40482122354, job 122115046016 ran src/gateway/session-row-projection.retention.test.ts in a Bun-labeled shard and failed its zero-live-target assertion with eight retained references.
  • On the exact corrected tree, canonical formatting/lint passed, the line-neutral test-line ratchet passed, all seven selected type families passed, and selector/protected source-owner coverage passed 149/149 cases.
  • The maintained bun-all wrapper ran all affected files on their owning runtimes: Node history retention 3/3, core row-projection retention 2/2, and database retention 2/2; Bun accepted-facts 22/22 and sharing-preparation 20/20.
  • The database collection suite is explicitly retained in gatewayDatabaseWorkerTestFiles and PR_PROTECTED_RUNTIME_TEST_FILES, with source-owner coverage binding the new file to the existing protected-selection contract.
  • Corrected-head pull request CI, independent review, autoreview, and hosted review remain pending.

@clawsweeper

clawsweeper Bot commented Oct 27, 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 scripts Repository scripts size: S labels Oct 27, 2026
@shakkernerd shakkernerd self-assigned this Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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: 🦐 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR assigns session forced-collection tests to Node and extracts collection cases from mixed suites while preserving their CI selection.

Example: CI runs with OPENCLAW_CI_TEST_RUNTIME_POLICY=bun-all.

  • Before: session-row-projection.retention.test.ts runs on Bun despite using V8 forced-collection assertions.
  • After: The retention suite runs on Node, while accepted-facts and sharing-preparation functional suites remain on Bun.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation preserves the relevant contracts, with reported mixed-runtime results and supporting harness coverage rather than directly inspectable execution traces.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored CI/test repair changes no product authority boundary; the body reports maintained-wrapper runs on Node and Bun, while inspected runner coverage uses an in-process child-execution harness.
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 receive non-diagnostic retention failures when CI runs V8 collection assertions on Bun.
Reason: The maintainer-authored direction matches the documented runtime contract and preserves the distinct functional and retention checks.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it corrects a current CI runtime mismatch while preserving neighboring Bun coverage, with no blocking defect found.

Priority: P2
Reviewed head: 577343e9ac962c7159ecae5859d7a6ce2eef5baf

Before merge

None.

Findings

None.

Tests

  • Low-value test test/scripts/ci-changed-node-test-plan.source-owners.test.ts: The new standalone toContain assertion pins an inventory literal without exercising planner selection; remove it or extend an existing planner fixture to demonstrate protected selection.
  • Missing end-to-end proof: The supplied passing counts do not include an inspectable base-failing/head-passing execution trace for the corrected routing.
Agent review details

How this fits together

The CI runtime selector receives test targets and project inventories and produces Node and Bun execution partitions for the shard runner.

flowchart TD
  A[Changed source and test targets] --> B[Protected test selection]
  B --> C[Project inventories]
  C --> D[Runtime selector]
  D --> E[Node collection tests]
  D --> F[Bun functional tests]
Loading

Technical review

Best possible solution:

Keep exact runtime exceptions in the existing selector and isolate only collection-dependent cases while retaining functional Bun coverage and original selection ownership.

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

Current-main routing omits these session exceptions despite their V8 collection assertions; the linked failed job supports the report, but no reproduction was run during this read-only review.

Is this the best way to solve the issue?

The existing exact-file selector is the appropriate owner, and extracting the two mixed-suite cases avoids unnecessarily removing functional Bun coverage.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Exact-file Node exceptions and daily Bun coverage keeps the original intent (ci: default daily tests to Bun and retain dual release validation #175699: Daily CI uses Bun while named Node contracts retain Node execution and release validation preserves the complete Node pass.)
  • Session projection and sidebar collection assertions keeps the original intent (e5e85a9: Forced collection detects superseded projection graphs; subsequent presentation and sidebar-history repairs extended the same retention boundary.)
  • Accepted-suffix disposal keeps the original intent (e77d4ad: Prepared facts survive refresh yields until presentation or canonical invalidation, with disposal releasing retained facts.)
  • Discovery-context collection with active session authority keeps the original intent (427171f: Registration authority must remain usable without retaining unrelated caller discovery context.)
  • Pending-input selector regression keeps the original intent (a363cc4: Only collection-dependent pending-input tests belong on Node; ordinary pending-input tests retain Bun coverage.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fa86f99 adds scripts/lib/ci-test-runtime.mts:307 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fa86f99a19fa; files: scripts/lib/ci-test-runtime.mts)
  • Shakker: Raw commit a363cc4 adds scripts/lib/ci-test-runtime.mts:105 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a363cc477a61; files: scripts/lib/ci-test-runtime.mts)

PR surface

Tests +1, Other +4. Total +5 across 12 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 10 114 113 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 12 118 113 +5

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This corrects a bounded CI runtime-assignment defect without changing product runtime behavior.
  • 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the inventory-literal test or replace it with a planner case demonstrating that an affected production-source change selects the extracted retention suite.

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-27T16:48:11.279Z sha 1ec9255 :: needs maintainer review before merge. :: none

Reviewed October 27, 2026, 2:26 PM ET / 18:26 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Oct 27, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 27, 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@shakkernerd
shakkernerd merged commit 79f1472 into main Oct 27, 2026
231 of 234 checks passed
@shakkernerd
shakkernerd deleted the session-collection-node-routing-584 branch October 27, 2026 18:48
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Session collection checks run on Node/V8 while neighboring functional tests retain Bun coverage.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
Route session forced-collection checks to Node/V8 while preserving Bun functional coverage, database-worker ownership, and protected PR selection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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