feat(08-02): ARG2 codec — one version, one decode path (G-suite GREEN)

graph.ts versioned IN PLACE (no second codec): GRAPH_MAGIC 0x41524732,
GRAPH_VERSION 2, HEADER_SIZE 72 (72%8==0 keeps f64 views aligned);
header gains landmarkCount u32 @60 (the old pad), landmarkQuantumS f32
@64, reserved u32 @68; the landmark suffix (u16 toTable, u16 fromTable,
u32 landmarkNodes) extends layoutFor's total arithmetic — exact-size
law covers the variable suffix BEFORE any view allocation (T-08-01).
D-01 fail-honest: ARG1 bytes / version!=2 / landmarkCount=0 / hostile
quantum / size mismatch all decode null (committed mini-graph-arg1.bin
is the standing rejection vector). GraphInput.landmarks REQUIRED and
loud-validated (T-08-04). RoadGraph gains the five landmark fields
(Plan 08-03's ALT potentials consume them).

Fixture regenerated as ARG2 through the SAME encode authority: the
builder gains the tiny real landmark stage (L=2, anchors [0,18],
quantum 0.1s, coverage 1.0 — identical bytes every re-run).

Rule-3 call-site updates forced by the required-landmarks law (missed
by the plan's files list): astar.test A3 + snap.test S3 synthetics
carry inert hand landmark blocks. Fixture regen pulled forward from
task 3 so this commit's own battery is green (74 passed, 0 failed).
This commit is contained in:
araharah-executor
2026-10-25 18:48:23 +08:00
parent 34d96b0cdb
commit 32a00b5b0b
5 changed files with 206 additions and 24 deletions
+9
View File
@@ -160,6 +160,15 @@ test("A3 unreachable -> null — a disconnected pair resolves the honest miss",
],
names: ["Isolated Road"],
maxSpeedKmh: 60,
// ARG2 (plan 08-02): every encode carries a landmark block — inert
// steering data until ALT lands (08-03); hand values keep this case
// focused on the unreachable-pair law. Sentinels mark component 2.
landmarks: {
quantumS: 0.5,
nodes: [0],
to: Uint16Array.of(0, 30, 0xffff, 0xffff),
from: Uint16Array.of(0, 30, 0xffff, 0xffff),
},
}),
);
assert.ok(g, "synthetic graph decodes");