The builder, checker, view and watchman read a step key as SD4 has it: ParseStepKey answers asker, node and id

The join with CT-SD4 (6351e988) gives ParseStepKey four values (G §484, §649); the callers that read only the node or the id follow.

Builds: design 47 G §484, §649

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 21:16:18 +01:00
parent 57a4397c90
commit 497f87176b
5 changed files with 5 additions and 5 deletions
@@ -48,7 +48,7 @@ func (r Runner) Run(ctx context.Context, module, node, tool string, args map[str
if answer.Key == "" {
return nil, fmt.Errorf("%s on %s answered no step key: %s", tool, node, raw)
}
if n, _, err := buildstep.ParseStepKey(answer.Key); err != nil || n != node {
if _, n, _, err := buildstep.ParseStepKey(answer.Key); err != nil || n != node {
return nil, fmt.Errorf("%s on %s answered the step key %q, which is not a key of that node", tool, node, answer.Key)
}
wait, cancel := context.WithTimeoutCause(ctx, r.Bound, fmt.Errorf("the step %s did not end within %s", answer.Key, r.Bound))
@@ -325,7 +325,7 @@ func (r StuckReader) Stuck(module string) (map[string]any, error) {
}
byID := make(map[string]string, len(ks))
for _, k := range ks {
if _, id, err := buildstep.ParseStepKey(k); err == nil {
if _, _, id, err := buildstep.ParseStepKey(k); err == nil {
byID[id] = k
}
}
@@ -60,7 +60,7 @@ func capKeys(keys []string, narrow string) ([]string, string) {
// longer id is the later and equal lengths compare as text. A key that is no step key goes last.
func newestFirst(keys []string) {
id := func(k string) (string, bool) {
_, id, err := buildstep.ParseStepKey(k)
_, _, id, err := buildstep.ParseStepKey(k)
return id, err == nil
}
sort.Slice(keys, func(i, j int) bool {
@@ -339,7 +339,7 @@ func (u UsageReader) Usage() UsageAnswer {
}
var recent []keyAt
for _, k := range keys {
_, id, err := buildstep.ParseStepKey(k)
_, _, id, err := buildstep.ParseStepKey(k)
if err != nil {
continue
}
@@ -33,7 +33,7 @@ func (w *Watchman) Step(language, key string, value []byte, op Op) {
w.say("no pulse for the step %s: %v", key, err)
return
}
node, id, err := buildstep.ParseStepKey(key)
_, node, id, err := buildstep.ParseStepKey(key)
if err != nil {
return
}