Summary
pklrun (introduced in #494) auto-runs pkl project resolve only when PklProject.deps.json is absent. It keys off file existence, not freshness — so editing a PklProject's dependencies without deleting deps.json leaves stale resolved deps in place and they are used silently.
This was an explicit, accepted scope decision for #494 (D1: resolve-only-if-missing). This issue tracks closing the staleness gap as a follow-up.
Symptom
- Resolve a project once →
PklProject.deps.json is created.
- Edit
PklProject: add / bump / remove a dependencies { ... } entry.
- Run
formae apply / eval again.
- Old resolved deps are used. New dep appears "not found" or pinned to the wrong version. Only fix today is manually
rm PklProject.deps.json.
Where
pkg/plugin/pklrun/pklrun.go — ensureProjectResolved checks os.Stat(deps) and returns early if it exists.
Options
- Compare mtimes: re-resolve when
PklProject is newer than PklProject.deps.json.
- Hash the
dependencies block and store/compare alongside deps.json.
- Escape hatch: a
--resolve/--force-resolve flag or FORMAE_PKL_RESOLVE=always env var.
mtime comparison is the cheapest correct default; the env/flag is a useful complement for "always re-resolve" workflows.
Out of scope
Concurrency hardening of the resolve write (parallel applies racing on deps.json) is a separate concern — tracked elsewhere.
Refs
Summary
pklrun(introduced in #494) auto-runspkl project resolveonly whenPklProject.deps.jsonis absent. It keys off file existence, not freshness — so editing aPklProject's dependencies without deletingdeps.jsonleaves stale resolved deps in place and they are used silently.This was an explicit, accepted scope decision for #494 (D1: resolve-only-if-missing). This issue tracks closing the staleness gap as a follow-up.
Symptom
PklProject.deps.jsonis created.PklProject: add / bump / remove adependencies { ... }entry.formae apply/evalagain.rm PklProject.deps.json.Where
pkg/plugin/pklrun/pklrun.go—ensureProjectResolvedchecksos.Stat(deps)and returns early if it exists.Options
PklProjectis newer thanPklProject.deps.json.dependenciesblock and store/compare alongsidedeps.json.--resolve/--force-resolveflag orFORMAE_PKL_RESOLVE=alwaysenv var.mtime comparison is the cheapest correct default; the env/flag is a useful complement for "always re-resolve" workflows.
Out of scope
Concurrency hardening of the resolve write (parallel applies racing on
deps.json) is a separate concern — tracked elsewhere.Refs
pklrun+ auto-resolve)