Repository navigation
The by-name fold site is visible to the complexity lens: counted and refused unread (stacked on #11315 + #11322) - #11368
gunbai-bot[bot] wants to merge 49 commits into
Conversation
…Loop the fn literal does
v2.compiler.fold_lowering read ONE step production. The grammar declares two
function-value productions reachable in argument position -- dag_production_fn_literal
(emitted ^dag_surface_fn_literal) and dag_production_arrow_lambda (emitted
^dag_surface_arrow_lambda) -- and fold_call_step_fn searched for the first only. A step
spelled `f: (acc, x) => ...` was therefore read as "no step form present" and shared one
state with a step passed BY NAME, which is a different fact: the arrow lambda's binder and
body are in hand at this stage, a named step's binder is a callee-resolution fact it does
not have.
MEASURED, one binary, both directions, fixtures differing only in lambda spelling
(scratch A/B over count_fold_sites / accumulator_copy_findings):
baseline repaired
arrow_seen 0 1
arrow_bound 0 1
arrow_suspect 0 1
fn_seen/bound/suspect 1/1/1 1/1/1
The arrow site was INVISIBLE to the traversal, not merely unbound: with no Loop produced
and no surface fold call surviving normalize, nothing reached the lens to be refused about
-- so a planted quadratic identical to one the gate catches was admitted in silence.
Population: ~2198 arrow-form step sites across ~538 files.
THE SHAPE OF THE REPAIR. A closed FoldStepForm = StepFnLiteral | StepArrowLambda |
StepByName, with both inline forms projecting onto the same two seam inputs through one
shared fold_call_seam_from_step into the existing, already spelling-agnostic
fold_call_seam_loop. No per-spelling arm at any consumer, and no "unknown lambda shape is
zero-cost" arm anywhere. StepByName is a real named arm over the residue, not a
fall-through: it keeps yielding the FoldCallStepFormUnresolved the seam produced before.
DELIBERATELY NOT GIVEN A CARRIER: the bare single-binder form `acc => e`. A fold step takes
(accumulator, item), and the grammar admits the one-binder form for ordinary lambdas, so
reading its sole binder as an accumulator would fabricate a carrier the source never
declared.
WHAT THIS DOES NOT DISCHARGE, stated because the row's trigger is a capability and this is
not all of it: the BY-NAME population (~18 sites / 14 files) is still invisible --
named_seen is 0 both before and after -- so ^fold_accumulator_unread remains unreachable
and gunbc.recurring_failure_mode fold_shape_visible_to_no_lens does NOT retire here. The
measurement above also shows why it is a different problem: no surface fold call survives
normalize for ANY spelling, so visibility depends entirely on producing a Loop, and a named
step has no inline body from which to build one honestly. Escalated separately rather than
decided here.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014tbjacTtGDpN2UHpBUrfoG
…a second specimen Appends to gunbc.recurring_failure_mode fold_shape_visible_to_no_lens, per fierce-lark-661 and eager-raven-113 rulings 2026-09-13. Four receipts, no prose restated elsewhere: REPAIR RECEIPT for the arrow half, with the measurement and with the PREDICTION THAT FAILED recorded beside it -- the repairing lane predicted from structure that the arrow site would be SEEN-but-unbound (recognition reads the callee head, not the lambda) and it is invisible outright. That is the fact the next reader needs, so it is in the row. NARROWED POPULATION: the row now carries the by-name step alone, ~18 sites / 14 files, against ~2198 arrow sites / ~538 files covered. The trigger is restated as the CAPABILITY -- a by-name fold step's accumulator flow is visible to the complexity lens -- not as "a Loop", and the row is deliberately uncommitted between the two candidate constructions, with the lens-side read DFS-first by ruling (a lens is a pure reader; lowering is not changed to suit it). SECOND SPECIMEN, the class from the other end: count_fold_sites' SURFACE arm is reachable on no ingest route. tree_contains_surface_fold_call is false for all three spellings, so the arm has never fired and visibility depends entirely on a Loop. A permanently-green check in the DESIGN 4b sense -- it reads as a second independent way to see a fold and is not one. Owner named as the lens authority. BARE SINGLE-BINDER ARROW as a refusal by construction rather than an omission: a fold step takes (accumulator, item), so `acc => e` gets no carrier and the reading refuses rather than falling through to a DFS for the first plausible ident. The citation for the arrow measurement names the scratch entry point that produced the numbers AND the enrolled fixtures that re-derive them, rather than implying the census produced them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014tbjacTtGDpN2UHpBUrfoG
…ion/deep-newt-301
…s, and the class is positional, not spelling-bound Answers the ordered question on gunbc.recurring_failure_mode fold_shape_visible_to_no_lens (is a lens-side read of the referenced step declaration available at lens time) by execution, in two halves. The declaration half is available: a module-scope step's Arrow member and its first domain binding sit in the normalized root. The site half is not: `fold(xs, init: 0, f: step)` lowers to a Transform whose operator is the brace token with the callee dropped -- the shape call_expression_erased_at_v2_body_lowering already records -- so there is nothing for a reader to resolve from. Neither candidate construction is built. The same measurement shows the class is wider than the by-name residue: the planted fn-literal copy the gate refuses as a sole body statement is admitted in silence after a let, in a match arm and in an if branch, so the arrow-half coverage of #11314 holds for the sole-body position only. A nested fold inside a sole-body fold IS seen, which refutes the surface-arm specimen. Three RED witnesses enrolled and rostered with dissolution on the erasure class's trigger, one green positive control, receipts on both class rows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
…ll subtree (review 65699)
parse_subtree_find_production_captured (v2.extdeps.languages.dag, delegating to
..._under_children) is a whole-subtree PRE-ORDER FIRST MATCH, not a read of the step
argument. So `fold(xs, init: 0, f: (acc, x) => ... fold(x, init: acc, f: fn(a, b) { a }) ...)`
classified on the INNER fn literal and built a seam Loop whose body and carrier belong to the
inner lambda. The copy planted on the OUTER carrier then goes unseen, because `acc` is not the
carrier the lens was handed -- a fabricated, plausible lowering answering confidently about the
wrong accumulator (DESIGN section 5). Worse than the invisibility this lane repaired: an
invisible site is silent; this one answers.
THREE ARMS, one binary, the nested case committed as a fixture:
main first cut this cut
arrow_seen 0 1 1
arrow_bound 0 1 1
arrow_suspect 0 1 1
fn_seen/bound/suspect 1/1/1 1/1/1 1/1/1
nested_outer_suspect 0 0 1
named_seen 0 0 0
The narrower reading still finds arrow lambdas -- measured, because a reading positioned at one
argument could plausibly have stopped finding them at all, and a green on the nested case would
be worthless if arrow_seen had fallen back to 0.
TWO INSTANCES BEYOND THE ONE REVIEWED. The same search reached inside
`fold_node(algebra: NodeFold { .. })`, whose step is a RECORD and not a lambda at all. And this
lane INTRODUCED one: the arrow arm fires when no fn literal exists anywhere in the subtree, so
`fold(xs, init: g(y => y), f: step)` would have minted a carrier from the init: lambda where
main honestly refused. That instance is this lane's, not inherited.
THE READING. The step form is located by the binding name each callee declares -- fold/f,
fold_list/cons, fold_list_right/snoc, fold_node/algebra -- and from that argument descends only
the CAPTURED-CHILD CHAIN, never across siblings. The direct-argument walk stops at every
^dag_surface_arg without descending into one, so an argument belonging to a nested call inside
an argument value is unreachable. Naming fold_node's step as `algebra` is what keeps the reading
out of that record.
Constructor note: a bare `Present { value: ^f }` inside an if-chain resolves to
Primitive(String) against Optional<Symbol>; the symbols themselves resolve fine (isolated with a
separate probe). It sits behind a typed helper now, the idiom the lens already uses for
some_finding / some_let_binding_fact.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014tbjacTtGDpN2UHpBUrfoG
…dded an instance main refused
Two distinguishing facts per eager-raven-113's ruling, recorded on
gunbc.recurring_failure_mode fold_shape_visible_to_no_lens rather than left in the PR.
THE SEARCH GRAIN, found by review 65699 on the repair itself. A whole-subtree pre-order
first-match reads the INNER fn literal of an arrow step's body and builds a seam Loop from
it, so the lens is handed the wrong accumulator and answers about it CONFIDENTLY. That
ranks ABOVE the invisibility this row was opened for: a silent subject at least leaves a
counter reading 0, while a wrong carrier leaves a clean verdict nobody has reason to doubt.
Right grain: read at the argument the CALLEE declares and descend only the captured-child
chain. Instrument named (planted_copy_nested_arrow.dag, outer carrier acc, inner a).
THE FIRST CUT ADDED AN INSTANCE THE UNREPAIRED CORPUS REFUSED, which is the general form
worth carrying: when the fix for an invisible shape is a BROADER search, the search acquires
the neighbouring shapes too and must be RE-POSITIONED rather than widened, or the repair
converts silence into a confident wrong answer.
Prose braces avoided in both receipts -- a .dag string interpolates `{ }`, so `fn(a, b) { a }`
written literally resolves as a variable.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014tbjacTtGDpN2UHpBUrfoG
Call apply now inhabits primary_expr and postfix_expr (no minted call surface identity) so resolve sees the existing node_query carrier; fold-loop stays first. Argument-loss and undeclared-callee REDs pin #11207's evidence contract on the prepared and unprepared routes. Co-authored-by: Cursor <cursoragent@cursor.com>
eager-raven held the T-fold until a fixture whose only in-module occurrence of the callee is the call (imported length vs import-only control). The delta is 1 on positional node_query calls; a Named-edge channel for that identity must stay 0. Co-authored-by: Cursor <cursoragent@cursor.com>
…ntrol. The import-only tree must cancel Named edges on the imported symbol, or a green is also 'imports do not use that channel'. The same positional counter on decl+call vs decl-only is the shape where a declaration name can be confused with a site. Co-authored-by: Cursor <cursoragent@cursor.com>
…yDiagnostics at projection fallback. A one-variant BodyProducerCallForwardStanding and Diagnostics vs NonEmptyDiagnostics at projection_diagnostics made the #11322 closure unresolvable. Arrow-form surface witness no longer asserts Loop false so it composes with #11314. Co-authored-by: Cursor <cursoragent@cursor.com>
…aching identity is refused at enrolment margin Run 34786156711 refused nested_fold_inside_a_sole_body_fold_is_visible at 1732ms CPU against the 500ms line. Same standing as accumulator_copy_corpus_path_test's ingest-reaching predicates: executed under claim_batch, enrolled in nothing, dissolving on the same trigger. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
…view 65741) The repair had minted a THIRD spelling of the `name ^dag_token_colon value` spine of dag_grammar_arg_expr, and conceded it in a comment with no owner, no trigger and no row -- which DESIGN section 6 makes MORE severe, not less. Net concepts must not grow by re-invention (section 2). WHERE IT COULD NOT GO, and the review's suggested consumption is not available: v2.compiler .body_lowering_fold IMPORTS v2.compiler.fold_lowering, so a compiler stage consuming the body-lowering copy closes an import cycle, and acyclicity is the import graph's only structural law (section 3). The decoder now lives at the layer BELOW both, in v2.extdeps.languages.dag, beside the grammar production it decodes -- dag_named_arg_name_optional, dag_named_arg_value_optional, and dag_call_named_arg_value_optional for the keyed direct-argument lookup whose stop-at-^dag_surface_arg rule is the correctness property this PR turns on. NET CONCEPTS GO DOWN, not sideways: fold_lowering's three private decoders are DELETED and consume the authority, and v2.lens.complexity_accumulator_copy.analyze arg_value_node now DELEGATES to it, its contract unchanged (a positional argument still yields the capture itself, which every caller depends on). Three spellings become one authority plus one delegating reader. body_lower_named_arg_value_optional is deliberately NOT folded in, with a reason rather than a deferral: it returns a LOWERED OPERAND, not the raw value node, so it is this spine PLUS body lowering's own operand read -- unfusing it is a body-lowering change, and that file is under active edit by #11322. Stated in the authority's own note. BEHAVIOUR RE-MEASURED THROUGH THE REFACTOR rather than assumed, since the lens's reader moved: arrow_seen/bound/suspect 1/1/1, fn 1/1/1, nested_outer_suspect 1, named_seen 0, and a new negative control clean_arrow_suspect 0 -- a clean arrow-form fold is NOT reported, so the suspect arms are discriminating rather than answering yes. Constructor note, second occurrence: a bare `Present { value: x }` inside an if/else arm resolves to the bare payload type rather than Optional<T>; the typed-helper idiom the lens already uses (some_finding) is what makes it resolve. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014tbjacTtGDpN2UHpBUrfoG
Sole-body `{ fold(...) }` was lowering with `{` as the Transform operator; named two-arg combiners kept a comma token and dropped the value subtrees. Unwrap a leading lbrace before reading the callee, and refuse punctuation atoms on both the callee and argument channels.
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # dag/gunbc/recurring_failure_mode/fold_shape_visible_to_no_lens.dag
…r as the first argument.
Comma was a legal infix operator, so `{ fold(..., f: step) }` became Transform[comma,...] after the brace unwrap. Named two-arg calls read pair.right of `x, y` and kept only the second value. Argument values now stop at the comma, repeat-elements starting with a comma still read the right, and call-suffix search no longer pre-order-walks the whole subtree.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ion/deep-newt-301
The helper insert left an orphan match at module scope, so the test file failed to parse and the required build lane never measured the subject. Co-authored-by: Cursor <cursoragent@cursor.com>
… non-step argument mints no carrier Review 65763 on #11315 measured a fabricated carrier on 42e5937 (pre-slot-read): a by-name step with a two-binder lambda in the xs argument lowered to a seam Loop with carrier a. still-bee's a5f5585 reads the step at the callee-declared slot and, re-measured on the merged head, holds for positional-nested, named-nested and the fold_node record form. Enrolled as a red control (no Loop, no carrier) with a positive twin (decoy beside a real inline step still caught). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
Review 65782: those rows were only consumed by witnesses that restated the declarations. Standing A stays in the existing annotation; executing evidence remains body_lowering_call_preservation. Co-authored-by: Cursor <cursoragent@cursor.com>
…with every refused route named Review 65787 on #11315: the row called plain-fn controls 'enrolled'. They are not -- as test fns the enrolment-margin gate refuses a newly enrolled ingest-reaching identity (run 34786156711), the falsifier long lane has been DeclaredCadenceUnrealized since #8283, and the remaining live cadences do not admit a hermetic ingest witness. The reds ARE enrolled (known-red, held by the changed-witness arm). Wording corrected on the row and the corpus-path file; the standing is a receipt on the row naming the class and the rung-drop trigger that would let the greens enroll. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
… first named argument. deep-newt's tokenize/parse/normalize dumps on b2e3d36 showed the call apply giving up on a production shell (body collapsed to 0 or xs) and param_list_comma_spine skipping the first named value. Peel primary_expr/fn_body before reading the call pair, skip punctuation by continuing right, and collect args from the full capture. Sole-body fold control now requires callee fold with arity 3 (xs and step). Co-authored-by: Cursor <cursoragent@cursor.com>
…te on no lane Review 65787's second remedy. gunbc.rung_drop accumulator_copy_positive_controls_off_every_lane: previous MechanicallyPreventable, temporary Mitigatable, lost as a passenger of the falsifier long-lane executor (#8283); population the six green controls; restoration an executing lane with a declared ceiling for an ingest-reaching hermetic witness, observed at retirement. Every refused route is recorded on the row by execution or by the closing authority. Roster wired, projection regenerated, roster witnesses pass; the class row now points at the drop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
Sole-body `{ fold(...) }` is a sequence whose right sibling of the call is `}`; treating that as the suffix dropped the callee. Skip braces before fold-loop and before generic call apply, and only read an int when the primary itself is a literal — not when init: 0 lives inside the call. Added the nested-map / inline-step decoy as a control.
Co-authored-by: Cursor <cursoragent@cursor.com>
eager-raven: coverage was being found by collapse. The witness file now carries seven executed shapes (sole-body ident, postfix dotted, named args, nested call in an argument, fold-loop-first by-name step, lambda argument, match-arm call). Match-arm bodies go through the same call apply as fn bodies instead of first-operand. Not frozen — floor must be green on this table. Co-authored-by: Cursor <cursoragent@cursor.com>
…ng it Review 65812 on #11315: two enumerations of one row set. A callee is fold-family exactly when it declares a step slot, so a member cannot exist without one and fall silently into FoldCallStepFormUnresolved. fold_lowering_test and the accumulator-copy controls pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
Fusion split at any comma, so f: step / fn-literal after positional+named never became an operand; the last let statement also skipped try_body_lowered, so generic apply beat fold-loop. Co-authored-by: Cursor <cursoragent@cursor.com>
FoldCallStepShapeInvalid and FoldCallNotAFold were discarded so generic call apply could still Accept a Transform. Co-authored-by: Cursor <cursoragent@cursor.com>
A two-element Repeat after the first positional (init: 0, f: step) kept only the left operand, so the by-name step never reached sole-body apply. Co-authored-by: Cursor <cursoragent@cursor.com>
xs |> fold(init: 0, f: step) used operand-ref on the right, so the combiner was a bare fold atom. Co-authored-by: Cursor <cursoragent@cursor.com>
…g test. unbound_symbol_reason_note had no consumer and restated the undeclared-callee resolve assertion. Co-authored-by: Cursor <cursoragent@cursor.com>
The failure-mode row still said silent wrongness after resolve-side REDs landed; frontier_arm_note still said an undeclared callee passes resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
The three peel-and-search wrappers shared a traversal and differed only at the leaf; the table's closure claim was count(shapes) == 8 over the same list. Co-authored-by: Cursor <cursoragent@cursor.com>
discriminant and coproduct_nullary_inhabitants already enumerate arms; a hand roster could omit a new constructor and stay green. Co-authored-by: Cursor <cursoragent@cursor.com>
…rms. Discarding those diagnostics and salvaging an operand reopened the wrapper-retention hole already ruled out in this file. Co-authored-by: Cursor <cursoragent@cursor.com>
body_lower_try_infix_transform now returns Outcome, so Present/Absent matches in vacuity and the add-infix witnesses were type errors on the required floor. Import list_snoc_item from algebra, its owner. Co-authored-by: Cursor <cursoragent@cursor.com>
The if-then Present { value: root } inferred as Node against the
Optional child-walk, which refused the required floor.
Co-authored-by: Cursor <cursoragent@cursor.com>
The body-lowering punct wall was a second, incomplete token list, so brackets and fat-arrow could still stand as callee or argument atoms. Co-authored-by: Cursor <cursoragent@cursor.com>
Each of its test fns was newly enrolled and hit the 500ms CPU ceiling, so the floor never got a verdict. Keep the undeclared-callee and arity checks on identities that already exist on main. Co-authored-by: Cursor <cursoragent@cursor.com>
review 66029: arm (iii) cannot stand on postfix step alone after the preservation file was dropped. `{ g(x: 1) }` and nested `{ g(x: h(y: 5)) }` now ride identities already on main so erasure still reds the merge path.
Co-authored-by: Cursor <cursoragent@cursor.com>
review 66048: postfix-reject and projection-to-transform must not carry `{ g(x: 1) }` / nested-call obligations. Those shapes get their own test fns; CI on e099b99 was Bool(false) because whole-tree lbrace walked brace-bodied `{ x }` siblings.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ite. review 66073: body_lower_arg_operand_optional is gone; leaving it in the lens annotation and RFM was a stale §3 name, and keeping the named-arg climb's trigger as unpaid inflated the rung. Record the named-arg path as climbed; residual is operand_ref pair.left and arg_value_node dissolution. Co-authored-by: Cursor <cursoragent@cursor.com>
Live citations name body_lower_arg_operand_local_optional; the old peel is described, not grepped as if it still resolved. Co-authored-by: Cursor <cursoragent@cursor.com>
…identity.
The dedicated test fns were newly enrolled and censored at the 500ms ceiling. `{ g(x: 1) }` and nested `{ g(x: h(y: 5)) }` now ride body_lowering_normalize_accepts_projection_module, which is already on main.
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # dag/gunbc/rung_drop/roster.dag # docs/design-rung-drops.md
…ion/deep-newt-301-lens-site # Conflicts: # src/v2/lens/complexity_accumulator_copy/analyze.dag
…refused unread, no step guessed On top of #11322 (the call reaches the tree as Transform[fold, xs, 0, step]) and #11315, the lens treats a Transform whose combiner is a fold-family head as a fold site: count_fold_sites counts it with carriers_bound 0 and the traversal refuses ^fold_accumulator_unread at it, walking the children under iteration with no new carrier. The operands are positional with labels erased, so no step is read from them (source order is not declaration order; resolving whichever operand is an Arrow would fabricate). Four rostered reds green with no edit and their rows delete: named_step_fold_refuses_accumulator_unread, report_counters_state_the_domain (this arm), let_prefixed_fold_copy_is_caught, match_arm_fold_copy_is_caught (#11322). declared_named_step stays red with its trigger narrowed to named actuals on the lowered call envelope. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
The floor's parse phase refused two lines of // inside count_fold_sites' body (the seed interpreter used locally does not run that gate). The rationale stays on analyze_lowered_fold_call's leading block, which already states it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
…-lens-site # Conflicts: # dag/gunbc/recurring_failure_mode/fold_shape_visible_to_no_lens.dag # src/v2/test/claim/complexity/accumulator_copy_corpus_path_test.dag
…wly enrolled ingest-reaching identities are refused at the post-#11195 100ms-equivalent tier Run 34856 on #11368 refused let_prefixed / match_arm / named_step_unread as new witnesses over the tier. Same standing as the six controls already declared in accumulator_copy_positive_controls_off_every_lane; population extended, projection regenerated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bce7eb8a30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
| } | ||
| match body_lower_call_preserving_core(shell: shell, captured: captured) { |
There was a problem hiding this comment.
Preserve declared calls in a resolvable form
When a primary expression calls a function declared in the same module, this new path replaces the previous atom fallback with a Transform, but that transform does not survive the staged resolver. I checked fn choose(x: Int, b: Bool) -> Int { x } followed by fn caller() -> Int { choose(x: 1, b: true) }; run_front_end now returns FrontEndRefused. Thus the change correctly makes undeclared callees visible, as the added negative test shows, but also rejects ordinary declared inter-function calls. The call-preserving representation must be wired to declaration resolution before routing all primary calls through it.
Useful? React with 👍 / 👎.
State at wind-down (2026-09-14, deep-newt-301 handing off)
Draft, stacked on #11315 (
be534576, at the floor) and #11322 (9fa8f614). The branch carries both plus main; the diff that is this PR's own is two commits —b8e47f28(lens fold-site arm, four roster rows deleted,declared_named_steptrigger narrowed, row receipt) andbce7eb8a(the four greened ingest-reaching witnesses are plainfns in theaccumulator_copy_positive_controls_off_every_lanedrop population, since #11195's 100ms-equivalent tier refuses newly enrolled identities over it) — plus876fbe2edropping a body-grain annotation.What remains for whoever picks this up:
gh pr ready 11368).body_lowering_normalize_add.*,body_lowering_projection_call.*,staged_front_end.*), reported to zesty-fox-514; my three at the same tier are already resolved atbce7eb8a.src/v2/lens/complexity_accumulator_copy/analyze.dag(closure member): an srv2 receipt is owed before the land.accumulator_copy_fold_analysis_test.dagunderclaim_batchon the rebased head; expected: all PASS exceptdeclared_named_step_fold_copy_is_caught(RED, kept, trigger = named actuals on the lowered call envelope).Follow-up owed by
node://adhoc-d517fc46-052: the row's original exit criterion. With #11322,fold(xs, init: 0, f: step)reaches the normalized tree asTransform[fold, xs, 0, step]. This change makes that site visible to the complexity lens:analyze_lowered_fold_calltreats a Transform whose combiner is a fold-family head as a fold site —count_fold_sitescounts it (folds_seen 1 / carriers_bound 0) and the traversal refuses^fold_accumulator_unreadat it, typed and located, walking the children under iteration with no new carrier.What it deliberately does not do: read a step from the operands. They are positional with the named-argument labels erased, and the seed binds actuals by label in any source order — so which operand fills the step slot is not a fact the tree carries. Reading the last one would be source-order-equals-declaration-order; reading whichever resolves to an Arrow member would be the first-plausible-ident fabrication the fold lowering itself refuses (§5). The residue is a new sub-capability: named actuals visible on the lowered call envelope (
node_is_call/call_argument_targetsread positionally), which zesty-fox-514 classified as its own admission.Executed on this head (claim_batch, 13 witnesses)
named_step_fold_refuses_accumulator_unread(original exit)report_counters_state_the_domain(original exit)let_prefixed_fold_copy_is_caught(#11322)match_arm_fold_copy_is_caught(#11322)declared_named_step_fold_copy_is_caughtRung for the by-name population: below-the-floor → Mitigatable (a copied accumulator in a by-name step is refused as unread at the site, on the Accepted diagnostics channel — counted, not silent). Receipt on
fold_shape_visible_to_no_lens.Census (re-derived on this head; single-line grep floor, not an exact count)
By-name fold-family step sites in
dag/+src/v2, excluding prose rows: 14 lines / 9 files, of which 3 are the pipe spellingxs |> fold(init:, f: name)(reach this arm once #11322'sCallOnInfixRhsforwarding lands) and 1 isfold_node(algebra: r)(record step; unread by construction).Instrument for the corpus-wide question is still not a required lane (see #11315's body); a green run here is not a corpus verdict.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RVFnQtBLTJd1ufJFr2hQKq