Decline a mutation offer (ADR-0120 amendment, schema v40)
Foundation / checks (ecs) (push) Successful in 2m20s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / checks (tsan) (push) Successful in 9m49s
Foundation / checks (client) (push) Successful in 19m23s
Foundation / checks (network) (push) Successful in 19m31s
Foundation / checks (checks) (push) Successful in 42m41s
Foundation / checks (postgres) (push) Successful in 45m36s
Foundation / postgres-tools (push) Successful in 28s
Foundation / server-image (push) Successful in 3m15s
Foundation / image (push) Successful in 3m18s
Foundation / checks (ecs) (push) Successful in 2m20s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / checks (tsan) (push) Successful in 9m49s
Foundation / checks (client) (push) Successful in 19m23s
Foundation / checks (network) (push) Successful in 19m31s
Foundation / checks (checks) (push) Successful in 42m41s
Foundation / checks (postgres) (push) Successful in 45m36s
Foundation / postgres-tools (push) Successful in 28s
Foundation / server-image (push) Successful in 3m15s
Foundation / image (push) Successful in 3m18s
An offer the cell cannot afford stayed open, and only one offer is issued at a time, so banked feeding credit never became a new offer. A v10 choice naming operator 0 now declines the exact outstanding offer. It is reserved and published like any choice: schema v40 accepts operator 0 in the reserved input and trace selections and stores result 3, declined. The owner consumes the offer and changes nothing else, and the client reports it as committed. Old traces never carry operator 0, so their replay is unchanged. The Evolution panel gets a "Decline this offer" button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1247,7 +1247,7 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
|
||||
for (std::size_t i = 0; i < selections.size(); ++i) {
|
||||
const auto& selection = selections[i];
|
||||
if (selection.life_id == 0 || selection.event_index == 0 || selection.offer_tick == 0 ||
|
||||
selection.operator_id == 0 || selection.successor_id == 0 ||
|
||||
selection.successor_id == 0 || // Operator 0 declines (ADR-0120 amendment).
|
||||
(i != 0 && selections[i - 1].life_id >= selection.life_id))
|
||||
return std::unexpected{CellularLivesError::invalid_intents};
|
||||
const auto life = std::ranges::lower_bound(
|
||||
@@ -1262,10 +1262,11 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
|
||||
const auto offer = life->mutation.offer.value_or(biology::MutationOffer{});
|
||||
if (offer.parent != life->identity.genome ||
|
||||
offer.context.event_index != selection.event_index ||
|
||||
!std::ranges::any_of(offer.candidates,
|
||||
[&](const auto& candidate) {
|
||||
return candidate.operator_id == selection.operator_id;
|
||||
}) ||
|
||||
(selection.operator_id != 0 && !std::ranges::any_of(offer.candidates,
|
||||
[&](const auto& candidate) {
|
||||
return candidate.operator_id ==
|
||||
selection.operator_id;
|
||||
})) ||
|
||||
state_->archive.find(selection.successor_id))
|
||||
return std::unexpected{CellularLivesError::mutation};
|
||||
for (std::size_t j = 0; j < i; ++j)
|
||||
@@ -1397,6 +1398,15 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
|
||||
const auto parent = next_archive.find(found->identity.genome);
|
||||
if (!parent || !found->mutation.offer.has_value())
|
||||
return std::unexpected{CellularLivesError::mutation};
|
||||
if (selection.operator_id == 0) {
|
||||
// ADR-0120 amendment: a decline consumes the offer and changes nothing else; its
|
||||
// reserved successor identity stays unused. Banked credit may earn the next offer.
|
||||
found->mutation.offer.reset();
|
||||
found->mutation.offer_tick = 0;
|
||||
mutation_results.push_back(
|
||||
{selection.life_id, selection.successor_id, CellularMutationResult::declined});
|
||||
continue;
|
||||
}
|
||||
const auto offer = found->mutation.offer.value_or(biology::MutationOffer{});
|
||||
auto transition =
|
||||
biology::fund_mutation(*parent, offer.context, offer, selection.operator_id,
|
||||
|
||||
Reference in New Issue
Block a user