Skip to content

fix(release): align survivor session metadata assertion - #123068

Merged
steipete merged 2 commits into
mainfrom
fix/release-upgrade-survivor-sessionfile-harness
Aug 13, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/release-upgrade-survivor-sessionfile-harness

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The trusted main release harness still required migrated file-backed session rows to retain sessionFile. Canonical session persistence intentionally retired that locator and stores transcript bytes separately, so exact-ref release validation failed after the signed candidate had correctly migrated the transcript and removed the legacy metadata.

Observed failure: https://github.com/openclaw/openclaw/actions/runs/31679241095

Why This Change Was Made

Keep the two owned invariants separate:

  • the migrated transcript file must exist under the canonical agent session directory;
  • the persisted session row must not contain retired sessionFile metadata.

The survivor fixture now models the canonical row shape instead of reintroducing the retired field. No runtime behavior, compatibility path, or fallback changes.

User Impact

Release validation no longer rejects correct upgrades after session locator retirement. A real missing transcript still fails the existing file-existence assertion, while retained legacy metadata now fails with an accurate diagnostic.

Evidence

  • node scripts/run-vitest.mjs test/scripts/upgrade-survivor-assertions.test.ts — 20 passed.
  • Fresh structured autoreview — no accepted/actionable findings; secret scan clean.
  • The signed candidate run prepared package, image, and prerelease plugin companions successfully before failing only on the stale trusted-harness assertion.

No changelog change is required; this is trusted release-harness alignment.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 13, 2026 08:15
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 13, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 4:33 AM ET / 08:33 UTC.

ClawSweeper review

What this changes

This PR updates upgrade-survivor release assertions and fixtures so migrated session rows reject retired sessionFile metadata for both file-backed and SQLite-backed stores.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The follow-up commit addresses the prior SQLite-specific finding by applying the retired-metadata assertion before the file/SQLite branch; this is a focused, correct release-harness repair pending exact-head validation.

Priority: P2
Reviewed head: c637377b9efc831961cc1287adfbb7eaa5a3e3b8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch cleanly resolves the prior finding and matches the canonical persistence contract, pending exact-head release validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal release-harness repair is outside the external-contributor proof gate; exact-head harness output is the relevant remaining validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal release-harness repair is outside the external-contributor proof gate; exact-head harness output is the relevant remaining validation.
Evidence reviewed 4 items Shared assertion repair: The branch checks every migrated row for retired sessionFile metadata before branching into file transcript existence or SQLite transcript-event checks.
Canonical persistence contract: Current main explicitly removes sessionFile as a retired runtime locator from canonical persisted session entries.
Existing owner-boundary coverage: Current main already tests that SQLite import drops a legacy transcript path from the resulting canonical row; the PR adds the missing release-harness SQLite negative case.
Findings None None.
Security None None.

How this fits together

The upgrade-survivor harness validates that a release upgrade preserves session transcripts while persisting only canonical session metadata. It reads migrated file or SQLite state and produces the release-validation pass/fail result.

flowchart LR
  Legacy[Legacy session state] --> Migration[Upgrade migration]
  Migration --> Store[File or SQLite session store]
  Store --> Harness[Upgrade survivor harness]
  Harness --> Metadata[Reject retired metadata]
  Harness --> Transcript[Verify transcript survival]
  Metadata --> Result[Release validation result]
  Transcript --> Result
Loading

Before merge

  • Resolve merge risk (P1) - This changes a trusted release gate, so merge should wait for the exact-head release-harness checks now in progress.
  • Complete next step (P2) - No repair job is needed: the current head addresses the prior finding, and the remaining action is normal exact-head validation before maintainer merge.
Agent review details

Security

None.

PR surface

Tests +7, Other -2. Total +5 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 27 20 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 12 14 -2
Total 2 39 34 +5

Review metrics

Metric Value Why it matters
Production versus test delta production -2, tests +7 The change centralizes an existing assertion and adds SQLite regression coverage without increasing runtime product code.

Stored data model

Persistent data-model change detected: migration/backfill/repair: test/scripts/upgrade-survivor-assertions.test.ts, unknown-data-model-change: scripts/e2e/lib/upgrade-survivor/assertions.mjs, unknown-data-model-change: test/scripts/upgrade-survivor-assertions.test.ts, vector/embedding metadata: scripts/e2e/lib/upgrade-survivor/assertions.mjs. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Validate the exact head (recommended)
    Merge after the current head completes the targeted survivor and required release-harness checks successfully.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require successful exact-head release-harness validation before merge.

Technical review

Best possible solution:

Keep canonical persisted session rows free of retired locators and land this focused harness correction once exact-head validation is green.

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

Yes. Current main's canonical-row projection removes sessionFile, while the prior harness asserted it only for file-backed rows; the branch makes that invariant storage-independent.

Is this the best way to solve the issue?

Yes. Applying the metadata assertion to the shared migrated-row set is the narrowest maintainable repair, while retaining distinct transcript checks for each storage backend.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 792b2054df2c.

Labels

Label changes:

  • 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: This maintainer-authored internal release-harness repair is outside the external-contributor proof gate; exact-head harness output is the relevant remaining validation.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The patch corrects release-validation behavior without altering shipped runtime behavior.
  • merge-risk: 🚨 automation: The edited survivor harness determines whether upgrade candidates pass trusted release validation.
  • 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: This maintainer-authored internal release-harness repair is outside the external-contributor proof gate; exact-head harness output is the relevant remaining validation.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Current-main blame attributes both the survivor assertion and canonical-session projection contract to this recent feature work. (role: introduced current session-harness invariant; confidence: high; commits: 1e7a76f49cc8; files: scripts/e2e/lib/upgrade-survivor/assertions.mjs, src/config/sessions/store-entry-shape.ts, src/config/sessions/session-accessor.test.ts)

Rank-up moves

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

  • Confirm the targeted survivor test and required exact-head checks complete successfully.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-13T08:20:53.599Z sha 999dc6f :: found issues before merge. :: [P2] Assert retired metadata for SQLite-backed survivors

@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the SQLite authority finding in c637377b9efc831961cc1287adfbb7eaa5a3e3b8.

The retired sessionFile invariant now runs before the file/SQLite split, while transcript proof remains backend-specific. Added a SQLite negative regression that seeds retained metadata and verifies the trusted harness rejects it.

Proof:

@steipete
steipete merged commit 7235943 into main Aug 13, 2026
110 checks passed
@steipete
steipete deleted the fix/release-upgrade-survivor-sessionfile-harness branch August 13, 2026 08:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
)

* fix(release): align survivor session metadata assertion

* test(release): cover SQLite survivor metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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