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
79 80 81 82 83 84 85 86 | |
DiagnosticSeverity
Bases: StrEnum
Severity of one Reactive Research diagnostic.
Source code in src/reactive_research/models.py
34 35 36 37 38 | |
ExtractionResult
dataclass
Complete result of extracting one repository.
Source code in src/reactive_research/models.py
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 | |
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
69 70 71 72 73 74 75 76 | |
ResearchDeclaration
dataclass
One typed relationship to an addressable research object.
Source code in src/reactive_research/models.py
60 61 62 63 64 65 66 | |
ResearchIdentifier
dataclass
Stable identifier for one addressable research object.
Source code in src/reactive_research/models.py
41 42 43 44 45 46 47 48 49 | |
__str__
__str__() -> str
Return the canonical identifier string.
Source code in src/reactive_research/models.py
47 48 49 | |
ResearchRelation
Bases: StrEnum
Supported relationships between repositories and research objects.
Source code in src/reactive_research/models.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
SourceLocation
dataclass
Location of one declaration in repository source.
Source code in src/reactive_research/models.py
52 53 54 55 56 57 | |
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 | |
extract_source_text
extract_source_text(
text: str, *, path: Path
) -> tuple[list[ResearchDeclaration], list[Diagnostic]]
Apply existing annotation normalization to observed or historical text.
Source code in src/reactive_research/extract.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
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
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
graph_projection
graph_projection(
graph: dict[str, Any],
*,
view: GraphView = "objects",
target: str | None = None,
) -> dict[str, Any]
Derive an object graph or repository projection without new declarations.
Source code in src/reactive_research/graph.py
16 17 18 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 54 55 56 57 58 59 60 61 62 63 64 65 | |
mermaid_graph
mermaid_graph(
graph: dict[str, Any], *, category: str = "propagation"
) -> str
Render deterministic Mermaid directly from the shared JSON graph boundary.
Source code in src/reactive_research/graph.py
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
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,
relations: set[str] | None = None,
) -> dict[str, Any]
Identify downstream objects potentially affected by a change.
Source code in src/reactive_research/impact.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
impact_obligations
impact_obligations(
graph: dict[str, Any],
identifier: str,
*,
previous: dict[str, Any] | None = None,
depth: ImpactDepth = "transitive",
relations: set[str] | None = None,
) -> dict[str, Any]
Calculate bounded typed obligations without proposing or applying edits.
Source code in src/reactive_research/impact.py
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
select_node
select_node(
graph: dict[str, Any], identifier: str
) -> dict[str, Any]
Resolve a node ID or an unambiguous observed label.
Source code in src/reactive_research/impact.py
39 40 41 42 43 44 45 46 47 48 | |
Snapshots
reactive_research.snapshot
Deterministic, content-addressed observations of existing research surfaces.
load_snapshot
load_snapshot(
reference: str, registry: str | None = None
) -> dict[str, Any]
Load and integrity-check a snapshot file or registry content-addressed ID.
Source code in src/reactive_research/snapshot.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
observe_workspace
observe_workspace(
path: Path,
*,
revisions: dict[str, str] | None = None,
registry: str | None = None,
) -> dict[str, Any]
Observe discovered projects, optionally substituting named committed trees.
Source code in src/reactive_research/snapshot.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 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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
snapshot_research_graph
snapshot_research_graph(
*,
path: Path,
registry: str | None,
base_snapshot: str | None,
show: str | None,
revisions: dict[str, str] | None = None,
) -> dict[str, Any]
Create or inspect a reproducible observation; output storage is explicit.
Source code in src/reactive_research/snapshot.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
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 | |