Files
mesh-delivery/modules/mesh-delivery-checker/rules/names.go
T
jschoubben 2159375873 Merge the trunk: B0's facts and checking program carry the registry's steps (issue 1921, milestone 47/G D3-D11)
B0's shape wins: the running checker asks and records facts, the checking program
decides. The registry's types win: the rules and the program read the generated
checker contract and the domain SDK, and no mesh-sdk delivery import is left.
The registry's series, renames and unparsed seat definitions become facts with
their refusals as rules; the tagged versions ride on the case. The program reads
the heads' seat definitions through sdk/seatdefs and the running checker lays them
over its reader's list by seat, reading no file of the heads: the reader's list
is larger than a run input's bound.

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
2026-11-07 02:57:21 +01:00

39 lines
1.2 KiB
Go

package rules
import checker "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshdeliverychecker"
// FailedFirst names what failed: a test (its package and name) or a machine, with the words of the failure. It is the shape
// of the verdict's `failed` and of each entry of its `failures` (the seat's two types of it have the same fields), so the
// rules judge with one and convert at the verdict's edge (failureItems, failedList).
type FailedFirst = checker.VerdictsByGroupHeadsValueFailed
func failureItems(list []FailedFirst) []checker.VerdictsByGroupHeadsValueFailuresItem {
if list == nil {
return nil
}
out := make([]checker.VerdictsByGroupHeadsValueFailuresItem, len(list))
for i, f := range list {
out[i] = checker.VerdictsByGroupHeadsValueFailuresItem(f)
}
return out
}
func failedList(items []checker.VerdictsByGroupHeadsValueFailuresItem) []FailedFirst {
if items == nil {
return nil
}
out := make([]FailedFirst, len(items))
for i, f := range items {
out[i] = FailedFirst(f)
}
return out
}
// failedOf is the first failure a verdict names: the zero value of a verdict that names none.
func failedOf(v checker.VerdictsByGroupHeadsValue) FailedFirst {
if v.Failed == nil {
return FailedFirst{}
}
return *v.Failed
}