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

71 lines
2.1 KiB
C

#ifndef RR_H
#define RR_H
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#define RR_MAX_RESOURCES 8
#define RR_NAME_SIZE 25
#define RR_DATA_SIZE 1024
#define RR_BLOCK_SIZE 64
typedef enum {
RR_OK = 0,
RR_UNAVAILABLE = 1,
RR_TOO_LARGE = 2,
RR_BAD_PLAN = 3
} rr_status;
typedef struct {
char names[RR_MAX_RESOURCES][RR_NAME_SIZE];
size_t count;
} rr_plan;
typedef struct {
unsigned char data[RR_DATA_SIZE];
size_t size;
size_t limit;
uint32_t checksum;
} rr_buffer;
typedef struct {
void *context;
int (*open)(void *, const char *);
ssize_t (*read)(void *, int, unsigned char *, size_t);
int (*close)(void *, int);
} rr_io;
typedef struct {
rr_status status;
int selected;
size_t attempts;
size_t opened;
size_t reads;
size_t closed;
size_t failures;
rr_buffer content;
} rr_result;
int rr_name_valid(const char *name);
void rr_plan_init(rr_plan *plan);
int rr_plan_add(rr_plan *plan, const char *name);
int rr_plan_validate(const rr_plan *plan);
int rr_plan_parse(rr_plan *plan, const char *text);
const char *rr_plan_name(const rr_plan *plan, size_t index);
int rr_plan_find(const rr_plan *plan, const char *name);
int rr_plan_format(const rr_plan *plan, char *text, size_t capacity);
void rr_buffer_init(rr_buffer *buffer, size_t limit);
void rr_buffer_reset(rr_buffer *buffer);
int rr_buffer_append(rr_buffer *buffer, const unsigned char *data, size_t count);
int rr_buffer_hex(const rr_buffer *buffer, char *text, size_t capacity);
uint32_t rr_checksum(const unsigned char *data, size_t count);
void rr_result_init(rr_result *result, size_t limit);
int rr_read_plan(const rr_plan *plan, const rr_io *io, size_t limit,
size_t block, rr_result *result);
const char *rr_status_name(rr_status status);
int rr_buffer_copy(rr_buffer *destination, const rr_buffer *source);
int rr_buffer_slice(const rr_buffer *source, size_t offset, size_t count,
rr_buffer *destination);
int rr_buffer_equal(const rr_buffer *left, const rr_buffer *right);
int rr_buffer_from_hex(rr_buffer *buffer, const char *text, size_t limit);
#endif