* refactor(state): fold singleton tables into config_machine_state at schema v11 Eight singleton tables (skill_curator_state, update_check_state, clawhub_promotions_feed_state, model_catalog_remote, voicewake_triggers, voicewake_routing_config, voicewake_routing_routes, onboarding_recommendations) were each one logical JSON value behind a fixed key; their bespoke schemas, lazy ensures, and per-table accessors collapse onto the shared config_machine_state KV under namespaced keys. cron_store_epochs retires outright: it was born write-only in #114388 and no reader ever existed in any language. Durable values (update check state, voicewake triggers and routing, per-workspace onboarding answers) migrate insert-if-absent during the v10->v11 migration; cache class contents rebuild on next use. Deferred with named reasons: exec_approvals_config (macOS direct-SQL contract), installed_plugin_index (same-tx lease fence), node_host_config and web_push_vapid_keys (secret-table git-backup redaction). # Conflicts: # src/skills/workshop/collection-review-state.ts # src/skills/workshop/collection-review.gateway-admission.test.ts * test: register v11 guard carve-outs and suppression pin The v11 migration module joins the raw-SQLite allowlist (migrations are the named guardrail exception), the lint-suppression allowlist records the second type-parameter suppression in config-machine-state, and the identity module keeps only externally consumed exports. * test: surface CLI stderr when migration-diagnostic assertion fails * test: expect migration diagnostics on stderr for models plain commands The #129037 pending-migration cases asserted that aliases/fallbacks lists never open the state database, but config-health observation (observeConfigSnapshot -> readConfigHealthStateFromStore) full-opens it on any config read whose file exists — reproduced identically on clean main with a main-built dist. The protected contract is exact stdout; the diagnostic legitimately lands on stderr for every case. * test: drop unused defaults import from CLI stdout e2e * test: split session path derivation out of oversized session-files suite #130016 pushed session-files.test.ts to 1008 lines, over the 1000-line lint cap and red for every PR's check-lint. The sessionPathForFile describe moves to a self-contained sibling following the existing session-files.*.test.ts split pattern; no assertions change. * refactor(state): fold four more singleton tables into schema v12 tui_last_sessions (cache-class, regenerates on next session switch), sidebar_sections (persistent section order, migrated as one JSON array), node_host_config, and web_push_vapid_keys join the v12 fold-in, taking the retirement to thirteen tables at the same version. The two secret singletons were blocked on table-granular git-backup redaction; backups now exclude config_machine_state rows by secret key prefix (nodeHost.*, webPush.vapidKeys) with a fail-closed row filter and regression proof, so STATE_SECRET_TABLE_NAMES sheds both tables. The sidebar fold also retires its lazy-ensure WeakSet and inline DDL; sidebar edits stay inside the existing session-group write transaction via direct Kysely. * fix(node-host): omit absent Cloudflare Access config like the column reader The KV rewrite returned gateway.cloudflareAccess as an own undefined property where the retired column reader omitted the key; toStrictEqual consumers (state-migrations doctor-repair test) caught the shape drift. Mirror the column reader's conditional spread at both construction sites. * fix(backup): disclose redacted machine-state prefixes after restore The prefix-granular secret redaction recorded omitted key prefixes in the backup manifest but the restore result exposed only excludedTables, so a redacted restore looked complete while nodeHost.* and webPush.vapidKeys configuration were intentionally absent. The restore result and CLI output now disclose the omitted prefixes (JSON mode carries them via the result shape), with restore-side regression coverage. * fix(tui): compare-and-delete retired session pointers Doctor cleanup read matching pointer keys then deleted them unconditionally, so a replacement pointer written between the scan and the delete was erased. The delete now re-checks the stored value inside the write transaction and only removes pointers that still name a retired session; a live replacement survives (regression covered). Also corrects the stale schema-version line in database-first.md.
summary, read_when, title
| summary | read_when | title | |||
|---|---|---|---|---|---|
| Repository script entry points and compatibility notes |
|
Scripts Directory |
Scripts Directory
The scripts/ directory contains repository tooling used by local development,
CI, docs publishing, releases, Docker proof, and maintainer operations. Prefer
the package-script entry points in package.json when one exists, then read the
underlying script before running it directly.
Compatibility
Many scripts are stable paths referenced by package.json, GitHub Actions,
docs, and maintainer runbooks. Do not move, rename, or regroup scripts only to
improve taxonomy. A directory migration needs an explicit maintainer-approved
compatibility plan for package scripts, workflows, docs snippets, and any raw
script paths users may have copied.
This index is a discovery aid for the current flat layout. It does not define a new directory taxonomy.
Common Entry Points
| Area | Prefer | Notes |
|---|---|---|
| Build | pnpm build |
Runs scripts/build-all.mts; use specific build scripts only when debugging a build stage. |
| Changed checks | pnpm changed:lanes --json, pnpm check:changed |
Lane classification lives in scripts/changed-lanes.mjs; changed-file checks live in scripts/check-changed.mjs. |
| Docs | pnpm docs:list, pnpm docs:check-mdx, pnpm docs:check-links |
Backed by scripts/docs-list.js, scripts/check-docs-mdx.mjs, and scripts/docs-link-audit.mjs. |
| Formatting docs | pnpm format:docs:check |
Uses scripts/format-docs.mts; use write mode only when intentionally formatting docs. |
| Lint | pnpm lint, pnpm lint:core, pnpm lint:all |
Wrapper scripts keep oxlint behavior aligned with repo config. |
| Targeted tests | pnpm test <path-or-filter> or node scripts/run-vitest.mjs <path-or-filter> |
Avoid bare vitest; it can start watch mode. |
| Changed tests | pnpm test:changed |
Uses the repo's changed-test resolver instead of a broad Vitest run. |
| Docker proof | pnpm test:docker:all, pnpm test:docker:rerun, pnpm test:docker:timings |
Use the planner/rerun helpers before launching broad Docker work. |
| Live proof | pnpm test:live |
Live checks require the matching environment and credentials. |
| Release checks | pnpm release:check, pnpm release:beta, pnpm release:candidate |
Release scripts are maintainer workflows; read release docs before use. |
| GitHub reads | scripts/gh-read |
Uses a GitHub App read token when configured, leaving normal gh login for writes. |
| Commits | git add <files...> then git commit -m "<message>" |
Stage only the intended files for each commit. |
| Remote proof | node scripts/crabbox-wrapper.mjs ... |
Use when the current host lacks the required isolation, OS, device, or capacity; sync each run and reuse the lease. |
Script Families
check-*.mts/check-*.ts/ retainedcheck-*.mjs: guardrails for architecture, docs, package contents, boundaries, workflows, and generated artifacts.run-*.mjs/run-*.mts: stable wrappers and typed implementations for Node, Vitest, oxlint, tsgo, and environment setup.test-*.mts/ retainedtest-*.mjs/test-*.sh/test-*.ts: test planners, Docker lanes, live checks, and focused validation helpers.docs-*andcheck-docs-*: docs listing, link auditing, MDX checks, spellcheck, sync, and i18n glossary checks.release-*,openclaw-npm-*, andplugin-*-release-*: release preparation, package verification, and publishing helpers.docker-*,test-docker-*, andtest-live-*-docker.sh: Docker E2E planning, rerun, timing, and live/package lane helpers.gh-read*,label-*,sync-labels.ts, and PR helpers: GitHub read, labeling, and maintainer workflow support.generate-*,write-*,copy-*, andsync-*: generated docs, metadata, package surfaces, and build artifact support.lib/: shared helpers imported by script entry points.
Maintenance Rules
- Read
scripts/AGENTS.mdbefore changing scripts. - Keep package scripts, generators, generated-artifact checks, docs references, and workflow references aligned when touching a script path.
- Prefer existing wrappers instead of introducing a raw tool invocation.
- Add or update focused tests under
test/scripts/when changing script behavior.
See also Scripts for public-facing script guidance.