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

45 lines
1.2 KiB
C

#ifndef RULES_H
#define RULES_H
#include <stddef.h>
#include <stdint.h>
#define RULE_LIMIT 32
#define PATTERN_LIMIT 128
#define MESSAGE_LIMIT 256
#define TERM_LIMIT 128
#define PORT_OK 0
#define PORT_SYNTAX 1
#define PORT_MEMORY 2
#define PORT_ARGUMENT 3
typedef struct compiled_rule compiled_rule;
typedef struct {
int identifier;
int priority;
const unsigned char *pattern;
size_t length;
} rule_input;
typedef struct {
void *state;
size_t count;
unsigned generation;
} rule_bank;
typedef struct {
size_t hits;
int identifier;
int priority;
int input_index;
} rule_result;
typedef struct {
size_t programs;
size_t terms;
} port_usage;
void port_budget(int budget);
int port_compile(const unsigned char *pattern, size_t length, compiled_rule **out);
int port_matches(const compiled_rule *program, const unsigned char *message, size_t length);
void port_release(compiled_rule *program);
port_usage port_current_usage(void);
void bank_init(rule_bank *bank);
int bank_replace(rule_bank *bank, const rule_input *rules, size_t count);
int bank_match(const rule_bank *bank, const unsigned char *message, size_t length, rule_result *out);
void bank_clear(rule_bank *bank);
#endif