Skip to content

Wiring-liveness wave-2(b): fn-arrow reflection builtin + corpus-wide lens coverage - #5722

Merged
briansrls merged 6 commits into
mainfrom
session/merry-badger-873
Jun 24, 2026
Merged

briansrls merged 6 commits into
mainfrom
session/merry-badger-873

Conversation

@briansrls

@briansrls briansrls commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Wiring-liveness wave-2(b): fn-arrow reflection + corpus-wide lens coverage

Closes the wave-1 lens's honest boundary — "the corpus has NO fn/arrow reflection ... a corpus-wide scan of real fn params is opaque today" — by landing the gunbc#5364 widen trigger: a fn/arrow corpus-reflection builtin wired into v2.lens.wiring_liveness so a declared fn parameter with no path to its output fails the floor. Builds on wave-1 (#5679); does not fork its kernel.

What lands

  • v2.std.fn_index.fn_arrow_decl_facts_live — host SOURCE reflection (sibling of concept_decl_facts_live, but ItemKind::FnItem/FuncItem). Yields one FnArrowDecl{qualified_name, name, output, params} per declared fn: the body projected to a reachability skeleton (parameter references → identity Atom leaves, everything else → neutral Conj containers) plus the declared parameter atoms. Bridge wired in v1_interpreter.rs (STD_FN_INDEX_BRIDGE_FNS / is_v4_std_fn_index_bridge_call), conformance-checked.
  • v2.lens.wiring_liveness corpus fold — wiring_dead_wires_over / wiring_liveness_corpus_is_clean. Reuses std.dependency DependencyView/dependency_lens/ready_set (no new dependence type — that re-coining is what sank the duplicate Wiring-liveness lens wave 1: dependence carrier + wired floor witness #5702). A parameter is wired iff reachable from the body output; the per-fn reachable set is computed once via ready_set (linear), not per-parameter saturation (quadratic).
  • Floor witness wiring_liveness_corpus_test.dag (auto-enrolled) — with no-host-enumeration controls (locally-authored probe fns must appear in the enumeration, proving the read axis by execution) and a synthetic dead-wire discrimination control.

Soundness (three corrections found by running it over the live corpus)

  1. item.params is concat(type_params, value_params) — generic type-params (T,K,V) are not value inputs; excluded via their self-named type-expr (T : T).
  2. A fn-valued parameter applied as a callee (predicate(x)) is stored as the call node's name, not a child — the marshaller now emits the atom for ExprVar reads and ExprCall callees.
  3. Legitimately-irrelevant inputs (a NodeFold step's ignored edge) are declared inert via the existing _-prefix convention (node.dag step: fn(acc, _edge, sub)); the reflection skips _-prefixed params. The two such params in dependency.dag are renamed _edge (plan §4).

Proven by execution (not typecheck + grep)

claim_batch over --source-root dsl --source-root src/v2: GREEN (dead-wire count 0) → un-declare one inert param (_edge→edge) → RED (floor FAILs) → revert → GREEN. Wave-1's three witnesses and the bridge conformance test still pass.

Honest scope

Coverage is the witness's resolve closure (the floor resolves per-entry closures), same as concept_decl_facts_live today. Whole-tree widening lands with #5364's corpus-as-node accessor (ctx.modules = whole tree); this PR is its SOURCE half. The opaque Rust-seed resolve_auth realization remains the separate wave-2 perturbation witness.

🤖 Generated with Claude Code

Brian Searls and others added 6 commits June 24, 2026 13:51
…lens coverage

Adds fn/arrow corpus reflection (the gunbc#5364 widen trigger) and wires it
into the wave-1 wiring-liveness lens so a declared fn parameter with no path to
its output fails the floor -- proven green-by-execution over the live closure
and red-on-perturbation.

- v2.std.fn_index.fn_arrow_decl_facts_live: host SOURCE reflection (sibling of
  concept_decl_facts_live, ItemKind::FnItem/FuncItem) yielding one FnArrowDecl
  per fn -- body projected to a reachability skeleton (param references become
  identity Atom leaves, all else neutral Conj containers) + declared param atoms.
  Excludes generic type-parameters (self-named type-expr) and _-prefixed
  declared-inert params; resolves fn-valued params used as call callees
  (ExprCall node name, not a child).
- v2.lens.wiring_liveness: corpus fold reusing std.dependency
  DependencyView/dependency_lens/ready_set (no new dependence type) -- a param is
  wired iff reachable from the body output.
- Floor witness wiring_liveness_corpus_test with no-host-enumeration controls and
  synthetic dead-wire discrimination.
- Declared the two NodeFold-step ignored edge params inert (_edge) per the
  existing node.dag convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 24, 2026 14:39
@gunbai-bot gunbai-bot Bot changed the title Wiring-liveness wave-2(b): fn-arrow reflection builtin + corpus-wide lens coverage — fail the floor on any .dag declared input with no path to an output, proven green-by-execution + red-on-perturbation over the LIVE corpus (not synthetic arrows). Unblocks the #5364 widen trigger. Reuse std.dependenc Wiring-liveness wave-2(b): fn-arrow reflection builtin + corpus-wide lens coverage Jun 24, 2026
@briansrls
briansrls merged commit 16f057e into main Jun 24, 2026
2 checks passed
@briansrls
briansrls deleted the session/merry-badger-873 branch June 24, 2026 16:18
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