Fix CI: run M10 process tests with the load governor off
Foundation / checks (deploy) (push) Successful in 3m15s
Foundation / checks (ecs) (push) Successful in 1m57s
Foundation / checks (client) (push) Successful in 12m33s
Foundation / checks (network) (push) Successful in 13m19s
Foundation / checks (tsan) (push) Successful in 8m5s
Foundation / checks (checks) (push) Successful in 32m42s
Foundation / checks (postgres) (push) Successful in 43m45s
Foundation / postgres-tools (push) Successful in 20s
Foundation / server-image (push) Successful in 24s
Foundation / image (push) Successful in 2m31s

checks (postgres) failed on both M10.9 pushes: on the shared CI runner one
session measured 22 ms p95 per tick, so the governor correctly refused
and the test's assumption about host speed failed (server-image was
skipped as a result). evo-server gains --m10-load-governor on|off (dev
only): off keeps measuring and exposing the work but never refuses or
sheds. The M10 session, load-smoke and two-process handoff tests use it;
the governor stays covered by its unit tests. Refreshes the dev session
window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-07 11:58:37 -04:00
co-authored by Claude Opus 5.5
parent 1ba6748288
commit 66efe87c90
6 changed files with 77 additions and 26 deletions
+15 -2
View File
@@ -55,6 +55,9 @@ struct M10Options {
std::string listen, certificate, key, issuer, environment, session_window;
// M10.5c: dev only, 60..3600 s; 0 keeps the default (300 s, ADR-0091).
std::uint64_t max_grant_lifetime{};
// M10.9 (ADR-0097, dev only): `--m10-load-governor off` keeps measuring and exposing the
// work but never refuses or sheds (process tests whose host speed is unknown).
bool load_governor{true};
// M10.8c (ADR-0096, dev only): this region's marker area in cells "X0,Y0,X1,Y1"
// (inclusive), its handoff key (32-byte P-256 scalar; key id = region id) and up to 8
// neighbours "REGION=X0,Y0,X1,Y1=HOST:PORT=SERVER_NAME=PUBLIC_KEY_FILE".
@@ -63,7 +66,7 @@ struct M10Options {
[[nodiscard]] bool any() const noexcept {
return !listen.empty() || !certificate.empty() || !key.empty() || !issuer.empty() ||
!environment.empty() || !session_window.empty() || max_grant_lifetime != 0 ||
!area.empty() || !handoff_key.empty() || !neighbours.empty();
!area.empty() || !handoff_key.empty() || !neighbours.empty() || !load_governor;
}
[[nodiscard]] bool complete() const noexcept {
return !listen.empty() && !certificate.empty() && !key.empty() && !issuer.empty() &&
@@ -115,6 +118,8 @@ template <typename Host> class M10Bridge {
return fail("error m10-grant-lifetime");
config.control.max_grant_lifetime = o.max_grant_lifetime;
}
if (!o.load_governor && config.control.environment != network::DeploymentEnvironment::dev)
return fail("error m10-load-governor");
std::optional<std::array<std::int64_t, 4>> area_cells;
if (!o.area.empty() && !(area_cells = cells_of(o.area)))
return fail("error m10-area");
@@ -139,6 +144,9 @@ template <typename Host> class M10Bridge {
config.ledger = bridge.control_.get();
config.actions = bridge.actions_.get();
bridge.area_cells_ = area_cells;
bridge.governed_ = o.load_governor;
if (!o.load_governor)
std::puts("m10 load governor off");
if (!o.handoff_key.empty()) {
const auto scalar = read(o.handoff_key);
auto signer = network::HandoffSigningKey::import(
@@ -250,6 +258,10 @@ template <typename Host> class M10Bridge {
c.m10_sessions = sessions_->sessions();
c.m10_refused_logins = sessions_->refused_for_load();
c.m10_load = governor_.state();
if (!governed_) { // Measured only: nothing is refused or shed.
c.m10_load.refusing = false;
c.m10_load.shed = 0;
}
}
void shutdown() {
if (sessions_)
@@ -284,7 +296,7 @@ template <typename Host> class M10Bridge {
bool changed = false;
for (std::uint64_t i = 0; i < ticks; ++i)
changed = governor_.observe(per_tick, session_per_tick, s.tick_debt, now_us) || changed;
if (!changed)
if (!changed || !governed_)
return;
const auto& load = governor_.state();
sessions_->set_load(load.refusing, load.shed);
@@ -435,6 +447,7 @@ template <typename Host> class M10Bridge {
std::unique_ptr<server::PostgresControlLedger> control_;
std::unique_ptr<server::PostgresActionLedger> actions_;
server::LoadGovernor governor_{*server::LoadGovernor::create({})};
bool governed_{true};
std::chrono::nanoseconds busy_{}, session_busy_{};
std::uint64_t measured_tick_{};
std::unique_ptr<server::PostgresProbeLedger> probes_; // Handoff mode only.