Skip to content

feat: persist workspace state and unify database publication - #1

Merged
adamcavendish merged 1 commit into
mainfrom
feat/workspace-publish-recovery
Sep 15, 2026
Merged

adamcavendish merged 1 commit into
mainfrom
feat/workspace-publish-recovery

Conversation

@adamcavendish

Copy link
Copy Markdown
Contributor

Summary

  • Persist service-owned database TOML, request limits and recovery blockers in a fixed workspace; restore healthy APIs after restart without runtime registration replay.
  • Replace separate register/migrate/reload calls with publish and unregister. Publish validates connection changes, drains requests, applies pending migrations within one batch timeout, and adopts interfaces and limits atomically.
  • Keep operation IDs typed and opaque; preserve data/source files during unregister and keep missing registered Turso files unavailable rather than recreating them.
  • Update HTTP/CLI contracts, documentation, runtime guidance, and SDK examples.
  • Include the previously committed switch to the pinned openapi-nexus 0.2.3 release binary instead of building the generator from source.

Compatibility

This changes the pre-release management API: use a workspace and POST publish rather than external paths and separate registration/migration/reload calls. The CLI now requires --workspace.

No authentication, address binding restriction, filesystem watcher, distributed PostgreSQL migration lock, or durable operation queue is introduced. Migration commits are not rolled back when a later publication step fails.

Review

Reviewed lifecycle state transitions, durable configuration adoption, migration history, request/resource ownership, restart isolation, and consumer contracts against the agreed W1–W4 design.

Fixed during review:

  • A definite pre-replacement persistence failure now preserves the old healthy service when no target/schema change has occurred. Uncertain replacement still fails closed.
  • Restart rejects managed-directory symlinks consistently with publish, isolates the failed database, and permits publication after path repair.
  • Unregistered directories without valid UTF-8 names no longer prevent workspace startup.
  • Corrected documentation for history-export availability and managed-path behavior.

Added regression coverage for these cases plus unregister removal/sync failures and target-switch persistence uncertainty.

Test plan

  • cargo build --locked
  • cargo fmt --check
  • cargo clippy --locked --all-targets -- -D warnings
  • Complete scripts/check.sh on the final code
  • Real Turso and PostgreSQL migration, execution, registry and HTTP contracts
  • Generated TypeScript SDK calls and process restart with both backends
  • Recursive OpenAPI schema SDK generation and compilation
  • Runtime skill validation and git diff --check

Local tests used disposable PostgreSQL data and the downloaded openapi-nexus binary. Hosted CI and release/container verification are separate checks, not claimed by the local results.

Documentation

Updated getting-started, workspace/registry, HTTP, migration and delivery references, examples, and runtime integration guidance. Public lifecycle changes have reference documentation, a walkthrough, and recovery guidance.

Store service-owned database configuration, effective limits and recovery blockers in TOML under a fixed workspace layout. Restore healthy APIs on startup without registration replay, isolate failed databases, and never recreate missing registered Turso files.

Replace public register/migrate/reload with publish and unregister. Validate target changes before adoption, drain requests before migration, apply one migration batch deadline, and atomically publish interfaces with their limits. Preserve configuration through shutdown and retain typed base36 operation IDs only in memory.

Cover both backends, restart, configuration persistence faults, target switching and request cleanup. Group PostgreSQL-dependent library tests in postgres_tests modules so the verification script discovers both registry and diagnostic contracts without individual test names.

Update HTTP/CLI documentation, runtime guidance and generated SDK examples. Download the pinned openapi-nexus 0.2.3 release binary rather than building it from source. The complete locked check script passes, including PostgreSQL and Turso SDK/restart contracts.
@adamcavendish
adamcavendish force-pushed the feat/workspace-publish-recovery branch from 68ee2f5 to 773126e Compare September 15, 2026 15:42
@adamcavendish
adamcavendish merged commit 9952974 into main Sep 15, 2026
2 checks passed
@adamcavendish
adamcavendish deleted the feat/workspace-publish-recovery branch September 15, 2026 16:30
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