Make repository refresh policy explicit - #52
Merged
Conversation
Repository-dependent commands now share one visible refresh contract instead of resolving against metadata according to command-specific behavior. Automatic interval refresh remains the rolling-release default, while forced and suppressed refresh are explicit and standalone sync is strict. Verified cached metadata remains available when ordinary refresh attempts fail, search can preserve partial results, and per-repository publication prevents concurrent refreshes from colliding. The sync-ttl spelling remains readable for compatibility, but sync-interval is the durable name because elapsed time triggers refresh rather than invalidating a cache.
Repository selection, refresh policy, verification, and outcomes now have one owner shared by package resolution, search, and standalone sync. This prevents command-specific semantics from drifting while preserving availability-first cached fallback and strict explicit synchronization. CLI commands now parse common flags, establish transfer adapters, and render structured core outcomes rather than owning repository policy.
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.
Repository-dependent commands currently disagree about when signed metadata is refreshed: search does not apply the configured interval, normal operations cannot suppress refresh precisely, and there is no strict operation for callers that need refresh failure to be observable. Review should establish one durable synchronization contract rather than judge command-specific fixes.
This change keeps automatic interval-based refresh as the rolling-release default and applies it consistently to install, upgrade, uninstall, and search.
--syncforces an attempt while ordinary commands retain verified-cache fallback;--no-syncsuppresses metadata refresh without preventing package archive downloads. The two flags are mutually exclusive.mere sync [repositories...]is the strict form. It refreshes all enabled or named repositories, reports each failure, preserves the prior verified cache, and exits nonzero when any requested source fails. Search warns and returns partial results when at least one verified repository remains usable.Refresh check, download, verification, and atomic publication are serialized per repository, so unrelated repositories do not share a global lock and concurrent writers cannot collide on staging paths. Future last-sync timestamps no longer suppress refresh indefinitely.
Configuration now writes and documents
sync-interval; existingsync-ttlinput remains readable as a compatibility alias because elapsed time triggers an attempt rather than invalidating verified metadata.Proof is inspectable in workflow run
a951a1d3-f57e-438a-9213-3b99342bf7cd: 762 tests passed with 2 skipped, the-Dcpu=baselinebuild passed, and the built CLI describe smoke passed.