A removal of a replacement names both fingerprints; the two-texts refusal names the places and the way out

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 23:19:03 +01:00
parent 80f992e367
commit aa7c9e8924
2 changed files with 31 additions and 12 deletions
@@ -215,6 +215,11 @@ func (p Proposal) glanceAsk() oc.Ask {
}
fmt.Fprintf(&d, "Proposed through the claude-code module on %s at %s UTC. %s has the fingerprint %s.",
p.From, p.At.UTC().Format("15:04 on 2 Jan"), removes, print)
if p.Over != "" && p.Digest != p.Over {
// A replacement is removed with the registered text it stands over: both fingerprints, the replacement's
// being the text sessions read.
fmt.Fprintf(&d, " The replacement sessions read, which it also removes, has the fingerprint %s.", p.Fingerprint())
}
} else {
if whole {
d.WriteString("The text:\n" + shown + "\n")
@@ -1352,25 +1357,33 @@ func registeredSection(p Paths, scope string, nodes []string, name string) (stri
_ = readJSON(p.config(), &items)
c := ConfigOf(Taken(items))
c.Terminal, _ = terminalText(p)
layers := [][]Item{c.Mesh, c.Terminal}
type place struct {
items []Item
says string
}
places := []place{{c.Mesh, "registered for the mesh (unregister it with claude_code_instructions_unregister, scope mesh, name " + name + ")"},
{c.Terminal, "set at the controller's terminal (its instructions setting)"}}
if scope == ScopeNode {
layers = [][]Item{c.Node, c.Terminal}
places = []place{{c.Node, "registered for this node (unregister it with claude_code_instructions_unregister, scope node, name " + name + ")"},
{c.Terminal, "set at the controller's terminal (its instructions setting)"}}
if !contains(nodes, p.Node) {
layers = [][]Item{c.Terminal}
places = places[1:]
}
}
digest := ""
for _, layer := range layers {
for _, it := range layer {
var holding []string
for _, pl := range places {
for _, it := range pl.items {
if it.Kind != KindInstructions || it.Name != name {
continue
}
d := textDigest(it.Files[name+".md"])
if digest != "" && d != digest {
return "", fmt.Errorf("the section %q is registered with different texts (for the mesh and at the controller's terminal); "+
"remove one of them first", name)
return "", fmt.Errorf("the section %q is registered with different texts: %s and %s; an approval is bound to one text, "+
"so unregister one of them first", name, strings.Join(holding, ", "), pl.says)
}
digest = d
holding = append(holding, pl.says)
}
}
return digest, nil