Skip to content

refactor!: clarify library contracts and unify CI verification - #92

Merged
ackness merged 7 commits into
mainfrom
refactor/libraries-and-ci
Sep 29, 2026
Merged

ackness merged 7 commits into
mainfrom
refactor/libraries-and-ci

Conversation

@ackness

@ackness ackness commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary / 摘要

Clarify the responsibilities and public contracts of the shared libraries, migrate their consumers together, and make local validation, PR CI, and release verification use the same checks.

  • Carry a complete prepared execution from Runtime to one host commit API; preserve suspension accounting, captured hook settings, and durable commit behavior.
  • Narrow package entrypoints, unify plugin handler/tool contracts and test harnesses, separate world generation from export, and return normalized world manifests.
  • Commit vector updates and index progress atomically on Memory, SQLite, and PostgreSQL; keep derived index state separate from portable checkpoints.
  • Fix Turbo inputs and database environment forwarding, remove implicit Web builds from lint/test, and provide working PostgreSQL and coverage commands.
  • Reuse CI gates for releases, add deterministic Chromium smoke coverage, and validate lockfiles without modifying installed dependencies. Remove six workspace dependencies left unused by the library migration.

Type of change / 变更类型

  • Bug fix / Bug 修复 (fix)
  • Refactor / 重构 (refactor)
  • Documentation / 文档 (docs)
  • Infra / CI / 基础设施 (chore)
  • Breaking change / 破坏性变更 (BREAKING CHANGE)

Verification / 验证方式

Validation is performed in an isolated checkout with Node 26.7.0 and pnpm 11.22.0. PostgreSQL uses a disposable pgvector container; browser checks use an isolated Memory backend.

  • pnpm lint via pnpm check; peer, boundary, dependency, manifest, i18n, 14 script regression, and actionlint checks passed.
  • pnpm test --concurrency=2: 7,780 Vitest tests and 33 desktop Node tests passed, plus desktop self-checks. PostgreSQL was required; 2 existing skips and 10 todos remain.
  • pnpm test:pg: 960 Store tests and 24 Server integration tests passed against disposable PostgreSQL/pgvector.
  • pnpm test:coverage: Vitest reports and desktop raw V8 coverage generated successfully.
  • pnpm e2e --list: 124 tests collected from 39 files; catches stale imports outside the smoke subset.
  • pnpm e2e:smoke --retries=0: 4 passed using the default automatic server startup. An external-stack run also passed all 4.
  • pnpm e2e --workers=2 --retries=0: 118 passed, 6 live-model cases skipped with LIVE_LLM_ENABLED=0. Used E2E_BASE_URL with a private Memory server on separate ports; the final run used a non-watching server to avoid interference from coverage file writes.
  • pnpm release:preflight: all 8 gates passed.
  • pnpm build: all 5 tasks passed, including staged desktop server startup smoke.

Platform installer packaging and real-model acceptance were not run; no release was published.

Related issue / context / 关联

Includes the previous library-contract and consumer improvements plus CI/pnpm fixes. Based on current main, including the provider improvements from #91. Concurrent dependency/toolchain upgrades and plugin-panel changes are excluded.

BREAKING CHANGE: Runtime execution/resume return prepared executions consumed by commitExecution; plugin tools use explicit result envelopes, context building is asynchronous, and Store backends use subpath imports. createWorld returns normalized content and writeWorldPackage exports it. Atomic commitVectorIndexBatch replaces the previous vector-progress CAS API. All repository consumers and fixtures are migrated together. Recreate development data/checkpoints that contain the previous vector-progress representation.

Docs sync / 文档同步

  • Updated docs/reference/ for framework contracts, storage, tools, and settings behavior.
  • Updated package architecture, plugin authoring/testing guides, both contributor guides, and the desktop release checklist.

Unify plugin author contracts and explicit tool results in the public SDK.
Carry complete execution plans through one host commit API, preserving
nested suspension accounting, immutable hook settings and activation scope.
Separate vector index progress from plugin data and scope background work
to each memory instance. Narrow store and context entrypoints and share
production tool setup with the plugin runner.

Update consumers, regression coverage and package responsibility guidance.

Validation: workspace lint and package boundary checks pass. Runtime has
1413 passing tests excluding the network listener suite; server has 1596
passing tests excluding sandbox-restricted HTTP and watcher suites. SDK,
tools, plugins, store, memory and author-runner checks pass. Full test/E2E
runs are limited by sandbox socket/IPC permissions. Frozen offline install
validation lacks cached registry metadata for its supply-chain check.

BREAKING CHANGE: executeTurn and resume return prepared executions;
commitExecution consumes their plans. Tool effects use explicit envelopes,
buildContext is asynchronous, store backends require subpath imports, and
memory background lifecycle is instance-owned. Recreate development data
and checkpoints containing the previous vector-progress representation.
Capture localized runtime prose with plugin generations, use logical parent
turns for retries, and resolve settings backends before store initialization.
Clear deleted-session plugin caches after successful deletion.

Share query embeddings and source ranking in memory search. Separate world
generation from explicit file export and preserve portable contract data.

Exercise real commits and hooks in plugin author tests, report unsupported
host capabilities, retain active entry callbacks, and check JavaScript SDK
usage in generated plugins and the character-creation guard.

Validation: workspace lint (22 tasks), changed-file formatting, package
boundaries, and focused regressions passed. Full tests reported 7310 Vitest
passes and 23 environment-blocked cases (loopback EPERM or watcher EMFILE).
Desktop selfchecks and browser E2E were blocked by tsx IPC EPERM; offline
installation verification lacked cached supply-chain metadata.

BREAKING CHANGE: createWorld returns validated content without outputDir;
use writeWorldPackage for file export. Memory tool wiring consumes the
unified MemorySystem.search interface.
Keep derived vectors and their progress consistent across concurrent ingestion instances. Apply CAS, vector deletions and upserts as one batch on Memory, SQLite and PostgreSQL.

BREAKING CHANGE: VectorStoreCapability.commitVectorIndexBatch and CommitVectorIndexBatchInput replace compareAndSetVectorIndexProgress and UpdateVectorIndexProgressInput.
Return schema transforms and defaults from world generation so file, store and return-only targets consume the same manifest. Cover canonical locales, character defaults and preserved content through the API.
Integrate the library boundary, execution ownership, consumer, atomic vector
index, and normalized world generation changes with the current provider code.
Remove obsolete workspace dependency declarations and migrate the remaining
Playwright Store import to the Memory backend entrypoint.

Validation: pnpm check, full tests (7780 Vitest and 33 desktop tests), required
PostgreSQL checks (960 Store and 24 integration tests), coverage, release
preflight, browser smoke (4), complete deterministic E2E (118; 6 live-model
cases skipped), and pnpm build including staged desktop server smoke passed.

BREAKING CHANGE: Runtime hosts consume prepared execution plans, plugin tools
use explicit result envelopes, context building is asynchronous, and Store
backends use subpath imports. World generation and export are separate APIs.
Atomic vector batches replace the previous vector-progress CAS API. Recreate
development data/checkpoints using the previous vector-progress representation.
Reuse CI gates during releases, collect the full browser suite and run a
small deterministic smoke suite. Validate workflow syntax with pinned
actionlint and check lockfiles in an isolated metadata-only workspace.

Track root TypeScript configuration and prompts in Turbo inputs, pass
PostgreSQL test environment through uncached Store/Server tasks, and retain
shared build dependencies without implicitly bundling Web during lint/test.
Separate Vitest and desktop coverage commands and require explicit database
integration tests. Cover failure propagation, cache invalidation, and
preflight side effects with script regressions; update contributor guidance.

Validation: pnpm check (13 script regressions), pnpm test, pnpm test:pg,
pnpm test:coverage, pnpm release:preflight, browser test collection and smoke,
full deterministic E2E, and pnpm build passed.
Replace the inherited webServer array instead of concatenating it through defineConfig. Add a regression for owned and external stacks. Validation: 14 script regressions and all 4 smoke flows pass with the default automatic server startup.
@ackness
ackness merged commit c71b208 into main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant