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
39 lines
1.2 KiB
Go
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
|
|
}
|