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
42 lines
1.6 KiB
Go
42 lines
1.6 KiB
Go
package check
|
|
|
|
import (
|
|
"context"
|
|
"mesh-delivery-checker/rules"
|
|
)
|
|
|
|
// A pull request whose head's seat definition does not parse fails its check, naming the seat and where it lives (design
|
|
// 26; the lead's ruling on A2i's finding 1): the indexer keeps such a definition as the pull request's entry of its state
|
|
// seat-definitions with `unparsed` set, and cannot refuse the manifest itself, whose digest the trunk may share.
|
|
|
|
// UnparsedSeat is one seat definition of a pull request's head that does not parse (rules.UnparsedSeat).
|
|
type UnparsedSeat = rules.UnparsedSeat
|
|
|
|
// SeatDefinitions reads the indexer's seat definitions of one pull request (its state seat-definitions, through its
|
|
// first view, DLV-M2).
|
|
type SeatDefinitions interface {
|
|
Unparsed(ctx context.Context, repository string, pull int) ([]UnparsedSeat, error)
|
|
}
|
|
|
|
// refuseUnparsed records, of each pull request, the indexer's seat definitions of its head that do not parse, or why
|
|
// they cannot be read, as a fact the rules judge (rules.JudgeUnparsed).
|
|
func (st *state) refuseUnparsed(ctx context.Context) {
|
|
if st.j.SeatDefinitions == nil || st.c.Try != nil {
|
|
return
|
|
}
|
|
for _, p := range st.c.Pulls {
|
|
u := rules.Unparsed{Key: pullKey(p)}
|
|
bad, err := st.j.SeatDefinitions.Unparsed(ctx, p.Repository, p.Number)
|
|
if err != nil {
|
|
u.Unread = err.Error()
|
|
}
|
|
u.Seats = bad
|
|
if u.Unread != "" || len(u.Seats) > 0 {
|
|
st.facts = append(st.facts, rules.Step{Repository: p.Repository, Number: p.Number, Unparsed: &u})
|
|
}
|
|
}
|
|
}
|
|
|
|
// SeatDefinitionsMachine names what refused a seat definition in a verdict's failure.
|
|
const SeatDefinitionsMachine = rules.SeatDefinitionsMachine
|