Batch 24 (20261102-C-bos-seed-24) screened all 3078 Bos seed queries. Only 23 themes were in scope (pure user-space reliability, at most one task per theme); the rest were single operations or explanations, installs and networking, system administration, ROS2, board-only or GUI requests. Two finished drafts were withdrawn as too close to existing tasks. Seeds supply direction only: all sources, contracts and tests are new, and no task shares more than 14 characters with its seed text. Each task passed the local gate and the trace6 Docker gate (5 runs per sample class). Claude rebuilt the catalog from the calibration receipts: 23/23 USABLE. 16 of 23 are C/C++. Only the task directories are taken; the batch worktree's lowered disk floor in rollout/core.py stays out of main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include "link.hpp"
|
|
|
|
#include <limits>
|
|
|
|
namespace carrier {
|
|
|
|
bool Controller::carrier_down(unsigned port)
|
|
{
|
|
if (!valid(port)) return false;
|
|
if (!ports_[port].carrier) return true;
|
|
ports_[port].carrier = false;
|
|
stop(port);
|
|
return true;
|
|
}
|
|
|
|
void Controller::schedule(unsigned port)
|
|
{
|
|
Port& state = ports_[port];
|
|
if (state.phase != Phase::opening) return;
|
|
backend_.close(port, state.generation);
|
|
if (state.failures < 3) ++state.failures;
|
|
if (state.failures == 3) {
|
|
state.phase = Phase::idle;
|
|
state.due = 0;
|
|
return;
|
|
}
|
|
const std::uint64_t delay = std::uint64_t(1) << state.failures;
|
|
if (delay > std::numeric_limits<std::uint64_t>::max() - now_) {
|
|
state.phase = Phase::idle;
|
|
state.due = 0;
|
|
return;
|
|
}
|
|
state.phase = Phase::waiting;
|
|
state.due = now_ + delay;
|
|
}
|
|
|
|
void Controller::tick(unsigned port)
|
|
{
|
|
Port& state = ports_[port];
|
|
if (!state.enabled || !state.carrier) return;
|
|
if (state.phase != Phase::waiting) return;
|
|
if (now_ < state.due) return;
|
|
begin(port);
|
|
}
|
|
|
|
} // namespace carrier
|