Dependencies and snapshots¶
When you build a component, the build pipeline resolves the
dependencies declared in dependencies { }, generates the symbols
they expose, and bundles the result. When you register a component,
the registry walks the same closure to ensure every transitive
dependency is registered. This page covers what's happening
underneath, why snapshots versus releases matter at each step, and the
two-layer cache that makes your builds fast.
Migration sources are not runtime dependencies
A workflow type's migrationRoutes { from(...) } names older versions of
itself. The build resolves those versions to generate the migration
adapters, and the registry records them as migration sources of the new
version, apart from its runtime dependencies: they are never walked as
part of the dependency closure, the release-time unused-dependency check
ignores them, and they do not keep the older version from being archived.
dependencies { } declares only the components used at runtime.
Two-layer resolution¶
At build time and at register time, the SimKit CLI resolves component references through a priority-ordered list of sources:
FILE_SYSTEM— the on-disk artifact cache at~/.workflows/repository/{data-types,methods,workflow-types}/<reference>.<sidecar>.json. Maven Local for components.REGISTRY_SERVICE— the configured component registry over the network.
The order is FILE_SYSTEM,REGISTRY_SERVICE. The CLI tries each source
in order; on a hit it returns; on a miss it falls through. Whatever the
registry-service resolver fetches, it back-fills the file-system
cache, so subsequent builds don't re-fetch.
For simkit component build this order is fixed and not configurable:
the local repository first (so a locally-built snapshot is favored
while a component is under development), then the registry. The
simkit component register command is the one place the order can
change — via its --dep-source flag (see the transitive walk below).
Snapshots: immutable, but -SNAPSHOT-latest floats¶
Each snapshot is immutable once created. A build never overwrites a
snapshot in place — it produces a new one, identified by a date and
sequence suffix (1.0.0-SNAPSHOT-2026-05-15-1, …-2, and so on).
Earlier snapshots stay in the registry untouched.
What moves is the -SNAPSHOT-latest pointer: it always resolves to the
newest snapshot of a given base version. So a dependency declared as
…:1.0.0-SNAPSHOT-latest can resolve to a different artifact over time
as new snapshots are published — even though no individual snapshot
ever changes.
For the build resolver, that leaves one thing worth knowing:
- The local cache can lag -SNAPSHOT-latest. The build tool always
checks the local repository before the registry, so if a newer
snapshot was published elsewhere, the build reuses the cached one. To
force a re-fetch, delete the cached file for that reference — or pin
an exact snapshot suffix (…:1.0.0-SNAPSHOT-2026-05-15-1), which is
immutable and so never goes stale.
The version qualifier in a dependency's reference decides whether a
snapshot is accepted. A bare version (…:1.0.0) resolves only the
released version. To depend on a snapshot, put the qualifier in the
reference: …:1.0.0-SNAPSHOT-latest floats to the newest snapshot of
that base version, or pin an exact one such as
…:1.0.0-SNAPSHOT-2026-05-15-1. Released components typically pin to
released dependencies; snapshot components typically track snapshot
dependencies.
Released versions: immutable¶
A version without -SNAPSHOT is immutable. Once 1.0.0 is on the
registry, it cannot change. The local cache for a released version
is therefore always correct — no need to re-fetch.
This is why the cache is so effective: most dependencies are released, and once cached they never need re-pulling.
Build-time dependency resolution: phase 2¶
The unified DSL build is a four-phase pipeline. Phase 2 is the one that resolves dependencies:
- Pre-process — find the
dependencies { }block, extract its declarations. - Resolve, generate code, and compile. For every declared dependency, resolve its description and sidecar JSON files (per the priority list), then pass them to the per-kind code generator (data type → schema extension functions; method → call function; workflow type → nested-workflow call function). Compile the generated Kotlin.
- Description interpretation. Compile and evaluate your
.ktsagainst the generated code. Produces the description JSON. - Definition interpretation. For workflow types, run the
workflowDefinition { }body to produce the workflow definition JSON.
Failures in phase 2 typically mean a missing or unresolvable
dependency. The error message names the failing reference and points
at the dependencies { } line; if the cache and registry both miss,
the fix is usually to declare the dependency correctly or check that
the target registry has it.
Register-time transitive walk¶
simkit component register <zip>... walks the dependency closure of
each input and ensures everything is in the target registry first:
- Read the input zip's description, extract declared dependencies.
- For each dependency:
- If already in the target registry, the foreign-key constraint is satisfied — skip.
- If among the user's input zips, register from that zip (locally edited snapshots beat a stale cache).
- Otherwise, resolve through the same priority chain
(
FILE_SYSTEMfirst,REGISTRY_SERVICEsecond), synthesize a zip from the cached files, and post it. - Recurse on the dependency's own dependencies until the closure is satisfied.
- Register the original input.
This is what the --dep-source flag on simkit component register
controls. The default chain works for nearly every case: most
dependencies are released, in the cache, and the cache hit is fast.
Permissions on dependencies¶
Declaring a dependency is a permission decision of the developer who
declares it: registration requires the usable permission on every
declared dependency version (USE, or TEST for a snapshot). That
permission does not travel with the component. A user who creates,
updates or runs a workflow needs their own usable permission on the
workflow type and on every member of its transitive dependency
closure; the registry judges all of them in one call, and the
workflow repository and workflow runner reject the operation up front
with an error that states how many dependencies block it. The names
of the blocking dependencies are shown only to users who may manage
the workflow type's permissions, on the workflow type version page
of the simkit web UI.
In practice: a workflow type meant for users outside your
organization needs every data type, method and material it depends on
to be usable by them too, usually through a PUBLIC or organization
permission on the dependency's component or group. The rule is
spelled out in
Component permissions.
Why this matters¶
Two different consumers, same mechanism: - Build uses the chain to fetch descriptions for code generation — it needs structural metadata about dependencies, not run-time deployment. - Register uses the chain to fetch full sidecar zips for posting to the registry — it needs everything the registry would reject for missing.
In both, the cache makes the fast path fast and the registry provides the source of truth on a miss.
Cross-references¶
- Components and versions — the semantic-versioning rules that decide which versions can resolve.
- How-to: scaffold a component.
- Reference: SimKit CLI —
simkit component buildandregistercommands and their--dep-sourceflag.