Repository navigation
Lane A Family-A: map-literal String-key coercion (type-derived) — clears HashMap<&str> E0308 family - #5714
Closed
briansrls wants to merge 6 commits into
Closed
Lane A Family-A: map-literal String-key coercion (type-derived) — clears HashMap<&str> E0308 family#5714briansrls wants to merge 6 commits into
briansrls wants to merge 6 commits into
Conversation
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>
gunbai-bot
Bot
changed the base branch from
main
to
emitter/seed-green-integration
June 24, 2026 04:46
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
briansrls
added a commit
that referenced
this pull request
Jun 24, 2026
…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>
gunbai-bot
Bot
force-pushed
the
emitter/family-a-map-key-coercion
branch
from
June 24, 2026 05:07
c6dce78 to
e7d837f
Compare
Contributor
|
Superseded by #5716. #5716 (base=main) is a strict superset of this branch (head e7d837f is an ancestor; the Family-A map-key commits and both Family-A witnesses are byte-identical inside it) and additionally carries the first-Option renderer fix + residual-3 fail-closed unwraps. #5716 is read-ready and CI-green, so the whole Route-A E0308-clearing delta lands to main via #5716. Closing this to keep a single clean merge path. — sent from deep-wolf-695 |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Family-A: map-literal String-key coercion (type-derived)
The single biggest E0308 lever in the Route-A re-baseline. A
data NAME: Map<String,V> = { k: v, ... }declaration emits as athread_local! { static CACHED = { let mut __m = HashMap::new(); __m.insert(<key>, <val>); ... } }. The key was emitted via the host→dag text seam without.to_string(), so the literal inferredHashMap<&str, V>and mismatched the declaredHashMap<String, V>.Fix (single authority:
src/v1/05_emit_rust.dag)emit_rust_map_literal_key(field_name, key_is_string, corpus_repr)— appends.to_string()to the key literal only when the declared key type is String-like, then routes through the existing host→dag seam.map_literal_key_is_string(map_type_node, source_indices)— reads the map's declared key type (first type arg, viachildren |> firstwith the__applied_type_argsfallback, mirroring the provenrust_host_text_carrier_elem_nameidiom) and testsis_rust_string_like. The coercion is DERIVED from the declared key type, not a blanketkeys → to_string— a non-String key is left bare.emit_data_def_bodycomputeskey_is_stringonce per map literal and threads it to the key emitter.The committed Route-A seed (
src/v1/stage0/src/v1_compiler_emit_rust.rs) is the hand-synced mirror; the correctedmap_literal_key_is_stringbody is spliced in to match.Proof by execution
dag_keywords(HashMap<String,String>) now emits__m.insert("true".to_string(), …). Freshregen_stage0 --emit-freshbuild: theHashMap<&str, V>family went 24 → 0.non_string_key_is_left_as_literal(key_is_string=false→ key emitted without.to_string()). No live corpus map literal has a non-String key (0 non-string-key inserts emitted), and no new "expected non-String key" errors appeared — confirming the coercion is per-slot type-derived, not blanket.map_literal_string_key_test.rs): host-repr coerce, faithful-repr seam routing, non-String control, and an end-to-endMap<String,Int>source fixture (String key coerced, Int value left bare).Out of scope (documented, not regressions)
The wider
--emit-freshwiring unmasks a separate pre-existing emitter family:|> firstemits as.first().cloned()(Option) where consumers expect the unwrapped element (633expected String/Rc, found Option). Confirmed pre-existing — the committed seed carries the identicala.clone().first().cloned()bug inextdeps_version_semver.rs:81but leaves that module unwired inlib.rs. Family B (Box/Rc auto-wrap, ~7) and E0560 measure-tower also remain. These are tracked for follow-on lanes, not this PR.— sent from deep-wolf-695