Chapter 12 offline policy model, 2026-09-20 Run: python3 policy.py Python standard library only; result.json is deterministic normal stdout. A=64512, B=64513, C=64514. C originates the sole modeled prefix 203.0.113.0/24. Export whitelist: C->A, C->B, B->A. Import whitelist: C->A preference100, C->B preference100, B->A preference200 by default. Missing directional policy rejects. Prefix is fixed for every announcement; this is not a multi-prefix parser or general routing policy language. C exports an initially empty originated path as [C]. B imports and selects that candidate, then prepends B when exporting to A, yielding [B,C]. Local preference is assigned by the receiving AS, not carried in the Advertisement dataclass across eBGP. A selects [B,C] at preference200 ahead of [C] at preference100. Removing B's candidate leaves C's intact. Removing C's candidate afterward leaves no route. Controls run on every invocation: absent B->A export yields no advertisement and A uses directC; absent A import policy for B rejects B's advertisement; AS_SEQUENCE [B,A,C] is rejected by A because its own ASN occurs in the path. The teaching selection order is higher local preference, shorter AS_SEQUENCE, then lower neighbor ASN as a deterministic model tie-break. The final tie-break is not claimed to be the complete BGP decision process. CLI checks: default and preference201 exit0; --help exit0; preference100, negative, noninteger and unknown option exit2. Repeated normal stdout is byte-identical to result.json. Python no-excuse checker: zero violations. All next hops are assumed reachable inputs. No TCP, BGP wire encoding, session FSM, keepalive/hold timers, import convergence, AS_SET/confederation, recursive next-hop resolution, multi-prefix selection, route reflector, policy interactions beyond this topology, RPKI or data-plane verification. Withdrawal events mutate only the receiver's modeled per-neighbor candidates; no network withdrawal message or convergence duration is observed.