Fix template update status for local sources and version-stamp the status cache - #96
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
local:templates against their source path on disk (not the copied git origin), soupdate availablereflects the source directory the template was saved from; adds asource missingstatus when that path is gone.__status.jsonand refresh it when written by a differentspecsversion, so a status-check logic fix takes effect on the nextlistafter an upgrade instead of waiting out the 24h staleness window.ErrLocalSourceMissing.git,template,registry, andcmd; docs + README updated.Notes