atlas.core.registry¶
atlas.core.registry
¶
Global module registry loading and querying.
load_registry
¶
Load registry.json from registry_path.
Returns an empty dict if the file does not exist, cannot be read, or contains invalid JSON.
Source code in src/atlas/core/registry.py
find_module
¶
check_conflicts
¶
Return names of installed modules that conflict with module_name.
Checks both directions:
1. module_name's own conflicts_with list (new module declares conflict)
2. Each installed module's conflicts_with list (existing module declares conflict)
Returns deduplicated conflicting names. An empty list means no conflicts.
Source code in src/atlas/core/registry.py
get_dependencies
¶
Return the requires list for module_name.
Returns an empty list if the module is not found or has no dependencies.
Source code in src/atlas/core/registry.py
get_dependents
¶
Return names of installed modules that require module_name.
Used on remove to block removal when other modules depend on the
target. Returns an empty list when it is safe to remove.
Source code in src/atlas/core/registry.py
find_init_conflicts
¶
Return conflicting pairs among detected modules.
During init, the detection engine may find multiple tools in the
project that cannot coexist (e.g. both ruff and flake8 detected).
This function returns all such pairs so the init proposal can flag
them for the agent / user to resolve.
Each returned tuple (a, b) means a and b conflict, where
a appears before b in detected. Each pair is reported once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry
|
dict
|
The loaded registry dict. |
required |
detected
|
list[str]
|
Module names found in the project by the detection engine. |
required |
Returns:
| Type | Description |
|---|---|
list[tuple[str, str]]
|
List of |
Source code in src/atlas/core/registry.py
get_recommendations
¶
Return recommended modules based on detection results.
detection is a ProjectDetection dataclass (or any object with
the same attributes). Each returned dict has the shape::
{"name": str, "category": str, "reason": str}
Results are ordered by category priority (vcs → language → pkg_manager → linter → formatter → testing → …). An empty list is returned when nothing matches or on bad input.
Source code in src/atlas/core/registry.py
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 | |
load_module_bundle
¶
Load the module.json for module_name from the warehouse.
Resolves the bundle directory via the registry entry's path
field. Returns an empty dict if the module is not registered, the
path is missing, the file does not exist, or JSON parsing fails.
Source code in src/atlas/core/registry.py
load_module_rules_md
¶
Load the rules.md content for module_name from the warehouse.
Returns the markdown string, or an empty string if the module is not registered, the path is missing, the file does not exist, or the file cannot be read.