a9a816e0ed
First Rust component of the Python -> Rust migration. Chosen first because
it is the lowest genuinely game-independent layer, it has an executable
oracle, and both existing Rust implementations of it are wrong.
Contents:
* fire2 -- the proven 16-byte frame header, frame/stream splitting
* heat2 -- tag packing, varints, all 11 TDF value types
* message -- frame + decoded body, routed by NUMERIC component/command
* diagnostics -- dumps for capture review
No FIFA 17 command tables, response schemas or notification IDs: this layer
knows 0x0009/0x0007 is component 9, command 7, not that it means
Util::preAuth. That mapping belongs to a game adapter, which is what lets a
future FIFA 18/23 adapter reuse this.
Parity is tested, not asserted. fixtures/generate.py drives the proven
Python responders (heat2.py, blaze_responder_v3b.py) and freezes 56 vectors
-- 31 of them real payloads from the responder's own builders, including
the 11.8 KB preAuth reply. tests/oracle_parity.rs replays every one
byte-for-byte. 54 tests green; clippy clean.
Supersedes two wrong framings, neither of which is removed yet:
* fifa-blaze/crates/blaze-proto/frame.rs -- a 12-byte header with a u16
length, nibble-packed type/options, an error field and a JUMBO flag.
A documented guess at FIFA 23 predating the FIFA 17 recon.
* heat2.py::build_fire2_frame -- packs >IHHHHB3s, msgId at [10:12] and
msgType at [12]. Dead code, but its docstring still states that layout.
Confidence is carried in the types: TypeId::is_verified() reports which
layouts are capture-backed (int/string/blob/struct) and which the oracle
marks UNVERIFIED (list/map/union/varlist/objtype/objid/float), with a test
asserting the unverified ones stay flagged.
Cargo.lock is deliberately NOT included: it re-resolves ~240 lines against
the current registry even without this crate, so that churn is pre-existing
and does not belong in a foundation commit.
The Python backend remains the live runtime and is untouched. Nothing
consumes this crate yet.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
26 lines
1022 B
TOML
26 lines
1022 B
TOML
[package]
|
|
name = "openfut-protocol-blaze"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT"
|
|
description = "Game-independent EA Blaze wire protocol: Fire2 framing and Heat2/TDF codec"
|
|
publish = false
|
|
|
|
# NO RUNTIME DEPENDENCIES, ON PURPOSE.
|
|
#
|
|
# This crate is a byte-level codec. Its oracle (fifa17-recon/tools/heat2.py) is
|
|
# stdlib-only, and every byte it emits has to match that oracle exactly, so
|
|
# there is nothing here for a third-party crate to do that std cannot.
|
|
#
|
|
# The obvious candidate would be the crates.io `tdf` crate, which fifa-blaze
|
|
# already depends on. It is deliberately NOT used: it targets a generic
|
|
# BlazeSDK 15.x dialect, and adopting it would silently substitute someone
|
|
# else's reading of the format for our own captured evidence. It stays useful
|
|
# as an independent cross-check, not as the implementation.
|
|
[dependencies]
|
|
|
|
[dev-dependencies]
|
|
# Fixture vectors are JSONL produced by the Python oracle; tests need to read
|
|
# them. Test-only, so it never reaches a shipped artifact.
|
|
serde_json = "1"
|