package catalogue import ( "strings" "testing" ) // A run-once container is a step the host runs to completion (novox/hq ADR 0052). The control // plane's part is small and exact: carry the field to the host unchanged, keep the step ahead of // the container it gates in author order, and refuse a malformed run-once near its cause rather // than on the machine. These tests defend that. func TestARunOnceStepMayNameWhatItReads(t *testing.T) { // For a step, restart-on means *run again* when what it reads changed: a gate that fetches a // provider's root names the binding file it reads, so a provider that moved is fetched again // (novox/hq ADR 0099). Accepted here, and the host's digest does the rest. digest := "@sha256:" + strings.Repeat("a", 64) good := []byte(`{"module":"m","resources":[ {"id":"conf","type":"file","path":"/x","content":"y"}, {"id":"seed","type":"container","name":"seed","image":"registry.example/x` + digest + `","run-once":true,"restart-on":["conf"]} ]}`) if _, err := decodeForTest(good); err != nil { t.Errorf("a run-once step naming what it reads was refused: %v", err) } }