Files
mesh-delivery/modules/mesh-delivery-checker/internal/check/binaries.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

28 lines
1.3 KiB
Go

package check
import (
"fmt"
"mesh-delivery-checker/rules"
)
// A change that adds or modifies a compiled program fails (issue 1577): it is build output, `go build` in a module's folder
// writes one beside go.mod, and `git add -A` takes it. The build module's fetch step, which holds the merged clone, reads the
// first bytes of each changed file and reports the programs (the build modules' fetch tools); the checker judges the answer.
// checkBinariesOf records what a pull request's first fetch answer read of compiled programs, whichever build module
// gave it, as a fact the rules judge (rules.JudgePrograms). A fetch that made the merge and names no program has none: the
// answer's `programs` is an omitted empty list (B2g), and `merge` tells a preview was made.
func (st *state) checkBinariesOf(t *target) {
key := fmt.Sprintf("%s#%d", t.pull.Repository, t.pull.Number)
if t.fetched.Merge == "" {
return // no merge was made: nothing was changed to judge
}
files := t.fetched.Programs
if files == nil {
files = []ProgramFile{} // reported, and none: the rules refuse nothing (a nil list is a module that reports none)
}
st.facts = append(st.facts, rules.Step{Repository: t.pull.Repository, Number: t.pull.Number, Module: t.module, Node: t.node,
Programs: &rules.Programs{Key: key, Files: &files}})
}