One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
#include "route.hpp"
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
namespace route {
|
|
namespace {
|
|
|
|
bool artifact_ready(const Config& config, const Artifact& artifact) {
|
|
return artifact.built && !artifact.path.empty() &&
|
|
artifact.machine == config.target_machine;
|
|
}
|
|
|
|
void fill_observation(TestResult& result, const Observation& observation,
|
|
const Test& test, const Config& config) {
|
|
result.attempted = true;
|
|
result.exit_code = observation.exit_code;
|
|
result.machine = observation.machine;
|
|
result.output = observation.output;
|
|
result.passed = observation.exit_code == 0 &&
|
|
observation.machine == config.target_machine &&
|
|
observation.output == "ran:" + test.input;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
Report execute(const Config& config, const Artifact& artifact,
|
|
const std::vector<Test>& tests, RunPort& port) {
|
|
Report report;
|
|
report.build_ok = artifact_ready(config, artifact);
|
|
report.tests_ok = report.build_ok;
|
|
report.reason = report.build_ok ? "ok" : "build";
|
|
report.tests.reserve(tests.size());
|
|
for (const Test& test : tests) {
|
|
TestResult result;
|
|
result.name = test.name;
|
|
if (report.build_ok) {
|
|
std::vector<std::string> argv;
|
|
std::string error;
|
|
if (command_for(config, artifact, test, argv, error)) {
|
|
const Observation observation = port.invoke(argv, test.input);
|
|
fill_observation(result, observation, test, config);
|
|
}
|
|
if (!result.passed) {
|
|
report.tests_ok = false;
|
|
report.reason = "test";
|
|
}
|
|
}
|
|
report.tests.push_back(std::move(result));
|
|
}
|
|
return report;
|
|
}
|
|
|
|
} // namespace route
|