Batch 21 (20261027-A-bos-redo-21) rebuilt 40 of the 53 rejected Bos-qiao environments: hidden assertions that ran inside the candidate's process now run in a trusted parent that reads observations from a low-UID worker; gold bytes are unchanged. 9 were excluded for scope (ROS2, oversize, security core), 3 are blocked because the source requires an exec bit the platform does not freeze, 1 lacks requests/bs4 in trace6. Batch 18 (20261026-C-hwe-codegen-18) adds its last 34 of 134 tasks; the first 100 landed in 2f32624d. Claude reviewed 74/74 USABLE against current digests, canonical families, no ID or source overlap with main, plain public docs. Only the new task directories are taken; the stale pre-batch-20 copies of concur-release-capsule and resource-temp-link on the batch 21 branch and both branches' progress notes stay as main has them. Difficulty is unmeasured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
#ifndef EEPROM_HPP
|
|
#define EEPROM_HPP
|
|
#include <cstdint>
|
|
#include <iosfwd>
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
namespace eeprom {
|
|
using Number = std::int64_t;
|
|
enum class Code { OK, RANGE, EXISTS, ABSENT, BUSY, TIMEOUT, SYNTAX, LIMIT };
|
|
struct Reply {
|
|
Code code = Code::OK;
|
|
Number completed = 0;
|
|
std::vector<Number> data;
|
|
};
|
|
struct Snapshot {
|
|
Code code = Code::OK;
|
|
Number cursor = 0;
|
|
Number busy = 0;
|
|
Number accepted = 0;
|
|
Number committed = 0;
|
|
Number polls = 0;
|
|
Number pending_start = 0;
|
|
std::vector<Number> pending;
|
|
std::vector<Number> bytes;
|
|
};
|
|
class Bus {
|
|
public:
|
|
Reply mount(Number id, Number fill, Number cycle);
|
|
Reply unmount(Number id);
|
|
Reply seek(Number id, Number address);
|
|
Reply page(Number id, const std::vector<Number>& values);
|
|
Reply poll(Number id);
|
|
Reply read(Number id, Number count);
|
|
Reply transfer(Number id, Number address, const std::vector<Number>& values, Number budget);
|
|
Snapshot inspect(Number id) const;
|
|
private:
|
|
struct Event {
|
|
char operation;
|
|
Number first;
|
|
Number second;
|
|
std::vector<Number> data;
|
|
};
|
|
struct Device {
|
|
Number cursor = 0;
|
|
Number cycle = 0;
|
|
Number busy = 0;
|
|
Number accepted = 0;
|
|
Number committed = 0;
|
|
Number polls = 0;
|
|
Number pending_start = 0;
|
|
std::vector<Number> pending;
|
|
std::vector<Number> bytes;
|
|
};
|
|
std::map<Number, std::vector<Event>> events_;
|
|
static bool valid_id(Number id);
|
|
static bool valid_bytes(const std::vector<Number>& values, std::size_t limit);
|
|
Device state(Number id) const;
|
|
void record(Number id, char operation, Number first, Number second, const std::vector<Number>& data);
|
|
};
|
|
void print_reply(std::ostream& out, const Reply& reply);
|
|
void print_snapshot(std::ostream& out, const Snapshot& snapshot);
|
|
int run_cli(Bus& bus, std::istream& input, std::ostream& output);
|
|
}
|
|
#endif
|