100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth range given to batch 22), each with at least one independent contract-edge defect and plain public docs. Claude reviewed 100/100 USABLE against current digests; no ID or source overlap with main or batch 22. Difficulty is unmeasured. progress.md records the wrap-up: all Codex sessions and Qwen schedulers stopped for the user's rollout, Qwen results so far (57 HARD of 373), and what is left on each batch branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.9 KiB
C++
48 lines
1.9 KiB
C++
#include "engine_internal.hpp"
|
|
namespace deferred {
|
|
int RequestState::inspect(int id, View& out) const
|
|
{
|
|
if (!valid_id(id)) return BAD_ID;
|
|
const auto found = registrations.find(id);
|
|
if (found == registrations.end()) return MISSING;
|
|
const Registration& r = found->second;
|
|
const auto pending = group(id, 0);
|
|
const auto active = group(id, 1);
|
|
const auto delivered = group(id, 2);
|
|
const Action p = batch(0, id, pending);
|
|
const Action a = batch(0, id, active);
|
|
const Action d = batch(0, id, delivered);
|
|
out = View{r.life, r.generation, r.priority, r.quota, r.cookie,
|
|
static_cast<Number>(r.gates.size()), p.count, p.sum,
|
|
pending.empty() ? 0 : requests[pending.front()].ticket,
|
|
a.count, a.sum, active.empty() ? 0 : requests[active.front()].ticket,
|
|
r.batches, d.count, d.sum, d.value};
|
|
return OK;
|
|
}
|
|
Summary RequestState::totals() const
|
|
{
|
|
std::set<int> queued;
|
|
std::set<int> active;
|
|
Number live = 0;
|
|
for (const auto& pair : registrations) {
|
|
if (pair.second.life != LIVE) continue;
|
|
live += 1;
|
|
if (!group(pair.first, 0).empty()) queued.insert(pair.first);
|
|
if (!group(pair.first, 1).empty()) active.insert(pair.first);
|
|
}
|
|
return Summary{installs, live, static_cast<Number>(queued.size()),
|
|
static_cast<Number>(active.size()), starts, finishes, kills,
|
|
errors, next_ticket, static_cast<Number>(retained.size())};
|
|
}
|
|
int Engine::view(int id, View& out) const { return state_->snapshot().inspect(id, out); }
|
|
Summary Engine::summary() const { return state_->snapshot().totals(); }
|
|
int Engine::event(int index, Event& out) const
|
|
{
|
|
if (index < 0 || index >= 16) return BAD_VALUE;
|
|
const RequestState state = state_->snapshot();
|
|
if (static_cast<std::size_t>(index) >= state.retained.size()) return NO_EVENT;
|
|
out = state.retained[index];
|
|
return OK;
|
|
}
|
|
}
|