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>
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
#include "ledger.hpp"
|
|
#include <ostream>
|
|
|
|
namespace scoped {
|
|
void observe(std::ostream& output, const Result& result, const Ledger& ledger) {
|
|
const auto state = ledger.gate().view();
|
|
const auto groups = ledger.snapshot();
|
|
output << result.code << ' '
|
|
<< result.total << ' '
|
|
<< result.visited << ' '
|
|
<< result.probes << ' '
|
|
<< result.stolen << ' '
|
|
<< state.owner << ' '
|
|
<< state.depth << ' '
|
|
<< state.acquisitions << ' '
|
|
<< state.releases << ' '
|
|
<< state.denied << ' '
|
|
<< state.invalid_releases << ' '
|
|
<< state.maximum_depth << ' '
|
|
<< groups.size();
|
|
for (const auto& group : groups) {
|
|
output << ' ' << group.id
|
|
<< ' ' << group.parent
|
|
<< ' ' << group.weight;
|
|
}
|
|
output << '\n';
|
|
}
|
|
|
|
int run_demo(std::ostream& output) {
|
|
Ledger ledger;
|
|
const auto root = ledger.add(0, -1, 7);
|
|
if (root.code != 0) {
|
|
return 1;
|
|
}
|
|
const auto middle = ledger.add(1, 0, 4);
|
|
if (middle.code != 0) {
|
|
return 1;
|
|
}
|
|
const auto leaf = ledger.add(2, 1, -2);
|
|
if (leaf.code != 0) {
|
|
return 1;
|
|
}
|
|
const auto report = ledger.report(3, 0);
|
|
output << "report code=" << report.code
|
|
<< " total=" << report.total
|
|
<< " visited=" << report.visited << '\n';
|
|
const auto state = ledger.gate().view();
|
|
output << "gate owner=" << state.owner
|
|
<< " depth=" << state.depth
|
|
<< " acquired=" << state.acquisitions
|
|
<< " returned=" << state.releases << '\n';
|
|
return 0;
|
|
}
|
|
}
|