4.7 KiB
Preservation test-only review
Reviewer /root/default_omission_review, 2026-09-13. Read only crates/oa-core/tests/default_omission_preservation.rs while the parent baseline gate was live. No edits to the test/input/source, no Cargo, no Gitea, no execution result claimed. Changes below are for after the frozen gate closes.
Findings
-
Constructor control locks expanded insertion despite its disclaimer. At lines 483–490, the exact golden requires
State { lifeline none; state none; }. A compact implementation correctly retaining authoredlifeline none;, removing inapplicableaction none;, and selecting State without inserting optional state would fail. The disclaimer does not weakenassert_eq!at lines 313–315. Separate the context control from the exact-source helper: require the full literal target model, State constructor selection, no action field, and exact preservation of the unchanged shared lifeline field plus unaffected source/trivia. Permit state omission. If final insertion formatting is itself an accepted output contract, establish its independent compact golden after the baseline gate; retain the old expanded spelling only as named historical baseline evidence. -
Relation control similarly overconstrains a semantically changed default field. Lines 526–531 require replacing
oriented true ;withoriented false ;. The revised user contract permits removal when the value changes and becomes the new context's omission default. Both updating in place and removing the oriented syntax while retaining its comment/trivia can satisfy that contract. The essential assertions are the literal CommunicationMean body with oriented=false, no stale explicit true, and preservation of unchanged endpoints/items/source trivia. Use a context-specific assertion or narrowly enumerated independently admitted output alternatives; do not broadly normalize whitespace or all default fields. Change the fixture comment at line 80 if choosing omission: it currently prescribes retaining field spelling even though this field is changing semantically. -
Do not infer baseline whitespace from successful admission of the golden.
assert_preserved_updateindependently compiles expected source (lines 297–306), proving that it denotes the intended model and already has IDs. This does not prove that the current updater produces the particular insertion spaces at line 488. Gate output must establish that empirical fact. If the normal constructor control fails only on predicted whitespace, classify it as an oracle spelling error, preserve frozen logs, and revise the test afterward; do not count it as a demonstrated preservation defect. Its current shared field has conventional spelling and no adjacent comment, so a stronger post-gate fixture should givelifelinedistinctive spacing/comment trivia if that control is meant to demonstrate shared-field lexical retention.
What is sound
- The three baseline/target model builders use literal structs, fixed IDs, and explicit source-default values rather than factory or writer output. Fixture admission checks the complete model and absence of stabilization edits (
268–280); desired target source is separately checked against the target model (297–306). No circular canonical-writer oracle found. - The nine original tests distinguish no-op/header-only controls from real sibling-payload changes: Exchange binding (
337), Node position (382), and TraceBaseline prose (416). Each intended scalar change is reflected independently in both the typed target and a unique-token source replacement. Exact bundle equality is appropriate for these tests because all other authored fields are semantically unchanged. - The constructor control's target explicitly uses MixedLegacy and State with unresolved optional fields. The relation control explicitly changes oriented=true to false with its relation kind. Those handwritten targets make the intended semantic differences clear; actual admission is still an execution result, not established by this review.
- Ignore messages honestly label static witnesses. The baseline gate should verify six original normal controls, two context controls, and the three desired-behavior witnesses separately. The three ignored tests should fail at the final source-preservation comparison to establish the predicted defects; an earlier fixture/model/admission failure establishes a test setup problem instead.
Recommendation: preserve the live gate inputs. After closure, retain exact byte assertions for the nine unchanged-field regressions, and revise the two context controls to encode semantic correctness plus unchanged-source preservation without obligating new/changed redundant default fields. No production design acceptance follows from this static test review.