Skip to content

QualifiedName de-fork: v2 authority = FreeMonoid<Symbol> + v1 seed bridge made generic - #6195

Merged
briansrls merged 9 commits into
mainfrom
session/smart-crab-896
Jul 3, 2026
Merged

briansrls merged 9 commits into
mainfrom
session/smart-crab-896

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

QualifiedName de-fork (v2 authority + v1 seed realization)

Dissolves the hand-rolled QualifiedName coproduct into the single FreeMonoid<Symbol> authority. Re-scoped from the original "v2-only" brief — investigation proved that premise false: the v1 Rust seed hardcoded QnEmpty/QnCons in host builtins (construct + consume + emit), so this is necessarily a v2-authority + v1-seed-realization de-fork.

v2 .dag

  • type QualifiedName = FreeMonoid<Symbol>; deleted the hand-rolled trio (qualified_name_eq/for_all/singleton) → FreeMonoid ops + structural ==.
  • Migrated ~22 consumers (QnEmpty/QnCons→Empty/Cons, eq→==, for_all→algebra for_all).
  • Two recursive-tail raw-match sites (qn_fold_step, layer_prefix) rewritten to the list_head idiom — see resolver-gap note below.

v1 seed — no longer knows QualifiedName/QnEmpty/QnCons as a domain

The three QualifiedName-specific host builtins are now generic FreeMonoid<Symbol> marshaling (type_name FreeMonoid, variants Empty/Cons):

  • qualified_name_value_from_dotted_string → free_monoid_symbol_value_from_dotted_string
  • qualified_name_value_to_module_path → free_monoid_symbol_value_to_dotted_string
  • emit_qualified_name_dag → free_monoid_symbol_emit_dag
    All callers (coproduct_reflection, external_authority_project ×7, v1_interpreter) updated. Bounded: no resolver changes, no broad cli_run cleanup. The .dag-facing std fn name is kept (it returns a generic FreeMonoid<Symbol>).

Verified by execution (rebuilt seed)

  • Structural == gate green + discriminating (freemonoid_eq_witness_test.dag): equal→true, differing/prefix/empty→false, no native/modeled straddle.
  • Dotted-string round-trip green through the generic seed bridge; layer_prefix green.
  • External-authority corpus witnesses green (exercises the 7 seed-consumer sites).
  • Rust manifest emit round-trip test green (3/3).
  • Full-corpus compile-clean gate (primary-precedence): pending (running locally).

Resolver-gap note (docs corrected)

#5552 fixed simple generic-alias instantiation (construct/match/use-site). Raw variant-matching a value bound from a recursive Cons.tail field still hits "variant not found in type FreeMonoid" (04_infer gap) — avoided here via the list_head/algebra idiom that all FreeMonoid consumers already use. fold-ergonomics.md, dag-v2-defork-audit.md (+ .dag twin) corrected.

Net concepts drop

Old QualifiedName coproduct + helper trio removed; no new parallel authority (the seed helpers are generic FreeMonoid marshaling, not a QualifiedName bridge).

🤖 Generated with Claude Code

briansrls and others added 8 commits July 3, 2026 02:55
…oupling

- Dissolved type QualifiedName = FreeMonoid<Symbol>; deleted qualified_name_eq/for_all/singleton.
- Migrated ~22 consumers (imports, QnEmpty/QnCons→Empty/Cons, eq→==, for_all→for_all).
- == gate PROVEN green (freemonoid_eq_witness_test): structural == matches old qualified_name_eq, no straddle.
- Rewrote 2 FreeMonoid raw-tail-match sites (qn_fold_step, layer_prefix) to list_head idiom
  (recursive tail raw-match still hits the #5552 'variant not found in type FreeMonoid' resolver gap).

BLOCKER: brief's 'QualifiedName is v2-ONLY' premise is FALSE. v1 Rust seed hardcodes QnEmpty/QnCons
tags in host builtins (cli_run.rs qualified_name_value_{from_dotted_string,to_module_path},
v1_interpreter.rs, external_authority_project.rs x7, emit_qualified_name_dag). Runtime produces
QnCons Values → .dag now expects Empty/Cons → non-exhaustive crash. Completing needs lockstep seed
edits (cli_run.rs is #6046-gated). Reported to operator; not touching seed unilaterally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… over FreeMonoid<Symbol>)

Per operator re-scope (v2-only premise was false; this is a v2-authority + v1-seed-realization de-fork):

Seed (src/v1/stage0/src/): the three QualifiedName-specific host builtins are now GENERIC
FreeMonoid<Symbol> marshaling — seed no longer knows QualifiedName/QnEmpty/QnCons as a domain:
- qualified_name_value_from_dotted_string -> free_monoid_symbol_value_from_dotted_string
  (type_name FreeMonoid, variants Empty/Cons)
- qualified_name_value_to_module_path     -> free_monoid_symbol_value_to_dotted_string (matches Empty/Cons)
- emit_qualified_name_dag                 -> free_monoid_symbol_emit_dag (emits Empty/Cons + algebra import)
  all callers (coproduct_reflection, external_authority_project x7, v1_interpreter) updated.
  Bounded: no resolver changes, no broad cli_run cleanup. .dag-facing std fn name kept.

Verified by execution (rebuilt seed): == gate green; dotted-string round-trip green through the
generic bridge; layer_prefix green; external-authority corpus witnesses green; Rust manifest
host emit round-trip test green (3/3).

Docs corrected (§8): fold-ergonomics.md, dag-v2-defork-audit.md + .dag twin now state #5552 fixed
SIMPLE generic-alias instantiation; recursive-tail raw-match remains a resolver gap avoided via
the list_head/algebra idiom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title roadmap hosting work QualifiedName de-fork: v2 authority = FreeMonoid<Symbol> + v1 seed bridge made generic Jul 3, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 3, 2026 05:16
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Local full-corpus compile-clean gate: PASS.

Since the ci job hits the by-design dark-CI 30-min cap (below the ~47min floor) and can't surface a compile-clean verdict, I ran the authoritative gate locally to completion:

gunbc run --entry dag/tools/floor_effect_gate_witness.dag \
  --function dag_compile_clean_gate_passes --claim-run
→ running dag_compile_clean_gate_passes()... true   (exit 0)

That is the exact floor gate (compile --source-root dag --source-root src/v2 --dependency-pool-index primary-precedence --target dag) — 0 compile errors corpus-wide with this migration. rust_tests is already green in CI, covering the v1 seed de-fork (host-builtin rename + manifest emit round-trip).

So the only red signal on this PR is the structural dark-CI timeout, not a real failure.

— sent from smart-crab-896

@briansrls
briansrls merged commit a5dffa2 into main Jul 3, 2026
2 of 3 checks passed
@briansrls
briansrls deleted the session/smart-crab-896 branch July 3, 2026 17:12
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