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

87 lines
2.4 KiB
C

#ifndef SCAN_H
#define SCAN_H
#include <stddef.h>
#include <stdint.h>
#define SCAN_CAPACITY 32u
#define SCAN_EVENT_CAPACITY 64u
#define SCAN_LIMIT 1000000u
#define SCAN_HASH_MOD 1000000007u
typedef enum {
SCAN_EXECUTE = 0,
SCAN_PREVIEW = 1
} ScanMode;
typedef enum {
SCAN_ACCEPT = 0,
SCAN_INACTIVE = 1,
SCAN_FUTURE = 2,
SCAN_PRIORITY = 3,
SCAN_BUDGET = 4,
SCAN_CREDIT = 5,
SCAN_OUTSIDE = 6
} ScanDecision;
typedef enum {
EVENT_VISIT = 1,
EVENT_COMMIT = 2
} EventKind;
typedef struct {
uint32_t id;
uint32_t units;
uint32_t ready;
uint32_t priority;
uint32_t active;
} ScanJob;
typedef struct {
ScanJob jobs[SCAN_CAPACITY];
size_t count;
uint32_t now;
uint64_t credits;
uint64_t revision;
uint64_t delivered;
} ScanStore;
typedef struct {
uint32_t kind;
uint32_t slot;
uint32_t id;
uint32_t units;
uint32_t decision;
} ScanEvent;
typedef struct {
ScanEvent events[SCAN_EVENT_CAPACITY];
size_t count;
int overflow;
} ScanPort;
typedef struct {
uint32_t begin;
uint32_t end;
uint32_t minimum_priority;
uint64_t budget;
uint32_t mode;
} ScanRequest;
typedef struct {
uint32_t visits;
uint32_t selected;
uint64_t units;
uint64_t digest;
} ScanResult;
void store_reset(ScanStore *store);
int store_configure(ScanStore *store, size_t count, uint64_t credits, uint32_t now);
int store_install(ScanStore *store, size_t slot, const ScanJob *job);
int store_set_clock(ScanStore *store, uint32_t now, uint64_t credits);
const ScanJob *store_job(const ScanStore *store, size_t slot);
int store_commit(ScanStore *store, size_t slot);
uint64_t store_active_mask(const ScanStore *store);
uint64_t store_fingerprint(const ScanStore *store);
int store_valid(const ScanStore *store);
void port_reset(ScanPort *port);
void port_visit(ScanPort *port, size_t slot, const ScanJob *job, ScanDecision decision);
void port_commit(ScanPort *port, size_t slot, const ScanJob *job);
int request_valid(const ScanStore *store, const ScanRequest *request);
ScanDecision scan_decision(const ScanStore *store, const ScanJob *job,
uint32_t floor, uint64_t budget, uint64_t credit);
uint64_t scan_digest(uint64_t previous, const ScanJob *job, size_t slot);
int scan_run(ScanStore *store, ScanPort *port,
const ScanRequest *request, ScanResult *result);
#endif