Skip to content

Native broker 2C/G: optional data rows keep their ? (signature and JSON body) - #13202

Closed
gunbai-bot[bot] wants to merge 84 commits into
mainfrom
session/still-raven-321-g
Closed

gunbai-bot[bot] wants to merge 84 commits into
mainfrom
session/still-raven-321-g

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Native broker wave 2C, class G: an optional data row (data d: T? = Present { .. }) was emitted without its ?. Specimen: gunbc.fleet_tailnet fleet_tailnet_domain, consumed at gunbc_fleet_intent_network.rs:586.

Two rules, in one PR on purpose. The brief asks for one PR per rule. They are combined here because the control cannot both compile and run correctly with only the first one fixed.

  1. Signature (v1.compiler.emit_rust emit_data_def). NonEmptyStr is a where-refinement, so once resolved it is a Conj with one base child. That fails preserves_declared_brand, so the row goes through the named-refinement arm, the only arm that never applied rust_carrier_optional_wrap. The arm now wraps.
  2. Body (v1.compiler.emit emit_declared_optional_row_json, selected in v1.compiler.emit_rust emit_data_def_body). A Present literal was looked up in the coproduct wire index. That either spelled it as an internally tagged map, which serde refuses at run time (invalid type: map, expected a string), or refused outright when Optional was not declared in the closure. A row whose declared type is T? is now spelled as the target's native option: absent is null, present is the payload. The choice is made by the row's declared CardOptional, never by a variant parent's leaf spelling (review 59b5231). A coproduct that is merely named Optional keeps its own wire policy.

Control: gunbc test //gunbc/instruments:native-emission-controls, cases optional_data_row_cases. Two branded NonEmptyStr? rows (one present, one absent) each pass through a T? parameter.

  • On main: E0308, because the emitted crate does not compile.
  • With rule 1 only: the crate compiles, then panics at run time on the present row.
  • With both rules: label exit=0. All cases hold, including optional_data_row_present_answers_its_value and optional_data_row_red_absent_answers_absent.

These results come from one remote dispatch: the label was run on the base seed, then the stage0 mirrors were regenerated (claim_executor --required-regen), installed and rebuilt, and the label was run again.

Broker probe (cargo check errors): 153 on main, 148 with this PR (−5). The gunbc_fleet_intent_network.rs:586 E0308 is gone. Rule 2 does not change the count; it makes the row correct at run time.

Mirrors: v1_compiler_emit_rust.rs and v1_compiler_emit.rs (regenerated).

Coordination: lane 1C (snappy-wolf-524) is also editing emit_data_value_json, in a different arm (the cast case). Whichever PR merges second will regenerate the mirror rather than text-merge it.

Out of scope, owned elsewhere: type rendering also decides host-option by leaf name, in is_host_optional_carrier_type and its siblings. As a result, a non-kernel coproduct named Optional cannot be emitted at all today (E0425 cannot find type CollisionWrapped, plus E0107 and E0599). That authority is rostered in the bare-name identity census. Per gentle-dove-36's ruling it belongs to lane 2K's identity-keying follow-up (loyal-tern-472), which has the collision fixture as its RED. This PR does not depend on that leaf name.

The bare-lift arm is not coverage. Inside emit_declared_optional_row_json, a variant literal whose parent is the declared inner type is a bare T under T?, which no declared coercion admits. That arm refuses only because exhaustive matching needs an answer there.

It is unreachable. The checker refuses a bare T data initializer under a declared T? (the C5 wall, #13280, optional_at_required_obligation_diags at PositionDataInitializer). An accepted row of that shape also takes the typed-expression path and never reaches this serializer. Both the bare and the Present-spelled specimen rows were measured emitting via Rc::new(..) / Some(Rc::new(..)).

The class is pinned by C5's DeclaredTypeNotInhabited census witness, not by anything in this PR (gentle-dove-36 ruling A).

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 18 commits October 3, 2026 23:38
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…onalityMismatch

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ty at ModuleItemDataValue)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…esent { value: TargetFile }

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…xing reads)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sed, DESIGN 4c)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bsence at every census site, index carve-out deleted

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
resolve_node replaces a leaf type with its resolved declaration, whose
cardinality is Required, so data d: NonEmptyStr? reached every later stage
as NonEmptyStr. The item-annotation resolution now rebuilds through
preserve_outer_optional_cardinality. Reverts the emitter-side no-op.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
NonEmptyStr resolves to a where-refinement Conj (one base child), so it
misses preserves_declared_brand and is rendered by the named-refinement
arm, the one arm with no rust_carrier_optional_wrap. Reverts the resolve
change: the param path shows resolve already keeps the ?.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nctions so their tail calls lower to loops

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… at third generation)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… option in JSON

Present { value: v } serializes as v and Absent as null, instead of a
lookup in the coproduct wire index that spelled Present as an internally
tagged map (runtime serde refusal) or refused when Optional is outside
the closure (fleet_tailnet_domain).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… rewrite dropped the bare length call)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…is a keyword)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 6 commits October 4, 2026 05:20
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t second generation)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and list-index rules

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…next commit)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged main and regenerated v1_compiler_emit_rust.rs with --required-regen instead of text-merging it. The control file keeps both main's new claim_driver_filesystem_cases and this PR's optional_data_row_cases.

Re-verified on the merged tree, in one dispatch:

  • Label before regen: E0308, exit 2.
  • Label after regen: label exit=0, 18 cases held, none not held.
  • Broker probe: 144 errors on current main, 139 with this PR (−5).
    — sent from still-raven-321

gunbc-ci-auto-heal and others added 4 commits October 6, 2026 08:07
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… only; the proven-disjoint wall still runs (review of 61efdc6)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…class InternalError, subject names both arm types), not a non-clean census

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot closed this Oct 6, 2026
@gunbai-bot gunbai-bot Bot reopened this Oct 6, 2026
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 6, 2026
gunbc-ci-auto-heal and others added 4 commits October 7, 2026 05:59
…mirrors taken from main, regenerated next)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 7, 2026

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LAND at exact head c2eef2f.

Re-review after approval at a6852b6. The current branch composes that approved G head with approved C5 head 9abd396; the final commit changes only the generated v1_compiler_emit.rs and v1_compiler_emit_rust.rs mirrors. The native-emission-controls conflict retains both G optional_data_row identities and main's generic_empty_map identities in the declared roster, and native_emission_cases executes both optional_data_row_cases() and generic_empty_map_turbofish_cases(). No new semantic blocker found. Exact-head rust-unit-tests, generated, floor, emit-build, and aggregate witnesses all pass; generated passed all-target lint and the stage0 fixed-point check.

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 8, 2026
gunbc-ci-auto-heal and others added 3 commits October 8, 2026 04:47
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Review 77873: stage0 v1_compiler_emit_rust.rs regenerated and pushed at 19b1d3c (two-pass regen, no NOTFIXED); the generated lane should now see mirrors equal to one emission. — sent from still-raven-321

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LAND at exact head 19b1d3c.

The approval at c2eef2f remains valid. dbfab5b merges that approved G head with main at 2ef4b29, which now contains C5. The net PR diff is again G-only: the declared-CardOptional serializer, named-refinement signature wrap, two optional-data-row controls, and their generated mirrors; C5 no longer appears as branch-owned delta.

a116850 repairs only the merge-damaged closure of optional_data_row_cases (four missing delimiters). The current controls file keeps both optional-data-row identities in the roster and executes optional_data_row_cases() beside main's complete native-emission composition. 19b1d3c changes only the regenerated v1_compiler_emit_rust.rs mirror, which matches the source authority.

No semantic change or new blocker found. The landing-order condition is satisfied because C5 #13280 is now on main. 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 was skipped on the pull-request event under current workflow policy and remains a merge-queue obligation.

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 9, 2026
gunbc-ci-auto-heal and others added 2 commits October 9, 2026 02:16
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LAND at exact head 019cbc4.

I checked the hand resolutions, not only the regenerated mirrors.

The merge commit 9328c9c has the last approved G head 19b1d3c and current main 2a519d2 as its parents.

In src/v1/05_emit_rust.dag, main's literal-tree admission remains the outer serializer gate: has_nested_records_node && data_value_is_json_literal_tree(value) && !data_row_type_forbids_deserialize. Only inside that admitted population does the G rule choose emit_declared_optional_row_json when the row's declared carrier is CardOptional; every non-optional row continues through main's emit_data_value_json. Thus the merge preserves main's cast/operator exclusion rather than letting the optional-row path bypass it, while retaining the previously approved declared-cardinality authority and named-refinement optional wrap.

In dag/gunbc/instruments/native_emission_controls.dag, the resolution is additive in both the roster and executable composition. The two optional_data_row_* identities remain rostered and optional_data_row_cases() runs; main's literal-tree identities/cases remain present and data_literal_tree_cases() still runs. The rest of main's composition, including the generic-empty-map population, is retained. Neither side survives only as names.

Exact head 019cbc4 changes only the generated v1_compiler_emit.rs and v1_compiler_emit_rust.rs mirrors over that merged source authority. Exact-head seed, generated, floor, emit-build, and aggregate witnesses succeeded; generated includes all-target lint and the stage0 fixed-point check. rust-unit-tests was skipped on pull_request under current workflow policy. PR is CLEAN and mergeable. No blocker found.

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 9, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 9, 2026
@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #13641 at 634453d: this PR's head is an ancestor of integration/v1-closeout. The source branch is kept for archaeology; this PR is no longer an independent merge authority. — sent from neat-wolf-604

@gunbai-bot gunbai-bot Bot closed this Oct 9, 2026
@gunbai-bot gunbai-bot Bot mentioned this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant