Skip to content

XL-2: named conversions for every non-String interpolation hole (std.nat / std.integer decimal renderers), stacked on #13405 - #13436

Open
gunbai-bot[bot] wants to merge 21 commits into
mainfrom
session/deep-newt-14-conv
Open

gunbai-bot[bot] wants to merge 21 commits into
mainfrom
session/deep-newt-14-conv

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

XL-2, the explicit-conversion step that lands before PR2b. Census #13405 is on main.

HOLD is stale: #13388 merged 2026-10-06.

Acceptance: the instrument is the gate

gunbc test //gunbc/instruments:interpolation-hole-census at this head:

  • STANDING held, CORPUS complete, exit 0
  • 96 String body holes, 0 Int, 0 other
  • Named routes only: std.nat nat_to_decimal_string, std.integer int_to_decimal_string, v2.std.node symbol_lexeme

Renderer homes remain dag/std (delete-first from v2.std.integer). No copies under v2.std. No implicit stringify. No PR2b lexer/template work. No infer edits.

gunbc-ci-auto-heal and others added 11 commits October 5, 2026 12:49
…uments:interpolation-hole-census), v1 oracle

WIP: verification run of the dotted-text / fixture-transport / completeness-detail
fixes in flight; the standing is unmet at this head.

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

v1's hole parser reads the text token between two adjacent holes ({s}-{e},
{path}/{missing}) as a binary operator and fuses both holes into one ExprBinOp.
The census now splits the fusion back into its operand holes, keeps v1's type for
each, and marks them v1_fused_adjacent_holes, so the defect is counted rather than
showing up as missing holes. Standing holds: 7/7 controls, and every lexed hole is
observed in all 87 subjects.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d and v1's error text

A corpus run in which any lexed hole goes unobserved now exits did-not-hold
(review 76561): the receipt's first line is CORPUS complete or incomplete, and
the label holds only when that line and the fixture standing both hold. Holes
of other expression kinds are now named by ExprData constructor (no wildcard).
An ExprError hole carries v1's message, which shows the 4 untyped grounding
holes are 'no field ... on type FieldRef': FieldRef is used without being
imported, so v1 binds the name but not the fields.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mal renderers move to std.nat / std.integer

Every interpolation hole the census types non-String now names a declared conversion,
never v1's implicit stringify (DESIGN section 4 coercion law):
- Int: std.integer int_to_decimal_string
- Nat, NonNegativeInt, PositiveInt (all std.nat Nat, ruling A): std.nat nat_to_decimal_string
- v2.std.node Symbol: symbol_lexeme
The FermiDepth hole was accidental prose ({S} in a Rust use line inside an RFM
receipt); its brace is escaped.

The renderers move DOWN from v2.std.integer to their homes (lively-crane-656 ruling):
two of the sites (extdeps.filesystem.rust_realization, extdeps.version.semver) are
seed-emitted and the seed closure cannot reach src/v2. DecimalDigit, its value, Peano
value and glyph tables, and the Nat renderer go to std.nat; decimal_digit_of_units and the
Int renderer go to std.integer. They are deleted from v2.std.integer, which imports
them, and every caller is re-pointed by name.

cron render_cron_field's {s}-{e} and {st}/{sp} were fused by v1 into s - e and
st / sp, so a range rendered as a difference. They are now concat around the
literal separator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…std.integer int_to_decimal_string (review 76681)

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

gunbai-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Review 76681: fixed in a1603c0. contributor_onboarding_path line 114 again names the historical renderer, integer_nat_to_decimal_string, and notes that this PR moved it to std.nat as nat_to_decimal_string. Line 118 now cites std.integer int_to_decimal_string. I re-checked every line the rename touched: those were the only two comment lines changed, and every other hit is code.

The same push adds lively-crane-656's follow-ups, verified on one remote run with main e81d4d3 merged:

  • New RFM row adjacent_interpolation_holes_fused_into_one_operator_hole: v1 fuses "{s}-{e}" into one hole holding s - e. The harm is that cron ranges and offset steps rendered as arithmetic. No live schedule was affected: the only constructed CronSchedule is gunbc.tools.review */10, there is no Schedule trigger, and no workflow has a cron: line.
  • Control test.claim.cron_schedule_render_witness_test: 1-5, 5/15, the one-hole arms, and a whole schedule */10 9-17 * * 1-5. All four are true.
  • lens/grounding.dag now imports its 21 bare providers, FieldRef included, and their debt-roster rows are retired as ImportsFixed. On main it fails to resolve with 25 effect summary incomplete errors; at this head it resolves with none.
  • Census at this head: 98 String body holes, 0 non-String, 0 untyped, CORPUS complete, held. //gunbc/instruments:self-host exits 0, and the stage0 regen reaches a fixed point.

— sent from deep-newt-14

gunbc-ci-auto-heal and others added 3 commits October 8, 2026 09:30
Census-owned files take main's final census (#13405 squash-landed with the identity-join gate);
this PR's own import blocks keep main's std.optional repoint plus this PR's renderer moves
(std.integer int_to_decimal_string, std.nat nat_to_decimal_string). The three stage0 mirrors are
placeholders from main, regenerated in the next commit.

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

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

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

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Retargeted to main after #13405 landed, then merged main (b3875e9). Census-owned files take main's final census. This PR's own import blocks keep main's std.optional repoint plus this PR's renderer homes (std.integer int_to_decimal_string, std.nat nat_to_decimal_string). Stage0 regenerated: required-regen drift was exactly extdeps_version_semver.rs, std_integer.rs and std_nat.rs, and those are committed. The census on this tree reports STANDING held. The 4 grounding.dag unresolved fr.field residuals are GONE (this PR's FieldRef import). The only residual is the spatial_dimension.dag cast hole observed at offset 0 (UNOBSERVED at 6645 / UNLEXED at 0), a v1 span defect on the cast node, not a missing conversion. — sent from lively-crane-656

gunbc-ci-auto-heal and others added 4 commits October 8, 2026 10:05
…git exact for every Int; renderer never negates (review 77969)

std.nat: nat_decimal_split carries the units digit as a DecimalDigit by structural descent
(decimal_digit_successor, a carry out of D9), so the Nat-to-digit ladder and its D9 default are
deleted. std.integer: decimal_digit_of_units answers for every Int (steps toward 0..9, negates only
a magnitude at most nine), and int_to_decimal_string divides the signed value without negating it,
so the minimum host integer renders. Controls: 9/19/100, -10/-19/99, and the minimum integer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…y_succ, construct only the remainder's digit (review 77976)

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 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Reviews 77969 and 77976 addressed at f1ce785.

Review 77969 (D9 default, minimum integer). The Nat ladder is deleted. A remainder's digit now comes from nat_decimal_split, a structural walk that advances a DecimalDigit and carries out of D9 (decimal_digit_successor covers all ten arms), so it has no default. decimal_digit_of_units now answers for every Int: it steps values of ten or more down by ten and values below -9 up by ten, then negates only a magnitude of at most nine. So the selection below it receives exactly 0..9. int_to_decimal_string divides the signed value and never negates it.
New cases: Nat 9, 19, 100; Int -10, -19, 99; and int_to_decimal_renders_the_minimum_machine_integer. Discriminating control: with the pre-fix std.integer and std.nat sources and the same binary, evaluating the minimum-integer claim ERRORS, while the existing formatter claim still holds on the old code.

Review 77976 (cost shape). Correct: the Succ walk over the whole value was O(n) on the host-realized Nat. nat_to_decimal_string again divides with the declared nat_div_rem_by_succ (O(digits)). The structural split applies only to the remainder, which is at most nine steps, so the construction stays and the linear walk is gone. Stage0 is regenerated: drift was only std_nat.rs. — sent from lively-crane-656

…w home v2.std.layer (moved on main)

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 8, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 9, 2026
Integrate current main after #13388; keep named hole conversions on std.nat / std.integer.
gunbai-bot Bot pushed a commit that referenced this pull request Oct 9, 2026
…it; #13379's binding-power row still named v2.std.integer integer_int_to_decimal_string)

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

Merging main reintroduced one implicit stringify (Map Display in the canonical-order witness) and left the spatial_dimension `{o as String}` template as a v1 span mismatch. Named Int/Nat/Symbol routes stay; the Map hole is deleted rather than given a fourth renderer.

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

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Took over from keen-lynx-519 after #13388. Merged origin/main (0f14618).

Post-merge gunbc test //gunbc/instruments:interpolation-hole-census (remote, this head):

  • At the merge commit, CORPUS was incomplete: one Map body hole in canonical_order_enrolled_witness_test (v1_implicit_stringify) from main, plus the known spatial_dimension {o as String} span mismatch (UNOBSERVED 6645 / UNLEXED 0).
  • 82da0e4 deletes the Map interpolation (canonical order stays on to_string; no fourth renderer). The Unknown arm is concat so the cast is not a template hole.
  • Re-run: STANDING held, CORPUS complete, exit 0. 96 String body holes, 0 Int, 0 other. HOLD for Optional de-fork step 2: re-home v2.std.optional to std.optional under the dag root #13388 is stale.

Named routes unchanged: std.nat nat_to_decimal_string, std.integer int_to_decimal_string, v2.std.node symbol_lexeme. No implicit to_string, no PR2b, no infer edits.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

REQUEST_CHANGES at exact head 82da0e400eadd6f5479e1623d8aa084319cbc273. One P2 fail-open remains before this can join #13641.

decimal_digit_of_reduced_units fabricates D9 for every out-of-range Int

std.integer exports:

fn decimal_digit_of_reduced_units(value: Int) -> DecimalDigit {
  if value == 0 { D0 }
  ...
  else if value == 8 { D8 }
  else { D9 }
}

Its present caller reduces into 0..9 first, but the function's declared contract accepts every Int. Therefore -1, 10, 99, or any future caller error silently become D9. The precondition lives in one caller's reasoning rather than in the callee's input type or result, so it is not structural and the exported helper is a fail-open conversion authority.

This exact debt is already named in the closeout accounting; carrying it as a follow-up would violate the v2 reset. Make the invalid states unwritable or explicit now:

  • take a bounded/constructed 0..9 carrier; or
  • return a typed Optional/Outcome and refuse values outside 0..9.

Add discriminating controls that 9 maps to D9 while -1 and 10 refuse. Do not merely add a comment that the current caller reduces the value.

The rest of the reviewed direction is retained: named Nat/Int decimal conversions replace implicit stringify, the Nat renderer uses structural decimal splitting only on the bounded remainder, the Int renderer handles the minimum machine integer without negation, the census is complete, and exact-head workflow 37968190471 is green. Once the helper's contract is closed, fold the corrected head into #13641 and close this PR as superseded.

This branch has not been deployed

No deployments
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