openclaw/scripts/e2e/lib
Peter Steinberger 1ea2640f54
refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466)
* refactor(state): make cron and subagent rows JSON-canonical

* refactor(state): make gateway origin device tokens canonical at v13

The lazy ensure predates the table joining the canonical schema; at the
v13 bump the schema owns creation, so the feature-local DDL, WeakSet
dedupe, and lazy-list entry retire. The legacy-file guard the ensure
carried stays at each call site.

* test: drop obsolete lazy-ensure coverage for origin device tokens

The table is canonical at v13; same-version lazy creation no longer
exists to protect. Origin CRUD, isolation, and rotation coverage remains
in the surviving cases.

* refactor(state): fold installed_plugin_index into config_machine_state

The singleton index row becomes one JSON value under
plugins.installedIndex with its rollback-fencing revision inside the
value; reads, CAS restore, and the lease-held write transactions use
direct Kysely on config_machine_state so the state_leases assertion
stays in-transaction. The v13 migration imports the row and drops the
table; the additive workspace_dir entry folds with it. Doctor guidance,
docker staging, and the e2e probes name the machine-state row.

* refactor(state): merge workspace_attestations into workspace_setup_state

One row per workspace now carries both setup milestones and the
attestation clock: nullable setup columns represent attestation-only
workspaces (replaceWorkspaceAttestation can precede any setup write) and
setupExists derives from a non-null version. The bootstrap-hash FK
repoints to the merged table; migration receipts keep the historical
workspace_attestations discriminator string. The v13 migration grows and
rebuilds the table, merges attestation rows (orphans without a path
alias drop — their hashes re-derive at the next bootstrap attestation),
and the consolidation kind is renamed state-consolidation-v13 to cover
the batch.

* test(state): cover the workspace merge and consolidation fallout

The v12-to-v13 regression seeds merged, attestation-only, and orphan
attestation workspaces; the 13-to-12 downgrade fixture recreates
workspace_attestations and installed_plugin_index from the folded data;
the fold-in migration gates the additive workspace_dir column for
pre-additive rows; the workspace merge now triggers on the setup table's
own shape so stable-era databases without an attestations table still
reshape; the consolidation applied-message covers the batch.

* refactor(state): fold shared auth profile singletons into config_machine_state

The shared-state auth_profile_stores/auth_profile_state rows (fixed key
'shared') become authProfiles.store/authProfiles.state machine-state
values; the agent-DB tables of the same names are untouched. Git-backup
redaction moves from table-drop to the authProfiles. secret prefix with
seeded-secret absence proof; migration receipts keep the historical
table-name discriminators; the shared-auth relocation and receipt
verification project the KV cells back to the receipt-era row shapes so
persisted digests stay byte-compatible. mcp_oauth_stores stays a table —
its multi-key fold is a named follow-up.

* test(state): finish shared-auth fold coverage and annotate boundary casts

Auth seeders and assertions across the e2e/scripts/secrets suites target
the authProfiles machine-state cells; the v12-to-v13 regression proves
payload-byte fidelity, non-shared-row drop, and insert-if-absent
precedence; the downgrade fixture recreates and repopulates both v12
tables. Boundary type assertions in the plugin-index store carry SAFETY
invariants per the ratchet.

* chore: shrink assertion-safety baseline for plugin-index store

* refactor(doctor): delete the dead onboarding-recommendations migration

Its input — the unscoped 'primary' onboarding row — existed only between
9a93a52a8a and 473962b7de, a two-day beta window; no shipped stable
can produce it and the runtime table folded away at v12. The audit
backup list keeps recognizing system-agent.jsonl artifacts because beta
installs that ran that import may still carry its backups.

* docs: sync the 13-to-12 downgrade example with the executable fixture

* style: format the synced downgrade example

* style: drop unused import and duplicate union constituent

* fix(state): keep orphan attestations across the v13 workspace merge

The merged workspace_setup_state required a workspace path, but legacy
orphan hashed-key attestations never recorded one. workspace_path is now
nullable (setup rows still enforce it via CHECK), the v13 migration and
the doctor file import keep orphans with a NULL path that heals on the
next live access, and the 13-to-12 downgrade keeps attestation-owned
hashes. Doctor test seeds move to the folded KV row.

* perf(state): retire unused cron indexes

* fix(state): preserve v13 migration recovery

* fix(state): preserve v12 lazy-table upgrade

* docs(state): document v13 auth relocation

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-27 15:26:14 +08:00
..
browser-cdp-snapshot
bun-global-install improve: verify packaged runtime on Bun 1.4 (#129552) 2026-08-25 23:41:05 -07:00
bundled-plugin-install-uninstall refactor: consolidate coercion ownership (#122299) 2026-08-11 17:14:53 -07:00
codex-media-path refactor: consolidate coercion ownership (#122692) 2026-08-12 09:25:28 -07:00
codex-npm-plugin-live fix(agents): reject forged plugin owner authority (#104872) 2026-08-25 20:36:05 -07:00
codex-on-demand feat(codex): upgrade main to app-server 0.149.1 (#128370) 2026-08-24 19:50:22 -07:00
config-reload refactor(scripts): migrate JavaScript tools to TypeScript (#121005) 2026-08-09 07:21:35 -07:00
docker-artifact-proof
docker-selected-plugins
docker-stats fix(e2e): bound Docker stats sample lines (#109262) 2026-07-29 07:30:29 -04:00
doctor-install-switch fix(doctor): preserve managed container services (#129527) 2026-08-25 17:48:32 -07:00
fixtures fix(e2e): declare agents-delete fixture owners (#123000) 2026-08-13 13:07:55 +08:00
gateway-network refactor(gateway): remove suspension mock replay (#122977) 2026-08-12 21:24:50 -07:00
kitchen-sink-plugin refactor: retire August compat windows (embedding API, pi aliases, target parser, spawning hook, setup exports, WhatsApp inbound aliases) (#124416) 2026-08-15 22:43:47 -07:00
live-plugin-tool refactor: consolidate coercion ownership (#122692) 2026-08-12 09:25:28 -07:00
npm-onboard-channel-agent test(e2e): share canonical auth store reader (#126960) 2026-08-23 18:00:36 -07:00
npm-telegram-live refactor: consolidate coercion ownership (#122299) 2026-08-11 17:14:53 -07:00
onboard test(onboard): handle telemetry consent prompt (#128943) 2026-08-25 02:06:02 -07:00
openai-chat-tools fix(ci): restore beta release harnesses (#116596) 2026-07-31 09:17:35 +08:00
openai-web-search-minimal fix: restore native OpenAI web search in packaged runs (#124215) 2026-08-15 20:30:41 -07:00
openwebui refactor: consolidate coercion contracts (#122458) 2026-08-11 23:26:37 -07:00
plugin-lifecycle-matrix refactor: consolidate coercion contracts (#122458) 2026-08-11 23:26:37 -07:00
plugin-update fix(ci): seed plugin update ownership metadata (#122752) 2026-08-13 02:39:32 +08:00
plugins fix(plugins): uninstall fully removes isolated npm plugin files (#123973) 2026-08-14 21:03:12 -07:00
release-media-memory
release-plugin-marketplace fix(plugins): remove stale load paths during uninstall (#118930) 2026-08-03 21:57:54 +00:00
release-scenarios test(e2e): share canonical auth store reader (#126960) 2026-08-23 18:00:36 -07:00
release-typed-onboarding test(onboard): handle telemetry consent prompt (#128943) 2026-08-25 02:06:02 -07:00
release-upgrade-user-journey test(release): require live channel after restart (#127013) 2026-08-26 03:27:23 -07:00
release-user-journey test(release): require live channel after restart (#127013) 2026-08-26 03:27:23 -07:00
sandbox-browser-sidecar fix(agents): serialize sandbox provisioning (#115645) 2026-07-29 14:50:15 +08:00
skills
update-channel-switch test(qa): cover CLI distribution workflows (#118948) 2026-08-04 05:09:39 +08:00
upgrade-survivor refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466) 2026-08-27 15:26:14 +08:00
agent-turn-output.mjs refactor(scripts): reuse shared record guard 2026-07-29 16:42:12 +02:00
auth-profile-store-assertions.d.mts test(e2e): share canonical auth store reader (#126960) 2026-08-23 18:00:36 -07:00
auth-profile-store-assertions.mjs refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466) 2026-08-27 15:26:14 +08:00
clawhub-fixture-server.cjs test(gateway): repair release-validation fixtures (#127263) 2026-08-21 09:20:56 -07:00
codex-app-server-fixture.mjs fix(e2e): include Codex thread project id (#130086) 2026-08-26 09:59:36 -07:00
codex-install-utils.mjs
codex-release-package-assertions.d.mts feat(codex): upgrade main to app-server 0.149.1 (#128370) 2026-08-24 19:50:22 -07:00
codex-release-package-assertions.mjs fix(codex): update managed runtime to 0.150.1 (#130685) 2026-08-27 13:31:46 +08:00
env-limits.mjs
fixture.mjs
gateway-frame-payload.mjs
incremental-line-reader.mjs
mcp-code-mode-probe-server.ts improve(code-mode): call tools as global functions (#126262) 2026-08-20 12:18:23 -07:00
mcp-code-mode-validation.ts improve(code-mode): call tools as global functions (#126262) 2026-08-20 12:18:23 -07:00
mock-openai-http.mjs refactor(scripts): migrate JavaScript tools to TypeScript (#121005) 2026-08-09 07:21:35 -07:00
package-compat.mjs fix(scripts): use direct-run helper for Windows guards (#110877) 2026-08-04 23:11:12 +08:00
package-git-fixture.mjs fix(e2e): skip package postinstall in git fixture (#127768) 2026-08-21 20:45:19 -07:00
plugin-index-sqlite.mjs refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466) 2026-08-27 15:26:14 +08:00
prepublish-plugin-registry.sh fix(release): stage Codex for npm onboarding candidates (#130360) 2026-08-26 16:58:45 -07:00
release-assertion-files.mjs
run-with-pty.mjs
session-log-mentions.ts
temp-state-dir.ts
text-file-utils.mjs
websocket-open.mjs