API
The reactive-research package provides the reference executable
implementation of Reactive Research.
API documentation below is generated from the package source and docstrings.
For command-line usage, use:
uvx reactive-research --help
uvx reactive-research COMMAND --help
Models
reactive_research.models
Core data models for Reactive Research.
Diagnostic
dataclass
One extraction or validation finding.
Source code in src/reactive_research/models.py
64 65 66 67 68 69 70 71 | |
DiagnosticSeverity
Bases: StrEnum
Severity of one Reactive Research diagnostic.
Source code in src/reactive_research/models.py
19 20 21 22 23 | |
ExtractionResult
dataclass
Complete result of extracting one repository.
Source code in src/reactive_research/models.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
defines
property
defines: tuple[ResearchDeclaration, ...]
Return all DEFINES declarations.
implements
property
implements: tuple[ResearchDeclaration, ...]
Return all IMPLEMENTS declarations.
valid
property
valid: bool
Return whether extraction produced no error diagnostics.
RepositoryContext
dataclass
Identity and revision of the repository being examined.
Source code in src/reactive_research/models.py
54 55 56 57 58 59 60 61 | |
ResearchDeclaration
dataclass
One typed relationship to an addressable research object.
Source code in src/reactive_research/models.py
45 46 47 48 49 50 51 | |
ResearchIdentifier
dataclass
Stable identifier for one addressable research object.
Source code in src/reactive_research/models.py
26 27 28 29 30 31 32 33 34 | |
__str__
__str__() -> str
Return the canonical identifier string.
Source code in src/reactive_research/models.py
32 33 34 | |
ResearchRelation
Bases: StrEnum
Supported relationships between repositories and research objects.
Source code in src/reactive_research/models.py
12 13 14 15 16 | |
SourceLocation
dataclass
Location of one declaration in repository source.
Source code in src/reactive_research/models.py
37 38 39 40 41 42 | |
Identifiers
reactive_research.identifiers
Research-object identifier parsing and validation.
Examples: SE-210.Definition.2.4 SE-210.Definition.4.3 SE-210.Theorem.5.2 SE-210.Proposition.4.14 SE-210.Example.4.11 SE-210.Remark.4.16c
InvalidResearchIdentifierError
Bases: ValueError
Raised when a research-object identifier is malformed.
Source code in src/reactive_research/identifiers.py
26 27 | |
parse_research_identifier
parse_research_identifier(value: str) -> ResearchIdentifier
Parse and validate a research-object identifier.
Source code in src/reactive_research/identifiers.py
30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Repository Discovery
reactive_research.repository
Repository discovery for Reactive Research.
discover_repository_context
discover_repository_context(
path: Path,
) -> RepositoryContext
Discover repository identity and revision.
Source code in src/reactive_research/repository.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
Extraction
reactive_research.extract
Extract Reactive Research declarations.
Reactive Research annotations may be provided in any source file with an eligible suffix.
extract_repository
extract_repository(path: Path) -> ExtractionResult
Extract Reactive Research declarations from one repository.
Source code in src/reactive_research/extract.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
extract_research
extract_research(
*, path: Path, check: bool = False
) -> dict[str, Any]
Extract declarations and return the normalized CLI representation.
Source code in src/reactive_research/extract.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
Validation
reactive_research.validate
Validate repository-local Reactive Research declarations.
validate_extraction
validate_extraction(
extraction: ExtractionResult, *, strict: bool = False
) -> tuple[Diagnostic, ...]
Validate one previously extracted repository result.
Source code in src/reactive_research/validate.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
validate_research
validate_research(
*, path: Path, strict: bool = False
) -> dict[str, Any]
Validate repository-local Reactive Research declarations.
Source code in src/reactive_research/validate.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
Declaration Export
reactive_research.declarations
Normalized declaration documents for Reactive Research.
declaration_document
declaration_document(
result: ExtractionResult,
*,
extractor_version: str | None = None,
) -> dict[str, Any]
Return a normalized declaration document.
Source code in src/reactive_research/declarations.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
declaration_record
declaration_record(
declaration: ResearchDeclaration,
*,
organization: str | None,
repository: str,
revision: str | None,
extractor_version: str,
) -> dict[str, object]
Return one normalized research declaration.
Source code in src/reactive_research/declarations.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
diagnostic_record
diagnostic_record(
diagnostic: Diagnostic,
) -> dict[str, object]
Return one normalized diagnostic.
Source code in src/reactive_research/declarations.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
export_declarations
export_declarations(path: Path) -> dict[str, Any]
Extract and export normalized declarations for one repository.
Source code in src/reactive_research/declarations.py
21 22 23 24 25 26 27 28 | |
is_declaration_document
is_declaration_document(value: object) -> bool
Return whether a value has the normalized declaration-document shape.
Source code in src/reactive_research/declarations.py
111 112 113 114 115 116 117 118 119 120 | |
Resolution
reactive_research.resolve
Resolve Reactive Research identifiers.
RegistryLoadError
Bases: ValueError
Raised when declaration registry input cannot be loaded.
Source code in src/reactive_research/resolve.py
24 25 | |
resolve_research
resolve_research(
*,
path: Path,
identifier: str | None,
resolve_all: bool,
registry: str | None,
snapshot: str | None,
) -> dict[str, Any]
Resolve research-object references.
Source code in src/reactive_research/resolve.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
Graph
reactive_research.graph
Build and query Reactive Research graphs.
build_research_graph
build_research_graph(
*,
path: Path,
target: str | None,
view: GraphView,
registry: str | None,
snapshot: str | None,
) -> dict[str, Any]
Build or inspect a typed Reactive Research graph.
Source code in src/reactive_research/graph.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
Impact Analysis
reactive_research.impact
Analyze downstream Reactive Research impact.
analyze_impact
analyze_impact(
*,
path: Path,
identifier: str,
depth: ImpactDepth,
registry: str | None,
snapshot: str | None,
from_snapshot: str | None,
to_snapshot: str | None,
) -> dict[str, Any]
Identify downstream objects potentially affected by a change.
Source code in src/reactive_research/impact.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
Snapshots
reactive_research.snapshot
Create and inspect Reactive Research graph snapshots.
snapshot_research_graph
snapshot_research_graph(
*,
path: Path,
registry: str | None,
base_snapshot: str | None,
show: str | None,
) -> dict[str, Any]
Create or inspect a reproducible graph snapshot.
Source code in src/reactive_research/snapshot.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
Inspection
reactive_research.inspect
Inspect Reactive Research objects and repositories.
inspect_research_object
inspect_research_object(
*,
path: Path,
target: str,
registry: str | None,
snapshot: str | None,
) -> dict[str, Any]
Explain one research object or repository.
Source code in src/reactive_research/inspect.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |