-
Notifications
You must be signed in to change notification settings - Fork 1
core: griffe-based bounded context introspection #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """Shared infrastructure components. | ||
|
|
||
| Infrastructure implementations that can be used across bounded contexts. | ||
| """ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """Repository implementations for Shared. | ||
|
|
||
| Contains memory, file, and introspection repository implementations. | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """File repository implementations. | ||
|
|
||
| Provides base classes for file-backed repository implementations. | ||
| """ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| """File-based solution configuration repository. | ||
|
|
||
| Reads [tool.julee] configuration from pyproject.toml. | ||
| """ | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import tomllib | ||
|
|
||
| from julee.core.entities.policy import SolutionPolicyConfig | ||
|
|
||
|
|
||
| class FileSolutionConfigRepository: | ||
| """Reads solution configuration from pyproject.toml.""" | ||
|
|
||
| def get_policy_config_sync(self, solution_root: Path) -> SolutionPolicyConfig: | ||
| """Read policy configuration from [tool.julee] in pyproject.toml. | ||
|
|
||
| Synchronous version for CLI and test fixture usage. | ||
|
|
||
| Args: | ||
| solution_root: Path to the solution root directory | ||
|
|
||
| Returns: | ||
| SolutionPolicyConfig with parsed settings, or defaults if not found | ||
| """ | ||
| pyproject_path = solution_root / "pyproject.toml" | ||
|
|
||
| if not pyproject_path.exists(): | ||
| return SolutionPolicyConfig() | ||
|
|
||
| try: | ||
| with open(pyproject_path, "rb") as f: | ||
| data = tomllib.load(f) | ||
| except tomllib.TOMLDecodeError: | ||
| return SolutionPolicyConfig() | ||
|
|
||
| tool_julee = data.get("tool", {}).get("julee", None) | ||
|
|
||
| if tool_julee is None: | ||
| return SolutionPolicyConfig() | ||
|
|
||
| return SolutionPolicyConfig( | ||
| is_julee_solution=True, | ||
| policies=tuple(tool_julee.get("policies", [])), | ||
| skip_policies=tuple(tool_julee.get("skip_policies", [])), | ||
| search_root=tool_julee.get("search_root"), | ||
| docs_root=tool_julee.get("docs_root"), | ||
| ) | ||
|
|
||
| async def get_policy_config(self, solution_root: Path) -> SolutionPolicyConfig: | ||
| """Read policy configuration from [tool.julee] in pyproject.toml. | ||
|
|
||
| Async version for use case compatibility. | ||
|
|
||
| Args: | ||
| solution_root: Path to the solution root directory | ||
|
|
||
| Returns: | ||
| SolutionPolicyConfig with parsed settings, or defaults if not found | ||
| """ | ||
| return self.get_policy_config_sync(solution_root) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Introspection repositories. | ||
|
|
||
| Repository implementations that discover entities by inspecting the filesystem | ||
| and code structure, rather than persisting entities. | ||
|
Comment on lines
+3
to
+4
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this file be in .../repositories/**file/**introspection/init.py like the solution_config.py above? As in, the directory specifies that it's afile implementation, whereas currently it's sitting on its own? It's been placed here because that's where it is in 56 but it looks (to me) like the whole of |
||
| """ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm - looks like introspection is explicitly not in
file, even though it's a Filesystem repository?