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

76 lines
2.4 KiB
C

#ifndef UNIT_PROFILE_H
#define UNIT_PROFILE_H
#include <stddef.h>
#include <stdint.h>
#define UP_CAPACITY 6
#define UP_BATCH_LIMIT 16
#define UP_VALUE_LIMIT INT64_C(1000000000)
#define UP_DOMAIN_LIMIT INT64_C(1000000)
typedef enum {
UP_OK = 0,
UP_ARG = 1,
UP_MISSING = 2,
UP_FULL = 3,
UP_DOMAIN = 4,
UP_RANGE = 5
} up_status;
typedef struct {
int id;
int numerator;
int denominator;
int64_t offset;
int64_t low;
int64_t high;
int decimals;
} up_profile;
typedef struct {
int64_t accepted;
int64_t rejected;
int has_value;
int64_t minimum;
int64_t maximum;
int64_t sum;
int64_t last;
} up_statistics;
typedef struct {
int occupied;
up_profile profile;
up_statistics statistics;
} up_entry;
typedef struct {
up_entry entries[UP_CAPACITY];
uint32_t revision;
} up_bank;
typedef struct {
uint32_t revision;
size_t count;
int64_t accepted;
int64_t rejected;
} up_summary;
/* Pure profile helpers: invalid/null configuration gives ARG from evaluate.
* Validation returns 1 exactly for the profile domain in the contract.
* Evaluation never updates a bank or writes output after a failure. */
int up_valid_id(int id);
int up_valid_direction(int direction);
int up_valid_input(int64_t input);
int up_profile_valid(const up_profile *profile);
up_status up_evaluate(const up_profile *profile, int direction,
int64_t input, int64_t *output);
/* Bank is always an initialized, non-null caller-owned object. */
void up_initialize(up_bank *bank);
void up_reset(up_bank *bank);
up_status up_define(up_bank *bank, const up_profile *profile);
up_status up_erase(up_bank *bank, int id);
up_status up_lookup(const up_bank *bank, int id, up_profile *profile);
up_status up_statistics_get(const up_bank *bank, int id,
up_statistics *statistics);
up_status up_statistics_clear(up_bank *bank, int id);
up_status up_summary_get(const up_bank *bank, up_summary *summary);
size_t up_enumerate(const up_bank *bank, int *ids, size_t capacity);
up_status up_convert(up_bank *bank, int id, int direction,
int64_t input, int64_t *output);
up_status up_batch(up_bank *bank, int id, int direction,
const int64_t *inputs, size_t count, int64_t *outputs);
up_status up_duplicate(up_bank *bank, int source_id, int destination_id);
#endif