Freeze offline cells, linger, suspend and resume them
Foundation / checks (ecs) (push) Successful in 2m15s
Foundation / checks (deploy) (push) Successful in 3m53s
Foundation / checks (tsan) (push) Successful in 9m46s
Foundation / checks (client) (push) Failing after 13m47s
Foundation / checks (network) (push) Successful in 19m5s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 19m34s
Foundation / checks (postgres) (push) Canceled after 19m28s

M11.7 (ADR-0128): a frozen step intent, set by the server for every owned life
whose account holds no session, leaves the cell unchanged but engulfable. Owner
format 6 / rules 5 track presence: lingering for 200 ticks, then suspended out of
the world without aging; an unfrozen intent resumes it in place or at the nearest
clear spot within three extents. Bundle v6, schema v38 and the cellular-v4
opening carry it. The server refuses an offline account's carried actions, ticks
while anyone lingers, and skips suspended cells in replication and perception.

Also fixes the TSan failure of CI run 374: the rules-4 owner test read the bud
through a reference into a replaced state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-14 07:50:45 -04:00
co-authored by Claude Opus 5.5
parent e71147f7a6
commit e74bdf286b
25 changed files with 741 additions and 69 deletions
+7 -3
View File
@@ -37,7 +37,9 @@ bool valid_intent(const CellularLifeIntent& life) {
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.bud && (step.intake_target || step.engulf));
!(step.bud && (step.intake_target || step.engulf)) &&
!(step.frozen && (step.movement != biology::CellularIntent{} || step.intake_target ||
step.engulf || step.bud));
}
bool valid_ticks(std::span<const CellularTickIntents> ticks) {
std::set<std::uint64_t> identities;
@@ -142,7 +144,8 @@ void put_intent(std::vector<std::uint8_t>& out, const CellularLifeIntent& life)
: life.intent.engulf ? 2
: life.intent.bud ? 3
: 0);
put(out, 0, 3);
out.push_back(life.intent.frozen ? 1 : 0); // Flags (ADR-0128): bit 0 frozen.
put(out, 0, 2);
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);
}
@@ -291,7 +294,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] > 3 || !all_zero(record.subspan(13, 3)))
if (record[12] > 3 || record[13] > 1 || !all_zero(record.subspan(14, 2)))
return std::unexpected{CellularBatchError::format};
CellularLifeIntent life;
life.life_id = get(record, 0, 8);
@@ -308,6 +311,7 @@ decode_cellular_batch(std::span<const std::uint8_t> bytes) {
}
life.intent.engulf = record[12] == 2; // ADR-0124 target kind.
life.intent.bud = record[12] == 3; // ADR-0125.
life.intent.frozen = record[13] == 1; // ADR-0128.
if (!valid_intent(life) ||
(!step.lives.empty() && step.lives.back().life_id >= life.life_id))
return std::unexpected{CellularBatchError::format};