amos 73a5240295 Batches 21 and 18: add 74 calibrated tasks (40 Bos redo, 34 HWE code-gen)
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>
2026-11-02 10:23:12 +08:00

69 lines
3.3 KiB
C++

#include "io.hpp"
#include <iostream>
#include <iomanip>
#include <locale>
#include <memory>
#include <sstream>
#include <string>
namespace {
void bytes(const std::string& s) {
std::cout << s.size() << ':';
const char* d = "0123456789abcdef";
for (unsigned char c : s) { std::cout.put(d[c >> 4]); std::cout.put(d[c & 15]); }
}
void view(const bio::View& v) {
std::cout << "V " << static_cast<int>(v.code) << ' ' << v.id << ' ' << v.seen << ' ' << v.live << ' ' << v.capacity << ' ';
bytes(v.pending); std::cout << ' '; bytes(v.durable); std::cout << ' '; bytes(v.history);
std::cout << ' ' << static_cast<int>(v.last);
for (bool f : v.faults) { std::cout << ' ' << f; }
std::cout << ' ' << v.writes << ' ' << v.flushes << ' ' << v.closes << '\n';
}
void stats(const bio::Stats& s) {
std::cout << "S " << s.opened << ' ' << s.live << ' ' << s.closed << ' ' << s.writes << ' ' << s.flushes << ' ' << s.closes << '\n';
}
struct Punctuation : std::numpunct<char> {
char do_thousands_sep() const override { return '_'; }
std::string do_grouping() const override { return "\1"; }
};
}
int main(int argc, char** argv) {
if (argc > 1 && std::string(argv[1]) == "cli") {
std::size_t size; int reset;
std::unique_ptr<bio::Session> session;
while (std::cin >> size >> reset) {
if (reset || !session) { session = std::make_unique<bio::Session>(); }
std::cin.get();
std::string payload(size, '\0');
std::cin.read(payload.data(), static_cast<std::streamsize>(size));
std::istringstream input(payload);
std::ostringstream output;
output << std::hex << std::showbase << std::showpos << std::boolalpha << std::uppercase;
output.width(19); output.fill('@');
output.imbue(std::locale(std::locale::classic(), new Punctuation));
const int count = bio::run_cli(*session, input, output);
std::cout << "C " << count << ' '; bytes(output.str()); std::cout << '\n';
for (int slot = 0; slot < 4; ++slot) { view(session->view(slot)); }
stats(session->stats());
}
return 0;
}
std::array<std::unique_ptr<bio::Session>, 2> sessions;
for (auto& s : sessions) { s = std::make_unique<bio::Session>(); }
int sid; std::string op; bio::Number id, a, b;
while (std::cin >> sid >> op) {
bio::Session& s = *sessions[sid];
if (op == "OPEN") { std::cin >> id >> a; std::cout << "R " << static_cast<int>(s.open(id,a)) << '\n'; }
else if (op == "PUT") { std::cin >> id >> a >> b; std::cout << "R " << static_cast<int>(s.put(id,a,b)) << '\n'; }
else if (op == "ARM") { std::cin >> id >> a >> b; std::cout << "R " << static_cast<int>(s.arm(id,a,b)) << '\n'; }
else if (op == "FLUSH") { std::cin >> id; std::cout << "R " << static_cast<int>(s.flush(id)) << '\n'; }
else if (op == "CLOSE") { std::cin >> id; std::cout << "R " << static_cast<int>(s.close(id)) << '\n'; }
else if (op == "VIEW") { std::cin >> id; view(s.view(id)); }
else if (op == "STATS") { stats(s.stats()); }
for (auto& live : sessions) {
for (int slot = 0; slot < 4; ++slot) { view(live->view(slot)); }
stats(live->stats());
}
}
return 0;
}