Skip to content

Fix template update status for local sources and version-stamp the status cache - #96

Merged
Ilyes512 merged 5 commits into
mainfrom
fix/template-update-status
Jul 15, 2026
Merged

Fix template update status for local sources and version-stamp the status cache#96
Ilyes512 merged 5 commits into
mainfrom
fix/template-update-status

Conversation

@Ilyes512

Copy link
Copy Markdown
Member

Summary

  • Check local: templates against their source path on disk (not the copied git origin), so update available reflects the source directory the template was saved from; adds a source missing status when that path is gone.
  • Version-stamp __status.json and refresh it when written by a different specs version, so a status-check logic fix takes effect on the next list after an upgrade instead of waiting out the 24h staleness window.
  • Upgrade local templates by re-copying from their source path (previously always skipped); missing source path errors as ErrLocalSourceMissing.
  • Tests across git, template, registry, and cmd; docs + README updated.

Notes

Ilyes512 added 5 commits July 15, 2026 18:47
Record the specs CLI version that wrote each __status.json and add
TemplateStatus.NeedsRefresh, which treats a cached status as needing a
re-check when it is stale OR was written by a different specs version.
This lets a status-check logic fix take effect on the first list after
an upgrade instead of waiting out the 24-hour staleness window.
Local templates (Repository "local:<path>") have their source of truth
on disk, not a git remote. CheckLocalSource compares the source path's
current git-describe (commit + version) against the values recorded when
the template was saved, reporting up-to-date, an available version, or a
new source-missing error kind when the path is gone or no longer a repo.
Route local: templates to CheckLocalSource instead of the copied git
origin, so "update available" reflects the source directory on disk
rather than an unrelated remote. Stamp the running specs version on every
written status and refresh via NeedsRefresh, and render the source-missing
label in the Status column.
registry.Upgrade previously skipped every local template. It now re-copies
a git-backed local template from its source directory when that path has
moved ahead, preserving the original Created timestamp and dropping the
stale status. A missing source path returns ErrLocalSourceMissing; a
non-git local directory remains untrackable (IsLocal).
Explain in the README and architecture/command docs that remote templates
are checked against their remote while local templates are checked against
their source path, describe the source-missing status, and note that cached
statuses refresh when stale or written by a different specs version.
@Ilyes512
Ilyes512 merged commit 52ac0f1 into main Jul 15, 2026
5 checks passed
@Ilyes512
Ilyes512 deleted the fix/template-update-status branch July 15, 2026 17:11
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