Compile every generated Screenplay document before returning it - #2402
Conversation
RoundTrip printed a document, compiled it and reprinted it, and its own comment called it the correctness gate for everything the generator produces. It lived in the spec project, so it only ever ran against hand-written fixtures - the generator running against a real application verified nothing. That is how a command property called Description shipped a document that did not compile: no fixture happened to use that name, and 690 green specs said nothing. Move the capability into the package and read every printed document back through the Screenplay compiler. A rejected document is the generator being wrong rather than anything the source declared, so it is reported at error severity and a host exits non zero. The text is returned regardless so the rejected line can be read. The verifier is held concretely rather than injected. A host that could substitute it could switch it off, and a check nobody runs is the situation this exists to end. SP0024 suppresses it, because a model recovered from source the compiler never accepted describes an application that does not exist. Reprinting and comparing stays a spec-level gate. Compiling is the cheap, decisive check; byte-identical reprint is a stronger claim about information loss and belongs where fixtures are known. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Reviewer context — deliberately kept out of the description. Why this exists. Three decisions worth checking
What this does not catch. Compiling your own output catches "invalid", never "valid but untrue". The enum defect fixed earlier in #2384 emitted Verification
No issue reference in the description because none of the open Screenplay issues (#2385, #2386, #2393–#2401) covers this. |
Added