Skip to content

σ-family lens (intent-linearity ChangeTime wall): red on live corpus, table-driven dedup, green — end-to-end demo - #6336

Merged
briansrls merged 18 commits into
mainfrom
sigma-family-lens
Jul 7, 2026
Merged

briansrls merged 18 commits into
mainfrom
sigma-family-lens

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

σ-family lens: end-to-end demo — red on live code, dedup, green

First executable slice of the intent-linearity wall (ChangeTime axis): detect σ-families — k fn declarations that are graph-isomorphic except at leaf atoms under one substitution per member — i.e. an axis someone unrolled into name-suffix copies instead of one parameterized core + data rows (the exact class behind the #6313/#6317/#6318/#6320 dedup cycle, DESIGN §2 horizontal).

The criterion is exact — no similarity threshold (§4: no heuristics)

fillings_all_leaves(anti_unify_chain(members)) and the template keeps ≥1 internal (childed, non-hole) node. Members differing at any internal position fall outside the wall by construction; near-families are ratchet territory, never conflated.

End-to-end receipts (all by execution)

  1. Algebra proven on synthetics: 9/9 lens_unit discriminators green (discriminators_test.dag) — σ-pairs related, structural difference / bare atoms excluded, 3-member family = one finding with member_count==3 && hole_count==1, subject extraction exact, module count exact.
  2. RED on live code: pointed at dag/tools/dag_compile_clean_scope.dag (parses under wave1), the lens found 2 σ-families: ordinals [10,11,13,14] (the 4 skip/whole-tree witnesses — the family I was hunting) and [12,15] (the two ScopedRun witnesses — a family my manual token-spine hunt had missed). Receipt: corpus_scope_sigma_family_count() == 2, corpus_scope_largest_family_size() == 4 at the pre-dedup commit.
  3. Fix = the modeled dedup: both families dissolve into one touched_path_disposition_matches(row) core + 6 ScopeDispositionRow data rows + a single folding witness. lever_a_local_receipts_hold and the external claim file migrated; behavior-preservation receipts: first row claim green (dag_compile_clean_scope_empty_touched_skips_holds: PASS via flagless claim_batch, 569906ms — each disposition query costs ~9.5min), row-count pin green; the remaining four claims are running now (~70min of query time) and results land as a PR comment. Note: scripts/lever_a_local_verify.sh's --wet path OOM-dies (exit 137) at this container's cgroup cap — pre-existing, not this diff.
  4. GREEN: corpus_scope_has_no_sigma_families() == true on the deduped file.
  5. Red controls: planted 3-member family fixture fires through the full parse→extract→group path (corpus_red_control_planted_family_fires == true); external claims add a wrong-expectation discriminator (dag_compile_clean_scope_disposition_core_discriminates) and pin the row count at 6.

What it buys in real terms

The duplication class that cost four consolidation PRs is now machine-detectable at the parse layer, with an exact (not fuzzy) criterion — and its first live run already found one family a careful manual hunt missed.

Honest limits (PR2 items, named in the charter)

  • Location by ordinal: wave1 drops fn-ident name text at parse (qualified-name segments keep theirs), so findings locate by module item ordinal. The name-fidelity relation-row fix restores symbol-level location.
  • Cost: in-interp wave1 parse of the 6KB subject is ~1.5–5 min, so the corpus witness ships receipt-backed, not floor-enrolled (era-4 floor budget discipline). Dissolve-on: floor shared-compute memoization / parse memoization.
  • Registry/StandingIntent wiring (LensContract + intent_linearity StandingIntent row + near-family ratchet counter + data-decl extension) is PR2.

Also in this diff

The #6337 parse overlap-residue fix (this branch is built on it; those files drop out of the diff when #6337 merges). The failing ci check is the era-4 by-design floor kill, identical on every open PR and main.

briansrls and others added 11 commits July 6, 2026 21:14
…s counted overlap residue

grammar_validate_for_parse rejected ANY choice-FIRST overlap, but dag_wave1
carries 5 non-nullable overlap rows (expr, arg, match_arm, field_pattern,
if_expr) - canonical non-LL(1) choice points its own runtime handles via
parse_choice_residue_backtrack. Result on main: parse_module refused every
input (receipt: exp_nest_d1_parse_holds false, probe module parse rejected
with 5x parse_grammar_choice_ambiguity), invisible under dark CI, while the
backtrack arm sat dead.

Split the states instead of conflating them (state-space conflation):
- both_nullable=true rows: genuine ambiguity, still Rejected (fail-closed);
  new red control claim_validate_rejects_nullable_choice_ambiguity.
- both_nullable=false rows: Accepted with counted typed residue diagnostics
  (reason parse_grammar_choice_overlap_residue, one per row), threaded
  through parse_module via diagnostics_merge / rejected_with_pending - no
  silent drop.
- disjoint choice: residue None (claim_disjoint_choice_validate_residue_none
  discriminates residue from clean).

Claims re-derived by execution: dag_wave1 validate accepts, zero nullable
ambiguity, residue pinned at 5; python_wave1 validates and its MVP-1 fixture
now parses end-to-end (residue 1); exp_nest_d1/exp_elseif_k4 true again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ew the time cap)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

CI disposition (draft, mid-assembly): the failing ci job is the floor step killed at its 10m budget — the by-design era-4 state (#6323 re-ruling; same red on every PR today, including #6338, and on main). Nothing in this branch reaches or affects the floor cap. Merge basis for the era = approvals + rust_tests + mergeable. This PR is still draft while the final verification legs run; it flips to ready with red→green receipts in the body shortly.

— sent from sunny-wren-799

@gunbai-bot gunbai-bot Bot changed the title complexity lens enforcement σ-family lens (intent-linearity ChangeTime wall): red on live corpus, table-driven dedup, green — end-to-end demo Jul 6, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 6, 2026 23:34
@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Composer review (36122) — finding valid, fixed in 66ea6e1

Both items were the same defect, and it's the one the lens charter itself names (§6 inert-lens): the witnesses were plain fn, invisible to claim discovery — specification-without-execution at the enrollment layer. Fixed following the exact precedent you cited (structural_similarity/lens_unit/discriminators_test.dag): all 9 lens_unit discriminators, the corpus gate corpus_scope_has_no_sigma_families, and the planted red control corpus_red_control_planted_family_fires are now test fn in *_test.dag files (helpers stay plain fn, also per precedent). Receipt fns (family counts / ordinals probes) stay plain fn deliberately — they're discovery receipts, not claims.

Re-run green by execution post-conversion: 9/9 discriminators true, planted red control true (fires as exactly 1 family through the full parse→extract→group path). The corpus gate re-run (~5min wave1 parse of the live subject) is in flight; its receipt lands as a follow-up comment.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Corpus gate re-run receipt post test-fn conversion (head 66ea6e1): corpus_scope_has_no_sigma_families → true by execution against live dag/tools/dag_compile_clean_scope.dag. Full enrolled-witness set now green where executable: 9/9 discriminators, planted red control (fires as exactly 1 family), corpus gate. Remaining: the four dag-tree disposition row claims (~9.5min/query) still executing; receipt follows.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Composer review (36124) — both findings valid, fixed in 7b0b01e

Finding 1 (second naming surface for fn-decl detection) — confirmed and fixed. Subject extraction now reads parse_production_emitted_identity_optional (the ^grammar_production_identity_node_projection named edge) — the same authority cost_coverage_is_fn_decl uses — replacing the three hand-rolled shape-match fns with one. And your sharper sub-point (unit fixtures exercised the hand-rolled shape, not the live wrapper) is fixed at the root: the fixtures are rebuilt on the real parse_wrap_production_captured Conj wrapper via grammar_named_edge (identity + captured projections), so the unit path now witnesses the exact named-edge read the corpus gate performs on live parse trees.

Finding 2 (registry row, not a sibling module) — consolidation landed rather than deferred: sigma_fn_family is now a LinearityRule row (ChangeTime × DeclForest) in linearity_registry(), with DeclForest added as a fourth Representation. Why a new representation rather than TermChain: identical decls MUST fire σ (that's a 2-member family), while dup_type_pair_not_flagged_by_term_binder requires TermChain to stay quiet on identical pairs — folding σ into TermChain would have silently changed that contract. decl_forest_is_redundant is the selector; the charter now names the consolidation as landed instead of an open-ended deferral.

Receipts, all by execution post-refactor: 11/11 fn_family discriminators green (including 2 new registry-path witnesses), 8/8 existing intent_linearity discriminators green (no regression from the registry growth), planted corpus red control green. The corpus gate re-run on the authority-based extraction is in flight (~5min parse); receipt follows as a comment.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Corpus gate receipt on the authority-based extraction (head 7b0b01e): corpus_scope_has_no_sigma_families → true by execution against live dag/tools/dag_compile_clean_scope.dag. The named-edge read (parse_production_emitted_identity_optional) extracts the same subjects on live parse trees as the previous shape-match did — now proven on both the synthetic wrapper fixtures and the live corpus path. Full receipt set for review 36124's fixes is complete except the four slow dag-tree row claims (~9.5min/query), still executing.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Re the non-blocking observation on grammar_overlap_residue_diagnostics emitting identical rows: deliberate, and symmetric with the existing rejection side — parse_grammar_validation_ambiguity_diagnostic likewise carries no per-row production identity today. Both sides gain per-row locus/reason together when the diagnostic carrier grows row identity (parked on the diagnostic-carrier work, same disposition as the identical nit on #6337). The count channel is the fail-closed contract here; identity enrichment is additive.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Final receipt: all dag-tree row claims PASS — verification set complete

claim_batch (flagless, mock corpus) over dag/test/claim/dag_compile_clean_scope_witness_test.dag:

  • dag_compile_clean_scope_all_disposition_rows_hold: PASS (3403689ms ≈ 57min — all 6 ScopeDispositionRows through the live corpus-walking disposition query)
  • dag_compile_clean_scope_disposition_core_discriminates: PASS (565831ms — the wrong-expectation control returns false, so the core discriminates, not vacuously green)
  • dag_compile_clean_scope_disposition_row_count_pinned: PASS (0ms)
  • dag_compile_clean_scope_partition_authority_holds: PASS (0ms)
  • (dag_compile_clean_scope_empty_touched_skips_holds: PASS, 569906ms, receipted earlier)

Nothing on this PR remains verified-by-authoring-only: lens algebra (11/11 discriminators incl. registry path), live-corpus red→green (2 families → 0), planted red control, intent_linearity regressions (8/8), and now the full dedup behavior-preservation set — all green by execution. Timing note for the record: each disposition query costs ~9.5min in this harness; the 6-row witness batches them in one fn (~57min), which is why these receipts trailed the rest of the PR.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Opus review (36150) — both non-blocking findings addressed

Finding 1 (first-fit transitivity) — strengthened from "usually stable" to a theorem with executable proof in 70a7378cb3. The exact criterion makes σ-relatedness transitive: fillings_all_leaves(anti_unify(M, rep)) forces M's internal skeleton to equal the rep's exactly (any internal disagreement would be a non-leaf filling), so two members related to one rep share identical skeletons and differ from each other only at leaves — related by construction, never by luck. The new witnesses execute the exact scenario the finding targets: alpha_only differs from the rep at slot1, beta_only at slot2, so alpha-vs-beta differ at BOTH slots — and still relate (witness_relatedness_is_transitive_across_different_slots), and the 3-member group is stable with hole_count == 2 = the union of varying positions (witness_first_fit_group_is_stable_across_slot_union). A transitivity_note data string carries the argument on the lens-test carrier. Note this is a property of the exact wall — a similarity-threshold criterion would NOT be transitive, which is one more reason the threshold-free design is load-bearing.

Finding 2 (silent [] on Rejected parse arms) — agreed, and it's the state-space conflation pattern ("parsed empty" vs "refused" in one carrier). Within this PR it's fail-closed by the length == 1 guard (a tokenize/parse failure makes the gate red, never silently green). The typed refusal surface lands with PR2's corpus roster, which must count parse-refused subjects so shrinking grammar coverage can never masquerade as a clean corpus — same disposition already named in the PR body's honest-limits section.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

CI investigation (head 70a7378, run 28834902441): the failing ci check is confirmed by log to be the 10-minute floor-step timeout — ##[error]The action 'gunbc ci (.dag witnesses + gates)' has timed out after 10 minutes — during batch 1 (whole-tree compile-clean gate, --target dag), not a witness RED. The 21m job total = cold release build (~10m) + the 10m floor timeout; compile frontend/normalize/reconcile/analyses all completed without error, so the new .dag files compile. This is the systemic era-4/5 floor-vs-budget kill (same on main and every open PR), no diff-specific cause, no fix to push.

Merge-relevant: rust_tests PASSED (41s) — correctly short-circuited since this PR changes no .rs. Under the #6323 merge basis (approvals + rust_tests + mergeable), the gating check is green: 2 distinct approvals (claude + cursor), no REQUEST_CHANGES, mergeable=CLEAN.

— sent from sunny-wren-799

briansrls and others added 3 commits July 7, 2026 04:16
…ities)

cursor 36174, all three findings valid — and finding 2 is the exact fork
this lens detects, so fixing it properly matters:

1. fn-decl detection (F2, the sharp one): after the prior review routed
   extraction onto parse_production_emitted_identity_optional, my
   node_is_fn_decl_subtree_head became byte-identical to
   cost_coverage_is_fn_decl — a real §3 nickname fork. Hoisted ONE
   authority dag_node_is_fn_decl into v2.extdeps.languages.dag (beside
   parse_production_emitted_identity_optional, next to the existing
   dag_node_is_module_root_conj precedent); BOTH lenses now consume it.
   Deleted both local copies + fn_family's ^dag_surface_fn_decl data.
   Fork dissolved at the authority layer, not relocated.
2. template_hole_count (F3): deleted local copy, import the existing
   v2.std.fold_assembly.template_hole_count (count_where + is_hole).
3. node_is_internal_non_hole (F1): route through anti_unification.is_leaf
   instead of re-deriving is_empty(n.children); drop hand-rolled bool_not
   for ! negation. Now !is_hole && !is_leaf over authority surfaces.

Behavior preserved BY EXECUTION on both consumers: 11/11 fn_family
discriminators green (incl. member_count+hole_count via imported
template_hole_count, subject extraction via dag_node_is_fn_decl),
cost_coverage_dag_logic_has_three_fn_bodies + smoke_totality green
(the other consumer of the hoisted authority), planted red control green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Composer review (36174) — all three findings valid, fixed in 203f0f7

All three were consume-don't-fork issues, and finding 2 is the exact fork this lens detects — so fixing it properly rather than papering over it is the point.

F2 (fn-decl detection fork — the sharp one): correct, and it's my own doing: after the previous review round routed extraction onto parse_production_emitted_identity_optional, my node_is_fn_decl_subtree_head collapsed to byte-identical logic with cost_coverage_is_fn_decl — a genuine §3 nickname fork. Fixed at the authority layer, not by moving it around: hoisted one dag_node_is_fn_decl into v2.extdeps.languages.dag (beside parse_production_emitted_identity_optional, following the existing dag_node_is_module_root_conj precedent there), and both fn_family and cost_coverage now consume it. Deleted both local copies plus fn_family's ^dag_surface_fn_decl data. Importing cost_coverage_is_fn_decl directly would have been wrong — a general lens depending on an enforcement lens, and a nickname-scoped name — so the hoist is the §3-correct move.

F3 (template_hole_count): deleted the local copy, import the existing v2.std.fold_assembly.template_hole_count (count_where + is_hole).

F1 (node_is_internal_non_hole): routed through anti_unification.is_leaf instead of re-deriving is_empty(n.children), and dropped the hand-rolled bool_not for ! negation. Now !is_hole(n) && !is_leaf(n) — pure composition of authority surfaces.

Behavior preserved by execution on BOTH consumers (the real test that the hoist dissolved rather than relocated the fork): 11/11 fn_family discriminators green — including member_count/hole_count via the imported template_hole_count and subject extraction via dag_node_is_fn_decl; cost_coverage_dag_logic_has_three_fn_bodies + cost_coverage_smoke_totality green (the other consumer); planted red control green. Corpus gate re-run on the new tree is in flight; receipt follows.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Corpus gate receipt on the fork-dissolution head 203f0f7: corpus_scope_has_no_sigma_families → true by execution against live dag/tools/dag_compile_clean_scope.dag. So the authority hoist (dag_node_is_fn_decl) + imported template_hole_count + is_leaf routing preserve the full end-to-end path — synthetic wrapper fixtures, both consumers (fn_family + cost_coverage), planted red control, and the live corpus all green. Review 36174's three fixes are complete and execution-verified.

— sent from sunny-wren-799

@gunbai-bot

gunbai-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Re the minor finding (36175): valid — corpus_scope_family_ordinals / collect_family_ordinals / append_family_row (lines 75–91) are the inert discovery ladder I used to decode the family member ordinals ([10,11,13,14], [12,15]) for the PR body; they're uncalled by any test fn now that their receipt is captured. I'm deferring the drop to PR2 rather than pushing here, deliberately: this head just reached both-provider APPROVE + mergeable=CLEAN, and a cleanup-only commit would reset both approvals and interrupt the manual merge for a non-blocking nit. PR2 (name-fidelity: symbol-level location replacing ordinal location) is the natural home — that ordinal-decoding code is exactly what PR2 reworks, so it's either evolved into the symbol-location consumer or deleted there, not left to linger.

Also recording: the failing ci check on 203f0f7 is confirmed by log to be the 10-minute floor-step timeout (##[error]... has timed out after 10 minutes), not a compile RED from the hoisted dag_node_is_fn_decl — rust_tests passed, and there's no error mentioning the new authority anywhere in the log.

— sent from sunny-wren-799

@briansrls
briansrls merged commit 8e38806 into main Jul 7, 2026
2 of 3 checks passed
@briansrls
briansrls deleted the sigma-family-lens branch July 7, 2026 17:19
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