Skip to content

Lane A E0308 re-baseline (Route-A last mile): CONTINUE emitter/seed-green-integration (do NOT start fresh). Assemble the REAL crate — emitted seed closure + the ~20 hand-written periphery modules (v1_interpreter/cli_run/v1_rt/lens kernel) — cargo-build it, and produce a CATEGORIZED E0308 count by va - #5716

Merged
briansrls merged 73 commits into
mainfrom
emitter/first-option-carrier-sig
Jun 24, 2026

Conversation

@briansrls

@briansrls briansrls commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Lane A E0308 re-baseline — Route-A last mile (faithful emitted-seed crate → cargo-green)

Drives the faithful --emit-fresh Route-A seed crate from 647 → 6 E0308 (measured by execution against the real assembled crate: emitted seed closure + hand-written periphery). Three landed changes, all on the .dag authority (src/v1/05_emit_rust.dag) and spliced into the hand-synced seed mirror (src/v1/stage0/src/v1_compiler_emit_rust.rs):

1. Family-A — map-literal &str key coercion (24 → 0)

A Map<String, V> data literal now emits HashMap<String, V> keys ("k".to_string()), not HashMap<&str, V>. The coercion is type-DERIVED from the declared key type (is_rust_string_like over the map's key type), NOT a blanket "always .to_string() keys".

  • Witnesses (map_literal_string_key_test.rs): string_key_is_coerced_to_owned_string (String key → owned) + the negative control non_string_key_is_left_as_literal (a non-String declared key stays an unowned literal — the wall against blanket coercion) + a real-source Map<String, Int> fixture proving owned keys with the Int value left uncoerced.

2. First-Option carrier signature — faithful Optional rendering (the dominant ~638 cluster)

Root cause (construction, not consumer-unwrap): the Rust emitter rendered T? types inconsistently — Int? → Option<i64> ✓ but String? → bare String ✗ (the Optional was dropped). The function body already emitted Some/None correctly, so only the signature mismatched (expected String, found Option<String>). Every String text-carrier renderer path had an early-return (is_host_text_carrier_type → "String", faithful name=="String" → render_rust_text_carrier) that short-circuited before the renderer that applies the Optional template.

  • Fix: a new rust_carrier_optional_wrap(n, rendered) wraps the carrier rendering in Option<..> iff n.return_cardinality == CardOptional, applied at the 11 String carrier early-returns (returns / fields / params / applied / alias-rhs). Cardinality-DERIVED faithful rendering — no unwrap, no fabrication.
  • Witnesses (optional_carrier_signature_test.rs): optional_string_return_renders_option_signature (String? → Option< signature) + the discriminating control non_optional_string_return_stays_bare (a non-optional String stays bare — would RED if it wrapped all String carriers). Signature-scoped so the runtime's own Option<..> types don't pollute the assertion.

This strictly subsumes the originally-signed "type-derived unwrap at pipe-first" shape: forcing an unwrap at the consumer would have MASKED the renderer bug (fabricating presence / spurious-panicking on a value that genuinely should be Optional). Construction over validation.

3. Residual-3 — fail-closed unwrap at the genuine optional-into-required consumers (9 → 6)

After the renderer fix, 3 genuine T?-into-T consumer sites remain — a value modeled -> T? (e.g. first → OptionalOf<T>, the modeled total-returning-optional) flowing into a NON-optional parameter. These are the real model hole: expected Rc<T>, found Option<Rc<T>>, where the v1 checker accepts optional-into-non-optional fail-open.

  • Fix: a new rust_call_arg_fail_closed_unwrap appends a located, fail-CLOSED .expect("fail-closed: an optional value flowed into non-optional parameter <idx> of <func> (empty Optional at runtime)") — type-DERIVED: emitted iff the declared param is required AND the arg's resolved type is CardOptional. It is explicitly NOT unwrap_or_default / unwrap_or_else(<fabricated>) (those would be §5 fail-OPEN — a silent wrong answer). On an empty Optional at runtime it aborts loudly with a diagnostic naming the call site.
  • Fires at exactly the 3 real sites (semver semver_compare_identifier, schedule schedule_witness_entry_eq / runnable_eq) and nowhere else — verified by emitting the whole crate and confirming 3 applied .expect("fail-closed: sites, no over-application.
  • Witnesses (optional_consumer_fail_closed_test.rs), three teeth:
    • required_param_optional_arg_emits_located_fail_closed_unwrap — maybe(..) -> Int? into consume(x: Int) emits the located .expect("fail-closed: (scoped to the drive fn).
    • required_param_nonoptional_arg_stays_bare — discriminating control: a non-optional arg into the same required slot gets NO unwrap (type-derived, not blanket).
    • empty_optional_unwrap_panics_not_fabricates — discriminating EXECUTION: the empty case actually FAILS CLOSED — None.expect("fail-closed: ...") PANICS (caught via catch_unwind), whereas the rejected fail-OPEN shape unwrap_or_default silently fabricates 0. The §5 distinction made executable.

Final residual: 6 E0308, all out-of-scope of this lane

Confirmed by execution against the rebuilt seed:

site mismatch family
extdeps_version_semver.rs:226 Rc<VersionScheme> vs fn-item fn-item-as-value
std_realization_schedule.rs:167 &str vs String &str/String
v1_compiler_complexity.rs:504,507 &str vs String &str/String
std_termination.rs:71,72 DescentEvidence vs Box<DescentEvidence> Box/Rc

§5 model-hole flag (follow-up owed upstream, NOT expanded here)

Residual-3 is fixed at the emitter with a fail-closed unwrap, but the deeper cause is a model §5 hole: pipe-first is modeled as -> T? (total-returning-optional, algebra.dag OptionalOf), and the .dag model admits that optional flowing into a non-optional slot without an explicit unwrap node, which the v1 checker accepts fail-open. A model-forces-unwrap follow-up (an explicit unwrap/partiality node, or grounding Optional against its realization) is owed on the operator-owned Optional / Value::Null runway. This PR deliberately does not expand into model-grounding; it makes the emitted Rust fail-closed and flags the model gap.

🤖 Generated with Claude Code

briansrls and others added 30 commits June 20, 2026 17:45
…ols (empty_intern_table, InductiveField, is_bare_leaf_item, SemVerConstraint) — clears E0425 from peeled/turbofish types not in source import set
…d-injection patch (clears E0433 x6 in bootstrap)
…ch (option d, container analogue of String/Nat) — guarded, List-only, at the 2 preserve-nominal sites; clears E0425/E0432 for newly-enrolled std files (realization_schedule Schedule, std_types list_length). v2-target faithful FreeMonoid untouched.
…s at the bare-nominal alias-RHS branch so Int/Nat as a generic ARG (Measure<...,Int>) lowers to i64 in the seed, consistent with the type Int = i64 alias def — clears the std_measure Int E0425
…r conflicts)

Resolved 4 conflicts in src/v1/05_emit_rust.dag and 1 in width_nat_type_arg_test.rs:
- render_rust_applied_type: keep branch's rust_seed_host_container_base (List->host Vec)
- rust_phantom_marker_inner: take main's join() simplification (equivalent, supersedes Optional-peel)
- emit_rust_expr_record_lit: take main's peeled_type_name refactor (branch lines were superseded duplicates)
- phantom-field comment: take main's wording (matches the refactor)
- machine_width test: keep active (un-ignore) — this branch carries the #5325 emitter fix the ignore waited on

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test runs compile_sources against the in-process lib (committed stage0
seed), whose emit_rust.rs does not yet carry this branch's .dag peel fix
(branch updated 05_emit_rust.dag only, not the committed seed mirror). So it
must stay #[ignore]d until the seed regen lands (Track A step 3 / 2-stage
bootstrap). Reverts an over-eager un-ignore from the main merge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…g/metering)

So `gunbc run` can interpret the live .dag compile/emit fold (compile_sources)
WITHOUT regenerating the seed mirror — making a .dag emitter fix verifiable BY
INTERPRETATION (DESIGN §5 green-by-execution, §7 self-host).

Additive only (fills previously-erroring builtin cases; cannot regress existing
behavior). Proven by execution: the interpreter now resolves the source closure
and runs the full lexer (tokenize) over a probe source, advancing into
parse/resolve. Remaining gaps are deeper interpreter semantics (e.g.
raw_map_lookup on a plain Record), not missing builtins.

- chars(s) -> List<Int>: code points (matches languages.dag emit template +
  lexer source_chars: List<Int>), method dispatch.
- chars_to_string(List<Int>, start, end) -> String: code-point slice -> token
  text, free-fn dispatch.
- record_source_chars_index_lookup(): no-op unit metering stub.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bounded spike (parent-approved) toward running the emit fold by interpretation.
Both additive / non-regressing (fill previously-erroring cases):

- raw_map_lookup: a Record without a callable `lookup` field is now treated as a
  record-form map (key looked up as a field name; miss -> Null -> Violates via the
  existing Witness bridge). Unblocks `data x: Map<K,V> = { ... }` literals, which
  the interpreter builds as Records. (Deeper root: literals are never built as
  type-directed Maps; this handles it at the consumption site.)
- list_push: dedicated method-dispatch arm (was free-fn only). Pushes the arg as
  a single element, unlike concat/append/push which merge a list-valued arg.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…59-2e3

The HAND-APPLIED-REGEN-MIRROR-SYNC mark previously pointed at snappy-swift-91 /
#5325 (done-but-re-drifted, unreachable). The live dissolution lane is
bright-stag's adhoc-1bdd0259-2e3: re-repair the 18-error regen-fixpoint hole +
add a regen-equals-committed CI drift-gate so a main-merge can never silently
re-drift the fixpoint. Comment-only; the panic! splice (code) is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The compile_error! -> panic! mirror splice shortened the string literal, so
rustfmt joins it onto one line (the original was split for the longer
compile_error! form). Hand-edit fmt-drift; cargo fmt --all applied. No code
change -- the splice is identical, only formatting. Restores rust_monolith_gate
fmt --all --check green on #5481.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…dag-only)

Foundational half of the class-3 corpus-representation-coherence fix (the
realization-layer handler-selection root behind the 26 List + 15 generic-syntax
census errors). Adds the named selector RustCorpusRepr = HostNative |
FaithfulFreeMonoid (04_emit_info.dag, auto-committed) and computes it ONCE as
the single authority in build_emit_graph_info (rust_corpus_repr over the whole
module corpus), threading it as the corpus_repr field through all 7 EmitGraphInfo
construction sites (each COPIES the field, never recomputes — quick-seal's
field=authority/param=read invariant).

INERT checkpoint: the type-renderer leaf gates still read the old per-module
rust_corpus_includes_v1_compiler/rust_emit_faithful_text_carrier, so emitted
output is byte-unchanged. Typechecks clean via the existing binary (0
diagnostics, 410 files emitted). The gate-switch + ~15-fn corpus_repr threading
+ leaf-fn param swap + dead-gate deletion + exact mirror transcription land in
the next pass, then the full-loop census oracle.

Realization-layer coherence fix, not a model change (List<e>=FreeMonoid<e> at
std/types.dag:227 untouched). Carrier B-home, idiom-threaded (per quick-seal).
adhoc-1bdd0259-2e3 dissolution lane. #5481.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brian Searls and others added 14 commits June 24, 2026 03:24
Assemble the REAL Route-A crate (emitted seed closure + 22 hand-written
periphery modules) via a new non-destructive `regen_stage0 --emit-fresh <dir>`
mode and cargo-build it to measure the latent emitter-completeness gaps the
committed hand-synced seed hides (std-tower modules unwired in lib.rs).

Result: 73 total errors, 38 E0308 -- the carrier-mark "~150 gaps" estimate was
stale by ~4x. The 38 E0308 reduce to two emitter root causes (89%):
  A (24+1) map-literal `&str` keys not coerced to String -> HashMap<&str,V>
  B (10)   missing Box/Rc/Option auto-wrap coercion
  C (3)    scalar &str/String
Non-E0308 residue (measure-tower E0560, unwired-periphery E0433) categorized
separately with an honest masking caveat. Baseline + reproducer in
docs/plans/e0308-rebaseline-route-a.md.

Also: --emit-fresh adds im-rc to the assembled Cargo.toml (mirrors committed
stage0 deps) so the hand-written v1_interpreter resolves -- removes a spurious
E0432 confound from the measurement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ility orphan gate)

The categorized baseline as a standalone docs/plans/*.md file is an orphan doc
(nothing in the roadmap_authority/design_document doc graph links it), which reds
both the .dag doc_reachability witness and the rust live_tree_has_no_orphan_docs
test -- the 2 failing CI checks. Per DESIGN §6 (no parallel-ledger docs), the
measurement findings + verified reproducer now live in the PR body / lane node;
the committed change is just the reusable apparatus (--emit-fresh harness mode +
im-rc Cargo patch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
emit_rust_map_literal_key applies .to_string() to a map-literal key iff the
declared key type is String-like (key_is_string, derived at the call site from
is_rust_string_like over the map's declared key type). Fixes the coercion
asymmetry where the value slot was type-coerced but the key slot emitted a bare
&str literal -> HashMap<&str,V> vs declared HashMap<String,V> (Family-A E0308).

Authority edit only; emitted-seed splice + witnesses follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 24, 2026
…ing-carrier RENDERING (638), faithful-rendering fix 647→9 (#5716); refutes the pipe-first-unwrap premise; residual 9 = out-of-scope tail + 3 model-hole consumers

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 24, 2026 06:57
briansrls added a commit that referenced this pull request Jun 24, 2026
…endering + 3 fail-closed unwraps); residual 6 all pre-existing out-of-scope, separately owned

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 24, 2026
…sedes stale ~12,600) (#5713)

* ROADMAP §5: Lane A cargo-green re-baseline (execution-grounded, supersedes stale ~12,600)

deep-wolf (#5705) assembled the real emitted crate (108 modules + 22 periphery)
and cargo-built it: 73 errors / 38 E0308, where 38 is a LOWER BOUND (8 E0433
wiring failures mask further E0308). 89% of E0308 = two emitter root causes
(Family A map-key to_string = 66% from one fix; Family B Box/Rc/Option auto-wrap),
not the stale ~12,600 / ~150-latent estimate (~4x over).

Enriches the bare §5 `5-cargo-green` Route-A-last-mile item with the grounded
shape + the pole (Family A → B) + the §5 honesty bound: unmask E0433 early so
the true ceiling surfaces; "done" is a re-measure-after-unmask, not 38→0.

ROADMAP.md regenerated (drift-gate green).

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

* WIP: ROADMAP planning

* ROADMAP §5: re-measure-after-unmask — true E0308 ceiling 647 (38 was E0433-masked), pole moved to first-Option family (633/647); Family A cleared by #5714

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

* ROADMAP §5: correct root cause by execution — pole is Optional-on-String-carrier RENDERING (638), faithful-rendering fix 647→9 (#5716); refutes the pipe-first-unwrap premise; residual 9 = out-of-scope tail + 3 model-hole consumers

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

* ROADMAP §5: pin Route-A tail — pole CLEARED 647→9→6 (#5716 faithful rendering + 3 fail-closed unwraps); residual 6 all pre-existing out-of-scope, separately owned

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

* ROADMAP §5: reframe finish-line — 0 E0308 is a MILESTONE not cargo-green; full build shows 32 other pre-existing errors (measure-tower 19 dominant, gated); done = 0 TOTAL errors

Refutes the '0 E0308 = done' pin by full-cargo execution (deep-wolf). Measure full-cargo, never a grep of one error family.

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

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brian Searls and others added 2 commits June 24, 2026 15:05
…carrier-sig

# Conflicts:
#	src/v1/stage0/src/bin/regen_stage0.rs
#5716's first-option-carrier work already landed in main; the only remaining
diff was a stale merge reverting other lanes (#5715 TS, ci_humming /
realization_measurement_loop / resolver plans). Restore each to origin/main so
this branch carries zero reversions. PR diff is now empty — flag for closure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Status: this PR's first-option-carrier-sig work has already landed in main (the optional-carrier wrap, fail-closed call-arg unwrap, and associated tests are all present on origin/main via the merged stack). After merging current origin/main, this branch's diff vs main is now empty.

The only thing the branch had carried beyond that was a stale merge resolution that reverted unrelated lanes' work (#5715 TS first-class, and the ci_humming / realization_measurement_loop / resolver_type_name_collision_wall plan fan-out from #5727). I restored all 14 of those files to origin/main's exact version (commit e0bbe841ec), so the branch now carries zero reversions and a zero net diff.

Recommendation: close this PR — it's an empty no-op; its deliverable is in main. Nothing here to merge.

— sent from deep-wolf-695

@gunbai-bot

gunbai-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Heads-up on what this review is actually approving: the BlockEvaluationMode coproduct + target_model.dag threading + plan-doc churn it describes are #5715 (TS first-class inc-2b) and #5727 (plan fan-out) — both already merged to main. They show up in this PR's "Files changed" only as a merge-base display artifact (this branch's stale merge-base re-surfaces content that is already in main), not as anything this PR introduces.

This PR's net diff vs current main is empty — its own first-option-carrier work (rust_carrier_optional_wrap) is already in main, and I restored the 14 other-lane files this branch had been reverting back to origin/main exact (commit e0bbe841ec). So a squash here would revert nothing (#5703/#5715/#5727 all preserved) — it's simply a no-op.

Recommendation stands: close this PR, don't merge it. There's no #5716-owned change left to land. (Parent jolly-cat-29 independently verified the net-zero diff and relayed the close recommendation to the operator.)

— sent from deep-wolf-695

@briansrls
briansrls merged commit b3bc7af into main Jun 24, 2026
2 checks passed
@briansrls
briansrls deleted the emitter/first-option-carrier-sig branch June 24, 2026 15:46
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