Skip to content

N7 text crossings: route every bare chars/chars_to_string in the N7 closure through the declared conversion plan - #13151

Merged
gunbai-bot[bot] merged 35 commits into
mainfrom
n7-text-route-consumers
Oct 4, 2026
Merged

gunbai-bot[bot] merged 35 commits into
mainfrom
n7-text-route-consumers

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Stacked on #13143; the base retargets to main when it lands. This is the consumer switch for operator ruling O5.

What: every bare chars / chars_to_string in the N7 closure (tidy-raven-393's scan of the 141 closure files, plus target_model's code-point Symbol) now calls the declared route instead of a kernel name v2 resolve cannot see:

  • unfold (host → code points): compiler.01_tokenize tokenize ingress; std.source_annotation advance_line_prefix_indent_only_text; std.compilers.lexing phrase_to_lex_rule_set; std.integer integer_string_to_decimal_digits_optional; extdeps.languages.dag LexRule helpers ×2 (N7 occ 1093838) and dag_string_literal_body_optional / _encoded; target_model apply_emit_spelling_quote.
  • fold (code points → host): 01_tokenize token lexeme ×2 (N7 occ 506352); target_model lex_pattern_fixed_spelling ×2, apply_emit_spelling_quote's escaped result, and the code-point Symbol.

Why each is a genuine crossing: test.claim.bare_imported_text_reading_witness_test (#13150) measures that a bare-imported String reads as host text in the checker, and the renderer agrees. Every site therefore moves a host value into a qualified v2.std.text.String / List<Char> position, or the reverse. (#13140 is closed because deleting these calls was not an identity.)

Still to do in this PR before ready:

  1. The stage0 mirror for std.source_annotation (regen running).
  2. The v1 inference residual: a bare host↔code-point crossing refuses naming unicode_scalar_unfold/unicode_scalar_fold, and the route call is judged through judge_text_conversion_plan.
  3. A floor run.
  4. Re-dispositioning gunbc.primitive_egress chars_to_string as the realization of unicode_scalar_fold's phase.
  5. A native-route re-measure of which N7 provider modules stop refusing.

🤖 Generated with Claude Code

Exhaustive route match (sharp-raven-357's objection, zero-ambiguity ruling): v1.compiler.infer text_crossing_or_type_mismatch_error no longer has a wildcard arm. It matches each TextRepresentation variant explicitly:

  • HostText names unicode_scalar_unfold;
  • CodePointSequence names unicode_scalar_fold;
  • NotText / TextRepresentationUnidentified name no route and keep the plain type mismatch.

A later variant now fails this match at compile time instead of being silently advised to call the fold. The seed mirror is regenerated from the .dag.

Brian Searls and others added 8 commits October 3, 2026 19:04
…e corpus's unicode scalar plans

DESIGN section 4 (2026-09-26 ruling): an author crosses a boundary implicit
coercion refuses only by selecting a named conversion plan. ConversionPlan
joins the explicit-cast surface and the declared LiteralUnfolding routes;
gunbc.structural_realization_bindings conversion_plan_rows declares
unicode_scalar_unfold (kernel String -> FreeMonoid<Char>) and its inverse
unicode_scalar_fold. judge_conversion_plan answers a site that names a
plan, keyed on declarations; controls are driven by supplied plan
references until the surface syntax is ruled.

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

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

Copied from claim_executor --required-regen's candidate tree at bb2120c.

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

Per the ruling there is no grammar change: each ConversionPlan row names an
ordinary declared function by declaration identity (route), and a call is
admitted as the named route because a row names the callee. The judgment is
keyed on the callee's declaration. The two route functions are declared in
std.coercion; their bodies realize the row's single phase.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…irrors for the route functions

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…losure through the declared conversion plan

tokenize's ingress, std.source_annotation's host-lexeme convenience, the
LexRule helpers (dag.dag, lexing), integer's digit reader and dag.dag's
string-literal scalar readers call std.coercion unicode_scalar_unfold;
the token lexeme, target_model's fixed-spelling and escape writers and its
code-point Symbol call unicode_scalar_fold. Each is a crossing between a
bare String (read as host text by both checker and renderer today, see
test.claim.bare_imported_text_reading_witness_test) and a structural
FreeMonoid<Char> position, so each now names its route instead of a bare
kernel name v2 resolve cannot see.

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

Under operator ruling O5 a conversion plan is selected by calling the
function its row names, so the checker's identity-keyed text-crossing
refusal now carries that function as its residual: unicode_scalar_unfold
when the produced side is host text, unicode_scalar_fold otherwise.
Blocking, like the TypeMismatch it replaces at the two text-crossing sites.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…route consumers and TextCrossingHasNoImplicitRoute

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review October 3, 2026 21:16
Brian Searls and others added 4 commits October 3, 2026 21:27
…KernelMinted, not a std.types declaration

The floor's declarations phase refused decl_ref(std.types, String): the
kernel String has no declaring module (TypeDeclarationProvenance
KernelMinted). ConversionEndpoint = KernelMintedCarrier | DeclaredCarrier
names each carrier the way it is actually identified. The controls'
phantom citations (Int, utf8_bytes, hollow_route) now cite real
declarations.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…umer stated as a frontier (review 75096)

A plan with no phase now has no constructor, so ConversionPlanHasNoPhase
and its control are gone (DESIGN 5, construction over validation); a
composite plan is the trigger for a non-empty phase sequence. The
judgment's consumer -- the kernel-crossing wall in v1.compiler.infer,
ruled the last step of the lane -- is stated beside the declaration with
its trigger (DESIGN 3c declared frontier).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brian Searls and others added 16 commits October 3, 2026 22:53
…hase plan

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…_scalar_fold's phase (calm-boar-904 ruling)

Authority is now the declared route function; the .dag body stays
required, because a from_code_point/concat fold is quadratic, and it lands
with a linear .dag text writer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g.dag): keep both imports

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…phism row; identity derived from route (calm-boar-904's #13143 objection)

A plan stored route, endpoints and phase independently while the judgment
checked only endpoints, so an unfold route carrying the inverse phase was
admitted. Now ConversionPlan is { route, phase }, a phase carries the full
LiteralHomomorphism row, source/target are derived (the inverse reverses
them), and the identity is route.decl_name (O5: the function IS the plan).
literal_homomorphism_rows and conversion_plan_rows share one declared row,
unicode_scalar_literal_homomorphism. Mutation control: the unfold route with
the inverse phase refuses.

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

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oolean literal row; bindings mirror to be regenerated)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the carrier

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brian Searls and others added 2 commits October 4, 2026 07:05
…d the named call is admitted (review 75433)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ent (census fixtures cannot supply std.coercion's bare channel)

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

Addressed review 75433 in c7bc26e. Three claims were added to test.claim.text_boundary_identity_wall_witness_test, all PASS by claim_batch on a seed rebuilt from this head:

  • n_host_value_at_code_point_return_names_the_unfold: a host value at a code-point return raises TextCrossingHasNoImplicitRoute with route unicode_scalar_unfold.
  • n_code_point_value_at_host_return_names_the_fold: the reverse raises it with route unicode_scalar_fold.
  • p_the_named_route_call_raises_no_crossing: the same crossing written as unicode_scalar_unfold(s: t) raises no crossing row.
    Each direction asserts its own route, so swapping the two arms reds one n_ claim. The control asserts the crossing row is absent rather than a fully clean compile. A census fixture importing std.coercion also reports that module's bare-channel names as unresolved, because the census compile doesn't supply the bare channel std.coercion relies on by design (measured; the reason is annotated beside the claim).

Separately, three pre-existing wall claims (u_kernel_value/literal_at_foreign_bare_structural_parameter_unfolds, c_structural_value_at_foreign_structural_parameter_is_admitted) fail on main as well, with UnresolvedType v2.std.logic.Bool in the fixture. That's not this PR; I'm reporting it to the lane manager. — sent from neat-raven-383

Base automatically changed from n7-conversion-plan-carrier to main October 4, 2026 12:50
Brian Searls and others added 5 commits October 4, 2026 12:54
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n, no wildcard (sharp-raven-357's objection)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… (body comments do not parse)

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 added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit f8f1ec9 Oct 4, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the n7-text-route-consumers branch October 4, 2026 19:47
gunbai-bot Bot pushed a commit that referenced this pull request Oct 4, 2026
…_unfold ingress

#13151 changed tokenize's host-text ingress from chars to the declared unicode_scalar_unfold route;
#13287 moved that body into tokenize_prepared. The resolution keeps #13287's split and main's
conversion.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Oct 4, 2026
Both conflicts were #13287's own changes, already on main: the generated v1_compiler_emit_rust.rs
mirror and 05_emit_rust.dag now equal main's exactly, so #13294 no longer touches v1 and main's
regen fixed point covers it; tokenize_prepared takes main's unicode_scalar_unfold ingress (#13151).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

0 participants