Carry the engulf intent on v10 sessions and the batch trace
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (deploy) (push) Successful in 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 6m47s
Foundation / checks (checks) (push) Canceled after 6m58s
Foundation / checks (client) (push) Canceled after 6m59s
Foundation / checks (tsan) (push) Canceled after 4m28s
Foundation / checks (network) (push) Canceled after 6m58s
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (deploy) (push) Successful in 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 6m47s
Foundation / checks (checks) (push) Canceled after 6m58s
Foundation / checks (client) (push) Canceled after 6m59s
Foundation / checks (tsan) (push) Canceled after 4m28s
Foundation / checks (network) (push) Canceled after 6m58s
ADR-0124: byte 12 of the canonical cellular input, the CellularAction wire message and the batch trace record becomes a target kind (0 none, 1 patch, 2 engulf with zero coordinates). Kind 2 exists only on v10, which no server admitted before; cellular servers now admit v10 with v9 behaviour plus engulf, and still refuse a v10 mutation choice until 11.4c. Admission, the session-batch adapter, trace codec, matcher and action-block validator carry the kind. The client session library accepts v10 and an engulf flag, and its send no longer reports a message its version cannot encode as sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -116,6 +116,45 @@ void v7_reliable_action_is_stable_and_strict() {
|
||||
CHECK(!decode_cellular_action_input(malformed_input));
|
||||
}
|
||||
|
||||
// ADR-0124: target kind 2 (engulf) exists only on v10, without coordinates or a patch.
|
||||
void v10_engulf_action_is_versioned_and_exclusive() {
|
||||
CellularAction engulf{17, 23, 29, 31, 5, -5, false, 0, 0};
|
||||
engulf.engulf = true;
|
||||
const auto bytes = encode_session(SessionMessage{engulf}, session_protocol_v10);
|
||||
CHECK(bytes.size() == session_header_bytes + 48 && bytes[session_header_bytes + 36] == 2);
|
||||
std::uint16_t version{};
|
||||
const auto decoded = decode_session(bytes, &version);
|
||||
CHECK(decoded && version == session_protocol_v10 &&
|
||||
std::get<CellularAction>(*decoded) == engulf);
|
||||
CHECK(encode_session(SessionMessage{engulf}, session_protocol_v9).empty());
|
||||
CHECK(encode_session(SessionMessage{engulf}).empty()); // The default v7 has no engulf.
|
||||
auto with_patch = engulf;
|
||||
with_patch.has_intake_target = true;
|
||||
CHECK(encode_session(SessionMessage{with_patch}, session_protocol_v10).empty());
|
||||
// A v9 decoder refuses kind 2 even with a valid layout.
|
||||
auto as_v9 = bytes;
|
||||
as_v9[4] = static_cast<std::uint8_t>(session_protocol_v9);
|
||||
CHECK(!decode_session(as_v9));
|
||||
// Coordinates are reserved for a patch target.
|
||||
auto placed = bytes;
|
||||
placed[session_header_bytes + 40] = 1;
|
||||
CHECK(!decode_session(placed));
|
||||
// A patch action on v10 is unchanged.
|
||||
const CellularAction feed{17, 23, 30, 31, 0, 0, true, 1'000, 2'000};
|
||||
const auto feed_bytes = encode_session(SessionMessage{feed}, session_protocol_v10);
|
||||
CHECK(std::get<CellularAction>(*decode_session(feed_bytes)) == feed);
|
||||
|
||||
CellularActionInput input{31, 5, -5, false, 0, 0, true};
|
||||
const auto canonical = encode_cellular_action_input(input);
|
||||
CHECK(canonical[12] == 2 && decode_cellular_action_input(canonical) == input);
|
||||
auto coordinated = canonical;
|
||||
coordinated[16] = 1;
|
||||
CHECK(!decode_cellular_action_input(coordinated));
|
||||
auto unknown_kind = canonical;
|
||||
unknown_kind[12] = 3;
|
||||
CHECK(!decode_cellular_action_input(unknown_kind));
|
||||
}
|
||||
|
||||
void v8_perception_is_bounded_and_canonical() {
|
||||
CellularPerception perception{19, 42, {}, std::nullopt};
|
||||
perception.patches = {
|
||||
@@ -223,6 +262,7 @@ int main() {
|
||||
round_trip_and_version_gate();
|
||||
malformed_frames_are_refused();
|
||||
v7_reliable_action_is_stable_and_strict();
|
||||
v10_engulf_action_is_versioned_and_exclusive();
|
||||
v8_perception_is_bounded_and_canonical();
|
||||
v9_perception_carries_only_valid_owner_diagnostics();
|
||||
v10_mutation_choice_is_a_strict_reliable_action();
|
||||
|
||||
Reference in New Issue
Block a user