Skip to content

Delete the value carry: every value position refuses at the value (let/stmt/if/arm/field), no navigation relabel - #12299

Merged
gunbai-bot[bot] merged 68 commits into
mainfrom
session/deep-bear-733-fold
Sep 26, 2026
Merged

gunbai-bot[bot] merged 68 commits into
mainfrom
session/deep-bear-733-fold

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Based on main (#12208 has landed; main merged in with a merge commit). Scope ruled by neat-boar-16 / gentle-koi-724: one transition closes the fail-open carry.

What changes (v2.compiler.body_lowering_fold)

  • Deleted: body_lower_value_lowered_or_carried, and the value_carried_unlowered HeadGrain advisory row in v2.workflow.compile_door_cause_ownership. The carry handed back an unlowered shell, let the file Accept, and the shell refused later at resolve at the wrong atom (new RFM row carried_unlowered_value_accepted_as_an_advisory_refuses_downstream_at_the_wrong_atom, with receipts from lambda_has_no_lowered_function_value_form and #12145 follow-up: value-position regression controls, lambda-argument frontier enrolled expected-red, RFM receipts (no compiler change) #12198/value_position_whole_read).
  • New: body_lower_value_read, which answers the lowered value, or a refusal body_lowering_reason_value_unlowered located at the value (FatalGrain row replaces the advisory row). Every value position uses it: record field initializer, if condition, if arms, let value, each block statement (body_lower_stmt_spine), and match-arm bodies (body_lower_match_arm_wire_read, on both the pattern-capture and spine routes).
  • Deleted (relabel): the operand-reader fallbacks body_lower_match_arm_body_optional and body_lower_if_arm_operand_optional, whose Absent was reported as match_arm_navigation_refused / if_navigation_refused. Navigation refusals remain only for a missing pattern, => or arm.
  • Bind fix: the let value and each statement were folded but never peeled, so the Bind carried the precedence spine the fold keeps around a lowered operand. They are now read through the value reader.

Claims (local gunbc run --claim-run, all green)

Discriminating reds (mutation applied to the fold, then reverted)

red rows
pre-change fold (this PR's base) both bind rows + all 5 refusal rows
statement spine back to raw body_lower_fold both bind rows
bound value back to raw body_lower_fold both bind rows + let-value refusal
value reader carries on Absent all 5 refusal rows
arm refusal relabelled as navigation arm-body refusal row

Not done, and why

  • "Arm missing => stays navigation" control: not authorable from source. The parser refuses that arm (parse_grammar_choice_overlap_residue) before lowering, so a claim could never go red (§4b decoration).
  • Statement-let binder / annotation: the binder is present (asserted by the bind rows); an annotation refuses type_annotation_not_carried at the type expression, located. Nothing is dropped.
  • Sibling advisory postfix_suffix_carried: a declared rung drop, out of scope.

Newly-refusing census: the deletion is the census

srv1 per-file lane census over the seven's closure (neat-boar-16): PR 9621aa703e5 vs base 9621aa703e5 with bfa5aef8308 reverted, rows keyed (path, fatal, head) and diffed both ways. Refusals go from 75 to 77.

Newly refusing (2): the population the carry hid. Both are a fn literal as a record field initializer, which is exactly the position body_lower_value_lowered_or_carried used to carry:

file declaration value position now refusing value_unlowered
src/v2/std/logic.dag bool_boolean_algebra meet: fn(a, b) { match a { .. } } (and join: fn(a, b) {..})
src/v2/std/language_model.dag language_model_empty_canonical_symbols member: fn(_) { false }

Under the carry, both Accepted normalize with the fn literal still unlowered inside the record. Both go green when fn literals get a lowered form (#12210).

Relabels (3): same files refuse, but now under the value's own cause.

  • src/v2/compiler/03_resolve.dag, src/v2/compiler/04_infer.dag: call_argument_unread → value_unlowered (an earlier value position now refuses first).
  • src/v2/std/text.dag: match_arm_navigation_refused → value_unlowered. This is the relabel dissolving: string_join's fn literal in an arm body.

Full corpus (dag + src/v2), srv1 driver census, base 2708 → PR 2730 refusals (neat-boar-16)

  • 30 newly refusing paths, all value_unlowered. This is the population the carry hid (list in the census message; they include std/logic and std/language_model above).

  • Relabels: 19 call_argument_unread→value_unlowered, 4 match_arm_navigation→value_unlowered, 2 operator_operand_unread→value_unlowered, 2 match_arm_navigation→call_argument_unread, and 1 each of wrapper_retention→value_unlowered, call_argument_unread→wrapper_retention and call_argument_unread→type_annotation_not_carried.

  • 9 paths refused at base (call_argument_unread) and were ACCEPTED at 9621aa7. That was a §5 defect, fixed at bdae8ca. body_lower_value_lowered handed a value whose bottom-up fold REFUSED to the top-down walker, which answered with the first lowerable subtree. On dag/extdeps/linux/proc_mountinfo.dag, let folded = fold(filter(map(..., l => trim(l)), ...), init: .., f: fn(acc, line) {..}) was bound to the body of the f: literal, and the fold call, the chain, init and the binders were all dropped. Routing the let value and statements through this reader exposed that pre-existing swallow. The fold's refusal now propagates. All nine refuse call_argument_unread again, as at base: dag/extdeps/linux/proc_mountinfo.dag, dag/extdeps/procps/pgrep.dag, dag/gunbc/instruments/dag_compile_clean_shard_totality_transport.dag, dag/test/claim/capacity_lease_chain_witness_test.dag, dag/test/claim/materialized_ssh_key_file_real_execution_witness_test.dag, dag/test/claim/terminal_wire_projection_witness_test.dag, and the three src/v2/test/claim/execution/emit_on_demand_*_family_witness_test.dag. Regression claim: a_fold_refusal_inside_a_let_value_propagates_instead_of_binding_an_inner_subtree_holds, which is Accepted under the old reader and refuses at the lambda with the fix.

  • Re-census at bdae8ca (2739 refusals): none of the nine are accepted any more, which confirms the fix. One newly refusing path from the propagation: dag/gunbc/host/host_standup_assimilation_deduction.dag, call_argument_unread at an f: lambda argument. That fold refusal was previously rescued by the walker, which answered with an inner subtree.

  • A second relabel route, fixed at 4886f22: dag/extdeps/vllm/engram_layout.dag (vllm_engram_is_prime) refused match_arm_navigation_refused at a locus with no source. body_lower_extract_comma_list_arm_head retried a second arm reading on ANY refusal of the first, which discarded a real content refusal (a lambda call argument in a block arm body). The same happens at base; there it was hidden behind an earlier refusal. The retry now runs only on a navigation (shape) miss. engram_layout now refuses call_argument_unread at the lambda. Claim: a_block_arm_whose_content_refuses_keeps_the_content_refusal_not_navigation_holds.

  • Final full-corpus census at 4886f22 (neat-boar-16): 2743 refusals vs base 2708. GONE vs base: 0, so no file is accepted that base refused. NEW PATHS: 35, which is the 31 above plus 4 files that were ACCEPTED at base with a wrong answer, surfaced by the retry-only-on-shape-miss fix. The old retry discarded their real call_argument_unread and let the second arm reading succeed:

    • dag/gunbc/ollama_runtime_bundle.dag
    • dag/gunbc/self_host_compile_phase_live_gate.dag
    • dag/gunbc/spark/collective_memory_path_standing.dag
    • src/v2/test/claim/resolve/namespace_candidate_rule_test.dag

    RELABELS (the mislabel dissolving corpus-wide): 149 match_arm_navigation_refused → call_argument_unread (engram_layout among them), 19 call_argument_unread → value_unlowered, 4 match_arm_navigation → value_unlowered, 3 match_arm_navigation → type_annotation_not_carried, 2 operator_operand_unread → value_unlowered, 1 wrapper_retention → value_unlowered, and 1 match_arm_navigation → operator_operand_unread. Nothing moved toward acceptance.

  • Out of scope, noted: the arm-list collectors (body_lower_collect_match_arms*) still treat a missing sequence projection as the end of the list (Rejected => Accepted(Empty)). That's structural navigation over the grammar's own shape, not a value refusal.

🤖 Generated with Claude Code

Brian Searls and others added 30 commits September 23, 2026 20:10
…d arguments no longer refuse the whole module

gunbc#12145 stopped the operand reader narrowing a sequence to its left element,
which had read h(q: a) as h and [a] as [. body_lower_call_arg_value read every
argument with that reader alone, so a nested call, record, caret symbol or
parenthesised group became call_argument_unread and its whole module refused
normalize. An argument's value is now lowered by body_lower_value_lowered (the
field-initializer / if-condition reader), with the operand reader as fallback.
A parenthesised group lowers to its inner expression instead of its first atom.
A list literal anywhere in an argument value still refuses, at the list
(body_lowering_reason_list_literal_unlowered): body lowering has no lowered form
for a list literal yet, so reading it would trade a refusal for a silent drop.
Witness: v2.test.claim.namespace_xl0.call_argument_value_resolve_refusal.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e no longer refuses the whole match

body_lower_match_scrutinee_optional read the scrutinee with the operand reader
alone: before gunbc#12145 match t(p: x) {..} narrowed to t, after it the match
refused as match_arm_navigation_refused (64 of the 133 still-refusing sample
modules). The scrutinee now goes through body_lower_value_lowered, operand reader
as fallback, refusal propagated. Witness claim: an undeclared name inside a call
scrutinee refuses at resolve at its atom.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ments read through the value reader

Stacked on #12173 (call arguments and match scrutinees via body_lower_value_lowered).
body_lower_operator_operand reads a non-operator operand whole via body_lower_value_lowered
before refusing operator_operand_unread; a function value in argument position is carried as
its preserved shell under value_carried_unlowered (the field-initializer disposition) instead of
refusing its module as call_argument_unread (weather.dag, gen-one's first fatal). Claim
v2.test.claim.namespace_xl0.value_position_whole_read with production-route shape assertions;
RFM row fold_rewrite_regression_visible_only_at_whole_route_identity_diff.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… outcome, not dropped (review 70746)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rom the #12198 srv1 diff)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e_query and node_subtree_nodes, no untyped edge field access (entry resolve refused '.target' on T)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…RFM receipts folded into lowering_accessor_collapses_a_sequence_operand as an exposure/coverage gap, not a new regression row (side-chat review)

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

[] -> v2.std.algebra.freemonoid_empty(); [e] -> freemonoid_singleton(item: e);
[e1..en] -> right-nested list_append(left: singleton(e1), right: ..). One producer
(body_lower_list_literal) reached from body_lower_primary_expr, so every value
position gets it; each element lowers whole via body_lower_value_lowered and an
element that cannot lower refuses located at it. The call-argument
list_literal_unlowered refusal is deleted. Declares freemonoid_singleton (the
free monoid's generator embedding) beside freemonoid_empty.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… shape of the operator_operand_unread files; the bare call lowered before the fallback (srv1: M1/M2 stayed green)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eclared body name refused at its atom; operator-operand fallback and its non-discriminating claims dropped (owned by #12194)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tionally so the rostered named-label drop does not red it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…; lambda claims enrolled expected-red as the MQ frontier; shape claims read an ingest without the lambda fixtures; RFM receipt updated

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

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…branch hunk the squash did not land is not this PR's)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-resolve under #12194's match-scrutinee controls; list_literal_has_no_lowered_form records the climb and cites the renamed and new claims

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…clared; move freemonoid_empty, freemonoid_singleton, list_append, list_snoc_item there (delete-first, no re-export) and repoint every consumer

v2.std.algebra imports v2.std.node, so v2.std.node's own list literals lowered to
v2.std.algebra calls would close a node -> algebra -> node cycle; v2 collapses onto
dag/std. Adds the self-reference claim: a module std.algebra's own list literals
resolve to its own qualified names, and its twin without list_append refuses at resolve.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bridge std_algebra.rs (FreeMonoid + list_snoc_item) replaces the v2_std_algebra.rs bridge and normalize's FreeMonoid-only stub

The emitted 03_normalize, 03_body_producer and use_site_verdict now import
list_snoc_item from std.algebra; their transport rows, shim libs and normalize's
declared source refs point at the one bridge (review 70892).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ebra FreeMonoid reference, elements positional in order -- with one infer introduction case

Reverses the right-nested list_append lowering: std.literal_elaboration
UnicodeScalarSequenceUnfold names the flat list-literal introduction as the
language's FreeMonoid introduction and rejects cons^n on cost and emitter fuel, so
the nested form forked that authority (ruling: gentle-koi-724 / neat-boar-16).
04_infer types the introduction: every element unifies to one T (compared with
provenance stripped), a differing element refuses located at it, [] stays on the
GroundingNotDerived frontier. freemonoid_singleton is deleted (no consumer left).
Claims: flat shape reader, 200-element depth control, infer introduction controls;
the std.algebra self-reference twin now omits FreeMonoid itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gle-level arms (emit-build: the emitter boxes a field bound under a nested Present{Accepted{..}} pattern, E0308)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…bound under a nested variant pattern keeps its Box (emit-build on #12208)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n and the list_append concat witness to std.algebra; infer mismatch claim reads the FATAL diagnostic; self-reference verdict carries its refusal reason

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ce verdicts through ProcessExit so a run names the refusal

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…algebra twin must refuse LOCATED AT the FreeMonoid head (its locus reads back as std.algebra.FreeMonoid)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 7 commits September 25, 2026 12:19
… takes main's roster-variant decode; #12208's duplicate copy of that fix is dropped

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…12267): both RFM occurrence receipts kept

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…reads as NOT an application

- application_head_read: a Transform the list reader recognises answers NotApplicationHead before
  its head is classified, so application_slots / application_read and the head-only readers never
  read a list as a malformed call (agreed with warm-ram-650: the second of #12202/#12208 to land
  adds it).
- list_introduction_elements_optional reads the head in BOTH forms: the marked declaration
  reference (post-resolve, #12220) and the bare qualified-name spine body lowering writes, since
  application_read also runs over lowered bodies. Safe because the path is compared for exact
  equality with the FreeMonoid path.
- Controls: a lowered list argument and a resolved list introduction read as NotApplication; the
  call enclosing the list still reads as an Application.
- Import conflicts resolved as unions with the moved fns from std.algebra.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…orts with the moved fns from std.algebra

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…_value_read and refuses at the value

body_lower_value_lowered_or_carried and the value_carried_unlowered HeadGrain advisory are deleted;
field initializers, if condition/arms, let value, each block statement and match-arm bodies refuse
with body_lowering_reason_value_unlowered located at the value. The operand-reader fallbacks whose
Absent was relabelled as match_arm/if navigation are deleted. Bind now carries lowered children.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 3 commits September 25, 2026 16:08
…-fold

# Conflicts:
#	src/v2/std/node_query.dag
…sion/deep-bear-733-fold

# Conflicts:
#	src/v2/std/node_query.dag
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Review 71334: fixed at c8590a1. body_shape_dbg_test.dag was my local debugging harness, swept into the commit by git add -A. It's deleted, and nothing referenced it. The PR's diff against its base is now exactly the six intended files: the fold, the cause-ownership row, the expected-red roster, body_shape_contract, the new value_read_refusal, and the RFM row.

— sent from deep-bear-733

gunbc-ci-auto-heal and others added 2 commits September 25, 2026 20:45
… which bound an inner subtree

body_lower_value_lowered answered a value whose bottom-up fold REFUSED by walking for the first
lowerable subtree; on dag/extdeps/linux/proc_mountinfo.dag the let value became the body of the
fold's f: literal and the module Accepted. The full-corpus census found nine files Accepted this
way. The fold's refusal now propagates; a regression claim covers the shape.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e content refuses keeps that refusal

body_lower_extract_comma_list_arm_head retried the repeat-element reading on ANY refusal of the
arm reading, discarding a real content refusal (call_argument_unread in a block arm body) and
reporting match_arm_navigation_refused instead (engram_layout, full-corpus census). Claim added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Base automatically changed from session/lively-koi-275 to main September 26, 2026 14:52
gunbc-ci-auto-heal and others added 2 commits September 26, 2026 14:57
…-fold

# Conflicts:
#	dag/gunbc/instruments/self_host_03_normalize_declared_source_refs.dag
#	dag/gunbc/instruments/self_host_03_normalize_shims/lib.rs
#	dag/gunbc/instruments/self_host_body_producer_shims/lib.rs
#	dag/gunbc/instruments/self_host_module_behavioral_transport_roster.dag
#	dag/gunbc/instruments/self_host_use_site_verdict_shims/lib.rs
#	dag/test/claim/self_host_03_normalize_behavioral_witness_test.dag
#	src/v2/compiler/body_lowering_fold.dag
#	src/v2/extdeps/languages/dag.dag
…idue, not in main's #12208 and not part of this PR

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

gunbai-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Review 71544: dag/gunbc/instruments/self_host_std_bridge_shims/std_algebra.rs is removed at 8b144bb. The finding is right that nothing loads it, and it also isn't this PR's file. It came from #12208's pre-squash commit 6350074, which reached this branch only because #12299 was stacked on #12208's unsquashed history. Main's squashed #12208 doesn't contain it, so dropping it restores main's state instead of deleting anything main relies on. The PR's diff against main is now exactly its six files: the fold, the cause-ownership row, the expected-red roster, body_shape_contract, value_read_refusal, and the RFM row.

— sent from deep-bear-733

…imens; claims read their row

Each claim ran tokenize/parse/normalize itself (~150k-390k eval steps) and the floor refused them
over the new-witness budget. vrr_outcomes is a nullary pure producer (cav_outcomes pattern),
enrolled warm in floor_pure_producer_share; the stage still executes once in preparation.

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 Sep 26, 2026
Merged via the queue into main with commit e4bdd90 Sep 26, 2026
5 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/deep-bear-733-fold branch September 26, 2026 22:36
@briansrls
briansrls restored the session/deep-bear-733-fold branch September 26, 2026 22:40
gunbai-bot Bot pushed a commit that referenced this pull request Sep 26, 2026
…into MQ-1: a fold refusal propagates as main rules; a let value and a sole statement read through body_lower_value_read; the fn-literal annotation refusal stays retired (the producer carries it)
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