Skip to content

Add instance aliases and bump zipx to 0.10.0 - #93

Merged
russwyte merged 3 commits into
mainfrom
bump/zipx-0.10.0
Sep 10, 2026
Merged

russwyte merged 3 commits into
mainfrom
bump/zipx-0.10.0

Conversation

@russwyte

@russwyte russwyte commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Two pieces on one pre-release PR.

Instance aliases

Look up a persistent FSM by a unique secondary key (campaign id, template id) without changing recover-on-construct.

  • InstanceIndex maps Alias(namespace, key) to instance id. Uniqueness is per namespace; rebind to the same id is a no-op; a clash is UniqueAliasError.
  • FSMRuntime.lookup(alias, machine, initial) resolves then reconstructs. Missing aliases fail with AliasNotFoundError.
  • Optional AliasExtractor diffs aliases on Goto, binds before EventStore.append, unbinds after. Recover reindexes once from rebuilt state.
  • Backends: in-memory, Postgres fsm_aliases (per-table schema init so existing DBs pick it up), IndexedDB aliases store (DB version 2) plus SharedFSMRuntime.lookup.

Verified: core/testFull, postgres/testFull, webJS/testFull, docs/testFull, scalafmtCheckAll.

zipx 0.10.0

Takes zipx 0.10.0, which fixes early-effect/zipx#156: zipxCheckDeps now reads the project-level scalaVersion (sbt 2 common settings) instead of ThisBuild / scalaVersion.

That lets the catalog move to Scala 3.9.0 without a ThisBuild pin. MyVersions.settings is enough.

Also:

  • sbt 2.0.8
  • Drop ThisBuild / from common build.sbt settings (sbt 2 injects those into every module)
  • Docs site/JS paths use LocalRootProject / baseDirectory so they stay at the repo root, not mechanoid-docs/

zipxWorkflowCheck is green locally. Workflow YAML did not change.

zipx 0.10.0 reads the project-level scalaVersion (sbt 2 common settings)
instead of ThisBuild, so the catalog can move off the metabuild Scala
without a ThisBuild pin. Drop that workaround and use LocalRootProject
for docs paths that must stay at the repo root.
FSMRuntime.lookup resolves an InstanceIndex alias then reconstructs as today.
In-memory, Postgres, and IndexedDB backends keep uniqueness; optional extractors
bind before append so a clash does not persist the event.
@russwyte russwyte changed the title Bump sbt-zipx to 0.10.0, Scala 3.9.0, and sbt 2.0.8 Add instance aliases and bump zipx to 0.10.0 Sep 9, 2026
Constructor parameters marked @alias become unique index keys. Namespace
defaults to the field name; scalars, Option, and collections are supported.
AliasCodec encodes values, with a low-priority toString given.
@russwyte
russwyte merged commit f37a7a3 into main Sep 10, 2026
12 checks passed
@russwyte
russwyte deleted the bump/zipx-0.10.0 branch September 10, 2026 00:16
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.

zipxCheckDeps reads ThisBuild / scalaVersion, so a catalog Scala bump fails on sbt 2

1 participant