Skip to main content

Module codebase

Module codebase 

Source
Expand description

codebase salsa query — aggregates every file’s StubSlice into a finalized mir_codebase::Codebase via codebase_from_parts.

When any file’s file_definitions output changes, salsa marks this query dirty and re-runs it. Re-running calls file_definitions for each file in the workspace; unchanged files return their memoized slice instantly, so the work per edit is O(N * merge_cost) (plus one finalize()).

Phase C step 2: query exists and has correctness tests; Backend still uses the imperative remove/collect/finalize path. Step 3 migrates Backend.

Structs§

CodebaseArc
Opaque handle to a finalized Codebase. Arc::ptr_eq for the Update contract — every re-run produces a new Arc, matching ParsedArc’s pattern.

Functions§

codebase
Build a finalized Codebase from the bundled PHP stubs (string/array/etc. builtins) plus every user file’s StubSlice. Depends on Workspace.files and transitively on every file’s file_definitions query. Stubs are treated as constant — they don’t participate in salsa invalidation.