Skip to content

SH-B: Production Rust realization closure now - #8175

Closed
briansrls wants to merge 2 commits into
mainfrom
session/wise-swift-269-wiring-v2
Closed

briansrls wants to merge 2 commits into
mainfrom
session/wise-swift-269-wiring-v2

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session wise-swift-269.
Pushing to session/wise-swift-269-wiring-v2 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

Brian Searls and others added 2 commits August 12, 2026 02:50
The compiler asks the TARGET to render a produced declaration and receives a
bodied-arrow scaffold. emit_produced.dag imports no target language: it matches
on target.produced_decl_support, refuses ProducedDeclUnwired with a typed,
located produced_decl_target_unwired, and otherwise calls the target's renderer.

Rust and C each own their own order, authored in their own modules:

  Rust  fn add(x: i32, y: i32) -> i32 { x + y }
  C     int add(int x, int y) { return x + y; }

Those differ in every axis the compiler previously owned -- keyword-first versus
return-type-first, NAME colon TYPE versus TYPE NAME, return arrow versus none,
value-producing versus statement-sequenced with a return token and terminator.
C required no compiler edit: it registers a renderer and supplies its own
binding spellings. That is criterion 5, and the cross-golden arms are its
discriminating RED -- neither target can produce the other's text, so a seam
that kept order in the compiler would fail the witness rather than pass quietly.

target_model_with_produced_scaffold installs the rendered scaffold, deciding
only WHERE it attaches. It reuses target_model_bundle_replace_edge_target rather
than adding node surgery, and takes the BARE base row from ProducedDeclWired --
the target's ordinary rule already carries a fixed scaffold, and appending a
second bodied-scaffold edge would let the fixed one win every lookup, emitting
one declaration's signature for every declaration.

Deleted as obsoleted by the climb: rust_produced_decl_target and, cascading,
rust_bodied_relation_rules_node_with_scaffold. The rust_signature_* chain is
KEPT -- it is now Rust's renderer body, which is where order belongs.

Re-cut onto merged main after #8155 squash-merged; the field carrier and its
preservation fixes come from that commit rather than being duplicated here.

Not verified by execution -- CI is the consumer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both findings in review 51267 verified against the code and fixed.

FINDING 1 - a regression I introduced. On main, emit_produced_module_rust
ignored the passed target and built a per-decl Rust target internally. Making
the passed TargetModel authoritative is the right seam cut, but it means
rust_target_model_staging -- still ProducedDeclUnwired after the mechanical pass
-- now refuses. Its two consumers, v2.workflow.realization_attempt and
emit_host_produced_module_equals_eval_test, would have hit
produced_decl_target_unwired instead of emitting. Staging now carries
rust_produced_decl_support(): it is a Rust target and renders Rust order,
differing from production only in lex, which is the dissolution-by-identity
sequencing already ruled for it.

FINDING 2 - the criterion-5 witness could not have passed. C's bundle carried
selection policy, declared inhabitants, translation rules, serialize source and
semantic-decl emission, but neither value_expression_projection nor
operator_realizations, and produced-decl emission serializes the arrow BODY
through those. The signature renderer covers prefix and scaffold order only; it
does not substitute for body projection.

Took the wire-it option rather than narrowing the golden to signature-only,
because narrowing would have made the receipt claim less than criterion 5 asks
while still reading like a two-target proof. C now carries a minimal
value-expression surface -- binding-ref plus an op_add catalog on c_token_plus,
mirroring Rust -- so the shared fixture body projects for C.

Forms C has not modeled carry token classes with no lex rule, so reaching one
REFUSES at serialization rather than emitting fabricated text. That is the
existing fail-closed lex-miss arm, not a new mechanism, and it keeps C's
unmodeled surface honest instead of quietly wrong.

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

gunbai-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closing as a duplicate of #8168 — no content is lost.

Both branches point at the identical commit c61e6aa749a. This PR was auto-opened for session/wise-swift-269-wiring-v2, my local working branch, which reached the remote alongside session/wise-swift-269-produced-decl-wiring (the branch #8168 tracks) while I was re-cutting the change onto merged main after #8155 squash-merged.

#8168 is the live one — it carries the reviews, the corrected title and body, and the CI run. Two open PRs with byte-identical content is the ambiguity that gets the wrong one approved, so this one goes and its branch is deleted. Nothing here exists outside #8168.

@gunbai-bot gunbai-bot Bot closed this Aug 12, 2026
@gunbai-bot
gunbai-bot Bot deleted the session/wise-swift-269-wiring-v2 branch August 12, 2026 03:30
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