irx.analysis.reachability
irx.analysis.reachability
Source: packages/irx/src/irx/analysis/reachability.py
title: Conservative declaration reachability for opt-in library modules.
summary: >-
Analyze every declaration for validity first. Retain whole referenced classes
(including virtual methods and destructors), rather than pruning methods or
guessing calls from syntax. Other modules retain their existing exported
code.Functions
plan_declarations(session: CompilationSession) -> frozenset[int] | None
title: Keep eager module exports and their lazy-library dependencies.
parameters:
session:
type: CompilationSession
returns:
type: frozenset[int] | NoneClasses
DeclarationReachability
title: Follow resolved AST and semantic edges without name rediscovery.
attributes:
seen:
type: set[int]
pending:
type: list[object]
nominal:
type: dict[str, astx.AST]Methods
collect(self, roots: list[astx.AST]) -> frozenset[int]
title: Compute a cycle-safe closure of resolved declaration references.
parameters:
roots:
type: list[astx.AST]
returns:
type: frozenset[int]visit(self, value: object) -> None
title: Traverse semantic records and reject unknown dependency shapes.
parameters:
value:
type: objectvisit(self, value: astx.AST) -> None
title: Walk children and sidecars, never parent links or import roots.
parameters:
value:
type: astx.ASTvisit(self, value: list[object] | tuple[object, ...] | set[object] | frozenset[object]) -> None
title: Traverse dependency collections.
parameters:
value:
type: >-
list[object] | tuple[object, Ellipsis] | set[object] |
frozenset[object]visit(self, value: dict[object, object]) -> None
title: Traverse sidecar maps and expression-bearing literal keys.
parameters:
value:
type: dict[object, object]