feat(campaign): make the label source a cell dimension

A 2x2 of policy against labelling needs the runner to express both factors.
It could only express the policy, so half the factorial had to go through
--extra, where the manifest would not record what was actually run.

Rejected at parse rather than on dispatch: a sweep that finds the bad value
on run 1 of 40 has already spent a cell's worth of device time.

Claude-Session: https://claude.ai/code/session_01A5KmftdEJ49A9z5mF5ESrX
This commit is contained in:
pj committed 2026-08-15 13:32:05 +05:30
1 parent d987526e47
commit ff2de344e9
3 files changed
+43

No files matched your search

@@ -343,6 +343,28 @@ func TestRunCampaign_ContinuesAfterFailingRun(t *testing.T) {
}
}
func TestRunCampaign_GivesEveryRunTheCellsLabelSource(t *testing.T) {
directory := t.TempDir()
configuration := testConfiguration(t, directory, "--seeds", "1-3", "--label-source", "resource-id")
var mutex sync.Mutex
var dispatched []string
executor := versionAnswering(func(_ context.Context, _ string, arguments []string, _ io.Writer) (int, error) {
mutex.Lock()
dispatched = append(dispatched, argumentValue(arguments, "--label-source"))
mutex.Unlock()
writeFakeRun(t, arguments, []trace.Step{observedStep(1)})
return 0, nil
})
if err := runCampaign(context.Background(), configuration, executor, io.Discard); err != nil {
t.Fatal(err)
}
if !slices.Equal(dispatched, []string{"resource-id", "resource-id", "resource-id"}) {
t.Errorf("--label-source reaching sanderling: got %v, want resource-id on every run", dispatched)
}
}
func TestRunCampaign_RefusesToReuseACampaignDirectory(t *testing.T) {
directory := t.TempDir()
configuration := testConfiguration(t, directory)