Carry bud actions and the v5 bundle through protocol and persistence
Foundation / checks (ecs) (push) Successful in 2m30s
Foundation / checks (deploy) (push) Successful in 4m0s
Foundation / checks (tsan) (push) Successful in 10m37s
Foundation / checks (client) (push) Failing after 13m56s
Foundation / checks (network) (push) Successful in 19m9s
Foundation / checks (checks) (push) Successful in 42m54s
Foundation / checks (postgres) (push) Successful in 44m9s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

M11.5c (ADR-0125): v10 cellular actions, the canonical input and the trace carry
target kind 3 (bud), matched to durable actions; below rules 4 the owner
ignores it. The v5 version bundle is admitted in C++ and by schema v36, which
also admits kind 3 in SQL action inputs; the provisioner offers cellular-v3.
A PostgreSQL test publishes a bud from a fed founder and recovers it after a
host restart. The publication tests now use commit ids no other suite produces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-14 06:42:41 -04:00
co-authored by Claude Opus 5.5
parent 5b255ad940
commit f22a540135
28 changed files with 529 additions and 69 deletions
+11 -5
View File
@@ -36,7 +36,8 @@ bool valid_intent(const CellularLifeIntent& life) {
const auto& step = life.intent;
return life.life_id != 0 && step.movement.x >= -movement_limit &&
step.movement.x <= movement_limit && step.movement.y >= -movement_limit &&
step.movement.y <= movement_limit && !(step.engulf && step.intake_target);
step.movement.y <= movement_limit && !(step.engulf && step.intake_target) &&
!(step.bud && (step.intake_target || step.engulf));
}
bool valid_ticks(std::span<const CellularTickIntents> ticks) {
std::set<std::uint64_t> identities;
@@ -83,7 +84,7 @@ bool valid_action_input(const CellularActionRecord& action, std::uint64_t begin_
const auto move_y = std::bit_cast<std::int16_t>(static_cast<std::uint16_t>(get(input, 10, 2)));
return !all_zero(action.account) && action.action_id != 0 && tick > begin_tick &&
tick <= end_tick && move_x >= -movement_limit && move_x <= movement_limit &&
move_y >= -movement_limit && move_y <= movement_limit && input[12] <= 2 &&
move_y >= -movement_limit && move_y <= movement_limit && input[12] <= 3 &&
all_zero(input.subspan(13, 3)) && (input[12] == 1 || all_zero(input.subspan(16, 8)));
}
bool action_less(const CellularActionRecord& a, const CellularActionRecord& b) {
@@ -137,7 +138,10 @@ void put_intent(std::vector<std::uint8_t>& out, const CellularLifeIntent& life)
put(out, life.life_id, 8);
put(out, static_cast<std::uint16_t>(life.intent.movement.x), 2);
put(out, static_cast<std::uint16_t>(life.intent.movement.y), 2);
out.push_back(life.intent.intake_target ? 1 : life.intent.engulf ? 2 : 0); // Target kind.
out.push_back(life.intent.intake_target ? 1 // Target kind.
: life.intent.engulf ? 2
: life.intent.bud ? 3
: 0);
put(out, 0, 3);
put(out, life.intent.intake_target ? life.intent.intake_target->x_um : 0, 4);
put(out, life.intent.intake_target ? life.intent.intake_target->y_um : 0, 4);
@@ -287,7 +291,7 @@ decode_cellular_batch(std::span<const std::uint8_t> bytes) {
step.lives.reserve(static_cast<std::size_t>(count));
for (std::uint64_t i = 0; i < count; ++i) {
const auto record = bytes.subspan(offset, cellular_batch_intent_bytes);
if (record[12] > 2 || !all_zero(record.subspan(13, 3)))
if (record[12] > 3 || !all_zero(record.subspan(13, 3)))
return std::unexpected{CellularBatchError::format};
CellularLifeIntent life;
life.life_id = get(record, 0, 8);
@@ -303,6 +307,7 @@ decode_cellular_batch(std::span<const std::uint8_t> bytes) {
return std::unexpected{CellularBatchError::format};
}
life.intent.engulf = record[12] == 2; // ADR-0124 target kind.
life.intent.bud = record[12] == 3; // ADR-0125.
if (!valid_intent(life) ||
(!step.lives.empty() && step.lives.back().life_id >= life.life_id))
return std::unexpected{CellularBatchError::format};
@@ -546,7 +551,8 @@ match_cellular_actions_to_trace(const CellularLives& predecessor, const Cellular
std::bit_cast<std::int16_t>(static_cast<std::uint16_t>(get(input, 8, 2))) ||
intent->intent.movement.y !=
std::bit_cast<std::int16_t>(static_cast<std::uint16_t>(get(input, 10, 2))) ||
intent->intent.intake_target != target || intent->intent.engulf != (input[12] == 2))
intent->intent.intake_target != target || intent->intent.engulf != (input[12] == 2) ||
intent->intent.bud != (input[12] == 3))
return std::unexpected{CellularActionBlockError::mismatch};
}
return {};
+5 -4
View File
@@ -238,8 +238,8 @@ validate_state(std::uint64_t world, std::uint64_t region, std::uint64_t frame,
identity - first < next_bud_sequence - 1;
};
const auto lineage_valid = [&](std::uint64_t life_id, std::uint64_t parent) noexcept {
if (parent == 0)
return life_id < cellular_bud_namespace;
if (parent == 0) // Rules 4 keep allocated identities below the bud namespace.
return !bud_rules || life_id < cellular_bud_namespace;
return bud_identity(life_id) && parent != life_id;
};
const auto& map = habitat.config();
@@ -1142,7 +1142,8 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
const bool bud_rules = state_->rules_version == cellular_lives_bud_rules;
for (const auto& ordered_intent : ordered) {
const auto& intent = ordered_intent.intent;
if (intent.bud && (!bud_rules || intent.intake_target || intent.engulf))
// Below rules 4 a bud is ignored, as engulfment is below rules 3 (ADR-0124/0125).
if (intent.bud && (intent.intake_target || intent.engulf))
return std::unexpected{CellularLivesError::invalid_intents};
}
for (std::size_t i = 0; i < selections.size(); ++i) {
@@ -1328,7 +1329,7 @@ CellularLives::advance_tick_with_mutations(std::span<const CellularLifeIntent> i
std::vector<CellularBudExecution> bud_results;
auto next_bud_sequence = state_->next_bud_sequence;
for (const auto& request : ordered) {
if (!request.intent.bud)
if (!bud_rules || !request.intent.bud)
continue;
const auto parent = std::ranges::lower_bound(
next_lives, request.life_id, {},