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>
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
#include "observer.h"
|
|
#include "audit.h"
|
|
#include "cli.h"
|
|
#include "stats.h"
|
|
#include "json.h"
|
|
#include <stdio.h>
|
|
|
|
static int execute_job(const Job *job, FILE *output, FILE *trace_stream, Stats *stats, int json)
|
|
{
|
|
Port port;
|
|
Observation out;
|
|
Trace trace;
|
|
int status;
|
|
port_init(&port, job);
|
|
trace_init(&trace, trace_stream, job->id);
|
|
port.trace = &trace;
|
|
trace_begin(&trace, job->mask, job->budget, job->hold);
|
|
if (audit_before(job, &port)) return -1;
|
|
status = observer_run(&port, job, &out);
|
|
if (status) return -1;
|
|
if (audit_after(job, &port, &out)) return -1;
|
|
trace_end(&trace, out.outcome, out.reads);
|
|
if (trace_finish(&trace)) return -1;
|
|
if (json ? json_observation(output, &out) : write_observation(output, &out)) return -1;
|
|
if (stats_add(stats, &out)) return -1;
|
|
return 0;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
Job *jobs = NULL;
|
|
size_t count = 0;
|
|
size_t at;
|
|
Cli cli;
|
|
Stats stats;
|
|
int rc = 0;
|
|
if (cli_open(&cli, argc, argv)) {
|
|
cli_usage(stderr);
|
|
return 2;
|
|
}
|
|
if (read_jobs(cli.input, &jobs, &count)) {
|
|
fputs("invalid input\n", stderr);
|
|
rc = 2;
|
|
goto done;
|
|
}
|
|
if (cli.validate_only) goto done;
|
|
stats_init(&stats);
|
|
for (at = 0; at < count; ++at) {
|
|
if (execute_job(&jobs[at], cli.output, cli.trace, &stats, cli.json)) {
|
|
fputs("observer error\n", stderr);
|
|
rc = 3;
|
|
goto done;
|
|
}
|
|
}
|
|
if (cli.summary && (cli.json ? json_summary(cli.output, &stats) :
|
|
stats_write(cli.output, &stats))) rc = 3;
|
|
done:
|
|
free_jobs(jobs);
|
|
if (cli_close(&cli)) rc = 3;
|
|
return rc;
|
|
}
|