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:
@@ -93,7 +93,7 @@ bool prepared_mutations_are_canonical(const CellularPreparedCommit& prepared,
|
||||
const auto decoded = server::decode_cellular_mutation_action_block(
|
||||
prepared.mutations, manifest.begin_tick, manifest.end_tick);
|
||||
if (!decoded || decoded->size() != selections || prepared.results.size() != selections ||
|
||||
std::ranges::any_of(prepared.results, [](std::uint8_t result) { return result > 2; }))
|
||||
std::ranges::any_of(prepared.results, [](std::uint8_t result) { return result > 3; }))
|
||||
return false;
|
||||
const auto encoded = server::encode_cellular_mutation_action_block(
|
||||
*decoded, manifest.begin_tick, manifest.end_tick);
|
||||
|
||||
@@ -606,7 +606,7 @@ load_cellular_mutation_publications(Postgres& db, RegionKey key, const LeaseGran
|
||||
const auto action = parse_integer<std::uint64_t>(row[1]);
|
||||
const auto input = unhex<34>(row[2].value_or(std::string{}));
|
||||
const auto result = parse_integer<std::uint32_t>(row[3]);
|
||||
if (!account || !action || *action == 0 || !input || !result || *result > 2)
|
||||
if (!account || !action || *action == 0 || !input || !result || *result > 3)
|
||||
return std::unexpected{malformed(false)};
|
||||
publications.push_back({*account, *action, *input, static_cast<std::uint8_t>(*result)});
|
||||
}
|
||||
@@ -1349,7 +1349,7 @@ std::expected<CellularMutationReservation, LifeReservationFailure> reserve_cellu
|
||||
const auto target_tick = little(input, 0, 8);
|
||||
if (account == Uuid{} || action_id == 0 || generation == 0 || target_tick == 0 ||
|
||||
little(input, 8, 8) == 0 || little(input, 16, 8) == 0 || little(input, 24, 8) == 0 ||
|
||||
target_tick <= little(input, 24, 8) || little(input, 32, 2) == 0)
|
||||
target_tick <= little(input, 24, 8)) // Operator 0 declines (ADR-0120 amendment).
|
||||
return std::unexpected{LifeReservationFailure{LifeReservationError::invalid, {}}};
|
||||
const auto base = control_parameters(key, lease, account, generation);
|
||||
const std::array<std::string, 9> p{base[0],
|
||||
@@ -1435,7 +1435,7 @@ load_pending_cellular_mutations(Postgres& db, RegionKey key, const LeaseGrant& l
|
||||
*generation == 0 || !target_tick || *target_tick == 0 || !successor ||
|
||||
*successor == 0 || !input || little(*input, 0, 8) != *target_tick ||
|
||||
little(*input, 8, 8) == 0 || little(*input, 16, 8) == 0 || little(*input, 24, 8) == 0 ||
|
||||
*target_tick <= little(*input, 24, 8) || little(*input, 32, 2) == 0)
|
||||
*target_tick <= little(*input, 24, 8))
|
||||
return std::unexpected{LifeReservationFailure{LifeReservationError::store, {}}};
|
||||
out.push_back(
|
||||
{*account, *action, key.region, *generation, *target_tick, *successor, *input});
|
||||
|
||||
Reference in New Issue
Block a user