The channel refuses a raised condition whose explanation does not open with "Needs you: " and its needs, so seven of grants' conditions, among them first-view-unanswered, never reached the operator. One helper now writes both, and every condition the unit tests say passes the channel's own check. Claude-Session: https://claude.ai/code/session_01NcbgfFfQ4Z9UE5jK32PmE5
21 lines
794 B
Go
21 lines
794 B
Go
package grants
|
|
|
|
import (
|
|
"strings"
|
|
|
|
occ "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/clients/operatorchannelclient"
|
|
oc "git.novox.be/novox/mesh-contracts/operator-and-conversation/go/seats/operatorchannel"
|
|
)
|
|
|
|
// needsYou sets what a raised condition needs of the operator and its explanation: the channel takes a condition whose
|
|
// explanation opens with "Needs you: " and those very words (operatorchannelclient.EncodeCondition, novox/hq ADR 0253 §1),
|
|
// and refuses any other, so the operator would never see it. rest is the explanation after them.
|
|
func needsYou(c *oc.Condition, needs, rest string) {
|
|
c.Needs = needs
|
|
sep := ". "
|
|
if strings.HasSuffix(needs, "?") || strings.HasSuffix(needs, ".") {
|
|
sep = " "
|
|
}
|
|
c.Explanation = occ.NeedsYou + needs + sep + rest
|
|
}
|