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>
80 lines
2.0 KiB
C++
80 lines
2.0 KiB
C++
#ifndef BUFFER_MODEL_HPP
|
|
#define BUFFER_MODEL_HPP
|
|
#include <cstdint>
|
|
#include <iosfwd>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace buffer_capacity {
|
|
enum class Status : std::int64_t {
|
|
OK = 0,
|
|
RANGE = 1,
|
|
EXISTS = 2,
|
|
ABSENT = 3,
|
|
BUSY = 4,
|
|
NOSPACE = 5
|
|
};
|
|
struct DeviceInfo {
|
|
std::int64_t id = 0;
|
|
std::int64_t capacity = 0;
|
|
std::int64_t allocation = 0;
|
|
};
|
|
struct SessionInfo {
|
|
std::int64_t id = 0;
|
|
std::int64_t device = 0;
|
|
std::int64_t cursor = 0;
|
|
};
|
|
struct ResourceInfo {
|
|
std::int64_t allocation = 0;
|
|
std::int64_t device = 0;
|
|
std::int64_t capacity = 0;
|
|
};
|
|
struct PoolInfo {
|
|
std::int64_t blocked = 0;
|
|
std::int64_t live_count = 0;
|
|
std::vector<ResourceInfo> resources;
|
|
};
|
|
struct DeviceResult {
|
|
Status status = Status::OK;
|
|
DeviceInfo value;
|
|
};
|
|
struct SessionResult {
|
|
Status status = Status::OK;
|
|
SessionInfo value;
|
|
};
|
|
struct WriteResult {
|
|
Status status = Status::OK;
|
|
std::int64_t count = 0;
|
|
};
|
|
struct ReadResult {
|
|
Status status = Status::OK;
|
|
std::vector<std::uint8_t> bytes;
|
|
};
|
|
class Engine {
|
|
public:
|
|
Engine();
|
|
~Engine();
|
|
Engine(const Engine&) = delete;
|
|
Engine& operator=(const Engine&) = delete;
|
|
Engine(Engine&&) = delete;
|
|
Engine& operator=(Engine&&) = delete;
|
|
Status create(std::int64_t device, std::int64_t capacity);
|
|
Status drop(std::int64_t device);
|
|
Status open(std::int64_t session, std::int64_t device);
|
|
Status close(std::int64_t session);
|
|
Status seek(std::int64_t session, std::int64_t position);
|
|
WriteResult write(std::int64_t session, std::int64_t count, std::int64_t byte);
|
|
ReadResult read(std::int64_t session, std::int64_t count);
|
|
Status resize(std::int64_t device, std::int64_t capacity);
|
|
Status set_allocation_blocked(std::int64_t blocked);
|
|
DeviceResult device(std::int64_t device) const;
|
|
SessionResult session(std::int64_t session) const;
|
|
PoolInfo pool() const;
|
|
private:
|
|
struct Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
};
|
|
int run_cli(Engine& engine, std::istream& input, std::ostream& output);
|
|
}
|
|
#endif
|