refactor(R0): delete ResolvedProgram pre-pass; add resolveBare/resolveQualified

Removes the S2.x pre-pass and its 10 NodeRefTable maps — 1934 net lines
deleted. The Resolver gains two lazy functions: resolveBare(name, from,
domain) and resolveQualified(target, name), each returning ResolvedAuthors
(verdict + author set). verdictOver and authoredAsDomainAnywhere move from
ResolvePass to Resolver as private methods. All domain-predicate helpers
(eligibleKind, structDeclOf, fnDeclOf, etc.) are promoted to pub.

Test file trimmed from 1352 to 396 lines; old pre-pass population tests
replaced by focused resolveBare / resolveQualified verdict tests.

540/540 regression tests pass. Zero behavior change.
This commit is contained in:
agra
2026-06-09 21:55:53 +03:00
parent ccae961dc4
commit 5ed54a08ee
4 changed files with 350 additions and 2284 deletions

View File

@@ -5,7 +5,6 @@ const types = @import("types.zig");
const inst = @import("inst.zig");
const errors = @import("../errors.zig");
const type_resolver = @import("type_resolver.zig");
const resolver = @import("resolver.zig");
const Node = ast.Node;
const TypeId = types.TypeId;
@@ -628,12 +627,6 @@ pub const ProgramIndex = struct {
/// in parallel with the import facts. Borrowed view; nothing in lowering
/// consumes it for selection yet (additive — S4 makes it the fact-store key).
decl_table: ?*imports.DeclTable = null,
/// The owning resolution pass's output (Fork C S2.1a), built by
/// `resolver.resolve` and owned by `Compilation`. Borrowed view; ADDITIVE /
/// PARALLEL / UNCONSUMED — nothing in lowering reads it yet (lowering still
/// uses the old selectors), so generated output is byte-identical.
resolved_program: ?*resolver.ResolvedProgram = null,
// ── Declaration maps ──
/// Function name → AST decl.
fn_ast_map: std.StringHashMap(*const ast.FnDecl),