openclaw/src/test-utils
Peter Steinberger c6b21f6f08
fix: keep retained databases held when deletion history is lost (#155024)
* fix: preserve held stores when deletion history is missing

Let Doctor reconstruct the deletion journal with a receipt while runtime
keeps existing and unknown stores held. Revalidate explicit restores and
keep automatic setup, migrations, and startup from activating held state.

Related: #154002

* fix(doctor): preserve deletion-journal reconstruction contracts

* fix(doctor): order agent discovery after shared state preparation

* fix(state): preserve runtime access with unknown deletion history

Keep unavailable journal reads as runtime facts while Doctor and retention
hold unverified stores. Preserve the selected environment and known paths
through initialization, worker dispatch, and lease cleanup, and retain
main's session ownership and integrity behavior.

* fix(state): retain deletion uncertainty across pathless reopen

Treat the surviving integrity-store family as prior-state evidence before
shared-state initialization. A pathless reopen after shared database loss
keeps the journal unavailable, so retained external stores stay held for
Doctor repair while runtime sessions remain usable.

* test(state): use the current native execution contract

Adapt the retained-store history regression to the native generation run API while preserving existing-only behavior and all data-preservation assertions.

* fix(doctor): preserve state snapshot and environment contracts

* fix(doctor): preserve held retained sources during recovery

* fix(doctor): migrate dormant stores with unknown deletion history

Preserve readable deletion identities and reconstruction holds when journal
history is incomplete. Admit unrelated stores with unknown history, and keep
explicit imports behind the same orphan-sidecar and receipt protections.

* test(projects): correct canonical environment snapshot expectation

Correct the raw environment spread introduced by this PR in e17c238b8b.
Assert the four unrelated captured inputs alongside the canonical state
and supervision keys.

* fix(sessions): import the canonical session database path resolver

Main added writer admission after this PR extracted the resolver.
Use the existing pure owner so the session worker bundle and typecheck
resolve the same function.

* test(ci): register the held-recovery Doctor session test owner

* fix(state): separate initialization inputs from worker environment facts

Restore the canonical shared-state command environment while preserving selected config inputs for native initialization. Return both project environment tests to their unchanged main contract.

* fix(sessions): use the canonical resolver for write admission

Preserve the physical queue and agent identity selected by the deleted-group write path after the resolver moved to its filesystem owner.

* test(state): remove stale imports after schema-facts refresh

Deletion-fence coverage lives in its dedicated suite, and main retired the old schema-version matrix. Remove the two unused imports left by the rebase.

* style(state): restore pinned formatter output

Restore the exact reviewed and tested source after the host hook used an older formatter. The worktree install now matches the existing lockfile; dependency declarations are unchanged.

* fix(agents): preserve runtime journal reads in receipt transactions
2026-09-24 01:34:23 +00:00
..
auth-token-assertions.ts
bundled-plugin-public-surface.ts
camera-url-test-helpers.ts
channel-plugin-test-fixtures.ts
channel-plugins.test.ts
channel-plugins.ts
chunk-test-helpers.ts
command-runner.ts
database-cleanup.ts
env.test.ts
env.ts
exec-assertions.ts
fetch-mock.ts
fixture-suite.ts
frozen-time.ts
fs-scan-assertions.ts
generation-live-test-helpers.ts
internal-hook-event-payload.ts
main-thread-sql-spies.ts
mock-call-assertions.ts
mock-http-response.ts
mock-http.test.ts
mock-http.ts
node-file-path.ts
node-process.test.ts
node-process.ts
npm-spec-install-test-helpers.ts
openclaw-test-state.auth.test.ts
openclaw-test-state.test.ts
openclaw-test-state.ts fix: keep retained databases held when deletion history is lost (#155024) 2026-09-24 01:34:23 +00:00
plugin-registration.ts
plugin-runtime-env.ts
plugin-setup-wizard.ts
port-claim-lock.ts
port-claims.ts
ports.test.ts
ports.ts
process-tree.test.ts
process-tree.ts
provider-usage-fetch.ts
repo-files.test.ts
repo-files.ts
secret-file-fixture.ts
secret-ref-test-vectors.ts
session-conversation-registry.ts
session-state-cleanup.test.ts
session-state-cleanup.ts
state-database-contention.ts
state-path-guard.ts
symlink-rebind-race.ts
system-run-prepare-payload.ts
talk-test-provider.ts
task-registry-runtime.ts perf(state): avoid main-thread subagent completion lock waits 2026-09-23 14:44:29 +00:00
task-registry-sqlite.ts
task-registry-store.ts perf(state): avoid main-thread subagent completion lock waits 2026-09-23 14:44:29 +00:00
temp-dir.ts
temp-home.test.ts
temp-home.ts
tracked-temp-dirs.ts
turn-model-selection-differential.ts
typed-cases.ts
vitest-mock-fn.ts
vitest-module-mocks.ts
vitest-spies.ts
web-provider-runtime.test-helpers.ts
zip-central-directory-fixture.ts