Show what a mutation costs and why an engulf failed
Foundation / checks (ecs) (push) Successful in 2m24s
Foundation / checks (deploy) (push) Successful in 4m7s
Foundation / checks (tsan) (push) Successful in 9m49s
Foundation / checks (client) (push) Successful in 17m12s
Foundation / checks (network) (push) Successful in 19m34s
Foundation / checks (checks) (push) Successful in 43m5s
Foundation / checks (postgres) (push) Successful in 44m57s
Foundation / server-image (push) Successful in 31s
Foundation / postgres-tools (push) Successful in 1m13s
Foundation / image (push) Successful in 3m24s
Foundation / checks (ecs) (push) Successful in 2m24s
Foundation / checks (deploy) (push) Successful in 4m7s
Foundation / checks (tsan) (push) Successful in 9m49s
Foundation / checks (client) (push) Successful in 17m12s
Foundation / checks (network) (push) Successful in 19m34s
Foundation / checks (checks) (push) Successful in 43m5s
Foundation / checks (postgres) (push) Successful in 44m57s
Foundation / server-image (push) Successful in 31s
Foundation / postgres-tools (push) Successful in 1m13s
Foundation / image (push) Successful in 3m24s
After the first M11.9 playtest (ADR-0129 amendment): each offered candidate now carries its funded cost to the cell, construction energy and matter per channel, so the client can grey out what the reserve cannot pay; a candidate is affordable by that cost exactly when the owner would fund it. A failed engulf now reports no contact, prey too large, or membrane too thick. The v10 candidate record grows to 64 bytes, so v10 clients must be rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -572,12 +572,26 @@ void cellular_host_admits_mutation_choices() {
|
||||
offer.candidates.front().operator_id};
|
||||
const auto next = host->state()->tick() + 1;
|
||||
// 11.4d: the owner's view lists the same candidates in operator order.
|
||||
const auto view = offer_view(life, next - 1);
|
||||
const auto view = offer_view(*host->state(), life, next - 1);
|
||||
CHECK(view.life_identity == life_id && view.event_index == choice.event_index &&
|
||||
view.offer_tick == choice.offer_tick &&
|
||||
view.candidates.size() == offer.candidates.size() &&
|
||||
std::ranges::is_sorted(view.candidates, {},
|
||||
&evo::network::CellularOfferedCandidate::operator_id));
|
||||
// ADR-0129: a candidate is affordable by its shown cost exactly when the owner would
|
||||
// fund it from the current reserve.
|
||||
const auto parent_genome = host->state()->archive().find(life.identity.genome);
|
||||
CHECK(parent_genome.has_value());
|
||||
for (const auto& shown : view.candidates) {
|
||||
bool covered = life.reserve.energy.value >= shown.cost_energy_pj;
|
||||
for (std::size_t c = 0; c < shown.cost_matter_fg.size(); ++c)
|
||||
covered = covered && life.reserve.matter[c].value >= shown.cost_matter_fg[c];
|
||||
const auto funded = parent_genome
|
||||
? fund_mutation(*parent_genome, offer.context, offer,
|
||||
shown.operator_id, 999'999, 999'999, life.reserve)
|
||||
: std::unexpected{MutationError::development};
|
||||
CHECK(covered == funded.has_value());
|
||||
}
|
||||
auto wrong = choice;
|
||||
wrong.operator_id = 0xFFFF;
|
||||
CHECK(host->select_mutation(account, control->generation, 31, wrong).status ==
|
||||
|
||||
Reference in New Issue
Block a user