# `Continuum.VersionRegistry`
[🔗](https://github.com/Yyeger/Continuum/blob/main/lib/continuum/version_registry.ex#L1)

Registry for workflow version hashes and callable entrypoints.

The hot path is process-independent: loaded workflow metadata is cached in
`:persistent_term` so module-load/start/resume registration never depends on
a GenServer being alive. The supervised child is only a short-lived boot task
that upserts loaded versions into the configured instance's repo.

# `entry`

```elixir
@type entry() :: %{
  workflow: module(),
  workflow_string: String.t(),
  version: term(),
  hash: binary(),
  version_hash: binary(),
  entrypoint: module()
}
```

# `ensure_registered`
*since 0.3.0* 

```elixir
@spec ensure_registered(module()) :: {:ok, entry()} | {:error, term()}
```

Register the current module metadata if the module is a Continuum workflow.

# `entries`
*since 0.4.0* 

```elixir
@spec entries() :: [entry()]
```

Return the loaded workflow-version entries currently known to this BEAM.

# `lookup`
*since 0.3.0* 

```elixir
@spec lookup(module()) :: nil | map()
```

Look up registered metadata for a workflow module.

This preserves the v0.1 helper shape for callers that only have one loaded
version. When multiple entrypoints are registered for the same logical
workflow, there is intentionally no "latest" ordering in the content-addressed
registry; resume dispatch must use `resolve/2` with the journaled hash.

# `register`
*since 0.3.0* 

```elixir
@spec register(module(), term(), binary()) :: :ok
```

Backwards-compatible registration helper for tests and old callers.

# `register`
*since 0.3.0* 

```elixir
@spec register(module(), term(), binary(), module()) :: :ok
```

Register a logical workflow/version hash to a concrete entrypoint module.

# `resolve`
*since 0.3.0* 

```elixir
@spec resolve(module() | String.t(), binary()) :: {:ok, entry()} | {:error, term()}
```

Resolve a journaled `(workflow, version_hash)` pair to a loaded entrypoint.

# `upsert_instance`
*since 0.3.0* 

```elixir
@spec upsert_instance(Continuum.Runtime.Instance.t(), [module()] | nil) :: :ok
```

Upsert loaded workflow versions for an instance into `continuum_workflow_versions`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
