✨ feat(manager): add CPA update recommendation status - #818
Merged
Merged
Conversation
Add fixed-source stable CPA discovery, fail-closed persisted recommendation state, and authenticated read/check endpoints. Share the Embedded RuntimeClient with lifecycle reconciliation while keeping all Runtime mutations outside Update01.
Expire cached CPA recommendations after the existing seven-hour freshness window and fail closed on future success timestamps. Resolve External CPA connections for every Runtime observation so setup and connection changes apply without restarting Manager Server. Add the CPA update service to the required race gate.
19 tasks
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
Adds the Update01 Manager-owned, read-only CPA update recommendation/status surface.
Manager now combines fresh Runtime observation with a separately persisted official-stable discovery cache without executing any Runtime mutation.
Baseline:
v2@92b955f70c77012af0e5d7e0558ea2199222c8f2Head:
f51ba65cf9ff947191aaa762bec79d1bd63aa831Scope
Changes
cpaupdateapplication service that owns official stable discovery, semver comparison, capability-aware recommendation policy, and read-only projection.GET /usage-service/runtime/updatesandPOST /usage-service/runtime/updates/checkbehind existing panel/admin authorization withCache-Control: no-store.cpa_update_check_v1; Runtime identity, generation, active artifact, current version, state, and capabilities remain fresh observations.RuntimeClientinstance between CPA update status and lifecycle reconciliation.RuntimeClient.Status()call so initial setup and A-to-B connection changes take effect without a Manager restart.internal/service/cpaupdateto the required Manager race gate and its workflow-integrity assertion.Authority split
targetVersion.Trusted current-version authority
ActiveGatewayArtifactwithengine=cpa, exact canonicalsha256:<64 lowercase hex>artifact identity, and matchingCPAObservedVersion.active_artifact_idfor the future Update02 execution fence.unsupported;CPAObservedVersionalone is never promoted to Embedded update authority.Fixed official source and bounds
https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/latest.vMAJOR.MINOR.PATCHtag.Status matrix
never_checkedupdate_availableup_to_dateahead_of_stableunknown_versionunsupportedmanaged_externallyMissing
prepare_updateoractivate_updateleaves a visible recommendation non-actionable; capability is read only fromRuntimeObservedStatus.Capabilities.External behavior
managed_externallyand always non-actionable.ExternalClient.Status()resolves the current connection source for every observation.Persistence, freshness, and cooldown
cpa_update_check_v1stores schema version, last attempt/success, safe last error, and validated target version only.User Impact
Authenticated Manager clients can inspect trusted CPA current identity/version, official latest stable version, recommendation state, and advertised update capabilities. No UI is added and no update is executed.
Compatibility / Runtime Notes
managed_externally; no mutation support is inferred, and connection setup/switches are observed dynamically.f51ba65cf9ff947191aaa762bec79d1bd63aa831in PR Check run35307419215.Data / Security Notes
manager_update_check_v1; no SQLite schema migration is required.Risk / Rollback
Risk level: Medium
Rollback notes: revert the two feature-branch commits. The additive
cpa_update_check_v1row is inert for older builds and does not alter existing CPAMP self-update state.Verification
Commands / evidence:
GitHub PR Check run
35307419215on exact headf51ba65cf9ff947191aaa762bec79d1bd63aa831:Focused regression evidence:
0.PrepareUpdate,ActivateUpdate,Start,Stop, andRestartpanic; all read/check tests pass with zero mutations.internal/service/updatechecktests pass unchanged as part ofgo test ./....Screenshots / Recordings
N/A — backend-only Update01; no UI changes.
Docs
Docs decision: Update01 exposes a transitional authenticated Manager control surface for later Update03 UI work. It makes no Public API v2 claim and does not change current user documentation.
Scope exclusions
PrepareUpdateorActivateUpdatecall.Start,Stop, orRestartupdate side effect.Attribution check
Commit and PR content contain no AI attribution markers,
Co-authored-by, generated-by footer, or unrelated attribution changes.Related
N/A — implements the approved local
task-v2-update-01-cpa-status-recommendationhandoff plan.