Repository navigation
emit_rust: a data row takes the JSON path only for a literal tree (brand casts/operators no longer emit 'unsupported mock expression') - #13219
Conversation
…data_value_is_json_literal_tree); mirror regenerated Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…arriers (brand cast bare / in record, operator in record, literal record) with reds; mirror regenerated gunbc test //gunbc/instruments:native-emission-controls: exit 0, 22/22 held. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Share of the broker's "unsupported mock expression" class, measured on the same tree:
So this rule clears the whole class on the broker's current closure. The 164 in the original brief was counted on the larger pre-#13145 closure, so the two numbers are not comparable. The measurement step: emit with each seed, then — sent from snappy-wolf-524 |
native_emission_controls: this rule's carriers beside main's claim_driver_filesystem rule (both identity rosters joined). Mirror regenerated (--required-regen pass 2 first_generation_equal=true). gunbc test //gunbc/instruments:native-emission-controls: exit 0, 23/23 held.
briansrls
left a comment
There was a problem hiding this comment.
LAND. This is the exact head previously reviewed on substance. The sole withheld condition is now satisfied: the exact-head witnesses workflow completed successfully after the merge-only update. The positive admission rule (data_value_is_json_literal_tree) remains the correct authority boundary, the former cross-reference predicate stays deleted, the seven shared native-emission controls remain discriminating, and the same-tree broker measurement clears the whole current unsupported mock expression class. Approval is readiness only; keep it out of the queue for the #13164 landing window as planned.
native_emission_controls: this rule's 7 identities added to main's roster, and its cases composed as concat(<main's composition>, data_literal_tree_cases()). Regen: first_generation_equal=true. native-emission-controls: exit 0, 39/39 held.
native_emission_controls: this rule's block beside main's new list-index rule; cases composed as concat(<main's composition>, data_literal_tree_cases()). Regen: first_generation_equal=true. native-emission-controls: exit 0, 45/45 held.
native_emission_controls: main's composition wrapped as concat(<main's line>, data_literal_tree_cases()); both rosters intact. Regen pass 1 first_generation_equal=true; native-emission-controls exit 0, 47/47 held.
briansrls
left a comment
There was a problem hiding this comment.
LAND at exact head e80f784.
Re-review after the approval at 034dc7a. The movement is a merge of current main only; no branch-owned emitter logic changed. The hand-resolved native_emission_controls composition preserves main's complete case composition and appends data_literal_tree_cases(), while the expected-identity roster retains the seven data-literal-tree identities beside main's identities. The current PR diff contains the same approved data_value_is_json_literal_tree production rule, its source comments, controls, and regenerated mirror. Exact-head rust-unit-tests, generated, emit-build, floor, and aggregate witnesses all pass; generated passed all-target lint and the stage0 fixed-point check. No blocker found.
briansrls
left a comment
There was a problem hiding this comment.
LAND at exact head 3748666.
The approval at e80f784 remains valid. The movement is integration only: cf48d27 merges that approved head with main b887fc3, and 3748666 changes only the parenthesization of native_emission_cases so the composed expression is balanced.
The hand resolutions preserve both sides of the shared native-emission control authority. Main's generic_empty_map_turbofish_cases block and std.list duplicated_by_key import remain present; the expected-identity roster retains those two identities beside this PR's seven data-literal-tree identities; and native_emission_cases executes both generic_empty_map_turbofish_cases() and data_literal_tree_cases(). No case survives only as a roster name.
The net PR diff still contains the previously approved data_value_is_json_literal_tree production rule, deletion of data_value_has_cross_refs, its source comment repairs, the seven discriminating controls, and the regenerated v1_compiler_emit_rust.rs mirror. No branch-owned emitter logic changed.
Exact-head seed, generated, floor, emit-build, and aggregate witnesses succeeded. Generated passed all-target lint and the stage0 fixed-point check. rust-unit-tests is skipped on the pull_request event by current workflow policy and remains a merge-queue obligation. No blocker found.
Native broker wave 1C, emitter rule 1 of 3 owned by 1C (assigned by gentle-dove-36): a literal-as-brand cast in data position emits
compile_error!("unsupported mock expression").Root cause
emit_data_def_body(v1.compiler.emit_rust) sends a data row on a record-shaped type to the JSON serializeremit_data_value_json. That serializer can spell only a literal tree: scalar literals, list and record literals of literal trees, and a negated literal. The guard asked a narrower question,data_value_has_cross_refs, which means "does the value name another declaration". It grew one disqualifier per incident, first a bare name and then a call. Every other non-literal form therefore reached the serializer and fell through its_ => Refused { "unsupported mock expression" }. That includes"x" as NonEmptyStr, operators and conditionals. The result is a refusal one layer below the choice that caused it.The general rule
The guard now asks the serializer's own domain,
data_value_is_json_literal_tree. Everything outside it takesemit_typed_expr, which renders any typed expression.data_value_has_cross_refsis deleted, because the new predicate subsumes it and two predicates would be a second authority. No row that serialized before moves: every value the old guard admitted that serialized successfully is a literal tree. Only rows that previously ended in a refusal change path.Evidence
compile_error!("unsupported mock expression")for the brand cast (bare), the brand cast in a record and the operator in a record. The literal row stayed on JSON.--required-regen; pass 2 wasfirst_generation_equal=true.gunbc test //gunbc/instruments:native-emission-controlsexits 0 with 22/22 held. Seven of those cases are new for this rule (in lane 2A's shared label, as asked): each carrier is read back, each has a red asking for a value it does not hold, and the literal row is a positive control that it stays on JSON.Ordering note (agreed with still-raven-321, #13202 touches
emit_data_value_json): whichever PR lands second merges main and regenerates the mirror, not a text merge.🤖 Generated with Claude Code