mesh-issues: take every condition key the controller raises, a delivery's with its slash among them (hq issue 475)
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate pass: builds mesh-issues → novox; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)

The tracker's own pattern refused the slash a delivery's id carries, so no issue
could track a delivery's condition and the operator's alert kept saying no issue
tracks it. Mirror the controller's key rule instead of a pattern of our own; a
router test proves a slashed key is matched and named end to end.
This commit is contained in:
2026-10-11 19:22:18 +02:00
parent fccad8c0a6
commit 7714f164c3
4 changed files with 136 additions and 8 deletions
@@ -0,0 +1,55 @@
package main
import (
"strings"
"testing"
)
// A condition link takes every key the controller raises (novox/hq issue 475). The keys are real: the delivery's
// as `mesh-controller.status` named it when the link was refused, the others as `mesh-controller.conditions`
// answered on 2026-10-11.
var realConditionKeys = []string{
"delivery.novox/mesh-controller_d2e9dc61590f.stalled", // a delivery's id carries its repository, owner/name
"machine.novox.telegram.telegram-token.secret-given",
"module.openrazer.shanks.relogin-needed",
"mesh.hand-acts.plans_go.healer-wanted", // a space in the id, made `_` by the controller
"delivery.leaf.over-budget",
}
func TestAConditionLinkTakesEveryKeyTheControllerRaises(t *testing.T) {
h := newHarness(t)
n := h.open(t, "a delivery stalls", "mesh-catalog")
for _, k := range realConditionKeys {
if _, err := h.Link(LinkAsk{Number: n, Kind: LinkCondition, Target: k}); err != nil {
t.Errorf("%s: %v", k, err)
}
}
got, err := h.Tracking([]string{realConditionKeys[0]})
if err != nil {
t.Fatal(err)
}
if is := got.Conditions[realConditionKeys[0]]; len(is) != 1 || is[0].Number != n || got.Said != "Issues track 1 condition." {
t.Fatalf("the delivery's condition is not said tracked: %+v", got)
}
}
// What the controller never raises is refused, so a link never names a condition that cannot exist.
func TestAConditionLinkRefusesWhatTheControllerNeverRaises(t *testing.T) {
for _, k := range []string{
"",
"delivery.stalled", // no id: a key is scope, id and kind
"weather.novox.rain", // no scope the controller knows
"machine..secret-given", // an empty token
"machine.novox.secret given", // a space the controller makes `_`
"machine.novox:1.secret-given", // a colon the controller makes `_`
"delivery.novox/mesh-controller@d2e9dc61590f.stalled", // `@` too
"machine.*.silent", // a wildcard on the bus
"machine.>", // a wildcard on the bus
"machine.ace.silent\nmore", // a second line
"machine." + strings.Repeat("a", 300) + ".silent",
} {
if _, err := checkTarget(LinkCondition, k); err == nil {
t.Errorf("%q was taken as a condition's key", k)
}
}
}