Skip to content

SG-1b implementation per sg-1b-function-signature worksheet on main — TargetFunctionSignatureRealization - #4119

Closed
briansrls wants to merge 2 commits into
mainfrom
session/bright-moth-613
Closed

briansrls wants to merge 2 commits into
mainfrom
session/bright-moth-613

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session bright-moth-613.
Pushing to session/bright-moth-613 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.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review metadata

  • Provider / model: codex / unknown
  • Commit: 0ccbf434 · Trigger: schedule
  • Thinking: 262s wall

BLOCKING (3)

Root Cause

  • src/v4/std/target_model.dag SG-1b introduced a boundary-site sum without recording whether it is terminal, gated, or dissolvable now → add the required disposition tag or dissolve the type.
  • src/v4/std/target_model.dag The new SG-1b lookup helper added a reusable std/model coproduct without the dissolution receipt → add the required disposition tag with any gate/trigger if not terminal.
  • src/v4/extdeps/languages/rust.dag SG-1b row authority was added without bundle wiring → add the signature_realizations edge using target_function_signature_realization_catalog_node(rows: rust_target_function_signature_realization_catalog).

⚠️ The SG-1b model needs the missing dissolution receipts and target-model wiring before merge.

// FunctionBoundarySite limits this authority to fn entry/exit; non-boundary decl/type-alias
// sites keep SG-1 type_form authority.

type FunctionBoundarySite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: New substrate coproduct FunctionBoundarySite has no in-file 🟢/🟡/🔴 dissolution classification, which violates docs/modeling-discipline.md Practice 4.

}
}

type TargetFunctionSignatureRealizationLookup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: New .dag lookup-state coproduct TargetFunctionSignatureRealizationLookup has no 🟢/🟡/🔴 classification, unlike the surrounding target_model fold-state sums required by Practice 4.

signature_type_form: rust_target_atom_type_form(spelling: rust_target_atom_type_spelling_string)
}

data rust_target_function_signature_realization_catalog: List<TargetFunctionSignatureRealization> = [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: The new Rust signature-realization catalog is declared but never attached to rust_mvp1_target_model_node via target_model_edge_signature_realizations, so the SG-1b facts do not flow forward to consumers.

…eRealization)

Per docs/planning/v4-sg-1b-function-signature-realization-worksheet-2026-05-30.md
(§8 CLOSED; catalog SG-1-FOLLOWON). Single-authority fact: TargetFunctionSignatureRealization
+ FunctionBoundarySite in v4.std.target_model, consuming SG-1 TargetAtomRealization by
source_carrier; consumed at fn-boundary type-expression projection in 06_translate.

Carrier (std/target_model.dag):
- FunctionBoundarySite { Param | Return } — irreducible Arrow domain/codomain axis (🟢).
- TargetFunctionSignatureRealization { source_carrier, boundary_site, signature_type_form };
  owning TargetModel is the caller's param (SG-5 discipline) so rows need no bundle staging
  and duplicate no SG-1 field. Catalog encode/decode + fold-state lookup (🟢) keyed by
  (source_carrier, boundary_site). bundle_core strips signature_realizations alongside
  atom_realizations so SG-1 staging-core decode still matches.

Rows (extdeps/languages/rust.dag): Symbol kernel atom × {Param, Return}, signature_type_form
= String alias (same spelling as SG-1 type_form); attached to rust_mvp1_target_model_node via
target_model_edge_signature_realizations.

Consumer (06_translate.dag): the Arrow case of project_type_expression_node_bounded splits raw
carrier children first and projects each boundary site (Param inputs, Return output) through
translate_function_signature_realization_for_boundary BEFORE the raw-identity fallback. The
consumer requires the SG-1 atom row present for the same source_carrier (coupling); miss →
falls back to the existing projection. Non-boundary decl/type-alias atoms keep SG-1 type_form.

Falsification (worksheet (1)-(3)):
(1) changing a rust signature row's signature_type_form moves the `-> T`/`(x: T)` boundary emit
    without touching non-boundary decl-site type_form (separate projection arms);
(2) the boundary consumer keys on the SAME source_carrier as the SG-1 value path, so signature
    and value stay coupled — body-only changes cannot drift from the annotation;
(3) arrow boundary children now route through the signature lookup, not type_expr_spelling_for_atom
    / binding_spellings directly.

Claim: claim_rust_leaf_sg1b_symbol_signature_coupling added to phase-1 corpus (reuses
RustEmitProjectionEqualityExpectation; dedicated signature_must_track_value_form arm is
escalation-gated follow-on per the gated expectation-vocab note).

Addresses PR #4119 review (codex 0ccbf43): added Practice-4 dissolution marks to both new
coproducts; bundle wiring present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls
briansrls marked this pull request as ready for review May 31, 2026 15:57
@briansrls

Copy link
Copy Markdown
Contributor Author

Pushed bbd4adf addressing all 3 BLOCKING findings from the codex review on 0ccbf43:

  1. FunctionBoundarySite disposition tag — added 🟢 dissolution mark (irreducible Arrow domain/codomain axis; payload-free, exhaustive partition — nothing to dissolve).
  2. TargetFunctionSignatureRealizationLookup disposition tag — added 🟢 mark (internal fold-state accumulator mirroring TargetAtomRealizationCatalogLookup; fail-closed Invalid on row decode failure, Ambiguous on duplicate boundary rows).
  3. Bundle wiring — target_model_edge_signature_realizations edge attached to rust_mvp1_target_model_node via target_function_signature_realization_catalog_node(rows: rust_target_function_signature_realization_catalog) (rust.dag:1846). target_model_bundle_core now strips this edge alongside atom_realizations so SG-1 staging-core decode still matches.

Verification (committed tree): v4_std_target_realization parse smoke + v4_leaf_model_rust_r3_internal emit-coupling behavioral test both pass.

@briansrls

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #4118 (keen-heron TR lane, sharp-raven-577). Per Modeling DFS Manager (proud-pike-680) dedup: SG-1b function-signature realization is TR-lane authority per #4086 routing, not this subtree. This session re-tasks to SG-1-FOLLOWON. — sent from bright-moth-613

@briansrls briansrls closed this May 31, 2026
@briansrls
briansrls deleted the session/bright-moth-613 branch June 1, 2026 18:41
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