fix(client): harden label pinning and close review findings
- Resolve the Windows admin config via the ProgramData known folder instead of the user-controlled ProgramData variable, so a user cannot redirect the admin lookup and drop pinned labels - vendor rename rewrites matching agent-lib.labels.json entries, so a renamed item keeps its labels instead of going to every client - validate checks the labels file in repositories without a lockfile - A kept modified copy of a deselected item is no longer drift in status, and the toast explains it as "no longer assigned to you" - Labels parser rejects trailing data such as an extra closing brace - Tests: admin pin wiring (config chain, --repo, admin as chosen config), reselect redeploy with byte-level no-op, status labels JSON, validate without lockfile, rename keeps labels - README: document unreadable admin config, drift semantics, rename Refs: agent_lib-fh4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
59735c3b24
commit
ae316860e5
17 files changed
+296
-17
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package client
|
||||
|
||||
import "sort"
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Action is one step of a sync plan.
|
||||
type Action string
|
||||
@@ -20,6 +23,13 @@ const (
|
||||
// ReasonNotSelected explains removals caused by the client's labels.
|
||||
const ReasonNotSelected = "not selected for this client's labels"
|
||||
|
||||
// IsLabelSkip reports whether a skip keeps a modified copy of an item that
|
||||
// is no longer selected for this client's labels. Such a copy blocks no
|
||||
// repository update, so it is not drift.
|
||||
func IsLabelSkip(e PlanEntry) bool {
|
||||
return e.Action == ActSkip && strings.HasPrefix(e.Reason, ReasonNotSelected)
|
||||
}
|
||||
|
||||
// PlanOptions tune planning. Force overwrites/removes locally modified
|
||||
// managed items; Deselected holds manifest keys filtered out by labels.
|
||||
type PlanOptions struct {
|
||||
|
||||
Reference in new issue
Block a user