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:
@@ -67,7 +67,7 @@ bool valid_ticks(std::span<const CellularTickIntents> ticks) {
|
||||
for (std::size_t i = 0; i < tick.mutations.size(); ++i) {
|
||||
const auto& mutation = tick.mutations[i];
|
||||
if (mutation.life_id == 0 || mutation.event_index == 0 || mutation.offer_tick == 0 ||
|
||||
mutation.successor_id == 0 || mutation.operator_id == 0 ||
|
||||
mutation.successor_id == 0 || // Operator 0 declines (ADR-0120 amendment).
|
||||
(i > 0 && tick.mutations[i - 1].life_id >= mutation.life_id) ||
|
||||
!identities.insert(mutation.successor_id).second)
|
||||
return false;
|
||||
@@ -127,7 +127,7 @@ bool valid_mutation_actions(std::span<const CellularMutationActionRecord> action
|
||||
const auto& input = action.input;
|
||||
if (all_zero(action.account) || action.action_id == 0 || action.tick <= begin_tick ||
|
||||
action.tick > end_tick || input.life_id == 0 || input.event_index == 0 ||
|
||||
input.offer_tick == 0 || input.offer_tick > begin_tick || input.operator_id == 0 ||
|
||||
input.offer_tick == 0 || input.offer_tick > begin_tick ||
|
||||
(i != 0 && !mutation_action_less(actions[i - 1], action)))
|
||||
return false;
|
||||
for (std::size_t j = 0; j < i; ++j)
|
||||
@@ -350,7 +350,7 @@ decode_cellular_batch(std::span<const std::uint8_t> bytes) {
|
||||
mutation.operator_id = static_cast<std::uint16_t>(get(record, 32, 2));
|
||||
if (!all_zero(record.subspan(34, 6)) || mutation.life_id == 0 ||
|
||||
mutation.event_index == 0 || mutation.offer_tick == 0 ||
|
||||
mutation.successor_id == 0 || mutation.operator_id == 0 ||
|
||||
mutation.successor_id == 0 ||
|
||||
(!step.mutations.empty() && step.mutations.back().life_id >= mutation.life_id))
|
||||
return std::unexpected{CellularBatchError::format};
|
||||
step.mutations.push_back(mutation);
|
||||
@@ -398,7 +398,7 @@ decode_cellular_mutation_input(const std::array<std::uint8_t, 16>& account, std:
|
||||
action.input.operator_id = static_cast<std::uint16_t>(get(input, 32, 2));
|
||||
if (action_id == 0 || action.tick == 0 || action.input.life_id == 0 ||
|
||||
action.input.event_index == 0 || action.input.offer_tick == 0 ||
|
||||
action.input.offer_tick >= action.tick || action.input.operator_id == 0)
|
||||
action.input.offer_tick >= action.tick)
|
||||
return std::nullopt;
|
||||
return action;
|
||||
}
|
||||
@@ -616,9 +616,10 @@ match_cellular_mutation_actions_to_trace(const CellularLives& predecessor,
|
||||
life->mutation.event_index != action.input.event_index ||
|
||||
life->mutation.offer_tick != action.input.offer_tick ||
|
||||
life->identity.life != action.input.life_id || offer.parent != life->identity.genome ||
|
||||
!std::ranges::any_of(offer.candidates, [&](const auto& candidate) {
|
||||
return candidate.operator_id == action.input.operator_id;
|
||||
}))
|
||||
(action.input.operator_id != 0 &&
|
||||
!std::ranges::any_of(offer.candidates, [&](const auto& candidate) {
|
||||
return candidate.operator_id == action.input.operator_id;
|
||||
})))
|
||||
return std::unexpected{CellularActionBlockError::mismatch};
|
||||
}
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user