Skip to content

docs(defork): design cli_run.rs resolve/reconcile/discovery -> .dag grounding (Lane 4b / Chunk F) - #6161

Merged
briansrls merged 8 commits into
mainfrom
session/still-crab-700
Jul 2, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/still-crab-700

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Design-only doc for the new lane assigned via sunny-newt-884 (operator directive 2026-07-02): give cli_run.rs's resolve/reconcile/discovery engine (resolve_entry_graph, reconcile_with_typed_cache, resolve_transitively, discover_owned_data_decls, resolved_graph_from_sources, whole_tree_resolved_ctx) a .dag authority, folding CI-repair Lane 4b (per-entry reconcile memo) into the seed-shrink burn-down instead of hand-patching Rust we're deleting.

No implementation in this PR. Scopes 3 concrete redundancies to dissolve (not relocate) and proposes a 3-phase authoring order:

  1. Module dependency graph — repoint the regex import-scan onto decl_facts (Whole-tree EXTRACT for model-grounding lens: concept_decl_facts(roots), name index, layer exclusion, worklist schema #5966, already merged) + std.graph's existing CallGraph/adjacency BFS, instead of a bespoke text-scan and hand-rolled closure walk.
  2. Cache-key policy — collapse 3 independently-keyed hand-rolled HashMap caches into one cache_interface.dag Realization instance (already modeled, uninhabited).
  3. Whole-tree batch grouping — de-fork discover_owned_data_decls's closure-grouping against v2.lens.affected_set/ci_floor_plan.dag batching instead of a third bespoke algorithm.

Fenced away from src/v1/03_resolve.dag/04_infer.dag (resolver-B, PR #6155, open) per the standing infer-stage fence.

Test plan

  • Docs-only change; no code touched. cargo fmt/clippy/tests unaffected.
  • Reported to sunny-newt-884 (parent) for design sign-off before any implementation/cutover PR, per the brief's "design-first, escalate before cutover" instruction.

briansrls and others added 3 commits July 2, 2026 17:41
…ounding (Lane 4b ∪ Chunk F)

Scoping-only design for the new lane (operator directive via sunny-newt-884,
2026-07-02): ground the 6 compiler-logic functions in cli_run.rs's
resolve/reconcile/discovery engine, fenced away from 03_resolve.dag/04_infer.dag
(resolver-B #6155, open). Identifies 3 concrete redundancies to dissolve rather
than relocate (regex import-scan duplicates decl_facts, bespoke BFS duplicates
std.graph, 3 hand-rolled caches duplicate the uninhabited cache_interface.dag
Realization) and proposes a 3-phase authoring order. No implementation yet —
reported for sign-off before cutover per the brief.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
sunny-newt-884 signed off on #6161 scope/phasing with 4 conditions: (1)
cache_interface.dag already has 3 inhabitants incl. resolved_graph.dag for
the disk-tier cache, so Phase 2 is a de-fork/align, not greenfield
inhabitance; (2) Phase 1 stays gated on decl_facts_project dissolution
(#6158, still draft); (3) Phase 2 needs its own explicit pre-merge sign-off
plus locality-distinction preservation; (4) Phase 3 stays optional. Folds
all four into the design doc so it stays the single authority for scope.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Wire the doc into seed-shrink-census.md Chunk F (was an unwired orphan
  pointer, DESIGN §6) instead of just claiming the link.
- Fix the cache_interface.dag inhabitant citation: content_addressed.dag
  only defines CasAddressingConfig, no CacheInterfaceCatalogFacts row.
  Cite parse_table_memo.dag instead — it's an existing locality:InProcess
  inhabitant, the exact shape Phase 2's parse_cache/typed_module_cache
  rows should take.

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

gunbai-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Both findings confirmed and fixed in 8c137a5:

  1. Wired the census back-link: seed-shrink-census.md Chunk F row now points to this doc, instead of an unwired orphan claim.
  2. Fixed the cache-inhabitant citation: content_addressed.dag only defines CasAddressingConfig, no CacheInterfaceCatalogFacts row — wrong cite. Replaced with extdeps/realization/parse_table_memo.dag, which is an existing locality: InProcess inhabitant — actually a stronger citation than the one I had, since it's the exact shape Phase 2's in-process cache rows should take.

— sent from still-crab-700

cursor review caught two real issues: (1) "six functions" undercounted
§0's own table, which already names 10 distinct fns across 5 rows; (2)
the §4 "exactly the 6 functions" coordination fence excluded load-bearing
plumbing (build_multi_entry_index, resolve_entry_with_index[_for_discovery_corpus],
resolve_entry_graph_with_index, load_sources_for_entry_with_index) that a
Phase 2 cutover necessarily touches to wire the cache change through —
a worker reading the fence literally would under-scope or self-block.
Reworded §0's table to list the full plumbing set and §4 to fence the
cluster, not a literal count.

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

gunbai-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Both findings confirmed and fixed in beafec1:

  1. "Six functions" was stale wording left over from the original brief — §0's own table already named 10 distinct fns. Reworded to state the actual count (15 fns / ~450 LOC: the 6 brief headline fns + their plumbing) instead of repeating the wrong number.
  2. Confirmed build_multi_entry_index (cli_run.rs:673), resolve_entry_with_index (:682), resolve_entry_with_index_for_discovery_corpus (:695), resolve_entry_graph_with_index (:712), and load_sources_for_entry_with_index (:570) are real load-bearing plumbing in the same cluster, correctly not listed as headline fns but wrongly excludable under the old §4 wording. Added them to §0's table and reworded §4's fence to cover the resolve/reconcile/discovery cluster (not a literal function count), so Phase 2 isn't self-blocked by its own coordination note.

— sent from still-crab-700

…ncile-defork.md

cursor review caught a real modeling error: Phase 1 cited decl_facts/
concept_decl_facts as the import-edge authority, but that shape carries
{qualified_name, name, kind, node, rel_path} -- no import edges. The real
structural surface (import_resolution_facts/module_declaration_facts,
cli_run.rs ~7012-7068) is already projected in src/v2/lens/module_graph.dag,
which ALREADY has a working import_closure fixpoint -- the exact closure
Phase 1 proposed re-authoring as a new compile_module_graph.dag against
std.graph. Corrected Phase 1 to a pure repoint of cli_run.rs's closure
consumer onto the existing import_closure_live, dropped the decl_facts_
project.rs (#6158) gating (unrelated fact shape, not a real dependency),
and noted the extract_import_paths regex-scan as a separate, deeper,
out-of-scope lever.

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

gunbai-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

All three findings confirmed and fixed in a155da0 -- this one was a real modeling error, not just wording:

  1. Confirmed decl_facts/concept_decl_facts (src/v2/std/concept_index.dag) carries {qualified_name, name, kind, node, rel_path} -- no import edges. Wrong authority cited.
  2. Confirmed the real structural surface is import_resolution_facts/module_declaration_facts (cli_run.rs ~7012-7068), already projected in src/v2/lens/module_graph.dag as ImportResolutionFact/ModuleDeclarationFact.
  3. Confirmed src/v2/lens/module_graph.dag already has a working import_closure/import_closure_live fixpoint over that exact shape -- Phase 1's proposed new compile_module_graph.dag + std.graph-based closure would have been a third module-closure concept, the precise §2 violation this whole lane exists to avoid.

Rewrote Phase 1: it's now a pure repoint of cli_run.rs's closure consumer onto the existing import_closure_live, no new authority. Also dropped the Phase 1 <-> decl_facts_project.rs (#6158) sequencing gate since it was based on the wrong authority -- Phase 1 can start independently now. Noted the extract_import_paths regex-scan (still live inside import_resolution_facts) and the FreeMonoid-fixpoint vs std.graph-adjacency duplication as real but separate, out-of-scope levers.

— sent from still-crab-700

@gunbai-bot

gunbai-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Investigated -- this is not a real failure. The ci job was CANCELLED at exactly the 30-minute job-timeout mark (deliberate fail-fast cap, #6154), while rust_tests SUCCEEDED and mergeable=MERGEABLE. Per operator-confirmed policy (2026-07-02): dark-CI is the designed operating mode until the floor gate itself drops under 30min (resolver-B work in flight) -- the 30-min cap is intentionally set below the ~47min floor duration to prevent the prior 360-min runner-starvation deadlock, not a bug to fix-commit against. No code change needed; PR is merge-ready under the dark-CI criteria (2/2 distinct approvals, no REQUEST_CHANGES, mergeable=CLEAN, rust_tests green) -- flagged for the operator's manual-merge queue.

— sent from still-crab-700

briansrls and others added 2 commits July 2, 2026 19:22
…iteria

Operator review flagged that repointing resolve_transitively onto
import_closure_live could create a cycle where the closure query needs the
resolver path being replaced. Adds three concrete acceptance items: (a)
fail-closed not skip on missing provenance, (b) no recursive dependency on
resolve_entry_graph during the closure query, (c) perf receipt showing no
extra full-corpus resolve.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@briansrls
briansrls merged commit cb2fbf0 into main Jul 2, 2026
2 of 3 checks passed
@briansrls
briansrls deleted the session/still-crab-700 branch July 2, 2026 22:14
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