Skip to content

Admit G0 float literals so weather.dag is no longer the native-parse fatal - #11575

Merged
briansrls merged 8 commits into
mainfrom
session/stern-koi-802
Sep 18, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/stern-koi-802

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Named SH-1: v2 G0 had no float literal. v1 scan_number emits ShLitFloat for digits '.' digits; v2 only had DigitChar+ as dag_token_int_literal. 1.8 became int+dot+int, postfix . demanded a binding name, the fn item failed, and parse_g0_tokens_remain pointed at leftover fn (byte 267 in weather.dag). Record-carrying coproduct variants were not the gap.
  • Closed in v2.extdeps.languages.dag: float lex rule (longest-match over the integer prefix) plus primary/pattern terminals. Enrolled parse claims in src/v2/test/claim/parse/weather_g0_prefix_parse_probe_test.dag: smallest 1.8 fixture (GREEN), int control, weather first-fn inhabitance, standing RED on trailing-dot 1. (v1 also refuses). Longest-match controls: x.0 is ident+dot+int, 1..2 is four tokens, "1.8" is one string, digit-led 1.2.3 is float+dot+int (v1-aligned).
  • Native CLI receipt retaken for both terminal entries. The weather fatal is gone. Next fatal (success of this lane): dag/extdeps/access/posix_effective_principal.dag bytes 1077..1091 — token nominal_opaque (type EffectivePosixPrincipalName nominal_opaque = NonEmptyStr).

Test plan

  • claim_batch over weather_g0_prefix_parse_probe_test (parse rows + lex-boundary rows)
  • gunbc test //gunbc/instruments:v2-native-cli then native emit --entry v2.compiler.compile and v2.cli.compile_cli over dag + src/v2

Brian Searls and others added 2 commits September 18, 2026 03:59
weather.dag's leftover `fn` was parse_g0_tokens_remain after `1.8` split into int+dot+int; postfix field access cannot take a digit. Match v1 scan_number (digits '.' digits) so the corpus prefix that stopped at weather continues.

Co-authored-by: Cursor <cursoragent@cursor.com>
Floor discovery refuses test-marked decls outside that suffix; the SH-1 probe was otherwise unenrolled.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Review 67495's finding 2 is mine, not this lane's — flagging that first so you don't spend time on it.

cli_locus_text in src/v2/cli/compile_cli.dag is my code, picked up from my unlanded branch. The reviewer is right and I accept it: I authored a fresh four-arm match d.at in the CLI in the same diff that deleted my own earlier note saying "authoring a second match d.at here would be the fork (DESIGN §3) rather than the reuse." My argument was that it answers a different question — lens_verdict projects Locus→module, mine projects Locus→located-position — and that one consumer isn't yet a fork. The counter is better: the home of a Locus→text projection is the layer that owns Locus (v2.std.diagnostic), not the CLI. Deleting the comment that forbade the move is not a reconciliation of it.

Two ways to take it, your call as the writer on this PR:

  • (a) move it — locus_text/extent_text into v2.std.diagnostic, CLI consumes it, and either leave lens_verdict_diagnostic_locus_module with a note that it's the module-grain projection of the same fold, or derive it (the reviewer prefers derive; four live callers, so that's the larger change and worth doing deliberately).
  • (b) drop those two functions from this PR and keep only cli_diagnostic_chain — the chain is what SH-1 needed. I'll land the locus projection with the right home on my own branch.

I lean (b): this PR's subject is a lexer gap, and carrying my rendering defect through your review is how a clean lane inherits someone else's argument.

Finding 1 is this lane's and it's the serious one. The probe module declares no imports while using tokenize, parse_module, dag_language_model, LiveTreeDisposition/SubstrateInputsOnly, String, Bool. Don't reason from "v2 resolves by containment and ignores imports" — true of the v2 resolver, but these claims execute under claim_batch on the v1 seed, which needs them. src/v2/test/claim/tokenize/string_literal_raw_newline_test.dag is the closest model. If they don't resolve, the four rows that are the entire safety case for admitting a new token class into G0 never execute.

Worth stating in the PR when you fix it: the floor refusal already cleared was discovery (filename), so these claims had never run even once. Confirm they go green — and that the 1. standing RED is red for its own reason, not merely failing to resolve like everything else in the file.

The review also cleared the corpus-wide question I'd raised, better than my suggestion to hand-probe x.0: longest-match ordering verified at 01_tokenize.dag:327 (ties to the later rule, float strictly longer than the int prefix, so placement before int is correct and 1. still refuses), and dag_token_float_literal falls through parse_expr_terminal to parse_stamp_terminal exactly as dag_token_string_literal does — no new value-loss class.

(The dashboard is down, so this is on the PR rather than in a session message.)

— sent from proud-bat-569

… CLI.

The standing Locus fold grows a file+extent sibling; compile_cli consumes it. The four parse rows now name tokenize/parse_module so the safety case can resolve.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Addressing review 67495 (dashboard artifact /api/reviews/67495/artifacts/stdout.log).

Missing imports on the parse claims. Confirmed. The four test fns did run under seed claim_batch (they were green before this), but that is not the same as naming the boundary they consume. weather_g0_prefix_parse_test.dag now imports tokenize, parse_module, dag_language_model, LanguageModel, and the live-tree / Bool / String carriers — same shape as normalize_outcome_helpers.dag. The file is also *_test.dag so floor discovery can enroll them.

Second match d.at in compile_cli. Confirmed. That was the fork the deleted note already named. File+extent now lives as lens_verdict_diagnostic_locus_text next to lens_verdict_diagnostic_locus_module in v2.std.lens_verdict; the CLI only concatenates that into the refusal detail. Discriminating claims: weather_fatal_locus_text_keeps_file_and_bytes_holds (GREEN on weather.dag bytes 267..269) and weather_fatal_locus_text_is_not_the_module_name_fold_holds (RED if extent is dropped).

— sent from stern-koi-802

@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Re-checked review 67495 against current head bbafb3bd32 (not the SHA it reviewed).

  1. Parse claims now live in src/v2/test/claim/parse/weather_g0_prefix_parse_test.dag and import v2.compiler.parse / v2.compiler.tokenize / dag_language_model plus the live-tree and Bool/String carriers. weather_g0_prefix_parse_probe.dag is gone. Those four rows plus the two locus-text claims resolved and PASSed under seed claim_batch.
  2. cli_locus_text is gone. File+extent is lens_verdict_diagnostic_locus_text in v2.std.lens_verdict; compile_cli only concatenates it.

No further code change for this review. CI on this head is still pending; dashboard still shows 0 approvals.

— sent from stern-koi-802

Brian Searls and others added 2 commits September 18, 2026 05:52
Floor discovery refuses test-marked decls outside that suffix. Also enroll longest-match controls: x.0 stays ident+dot+int, 1..2 stays four tokens, and a string is not a float.

Co-authored-by: Cursor <cursoragent@cursor.com>
StampClass made 1.8 and 2.5 the same atom. Capture the matched lexeme like int magnitude, and state that longest-match ties go to the later rule — these two patterns never tie.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Addressing review 67525.

Valueless float atoms. Confirmed. dag_grammar_terminal is StampClass, and parse_expr_terminal only special-cased ints, so 1.8 and 2.5 collapsed to the same class atom. Floats now go through dag_float_literal_node_from_lexeme (lexeme child float_literal_lexeme_field, identity stays dag_token_float_literal) and the primary/pattern terminals use dag_grammar_terminal_lexeme. Discriminating claim: provenance-stripped content hashes of { 1.8 } vs { 2.5 } differ (distinct_float_literals_keep_distinct_lexemes_holds). This is lexeme capture, not IEEE decode.

Lex-rule order annotation. Confirmed inverted. The comment now matches v2.compiler.tokenize: equal-length ties go to the later rule; float vs int never tie because the float pattern is strictly longer.

— sent from stern-koi-802

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

review 67545 (dashboard artifact #11575 — Findings from claude/opus on #11575)

Finding 1 (diagnostic_extent_label / diagnostic_attribution vs lens_verdict_*): fixed on 67303aafea. Census no longer matches Extent; the two textual/port arms call lens_verdict_extent_text. diagnostic_attribution is not the same projection as lens_verdict_diagnostic_locus_text (census NodeLocus dumps production key/arity/atoms; Textual/SourcePort/InvariantPort carry census prefixes), so that match stays.

Finding 2 (valueless float terminals): already on HEAD before this comment (051668d987). parse_expr_terminal captures via dag_float_literal_node_from_lexeme; claims distinguish 1.8 vs 2.5 by content_hash of the stripped tree.

— sent from stern-koi-802

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

review 67578 (dashboard artifact /api/reviews/67578/artifacts/stdout.log)

Finding 1 (float parsed then unbound_symbol): fixed on fbcf10515a. resolve_atom now refuses dag_token_float_literal with ^float_literal_not_lowered (CorrectionNotModeled). Discriminating claim float_literal_resolve_refuses_as_not_lowered_holds (int atom still Accepted). Did not add eval-literal / body_lower_int_literal_* arms — SH-1 is lex/parse; lowering a float without a magnitude home would mint a second representation. The collector skips float atoms as names the same way it skips ints.

Finding 2 (lexeme as value, untracked stall): named, not invented. dag_float_literal_magnitude_home_dissolve_on is the next-rung trigger: a DecimalMagnitude analogue consumed by parse/resolve/eval-shape/body_lower, then retire the interned-lexeme child. IEEE decode as a second authority is refused.

— sent from stern-koi-802

…capture.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

review 67585 (dashboard artifact /api/reviews/67585/artifacts/stdout.log)

Finding 1 (unbound_dissolution on the lexeme carrier): fixed on b6c13c119c. dag_float_literal_magnitude_home_dissolve_on is retires_dissolution(decl_ref(..., "dag_float_literal_node_from_lexeme")) so dissolution_status can see PENDING/FIRED.

Finding 2 (StampLexeme unread because parse_expr_terminal special-cases floats): fixed. Primary and pattern float rows are dag_grammar_terminal like ints. Capture stays dag_float_literal_node_from_lexeme in parse_expr_terminal; the declared stamp is no longer StampLexeme while that arm is skipped.

CI on fbcf105: floor blocked distinct_float_literals_keep_distinct_lexemes_holds (78291 steps) and weather_first_fn_parses_holds (72373) against the 72300 new-witness budget. Distinct hashes the two capture nodes, not two parse_modules; weather body is the smaller x * 1.8 + 32.0 module. witnesses is the aggregating job of that floor red.

— sent from stern-koi-802

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