H-A-112: the composition step's case carries no verdicts
The composer's Case.Verdicts goes (its one writer was the checker); the validate step judges the manifests before the composition step, so caseOf answers the manifests and none words alone. Builds: design 47 H §745; lead answers H-A-112, H-A-108 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -23,8 +23,8 @@ import (
|
||||
|
||||
// The run of a composition step (design 47 G §354, §63, §64, §718; A-226, A-238, A-240, A-252, A-254, A-261): the step reads one
|
||||
// composition run per machine of its candidate (compositionruns.go), and the step that starts a machine's run composes it: one
|
||||
// compose-candidate ask of the node, one composer.Request, depth compose, the one machine and one case `change`, its manifests,
|
||||
// verdicts and seats from the step's catalog revision read through mesh-catalog's `revision`, kept once in `inputs`; one run ask
|
||||
// compose-candidate ask of the node, one composer.Request, depth compose, the one machine and one case `change`, its manifests
|
||||
// and seats from the step's catalog revision read through mesh-catalog's `revision`, kept once in `inputs`; one run ask
|
||||
// of the seat node-build-go, naming no head, its program the node-engine build's catalog entry with the composer's package,
|
||||
// chosen once and recorded in the run. The run's end is heard on the build seat's step-ended of that ask, its answer (a
|
||||
// composer.Verdict) read from `output`, and written in the run's key, whose change every reading step hears. A machine the
|
||||
@@ -188,7 +188,8 @@ func couldNotRun(said string) stepOutcome {
|
||||
}
|
||||
|
||||
// runPrep is what the step that starts a run reads of its catalog revision, once for every machine it starts: the seats, the
|
||||
// case's manifests and verdicts, and the composer program per machine.
|
||||
// case's manifests, and the composer program per machine. The case carries no verdicts: the step validate judged the
|
||||
// manifests before the composition step (design 47 H-A-112, H-A-108).
|
||||
type runPrep struct {
|
||||
r *compositionRun
|
||||
step meshwants.StepRun
|
||||
@@ -196,7 +197,6 @@ type runPrep struct {
|
||||
// read once
|
||||
seats []json.RawMessage
|
||||
manifests map[string]composer.Manifest
|
||||
verdicts map[string]json.RawMessage
|
||||
none map[string]string
|
||||
programOf func(node string) (buildstep.RunProgram, string, error)
|
||||
err error
|
||||
@@ -212,7 +212,7 @@ func (p *runPrep) get(ctx context.Context) error {
|
||||
if p.seats, p.err = p.r.seats(ctx, half.Revision.Definitions); p.err != nil {
|
||||
return
|
||||
}
|
||||
if p.manifests, p.verdicts, p.none, p.err = caseOf(half); p.err != nil {
|
||||
if p.manifests, p.none, p.err = caseOf(half); p.err != nil {
|
||||
return
|
||||
}
|
||||
p.programOf, p.err = p.r.programs(ctx, half)
|
||||
@@ -244,7 +244,7 @@ func (r *compositionRun) start(ctx context.Context, key string, run meshwants.Co
|
||||
return
|
||||
}
|
||||
req := composer.Request{V: composer.Version, Input: in.Body, Depth: composer.DepthCompose, Machines: []string{node},
|
||||
Cases: []composer.Case{{Name: changeCase, Manifests: prep.manifests, Verdicts: prep.verdicts, None: prep.none}}, Seats: prep.seats,
|
||||
Cases: []composer.Case{{Name: changeCase, Manifests: prep.manifests, None: prep.none}}, Seats: prep.seats,
|
||||
BlameTries: r.runs.set.blameTries} // the composer's bound of its search for culprits (§721, A-466r)
|
||||
raw, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
@@ -479,12 +479,10 @@ func (r *compositionRun) seatAt(ctx context.Context, seat, digest string) (json.
|
||||
return def, nil
|
||||
}
|
||||
|
||||
// caseOf is the case's manifests, verdicts and none from the revision's entries: each manifest whole, the verdict of each one not
|
||||
// accepted (a module without one is accepted), and the revision's none words of each module it gives no fingerprint, whose
|
||||
// build can never be made (design 47 G A-470j, A-470k).
|
||||
func caseOf(half mcc.Half) (map[string]composer.Manifest, map[string]json.RawMessage, map[string]string, error) {
|
||||
// caseOf is the case's manifests and none from the revision's entries: each manifest whole, and the revision's none words of each
|
||||
// module it gives no fingerprint, whose build can never be made (design 47 G A-470j, A-470k). It sets no verdicts (H-A-112).
|
||||
func caseOf(half mcc.Half) (map[string]composer.Manifest, map[string]string, error) {
|
||||
manifests := map[string]composer.Manifest{}
|
||||
verdicts := map[string]json.RawMessage{}
|
||||
var none map[string]string
|
||||
for name, e := range half.Entries {
|
||||
if len(e.Manifest) == 0 {
|
||||
@@ -492,7 +490,7 @@ func caseOf(half mcc.Half) (map[string]composer.Manifest, map[string]json.RawMes
|
||||
}
|
||||
raw, err := json.Marshal(e.Manifest)
|
||||
if err != nil {
|
||||
return nil, nil, nil, fmt.Errorf("the manifest of %s cannot be encoded: %w", name, err)
|
||||
return nil, nil, fmt.Errorf("the manifest of %s cannot be encoded: %w", name, err)
|
||||
}
|
||||
manifests[name] = composer.Manifest{Raw: raw}
|
||||
if e.Fp == "" && e.None != "" {
|
||||
@@ -501,34 +499,8 @@ func caseOf(half mcc.Half) (map[string]composer.Manifest, map[string]json.RawMes
|
||||
}
|
||||
none[name] = e.None
|
||||
}
|
||||
if e.Verdict == "" || e.Verdict == mcc.VerdictAccepted {
|
||||
continue
|
||||
}
|
||||
v := caseVerdict{V: 1, Module: name, State: e.Verdict}
|
||||
if e.Verdict != mcc.VerdictRefused {
|
||||
v.State = mcc.VerdictManifestWaits
|
||||
}
|
||||
if e.Inputs != nil {
|
||||
v.Problems, v.Unknown, v.Warnings = e.Inputs.Problems, e.Inputs.Unknown, e.Inputs.Warnings
|
||||
}
|
||||
raw, err = json.Marshal(v)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
verdicts[name] = raw
|
||||
}
|
||||
return manifests, verdicts, none, nil
|
||||
}
|
||||
|
||||
// caseVerdict is a manifest's verdict as the composer's case reads it, by an entry's own verdict: the form the seat mesh-catalog's
|
||||
// state verdicts had, which left the seat with the take-in's validation (design 47 H §745, H-A-79).
|
||||
type caseVerdict struct {
|
||||
V int64 `json:"v,omitempty"`
|
||||
Module string `json:"module"`
|
||||
State string `json:"state"`
|
||||
Problems []string `json:"problems,omitempty"`
|
||||
Unknown []string `json:"unknown,omitempty"`
|
||||
Warnings []string `json:"warnings,omitempty"`
|
||||
return manifests, none, nil
|
||||
}
|
||||
|
||||
// nodeEngineEntry is the entry of the module that claims the seat node-engine, or false.
|
||||
|
||||
@@ -157,7 +157,7 @@ func newRunStand(t *testing.T, revisionEngine, trunkEngine, seatDigest string) *
|
||||
}
|
||||
|
||||
// Design 47 G §354, §63, §64, A-226, A-238, A-240, A-243, A-252, A-254, A-261: one request and one run ask per machine, the request
|
||||
// depth compose with the one machine and one case `change`, its manifests, verdicts and seats from the step's revision; the
|
||||
// depth compose with the one machine and one case `change`, its manifests and seats from the step's revision, no verdicts (H-A-112); the
|
||||
// composer is the node-engine build each machine runs, its entry read through `entry`, or the revision's where it differs from the
|
||||
// trunk's, or the revision's for a machine whose node-engine is not heard running (A-451); the run's verdict is read from its step-ended; a machine away passes with a warning, one not composing fails the step.
|
||||
func TestTheCompositionStepRunsOneAskPerMachine(t *testing.T) {
|
||||
@@ -185,8 +185,7 @@ func TestTheCompositionStepRunsOneAskPerMachine(t *testing.T) {
|
||||
t.Errorf("the request of ace %+v", req)
|
||||
}
|
||||
c := req.Cases[0]
|
||||
if string(c.Manifests["m"].Raw) != `{"module":"m"}` || len(c.Manifests) != 4 || len(c.None) != 1 || c.None["lidarr"] != "builders disagree: node" || len(c.Verdicts) != 1 || !strings.Contains(string(c.Verdicts["bad"]), `"refused"`) ||
|
||||
!strings.Contains(string(c.Verdicts["bad"]), "no seat x") {
|
||||
if string(c.Manifests["m"].Raw) != `{"module":"m"}` || len(c.Manifests) != 4 || len(c.None) != 1 || c.None["lidarr"] != "builders disagree: node" || len(c.Verdicts) != 0 {
|
||||
t.Errorf("the case %+v %s", c.Manifests, c.Verdicts)
|
||||
}
|
||||
if strings.Join(s.entries, " ") == "" {
|
||||
|
||||
Reference in New Issue
Block a user