Serializes a builder program's pre-finalize plan state: export
yields a JSON-safe attrset with the BuildPlan fields, json the
corresponding string. Live derivations never appear in the output —
boxed derivation fields are omitted, and bare boxed positions show
as null.