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

81 lines
2.1 KiB
C

#ifndef LINKBUF_H
#define LINKBUF_H
#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#define LB_MAX_NODES 64
#define LB_MAX_QUERIES 128
#define LB_MAX_PATH 128
#define LB_MAX_TARGET 512
#define LB_MAX_ROWS 512
#define LB_LINE 1400
typedef enum {
LB_LINK = 1,
LB_FILE = 2
} lb_kind;
typedef enum {
LB_OK = 0,
LB_TRUNCATED = 1,
LB_MISSING = 2,
LB_NOTLINK = 3,
LB_NOMEM = 4
} lb_status;
typedef struct {
char path[LB_MAX_PATH];
lb_kind kind;
unsigned char target[LB_MAX_TARGET];
size_t length;
} lb_node;
typedef struct {
size_t initial_capacity;
size_t maximum_capacity;
size_t repetitions;
size_t node_count;
size_t query_count;
lb_node nodes[LB_MAX_NODES];
char queries[LB_MAX_QUERIES][LB_MAX_PATH];
} lb_graph;
typedef struct {
char path[LB_MAX_PATH];
lb_status status;
unsigned char target[LB_MAX_TARGET];
size_t length;
} lb_row;
typedef struct {
size_t row_count;
lb_row rows[LB_MAX_ROWS];
size_t total_length;
size_t ok_count;
size_t truncated_count;
size_t missing_count;
size_t notlink_count;
size_t nomem_count;
unsigned long checksum;
} lb_report;
typedef struct {
size_t allocations;
size_t releases;
size_t live_blocks;
size_t live_bytes;
size_t peak_bytes;
size_t read_calls;
size_t bad_releases;
} lb_metrics;
int lb_normalize(const char *input, char output[LB_MAX_PATH]);
int lb_load(FILE *stream, lb_graph *graph, char *error, size_t size);
const lb_node *lb_find(const lb_graph *graph, const char *path);
void lb_sort_nodes(lb_graph *graph);
int lb_collect(const lb_graph *graph, lb_report *report);
void lb_summarize(lb_report *report);
const char *lb_status_name(lb_status status);
unsigned long lb_target_checksum(const unsigned char *data, size_t length);
void lb_port_begin(const lb_graph *graph);
void *lb_port_allocate(size_t size);
void lb_port_release(void *pointer);
ssize_t lb_port_readlink(const char *path, void *buffer, size_t capacity);
lb_metrics lb_port_metrics(void);
void lb_port_end(void);
#endif