Skip to content

test(update): prove the previous reader after pre-ready migrations - #204883

Merged
obviyus merged 9 commits into
mainfrom
ci/state-reader-downgrade
Nov 25, 2026
Merged

obviyus merged 9 commits into
mainfrom
ci/state-reader-downgrade

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Class A — previous-reader enforcement, stage 1

Follow-up to merged #204685 and #204830; coordination #204775. Existing owner: upgrade-survivor. Instances behind the proof-debt class: #203735, #203769, #204094, #204224, #204426, #204512, #204275. This adds proof, not claims to fix those separate runtime causes.

Contract

  • Keep the merged healthy head → synthetic-next update lane. Its retained T also reports shared-schema readability from an isolated online backup (readable, refused, unproven), without changing the update result.
  • For actual schema-version/production-migration diffs, build T from the PR fork point and reuse CI's tested merge-tree package as T+1. Record both source/build identities.
  • Seed shared cron and agent sessions/history through T's real Gateway writers. Stop T, retain raw preimages, boot T+1, stop it at the exact Gateway TCP listen boundary, then hard-kill/reap its process group.
  • Inspect DB/WAL/SHM copies after the kill. Advanced stores must have committed target schemas and valid floors; untouched lazy stores are named as untouched. Integrity/setup failures always fail.
  • Project actual rollback state: restore only raised-floor stores from T's preimages, preserve other candidate-written store bytes, then authenticate to genuine T and read the seeded cron/session/history data. Compatibility becomes required when candidate source includes ReaderFloor's contract; absent/NULL floor metadata is valid and is not mistaken for missing capability.

No production code/schema change, down-migration, fake success receipt, production startup hook, or committed src/update/src/state edit. StoreCustody owns the separate normal-update crash case; this PR does not reintroduce the old red case. Bulk-access enforcement and the 10 GB nightly are stages 2 and 3, not claimed here.

Cost and simplification

One extra previous-source build only for schema/migration diffs; no new CI job, runner tier or fanout. Existing lane ceiling rises 40 → 55 min; per-container ceiling stays 20 min and the existing seed job stays 115 min. Explicit downgrade qualification skips the unrelated synthetic successor build. Actual additional runtime is not measured yet.

The previous-reader report's duplicate process supervisor is deleted; seeder, report and downgrade share one bounded process-group owner. Separate modules own source preparation, real RPC fixture, crash barrier, physical store observations/projection and the controller; none ships in the product. These are the smallest coherent pieces of the approved pre-ready oracle, not a second updater.

Final PR-owned tokei code against pinned main f36e439d70772464e10f66182e05e52e99e22663: production 0 → 0; scripts 2,116 → 3,516 (+1,400); tests 8,797 → 9,175 (+378). Net raw test growth is 394 / 400, allocation 0. The duplicate SQLite fixture factory/mixed-projection case is gone; byte preservation and restored-content assertions remain in the single suite. No unrelated deletions, suppression allowlist entries or Knip ignores were added.

Evidence and current gate

Ready for review; published head ead509c7f0fdd54096923f7cc11b0d7df2d824ec, with the required CI watchdog armed. Do not treat prior-head runtime proof as a final CI result. Subsequent changes affect typing, unit fixtures, lint and typed failure receipts, not the successful migration/projection path.

  • Healthy update and schema-read observation on 1f0cdf960f0c: AWS run_8fc9ebd67a55f3ac853523dc53dd7100. Committed/reported trial e7846307-c5b3-48eb-97c4-c8c0bdfd4455, schema42, two rows; CLI153097ms. Verified old T refused the isolated new shared schema with exit78; backup stayed schema42. This is the requested report, not an accepted downgrade refusal.
  • Genuine pre-ready qualification on 55efd824fc82: AWS run_2c8997c1c413a76556c9a07c640be21b. Actual d4c6c46 source T→published candidate: both agents43→44 before candidate SIGKILL; raised stores restored, shared41 byte-preserved. Config preimage restored atomically: before/restored SHA 74a6c60183b06ccb29deda5eb80de98ae113767aa9e3d232f10c8c8f8c641387, candidate SHA 076aa2f7d5f926c7998edbb5afeb18a48b42161dee8acf79ad5498371e803b0f. Genuine T served, its build ID matched, and both exact histories and the cron sentinel passed. This older-writer qualification is not a claim that d4 is this PR's fork point.
  • ReaderFloor's independent #204880 size-loss/config-provenance case remains known (run_5eaf078abca514a139d8c599b2092035). Our different fixture passing does not clear it. Rollout remains report-only until the reader-floor/recovery fix lands; no override flag, backup deletion or unraised-database restore was added.
  • The genuine proof's full build and14 owner tests passed. After the test consolidation, exact published 55ff2e4cfa76 AWS run_c243aab4f60386a030d0fa6e81cb65a0 passed selected canonical type graphs, 11 focused tests, and the 391/400 test-line ratchet.
  • Two full source reviews (43bd8ae1016a, 55efd824fc82) found zero findings, patch correct, security cleared. Exact final-head review of only the later repair delta 55efd824fc82..ead509c7f0fd also completed clean (zero findings/security cleared); this is not a third full-range audit or release rebuild.
  • Complete changed-file format, lint, scripts/test-root types and guards passed in AWS run_69e9eb1d2d90257c64d462065092464e. That full canonical command also reported a CLI-only harness export (now private) and pinned-production src/gateway/operator-admission.ts:intersectOperatorRunModelPolicy, which this PR does not modify. Previous head 18be57a08bda run_7ebfa24dbd0e08ea4509fd93887a6ae3 then passed the canonical script-Knip profile, 11 tests and 394/400 line ratchet. No full-command green or current-main reproduction of the production finding is claimed; final PR CI is authoritative.
  • Exact waiver-free final head AWS run_14b6d54ff040f3eda60ba6620d8a44f7 passed scoped canonical scripts lint/typecheck, 25 tests (11 downgrade boundaries plus the suppression guard), and 394/400 line ratchet. The two annotations were removed using explicit reflective receiver handling and existing protocol destructuring, not allowlisted. All owned AWS leases released with --wait.

Fable challenged the design before code. Bulk-access enforcement and the real10GB nightly remain the approved subsequent stages, not claimed by this PR.

Seed with real previous-release Gateway writers; inspect candidate crash copies and project raised-floor restores before old-reader smoke.
Record tested merge/fork identities and source-provenanced rollout capability. Verification and publication remain separate from healthy-only PR #204685.
Retain merged healthy-only lane; omit the unrelated synthetic successor build for an explicit genuine downgrade run.
@clawsweeper

clawsweeper Bot commented Nov 24, 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 docs Improvements or additions to documentation scripts Repository scripts docker Docker and sandbox tooling size: XL labels Nov 24, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds previous-build readability reporting and a pre-listen downgrade qualification scenario to the existing upgrade-survivor lane.

Example: A candidate migrates state containing the ops agent’s seeded session and cron job.

  • Before: The healthy update lane does not exercise the previous build against projected rollback state.
  • After: The new scenario stops the candidate before listening, restores raised-floor stores, and asks the previous build to read the seeded data.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful approved direction, but the new fixture has a source-verifiable setup failure and current-head qualification remains unexecuted.
Proof confidence 🦪 silver shellfish (2/6) This maintainer-authored PR changes test infrastructure only; its cited earlier checkpoint covers SQLite projection and the port barrier, while the body explicitly leaves current-head genuine-release qualification unproven.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Update qualification does not yet establish that the previous build can read state preserved by a pre-ready rollback projection.
Reason: The maintainer-authored stage addresses documented update proof debt through the existing survivor lane without expanding the production updater.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this useful, maintainer-authored draft open; its new downgrade fixture contains an invalid config entry that prevents qualification from reaching seeding.

Priority: P2
Reviewed head: 43bd8ae1016a363a3686a742a682a0baeb1abe5a

Before merge

  • Remove the retired Workshop key from the reader fixture (P2) - Every downgrade run writes skills.workshop.autonomous.mode into the fresh previous-reader config. The strict skills schema no longer accepts workshop, and src/config/validation.workshop-contract.test.ts explicitly rejects this exact shape. Gateway startup therefore fails before createReaderFixture can seed cron or sessions, making the new schema qualification fail during setup. Remove this entry; plugins.enabled is already false.
  • Complete next step - The PR author should execute the corrected genuine-release downgrade scenario and affected workflow/tooling checks on the final head before marking this draft ready.

Findings

  • [P2] Remove the retired Workshop key from the reader fixture — scripts/e2e/lib/upgrade-survivor/reader-fixture.mjs:280
Agent review details

How this fits together

The upgrade-survivor tooling consumes built packages and isolated Gateway state, exercises update and downgrade scenarios, and emits CI qualification receipts.

flowchart LR
  A[PR fork source] --> B[Previous package]
  C[Tested merge package] --> D[Candidate Gateway]
  B --> E[Seeded fixture]
  E --> D
  D --> F[Post-kill store copies]
  F --> G[Rollback projection]
  G --> H[Previous reader smoke]
Loading

Technical review

Best possible solution:

Remove the retired Workshop setting and qualify the existing genuine-release scenario without changing production configuration or migration behavior.

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

Source establishes the failure: the fixture writes the exact configuration rejected by the existing Workshop validation contract, and noninteractive Gateway startup cannot repair it; no target code was executed.

Is this the best way to solve the issue?

Extending the existing survivor owner is appropriate, and the shared process supervisor and separate store-copy inspection support the intended boundary; removing the obsolete setting is the smallest complete repair.

Full review comments:

  • [P2] Remove the retired Workshop key from the reader fixture — scripts/e2e/lib/upgrade-survivor/reader-fixture.mjs:280
    Every downgrade run writes skills.workshop.autonomous.mode into the fresh previous-reader config. The strict skills schema no longer accepts workshop, and src/config/validation.workshop-contract.test.ts explicitly rejects this exact shape. Gateway startup therefore fails before createReaderFixture can seed cron or sessions, making the new schema qualification fail during setup. Remove this entry; plugins.enabled is already false.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Healthy update survivor and schema fixture keeps the original intent (e2ac431: Exercise a real source-built successor and schema migration while leaving the separate crash-recovery defect with its product owner.)
  • Gateway update handoff qualification keeps the original intent (bcd6666: Protect update.run, committed trials, serving build identity, and retained previous releases through the existing survivor.)
  • Published survivor scheduling keeps the original intent (94c99f7: Keep published-driver compatibility in hourly and release verification rather than ordinary PR selection.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/scripts/upgrade-survivor-schema-downgrade.test.ts test/scripts/upgrade-survivor-schema-store-facts.test.ts
  • pnpm test test/scripts/ci-workflow-guards.test.ts
  • node --import tsx scripts/check-workflows.mts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.tooling.json --incremental
  • Qualify a pinned genuine schema-changing release pair with OPENCLAW_UPGRADE_SURVIVOR_SCENARIO=release-update and OPENCLAW_UPGRADE_SURVIVOR_RELEASE_CASE=downgrade through scripts/e2e/upgrade-survivor-docker.sh.

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit bcd6666 adds scripts/e2e/lib/upgrade-survivor/release-update.mjs:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bcd6666917ed; files: scripts/e2e/lib/upgrade-survivor/release-update.mjs)

PR surface

Tests +459, Docs +28, Config +17, Other +1393. Total +1897 across 16 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 459 0 +459
Docs 2 29 1 +28
Config 1 17 0 +17
Generated 0 0 0 0
Other 10 1420 27 +1393
Total 16 1925 28 +1897

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.

Review metrics

Metric Value Why it matters
Qualification deadline 40 → 55 minutes The existing lane gains previous-source preparation while retaining the existing job and container deadlines.

Labels

Label changes:

  • add P2: The defect blocks the new schema downgrade qualification but does not alter shipped updater behavior.
  • add merge-risk: 🚨 automation: Selected schema-change PRs would fail during previous-Gateway fixture setup before exercising the intended migration boundary.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The defect blocks the new schema downgrade qualification but does not alter shipped updater behavior.
  • merge-risk: 🚨 automation: Selected schema-change PRs would fail during previous-Gateway fixture setup before exercising the intended migration boundary.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 24, 2026, 3:56 PM ET / 20:56 UTC.

Remove retired per-agent heartbeat/workshop doctor inputs; fresh fixture config must be accepted directly by both releases.
Capture the prior reader’s actual committed message shape and identity before comparing rollback reads.
@obviyus
obviyus marked this pull request as ready for review November 24, 2026 21:47
…smoke

Restore the real prior config atomically and record pre-candidate, candidate and restored hashes.
Keep unraised SQLite triples unchanged; never bypass the older-config guard with an environment override.
…Lite coverage

Type classifier inputs from the actual smoke/projection helpers and read the structured failure message.
Delete the redundant mixed-projection case and second SQLite fixture factory; retain byte preservation, restored data, lazy-store, invalid metadata and routing boundaries in one suite.
…ceipts

Apply the complete CI diagnostic set: braces, actual method receiver annotation, protocol metadata naming and nonshadowed watch helpers.
Keep caught failures as real Error objects with causes and retain the recorded receipt; no release or schema behavior changes.
Remove the unused public surface; the committed CLI remains its only caller.
Use reflective method capture with an explicit callable check and retain Reflect.apply receiver semantics.
Alias the external transcript metadata key by destructuring, following existing survivor helpers; add no suppression allowlist entries.
@obviyus
obviyus merged commit 1bec224 into main Nov 25, 2026
134 checks passed
@obviyus

obviyus commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Landed. Update-owner PRs that change a schema version or a migration now prove the previous release can still run what the new release's boot left behind: build T from the merge base and T+1 from the tested merge tree, kill T+1 before ready, restore exactly what the launcher restores (raised-floor databases from their pre-image, the previous config), keep other stores as T+1 left them, and run T's smoke suite. It reports until the reader floor (#204956) lands, then it becomes required. Proof: genuine 2026.11.7 run run_2c8997c1 (config restored, agent pre-images restored, shared state byte-identical, T ready and reading both histories).

@obviyus
obviyus deleted the ci/state-reader-downgrade branch November 25, 2026 00:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…penclaw#204883)

## Class A — previous-reader enforcement, stage 1

Follow-up to merged openclaw#204685 and openclaw#204830; coordination openclaw#204775. Existing owner: upgrade-survivor. Instances behind the proof-debt class: openclaw#203735, openclaw#203769, openclaw#204094, openclaw#204224, openclaw#204426, openclaw#204512, openclaw#204275. This adds proof, not claims to fix those separate runtime causes.

## Contract

- Keep the merged healthy head → synthetic-next update lane. Its retained T also reports shared-schema readability from an isolated online backup (`readable`, `refused`, `unproven`), without changing the update result.
- For actual schema-version/production-migration diffs, build T from the PR fork point and reuse CI's tested merge-tree package as T+1. Record both source/build identities.
- Seed shared cron and agent sessions/history through T's real Gateway writers. Stop T, retain raw preimages, boot T+1, stop it at the exact Gateway TCP listen boundary, then hard-kill/reap its process group.
- Inspect DB/WAL/SHM **copies** after the kill. Advanced stores must have committed target schemas and valid floors; untouched lazy stores are named as untouched. Integrity/setup failures always fail.
- Project actual rollback state: restore only raised-floor stores from T's preimages, preserve other candidate-written store bytes, then authenticate to genuine T and read the seeded cron/session/history data. Compatibility becomes required when candidate source includes ReaderFloor's contract; absent/NULL floor metadata is valid and is not mistaken for missing capability.

No production code/schema change, down-migration, fake success receipt, production startup hook, or committed `src/update`/`src/state` edit. StoreCustody owns the separate normal-update crash case; this PR does not reintroduce the old red case. Bulk-access enforcement and the 10 GB nightly are stages 2 and 3, not claimed here.

## Cost and simplification

One extra previous-source build only for schema/migration diffs; no new CI job, runner tier or fanout. Existing lane ceiling rises 40 → 55 min; per-container ceiling stays 20 min and the existing seed job stays 115 min. Explicit downgrade qualification skips the unrelated synthetic successor build. Actual additional runtime is not measured yet.

The previous-reader report's duplicate process supervisor is deleted; seeder, report and downgrade share one bounded process-group owner. Separate modules own source preparation, real RPC fixture, crash barrier, physical store observations/projection and the controller; none ships in the product. These are the smallest coherent pieces of the approved pre-ready oracle, not a second updater.

Final PR-owned `tokei code` against pinned main `87236ceb25a9fc98d1043d1f18edfcb71b98414b`: production **0 → 0**; scripts **2,116 → 3,516 (+1,400)**; tests **8,797 → 9,175 (+378)**. Net raw test growth is **394 / 400**, allocation **0**. The duplicate SQLite fixture factory/mixed-projection case is gone; byte preservation and restored-content assertions remain in the single suite. No unrelated deletions, suppression allowlist entries or Knip ignores were added.

## Evidence and current gate

Ready for review; published head `ead509c7f0fdd54096923f7cc11b0d7df2d824ec`, with the required CI watchdog armed. Do not treat prior-head runtime proof as a final CI result. Subsequent changes affect typing, unit fixtures, lint and typed failure receipts, not the successful migration/projection path.

- Healthy update and schema-read observation on `1f0cdf960f0c`: AWS [run_8fc9ebd67a55f3ac853523dc53dd7100](https://crabbox.openclaw.ai/portal/runs/run_8fc9ebd67a55f3ac853523dc53dd7100). Committed/reported trial `e7846307-c5b3-48eb-97c4-c8c0bdfd4455`, schema42, two rows; CLI153097ms. Verified old T refused the isolated new shared schema with exit78; backup stayed schema42. This is the requested report, not an accepted downgrade refusal.
- Genuine pre-ready qualification on `55efd824fc82`: AWS [run_2c8997c1c413a76556c9a07c640be21b](https://crabbox.openclaw.ai/portal/runs/run_2c8997c1c413a76556c9a07c640be21b). Actual ad98b9e source T→published candidate: both agents43→44 before candidate SIGKILL; raised stores restored, shared41 byte-preserved. Config preimage restored atomically: before/restored SHA `74a6c60183b06ccb29deda5eb80de98ae113767aa9e3d232f10c8c8f8c641387`, candidate SHA `076aa2f7d5f926c7998edbb5afeb18a48b42161dee8acf79ad5498371e803b0f`. **Genuine T served, its build ID matched, and both exact histories and the cron sentinel passed.** This older-writer qualification is not a claim that d4 is this PR's fork point.
- ReaderFloor's independent [openclaw#204880](openclaw#204880) size-loss/config-provenance case remains known ([run_5eaf078abca514a139d8c599b2092035](https://crabbox.openclaw.ai/portal/runs/run_5eaf078abca514a139d8c599b2092035)). Our different fixture passing does not clear it. Rollout remains report-only until the reader-floor/recovery fix lands; no override flag, backup deletion or unraised-database restore was added.
- The genuine proof's full build and14 owner tests passed. After the test consolidation, exact published `55ff2e4cfa76` AWS [run_c243aab4f60386a030d0fa6e81cb65a0](https://crabbox.openclaw.ai/portal/runs/run_c243aab4f60386a030d0fa6e81cb65a0) passed selected canonical type graphs, **11 focused tests**, and the **391/400** test-line ratchet.
- Two full source reviews (`43bd8ae1016a`, `55efd824fc82`) found zero findings, patch correct, security cleared. Exact final-head review of **only the later repair delta** `55efd824fc82..ead509c` also completed clean (zero findings/security cleared); this is not a third full-range audit or release rebuild.
- Complete changed-file format, lint, scripts/test-root types and guards passed in AWS [run_69e9eb1d2d90257c64d462065092464e](https://crabbox.openclaw.ai/portal/runs/run_69e9eb1d2d90257c64d462065092464e). That full canonical command also reported a CLI-only harness export (now private) and pinned-production `src/gateway/operator-admission.ts:intersectOperatorRunModelPolicy`, which this PR does not modify. Previous head `18be57a08bda` [run_7ebfa24dbd0e08ea4509fd93887a6ae3](https://crabbox.openclaw.ai/portal/runs/run_7ebfa24dbd0e08ea4509fd93887a6ae3) then passed the canonical script-Knip profile, **11 tests** and **394/400** line ratchet. No full-command green or current-main reproduction of the production finding is claimed; final PR CI is authoritative.
- Exact waiver-free final head AWS [run_14b6d54ff040f3eda60ba6620d8a44f7](https://crabbox.openclaw.ai/portal/runs/run_14b6d54ff040f3eda60ba6620d8a44f7) passed scoped canonical scripts lint/typecheck, **25 tests** (11 downgrade boundaries plus the suppression guard), and **394/400** line ratchet. The two annotations were removed using explicit reflective receiver handling and existing protocol destructuring, not allowlisted. All owned AWS leases released with `--wait`.

Fable challenged the design before code. Bulk-access enforcement and the real10GB nightly remain the approved subsequent stages, not claimed by this PR.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Nov 25, 2026
## What Problem This Solves

Update PRs have no automatic check against migrations that scan or rewrite conversation-sized tables. A change described as schema-only can therefore introduce bulk-data work into an update.

Class A, stage 2, following #204685 and #204883. Related proof-debt instances: #203735, #203769, #204094, #204224, #204426, #204512, #204275. These are coverage links, not claims that this PR fixes their separate runtime causes.

## User Impact

No shipped code, schema, configuration, or user action changes. Selected schema/migration PRs gain an enforcement check in the existing Linux npm upgrade-survivor lane; ordinary PR CI also runs its native and owner regressions.

## Why This Change Was Made

One owner remains `release-update-survivor`, extended before its existing previous-release build rather than adding a runner, matrix cell, or second release harness. The source baseline was pinned to `origin/main` **1bec22471ad0114e4d3fe57954ccb443c5672262** before implementation.

- Freeze the agent DDL directly from the pinned fork-point Git blob and seed that version before the real leased maintenance owner runs. Do not regenerate the previous schema from candidate history: fork and candidate versions may be equal while an additive repair is pending. Fast numeric-step counterexamples remain explicit canonical policy fixtures, not claims of genuine old-release writer compatibility; #204883 owns that separate release-path proof.
- Reject executed bulk-data access, including `WHERE 0`, trigger work, FTS/shadow access and index builds. Permit proven constant metadata DDL; fail a bulk-schema touch combined with that store's reader-floor rise. Diagnostics identify the store and version range.
- Observe native preparation/execution, cached reprepare and iterator consumption together with before/after catalogs, not SQL-string splitting or row-count guesses. Unsupported APIs/process escapes fail coverage.
- Test-side spies delegate the real integrity exports unchanged. Only their dynamic boundaries are excluded; migration SQL before the finalizer and in its supplied callbacks remains observed. No production hook, flag, export, or blanket integrity-PRAGMA exemption.
- Install before source-owner imports and qualify the actual native named bindings. A fresh, unmodified native ESM child checks caught-error/coverage-failure behavior. There is no named-export mock, adapter, or preload workaround.
- Retain the sanitized `migration-bulk-access.json` receipt via the existing artifact allowlist. Observation failures retain diagnostics while rethrowing the original error, including frozen errors. Keep SQLite-native contracts on Node and use the existing isolated fork owner for main-thread maintenance authority.

Cost: no new runner class, fanout, or build; the check precedes the existing selected lane's previous-release build. The measured small real-owner case takes about 1.8 seconds, plus the existing Vitest worker preparation.

### Size and simplification

Harness-only Class A exception: **production-code delta 0**. On this PR's own `scripts/**` files, `tokei` code is **1,659 → 2,778 (+1,119)**, excluding tests. Native execution provenance, catalog policy and real-owner invocation are the smallest complete enforcement stage; splitting off an unused observer would not enforce the rule. No unrelated deletions were padded to meet a quota.

Removed unused observer getters/private exports and an overlapping classifier integrity-only case. Retained tests cover three distinct boundaries: native interception, bulk policy, and the actual leased owner/finalizer, plus execution-routing/volume and artifact contracts. Exact net test growth is **776**; the record allocates only **376** above the unchanged 400-line allowance, with a reason per file.

The 10 GB nightly and the separately approved ReaderFloor required-gate flip are not part of this stage.

## Evidence

- AWS [run_f877a94ca0bc44ca9915e83b966bc2a8](https://crabbox.openclaw.ai/portal/runs/run_f877a94ca0bc44ca9915e83b966bc2a8), repair head **643b611e3a**: actual root-scripts types passed; all **25 Node tests** and **39 pinned-Bun volume tests** passed through the real CI shard entrypoint. The real owner43→44 took **1,840 ms**; callback-bulk rejection **1,708 ms**; sanitized failure/original-error test **1,456 ms**. The parallel deliberately bulk-touching process exited **1** for transcript_events READ/UPDATE, and its persisted receipt was checked independently with zero coverage gaps. This batch exposed only a frozen-Error lint typing issue, subsequently fixed in9b by splitting construction and freezing into equivalent statements; that typing fix changed no observer, policy, owner or volume implementation.
- AWS static/routing gate: [run_089d279b4d1166ff262389a5ffaf8a4a](https://crabbox.openclaw.ai/portal/runs/run_089d279b4d1166ff262389a5ffaf8a4a): lint clean, 18 routing tests passed, and the focused artifact allowlist regression passed (238 unrelated cases intentionally unselected).
- Prior review-repair head **9b3bf78171af2f1f17d39c4f2ee6dc13c1a182ce**: AWS [run_4b1e0691d2f51c7081f4db6e74ec6247](https://crabbox.openclaw.ai/portal/runs/run_4b1e0691d2f51c7081f4db6e74ec6247) passed actual root-scripts types, lint, formatting, the native-observer suite and **698/(400+298)** budget. Its only source difference from the 25-test/Bun-volume proof was the equivalent frozen-Error fixture idiom and one-line allocation adjustment; unchanged owner and Bun profiles were not rerun.
- Approved final fork-DDL repair, **230bb1aead4620a36361d4f25f348211811c8e4a**: AWS [run_e9c4578580e1fc461be523d79cbb2865](https://crabbox.openclaw.ai/portal/runs/run_e9c4578580e1fc461be523d79cbb2865) passed all **5 targeted owner tests** using the actual frozen fork1bec DDL. The new same-version additive-repair control took **1,660 ms**: the real missing-table branch ran with equal versions and its bulk work was rejected. No production schema/code change.
- Upstream CI attribution in the same AWS run: a separately cloned checkout pinned to **main ad96c24** reproduced `ci-scheduled-coverage.test.ts:79` solely for `.agents/skills/openclaw-writing/scripts/writing.test.mjs` (1 failed, 2 unrelated cases unselected). This file and missing native-test ownership already exist on that base; no planner invariant was weakened. Main CI45537657628 had run only security-fast, so its green result was not presented as invariant-execution evidence.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
## What Problem This Solves

Update PRs have no automatic check against migrations that scan or rewrite conversation-sized tables. A change described as schema-only can therefore introduce bulk-data work into an update.

Class A, stage 2, following openclaw#204685 and openclaw#204883. Related proof-debt instances: openclaw#203735, openclaw#203769, openclaw#204094, openclaw#204224, openclaw#204426, openclaw#204512, openclaw#204275. These are coverage links, not claims that this PR fixes their separate runtime causes.

## User Impact

No shipped code, schema, configuration, or user action changes. Selected schema/migration PRs gain an enforcement check in the existing Linux npm upgrade-survivor lane; ordinary PR CI also runs its native and owner regressions.

## Why This Change Was Made

One owner remains `release-update-survivor`, extended before its existing previous-release build rather than adding a runner, matrix cell, or second release harness. The source baseline was pinned to `origin/main` **285567057721b971ed4c9679ef3b06f951ca583c** before implementation.

- Freeze the agent DDL directly from the pinned fork-point Git blob and seed that version before the real leased maintenance owner runs. Do not regenerate the previous schema from candidate history: fork and candidate versions may be equal while an additive repair is pending. Fast numeric-step counterexamples remain explicit canonical policy fixtures, not claims of genuine old-release writer compatibility; openclaw#204883 owns that separate release-path proof.
- Reject executed bulk-data access, including `WHERE 0`, trigger work, FTS/shadow access and index builds. Permit proven constant metadata DDL; fail a bulk-schema touch combined with that store's reader-floor rise. Diagnostics identify the store and version range.
- Observe native preparation/execution, cached reprepare and iterator consumption together with before/after catalogs, not SQL-string splitting or row-count guesses. Unsupported APIs/process escapes fail coverage.
- Test-side spies delegate the real integrity exports unchanged. Only their dynamic boundaries are excluded; migration SQL before the finalizer and in its supplied callbacks remains observed. No production hook, flag, export, or blanket integrity-PRAGMA exemption.
- Install before source-owner imports and qualify the actual native named bindings. A fresh, unmodified native ESM child checks caught-error/coverage-failure behavior. There is no named-export mock, adapter, or preload workaround.
- Retain the sanitized `migration-bulk-access.json` receipt via the existing artifact allowlist. Observation failures retain diagnostics while rethrowing the original error, including frozen errors. Keep SQLite-native contracts on Node and use the existing isolated fork owner for main-thread maintenance authority.

Cost: no new runner class, fanout, or build; the check precedes the existing selected lane's previous-release build. The measured small real-owner case takes about 1.8 seconds, plus the existing Vitest worker preparation.

### Size and simplification

Harness-only Class A exception: **production-code delta 0**. On this PR's own `scripts/**` files, `tokei` code is **1,659 → 2,778 (+1,119)**, excluding tests. Native execution provenance, catalog policy and real-owner invocation are the smallest complete enforcement stage; splitting off an unused observer would not enforce the rule. No unrelated deletions were padded to meet a quota.

Removed unused observer getters/private exports and an overlapping classifier integrity-only case. Retained tests cover three distinct boundaries: native interception, bulk policy, and the actual leased owner/finalizer, plus execution-routing/volume and artifact contracts. Exact net test growth is **776**; the record allocates only **376** above the unchanged 400-line allowance, with a reason per file.

The 10 GB nightly and the separately approved ReaderFloor required-gate flip are not part of this stage.

## Evidence

- AWS [run_f877a94ca0bc44ca9915e83b966bc2a8](https://crabbox.openclaw.ai/portal/runs/run_f877a94ca0bc44ca9915e83b966bc2a8), repair head **643b611e3a**: actual root-scripts types passed; all **25 Node tests** and **39 pinned-Bun volume tests** passed through the real CI shard entrypoint. The real owner43→44 took **1,840 ms**; callback-bulk rejection **1,708 ms**; sanitized failure/original-error test **1,456 ms**. The parallel deliberately bulk-touching process exited **1** for transcript_events READ/UPDATE, and its persisted receipt was checked independently with zero coverage gaps. This batch exposed only a frozen-Error lint typing issue, subsequently fixed in9b by splitting construction and freezing into equivalent statements; that typing fix changed no observer, policy, owner or volume implementation.
- AWS static/routing gate: [run_089d279b4d1166ff262389a5ffaf8a4a](https://crabbox.openclaw.ai/portal/runs/run_089d279b4d1166ff262389a5ffaf8a4a): lint clean, 18 routing tests passed, and the focused artifact allowlist regression passed (238 unrelated cases intentionally unselected).
- Prior review-repair head **9b3bf78171af2f1f17d39c4f2ee6dc13c1a182ce**: AWS [run_4b1e0691d2f51c7081f4db6e74ec6247](https://crabbox.openclaw.ai/portal/runs/run_4b1e0691d2f51c7081f4db6e74ec6247) passed actual root-scripts types, lint, formatting, the native-observer suite and **698/(400+298)** budget. Its only source difference from the 25-test/Bun-volume proof was the equivalent frozen-Error fixture idiom and one-line allocation adjustment; unchanged owner and Bun profiles were not rerun.
- Approved final fork-DDL repair, **230bb1aead4620a36361d4f25f348211811c8e4a**: AWS [run_e9c4578580e1fc461be523d79cbb2865](https://crabbox.openclaw.ai/portal/runs/run_e9c4578580e1fc461be523d79cbb2865) passed all **5 targeted owner tests** using the actual frozen fork1bec DDL. The new same-version additive-repair control took **1,660 ms**: the real missing-table branch ran with equal versions and its bulk work was rejected. No production schema/code change.
- Upstream CI attribution in the same AWS run: a separately cloned checkout pinned to **main 34773c7** reproduced `ci-scheduled-coverage.test.ts:79` solely for `.agents/skills/openclaw-writing/scripts/writing.test.mjs` (1 failed, 2 unrelated cases unselected). This file and missing native-test ownership already exist on that base; no planner invariant was weakened. Main CI45537657628 had run only security-fast, so its green result was not presented as invariant-execution evidence.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
…204883)

## Class A — previous-reader enforcement, stage 1

Follow-up to merged #204685 and #204830; coordination #204775. Existing owner: upgrade-survivor. Instances behind the proof-debt class: #203735, #203769, #204094, #204224, #204426, #204512, #204275. This adds proof, not claims to fix those separate runtime causes.

## Contract

- Keep the merged healthy head → synthetic-next update lane. Its retained T also reports shared-schema readability from an isolated online backup (`readable`, `refused`, `unproven`), without changing the update result.
- For actual schema-version/production-migration diffs, build T from the PR fork point and reuse CI's tested merge-tree package as T+1. Record both source/build identities.
- Seed shared cron and agent sessions/history through T's real Gateway writers. Stop T, retain raw preimages, boot T+1, stop it at the exact Gateway TCP listen boundary, then hard-kill/reap its process group.
- Inspect DB/WAL/SHM **copies** after the kill. Advanced stores must have committed target schemas and valid floors; untouched lazy stores are named as untouched. Integrity/setup failures always fail.
- Project actual rollback state: restore only raised-floor stores from T's preimages, preserve other candidate-written store bytes, then authenticate to genuine T and read the seeded cron/session/history data. Compatibility becomes required when candidate source includes ReaderFloor's contract; absent/NULL floor metadata is valid and is not mistaken for missing capability.

No production code/schema change, down-migration, fake success receipt, production startup hook, or committed `src/update`/`src/state` edit. StoreCustody owns the separate normal-update crash case; this PR does not reintroduce the old red case. Bulk-access enforcement and the 10 GB nightly are stages 2 and 3, not claimed here.

## Cost and simplification

One extra previous-source build only for schema/migration diffs; no new CI job, runner tier or fanout. Existing lane ceiling rises 40 → 55 min; per-container ceiling stays 20 min and the existing seed job stays 115 min. Explicit downgrade qualification skips the unrelated synthetic successor build. Actual additional runtime is not measured yet.

The previous-reader report's duplicate process supervisor is deleted; seeder, report and downgrade share one bounded process-group owner. Separate modules own source preparation, real RPC fixture, crash barrier, physical store observations/projection and the controller; none ships in the product. These are the smallest coherent pieces of the approved pre-ready oracle, not a second updater.

Final PR-owned `tokei code` against pinned main `f36e439d70772464e10f66182e05e52e99e22663`: production **0 → 0**; scripts **2,116 → 3,516 (+1,400)**; tests **8,797 → 9,175 (+378)**. Net raw test growth is **394 / 400**, allocation **0**. The duplicate SQLite fixture factory/mixed-projection case is gone; byte preservation and restored-content assertions remain in the single suite. No unrelated deletions, suppression allowlist entries or Knip ignores were added.

## Evidence and current gate

Ready for review; published head `ead509c7f0fdd54096923f7cc11b0d7df2d824ec`, with the required CI watchdog armed. Do not treat prior-head runtime proof as a final CI result. Subsequent changes affect typing, unit fixtures, lint and typed failure receipts, not the successful migration/projection path.

- Healthy update and schema-read observation on `1f0cdf960f0c`: AWS [run_8fc9ebd67a55f3ac853523dc53dd7100](https://crabbox.openclaw.ai/portal/runs/run_8fc9ebd67a55f3ac853523dc53dd7100). Committed/reported trial `e7846307-c5b3-48eb-97c4-c8c0bdfd4455`, schema42, two rows; CLI153097ms. Verified old T refused the isolated new shared schema with exit78; backup stayed schema42. This is the requested report, not an accepted downgrade refusal.
- Genuine pre-ready qualification on `55efd824fc82`: AWS [run_2c8997c1c413a76556c9a07c640be21b](https://crabbox.openclaw.ai/portal/runs/run_2c8997c1c413a76556c9a07c640be21b). Actual d4c6c46 source T→published candidate: both agents43→44 before candidate SIGKILL; raised stores restored, shared41 byte-preserved. Config preimage restored atomically: before/restored SHA `74a6c60183b06ccb29deda5eb80de98ae113767aa9e3d232f10c8c8f8c641387`, candidate SHA `076aa2f7d5f926c7998edbb5afeb18a48b42161dee8acf79ad5498371e803b0f`. **Genuine T served, its build ID matched, and both exact histories and the cron sentinel passed.** This older-writer qualification is not a claim that d4 is this PR's fork point.
- ReaderFloor's independent [#204880](#204880) size-loss/config-provenance case remains known ([run_5eaf078abca514a139d8c599b2092035](https://crabbox.openclaw.ai/portal/runs/run_5eaf078abca514a139d8c599b2092035)). Our different fixture passing does not clear it. Rollout remains report-only until the reader-floor/recovery fix lands; no override flag, backup deletion or unraised-database restore was added.
- The genuine proof's full build and14 owner tests passed. After the test consolidation, exact published `55ff2e4cfa76` AWS [run_c243aab4f60386a030d0fa6e81cb65a0](https://crabbox.openclaw.ai/portal/runs/run_c243aab4f60386a030d0fa6e81cb65a0) passed selected canonical type graphs, **11 focused tests**, and the **391/400** test-line ratchet.
- Two full source reviews (`43bd8ae1016a`, `55efd824fc82`) found zero findings, patch correct, security cleared. Exact final-head review of **only the later repair delta** `55efd824fc82..ead509c` also completed clean (zero findings/security cleared); this is not a third full-range audit or release rebuild.
- Complete changed-file format, lint, scripts/test-root types and guards passed in AWS [run_69e9eb1d2d90257c64d462065092464e](https://crabbox.openclaw.ai/portal/runs/run_69e9eb1d2d90257c64d462065092464e). That full canonical command also reported a CLI-only harness export (now private) and pinned-production `src/gateway/operator-admission.ts:intersectOperatorRunModelPolicy`, which this PR does not modify. Previous head `18be57a08bda` [run_7ebfa24dbd0e08ea4509fd93887a6ae3](https://crabbox.openclaw.ai/portal/runs/run_7ebfa24dbd0e08ea4509fd93887a6ae3) then passed the canonical script-Knip profile, **11 tests** and **394/400** line ratchet. No full-command green or current-main reproduction of the production finding is claimed; final PR CI is authoritative.
- Exact waiver-free final head AWS [run_14b6d54ff040f3eda60ba6620d8a44f7](https://crabbox.openclaw.ai/portal/runs/run_14b6d54ff040f3eda60ba6620d8a44f7) passed scoped canonical scripts lint/typecheck, **25 tests** (11 downgrade boundaries plus the suppression guard), and **394/400** line ratchet. The two annotations were removed using explicit reflective receiver handling and existing protocol destructuring, not allowlisted. All owned AWS leases released with `--wait`.

Fable challenged the design before code. Bulk-access enforcement and the real10GB nightly remain the approved subsequent stages, not claimed by this PR.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 1bec224)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 26, 2026
Release adaptation: conflict resolution in the #204512/#204700 ports left indentation in src/update/run.ts and import order in src/update/cli.test.ts unformatted. The #204883 survivor fact helper sorts with an explicit comparator because the release script lint requires one. No behavior change.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>
obviyus added a commit that referenced this pull request Nov 26, 2026
)

## What Problem This Solves

Schema-change CI can still report a previous-reader failure without failing the PR, and the test itself restores databases/config before checking that reader. That does not prove the rollback that an installed OpenClaw actually performs.

Related coverage class: #203735, #203769, #204094, #204224, #204426, #204512, #204275. Follows #204883 and #205022 after #204956, #205165 and #205578. These are proof-debt coverage links, not claims to fix each runtime cause.

## User Impact

Schema/migration changes must pass the existing Linux update lane's genuine previous-reader check. No shipped behavior, storage schema, launcher format or update contract changes. The nightly 10 GB case remains a separate PR.

## Why This Change Was Made

The existing upgrade-survivor downgrade controller remains the sole check owner. T's public `update --tag file:<candidate> --no-restart` prepares the genuine candidate, and T's actual resident launcher retries and rolls back its trial. The harness records stopped-store inspection copies, trial/manifest/build evidence, then checks T's authenticated serving identity and exact seeded sessions, history and cron.

Deletes the report-only/capability probe, the harness's store/config restoration writer, and the candidate's redundant global install. Raised-floor stores must return to T's committed schema/floor; unraised stores must retain T+1's schema/floor. Candidate-created null-preimage stores follow production restoration rather than a second test policy. The pre-listen barrier is target-root scoped so the real fallback is not parked.

The resident and Gateway are separately detached processes; bounded cleanup and a shutdown allowance above the resident's real 15-second child deadline are necessary to observe stores only after shutdown. The fixture restarts the resident mid-trial to obtain quiescent post-migration facts without racing its retry.

Line-count policy: direction over deletion quota; no production code added or changed (delta 0). On this PR's seven harness `.mjs` files, `tokei` code lines: **1,225 → 1,331 (+106)** against pinned main `b7bd237d00508e0999c7a3fc6e36bc32bf421098`. Growth replaces the synthetic restoration path with real updater/resident lifecycle coverage; no padded deletions.

## Evidence

- Source/Fable 5.2 design challenge completed before implementation; accepted concrete corrections for real explicit-artifact preparation, launcher provenance, detached process ownership, release-scoped barrier and failure classification.
- Final head **`d402754aeddc08073c5a768d0eb9ec5a757c090f`**: AWS [run_c853226a09bf6307cb2fb9c6883a6e3f](https://crabbox.openclaw.ai/portal/runs/run_c853226a09bf6307cb2fb9c6883a6e3f) passed canonical root-scripts types and **25/25** real NodeSQLite/barrier owner tests (8.90 seconds). Hosted [CI 45786731172](https://github.com/openclaw/openclaw/actions/runs/45786731172) is **green**, including lint, selected types, build, changed tests, docs, plan, guards and the existing [Docker seed lane](https://github.com/openclaw/openclaw/actions/runs/45786731172/job/139796419090) (**51m06s**, within its115-minute budget).
- Nine-file AWS formatting passed in [run_7b781a5cac85a7c1da10d6c349c797db](https://crabbox.openclaw.ai/portal/runs/run_7b781a5cac85a7c1da10d6c349c797db). Final exact-head local review: patch correct, zero findings, security cleared (`d402754aeddc.md`).
- **Genuine green:** AWS [run_61f0082ee849fbbdbe56541506e092d2](https://crabbox.openclaw.ai/portal/runs/run_61f0082ee849fbbdbe56541506e092d2), candidate full build **401.239 seconds**, real runtime **186 seconds**; T full build **398 seconds** in [run_f95430f16696a3a598cdbc58a7840fe2](https://crabbox.openclaw.ai/portal/runs/run_f95430f16696a3a598cdbc58a7840fe2). Genuine T source `9959708b7d1df23a2600c5f9b3e09d54270e391b` versus exact d402 candidate, both version2026.11.10 with distinct verified build IDs. Two real pre-listen crashes led to trial `rolled-back`, attempts2, actual format4 resident selecting T. T was ready/authenticated with matching build identity; exact histories for two agents and cron passed. Agent stores advanced44→45, retainedfloor44 and remained45 after rollback; shared42/floor42 was untouched. The actual manifest correctly contained no restore entries for this all-unraised pair. Raised-store restoration is not claimed as an integration result for this pair. Saved receipt/trial/manifest were independently read after root-owned artifact recovery; the driver itself exited0.
- **Genuine red:** AWS [run_1b513d7779956f918a79f09cd66ada22](https://crabbox.openclaw.ai/portal/runs/run_1b513d7779956f918a79f09cd66ada22), throwaway commit **`4d9f9361eafb9d6f96866401973e8e5401efea29`** (never pushed/merged). Full build **403.664 seconds**, runtime **183 seconds**. A real floor-preserving migration changed canonical session labels and their projection. The actual required gate exited **1**, with **no structural/setup failures**, solely because T's old-label lookup returned0!==1. T was ready/authenticated with the correct serving build; the real resident had rolled back, and agent45/floor44 remained retained. Before this one full corrected run, [run_4ca76b2321c5e2fb29fc90a317dfe8c0](https://crabbox.openclaw.ai/portal/runs/run_4ca76b2321c5e2fb29fc90a317dfe8c0) (**64.925 seconds**) calibrated exact SQL against disposable retained copies and the unchanged genuine T oracle. The first projection-only specimen passed because RPC reads canonical JSON; it is not counted as red proof. Receipts, trials, manifests, store inspections and Gateway logtails were saved and independently read.
- The genuine runtime pair is an explicitly historical qualification pair, **not this harness-only PR's fork point**. Automatic selected schema/migration CI still uses the genuine fork point → tested merge package; this PR changes no selector or fanout. The CI candidate package is reused; only selected schema/migration diffs incur the prior-release build and downgrade runtime.
- AWS leases were released with `stop --wait` (including `cbx_5408b16cf245`). No provider fallback, assertion forcing, or host proof. **Runtime green/red requirements, exact-head local review and hosted CI are complete.** The10GB nightly remains deferred.
- No host build/test/lint/format runs. Production restore is the only writer; no new production hooks or formats.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…claw#205857)

## What Problem This Solves

Schema-change CI can still report a previous-reader failure without failing the PR, and the test itself restores databases/config before checking that reader. That does not prove the rollback that an installed OpenClaw actually performs.

Related coverage class: openclaw#203735, openclaw#203769, openclaw#204094, openclaw#204224, openclaw#204426, openclaw#204512, openclaw#204275. Follows openclaw#204883 and openclaw#205022 after openclaw#204956, openclaw#205165 and openclaw#205578. These are proof-debt coverage links, not claims to fix each runtime cause.

## User Impact

Schema/migration changes must pass the existing Linux update lane's genuine previous-reader check. No shipped behavior, storage schema, launcher format or update contract changes. The nightly 10 GB case remains a separate PR.

## Why This Change Was Made

The existing upgrade-survivor downgrade controller remains the sole check owner. T's public `update --tag file:<candidate> --no-restart` prepares the genuine candidate, and T's actual resident launcher retries and rolls back its trial. The harness records stopped-store inspection copies, trial/manifest/build evidence, then checks T's authenticated serving identity and exact seeded sessions, history and cron.

Deletes the report-only/capability probe, the harness's store/config restoration writer, and the candidate's redundant global install. Raised-floor stores must return to T's committed schema/floor; unraised stores must retain T+1's schema/floor. Candidate-created null-preimage stores follow production restoration rather than a second test policy. The pre-listen barrier is target-root scoped so the real fallback is not parked.

The resident and Gateway are separately detached processes; bounded cleanup and a shutdown allowance above the resident's real 15-second child deadline are necessary to observe stores only after shutdown. The fixture restarts the resident mid-trial to obtain quiescent post-migration facts without racing its retry.

Line-count policy: direction over deletion quota; no production code added or changed (delta 0). On this PR's seven harness `.mjs` files, `tokei` code lines: **1,225 → 1,331 (+106)** against pinned main `dbf975ac7374fa6f95c5778cbe98abda8a8f5cc3`. Growth replaces the synthetic restoration path with real updater/resident lifecycle coverage; no padded deletions.

## Evidence

- Source/Fable 5.2 design challenge completed before implementation; accepted concrete corrections for real explicit-artifact preparation, launcher provenance, detached process ownership, release-scoped barrier and failure classification.
- Final head **`d402754aeddc08073c5a768d0eb9ec5a757c090f`**: AWS [run_c853226a09bf6307cb2fb9c6883a6e3f](https://crabbox.openclaw.ai/portal/runs/run_c853226a09bf6307cb2fb9c6883a6e3f) passed canonical root-scripts types and **25/25** real NodeSQLite/barrier owner tests (8.90 seconds). Hosted [CI 45786731172](https://github.com/openclaw/openclaw/actions/runs/45786731172) is **green**, including lint, selected types, build, changed tests, docs, plan, guards and the existing [Docker seed lane](https://github.com/openclaw/openclaw/actions/runs/45786731172/job/139796419090) (**51m06s**, within its115-minute budget).
- Nine-file AWS formatting passed in [run_7b781a5cac85a7c1da10d6c349c797db](https://crabbox.openclaw.ai/portal/runs/run_7b781a5cac85a7c1da10d6c349c797db). Final exact-head local review: patch correct, zero findings, security cleared (`d402754aeddc.md`).
- **Genuine green:** AWS [run_61f0082ee849fbbdbe56541506e092d2](https://crabbox.openclaw.ai/portal/runs/run_61f0082ee849fbbdbe56541506e092d2), candidate full build **401.239 seconds**, real runtime **186 seconds**; T full build **398 seconds** in [run_f95430f16696a3a598cdbc58a7840fe2](https://crabbox.openclaw.ai/portal/runs/run_f95430f16696a3a598cdbc58a7840fe2). Genuine T source `901b070361208f47a21206eba9c5ef9b5670f254` versus exact d402 candidate, both version2026.11.10 with distinct verified build IDs. Two real pre-listen crashes led to trial `rolled-back`, attempts2, actual format4 resident selecting T. T was ready/authenticated with matching build identity; exact histories for two agents and cron passed. Agent stores advanced44→45, retainedfloor44 and remained45 after rollback; shared42/floor42 was untouched. The actual manifest correctly contained no restore entries for this all-unraised pair. Raised-store restoration is not claimed as an integration result for this pair. Saved receipt/trial/manifest were independently read after root-owned artifact recovery; the driver itself exited0.
- **Genuine red:** AWS [run_1b513d7779956f918a79f09cd66ada22](https://crabbox.openclaw.ai/portal/runs/run_1b513d7779956f918a79f09cd66ada22), throwaway commit **`4d9f9361eafb9d6f96866401973e8e5401efea29`** (never pushed/merged). Full build **403.664 seconds**, runtime **183 seconds**. A real floor-preserving migration changed canonical session labels and their projection. The actual required gate exited **1**, with **no structural/setup failures**, solely because T's old-label lookup returned0!==1. T was ready/authenticated with the correct serving build; the real resident had rolled back, and agent45/floor44 remained retained. Before this one full corrected run, [run_4ca76b2321c5e2fb29fc90a317dfe8c0](https://crabbox.openclaw.ai/portal/runs/run_4ca76b2321c5e2fb29fc90a317dfe8c0) (**64.925 seconds**) calibrated exact SQL against disposable retained copies and the unchanged genuine T oracle. The first projection-only specimen passed because RPC reads canonical JSON; it is not counted as red proof. Receipts, trials, manifests, store inspections and Gateway logtails were saved and independently read.
- The genuine runtime pair is an explicitly historical qualification pair, **not this harness-only PR's fork point**. Automatic selected schema/migration CI still uses the genuine fork point → tested merge package; this PR changes no selector or fanout. The CI candidate package is reused; only selected schema/migration diffs incur the prior-release build and downgrade runtime.
- AWS leases were released with `stop --wait` (including `cbx_5408b16cf245`). No provider fallback, assertion forcing, or host proof. **Runtime green/red requirements, exact-head local review and hosted CI are complete.** The10GB nightly remains deferred.
- No host build/test/lint/format runs. Production restore is the only writer; no new production hooks or formats.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant