Files
ARCADIA-Studio/harness/experiments/default-policy-20260913/policy-review.md
T

30 lines
5.3 KiB
Markdown

# Isolated source-7 omission policy: independent static review
Reviewed by `/root/default_policy_critic` for parent Codex-9e8r6t, 2026-09-13. Scope: `harness/prototypes/source-defaults-20260913.rs` and `crates/oa-core/tests/default_omission_policy.rs`, checked against current `language.rs`, `model.rs`, `view_options.rs`, and `language/semantic_source.rs`, with the candidate design and prior preservation/admission reports as intent. HEAD is `136917b47e50f7c07da975b93f879493cab81e21`; the two policy files are staged additions. No Cargo command, Gitea action, or compiled-input edit was performed by this reviewer. This report is static evidence; parent owns execution/capture verification.
## Finding
No blocking correctness defect or important oracle overconstraint found within the documented field-map interface. This is acceptance of neither public compact formatting nor lossless updates.
- The explicit declaration defaults agree with the source-7 admission path (`language.rs:1705-1870`), including source Scenario `MixedLegacy`, header-specific state kinds, BoundaryExchange true versus CommunicationMean false orientation, and DataField maximum 1 rather than unbounded none. Required Port contract, relation endpoints/ports/contextual payloads, node identities, artifact owner and trace endpoints are not omission candidates.
- Selected nested constructors remove only admitted Option/default fields. Required String minimum_length, Enumeration literals, Event payloads, occurrence bindings/control/fragment/branch payloads, Timer expression, MessageValue field/expression, coordinate records, PortContract payloads, and contextual endpoint/purpose fields remain. Whole default String/Signal/Exchange removal differs correctly from pruning required fields in a nondefault selected constructor.
- `operation { allocation: null }` becomes present `operation {}` rather than absence. Present empty default lists, primitive value payloads, revision/fragment empty strings, Only([])/Any([]), and historical baseline payloads retain their distinctions.
- `restore_serialization_skips` restores exactly the applicable serializer omissions found at `model.rs:561`, `1556`, and `1604`; it does not add Exchange fields to Action/State. Existing values use `entry(...).or_insert(...)`, so populated values survive. It intentionally does not hydrate already compact/partial maps; production integration must honor the documented typed-extraction input requirement.
- Signed zero comparison checks zero bits after JSON numeric equality. The two node-coordinate sign witnesses independently assert bits; required nested coordinates are never removed. No recursive default removal reaches semantic historical content (`semantic_source.rs:127-188` still owns its typed writer).
- Exact expected maps, input immutability and compact idempotence are appropriate for this isolated function contract. Synthetic identity strings and historical/future sentinels are not admission tests. Passing them must not be described as evidence those particular sources/models compile.
## Nonblocking oracle gaps
1. Unknown/future preservation currently has top-level sentinels only (`every_element_omits_only_empty_common_defaults`, `relation_required_endpoints_and_contextual_payloads_remain`). Add focused nested sentinels before claiming this protection has been exercised: String minimum_length=0 plus future=[]; default Exchange plus future=null; all-default view_options plus future=false; unknown constructor and a multi-key constructor wrapper. Known defaults may disappear, but the unknown field and containing nonempty composite must remain. Static inspection predicts success: exact object key-count comparison prevents whole-field removal, and `constructor_payload` refuses multi-key wrappers.
2. Complete-comparison tests exercise missing skips and existing semantic content, but do not explicitly prove that populated Exchange operation/nonempty node port_anchors survive CompleteForEdit or that CompleteForEdit is idempotent. Static `or_insert` behavior supports these properties; a small preservation witness would strengthen the restoration oracle.
3. Literal-map tests are independent of the policy implementation, but do not connect its duplicated default inventory to actual model serialization and parser admission. Before production acceptance, representative valid typed projects should pass extraction -> compact generation -> public parser with independently checked full models and signed-zero bits. Existing admission evidence resolves selected nested Option questions only.
## Remaining gates
Parent's captured focused run may establish these map tests execute, but cannot establish public formatting, source version dispatch, modular exports, compact insertion/replacement, or authored-token preservation. The three known baseline failures remain separate until actual update integration is implemented and rerun, including their sibling-change triggers. Future source8 fields/defaults require a named integrated-version audit; this source7 experiment deliberately does not traverse them. Shared source-default construction and public writer/update separation remain design/integration work.
Observed final review file hashes (SHA-256):
- policy: `cf22a23d84e9abe949d38bd2f8771d9c677149006d8c436084b154d8eaa1d460`
- tests: `cccf1d27e2f04186a94ce29e0eaef714398317462f7f1f0f039d10dc1f443b2f`