amos 8b7616bfd8 Batch 22 (20261027-C-hwe-hard-22): add 63 calibrated HWE hard-design tasks
From the 101 lk/man/pth code-gen sources: 63 tasks (C11 36, C++17 27,
11 canonical families), 38 skipped for scope or duplication. Each task
has at least one independent contract-edge defect, boundary types
rotate, and public docs state trap clauses as plain contract prose.
Claude reviewed 63/63 USABLE against current digests. Difficulty is
unmeasured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:14:57 +08:00

54 lines
1.3 KiB
C++

#include "latch.hpp"
#include <string>
namespace release {
namespace {
void field(std::string &output, Count value, bool first)
{
if (!first) {
output.push_back('|');
}
output += std::to_string(value);
}
}
std::string format_snapshot(const Snapshot &value)
{
std::string output;
field(output, value.target, true);
field(output, value.remaining, false);
field(output, value.open, false);
field(output, value.revision, false);
field(output, value.broadcasts, false);
field(output, value.participants, false);
field(output, value.completed, false);
field(output, value.waiting, false);
field(output, value.released, false);
field(output, value.canceled, false);
field(output, value.queued, false);
field(output, value.next_ticket, false);
return output;
}
std::string format_waiter(const WaitInfo &value)
{
std::string output;
field(output, static_cast<unsigned>(value.state), true);
field(output, value.ticket, false);
return output;
}
std::string format_ids(const std::vector<Id> &ids)
{
if (ids.empty()) {
return "-";
}
std::string output;
for (std::size_t index = 0; index < ids.size(); ++index) {
if (index != 0) {
output.push_back(',');
}
output += std::to_string(ids[index]);
}
return output;
}
}