amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
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>
2026-10-27 01:55:56 +08:00

53 lines
1.4 KiB
C

#ifndef BORROWED_READER_H
#define BORROWED_READER_H
#include <stddef.h>
#include <stdint.h>
#define RB_LINE_MAX 79
#define RB_NAME_MAX 12
#define RB_VALUE_MAX 1000000
#define RB_INPUT_MAX 16384
#define RB_FNV_START UINT32_C(2166136261)
enum rb_status {
RB_OK = 0,
RB_LIMIT = 1,
RB_BAD_HEADER = 2,
RB_BAD_RECORD = 3,
RB_IO_ERROR = 4
};
typedef int (*rb_read_fn)(void *, int, unsigned char *, size_t);
typedef int (*rb_close_fn)(void *, int);
struct rb_source {
void *context;
int handle;
rb_read_fn read;
rb_close_fn close;
};
struct rb_options {
int strict;
unsigned limit;
};
struct rb_report {
enum rb_status status;
unsigned accepted;
unsigned rejected;
int64_t sum;
int minimum;
int maximum;
uint32_t checksum;
};
struct rb_record {
char name[RB_NAME_MAX + 1];
int value;
};
void rb_report_init(struct rb_report *report);
int rb_record_parse(const unsigned char *line, size_t length,
struct rb_record *record);
void rb_report_accept(struct rb_report *report, const struct rb_record *record,
const unsigned char *line, size_t length);
int rb_line_ignored(const unsigned char *line, size_t length);
const char *rb_status_name(enum rb_status status);
enum rb_status rb_collect(const struct rb_source *source,
const struct rb_options *options,
struct rb_report *report);
#endif