Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ dependencies = [
"six>=1.16.0",
"jsonschema>=4.0.0",
"jsonpointer>=3.0.0",
# Code introspection (doctrine tests, CLI)
"griffe>=1.0.0,<2",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -202,6 +204,12 @@ module = [
]
ignore_missing_imports = true

[tool.julee]
# julee is itself a julee solution
search_root = "src/julee"
docs_root = "docs"
skip_policies = ["temporal-pipelines"] # julee core doesn't use Temporal

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
Expand Down
24 changes: 14 additions & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ babel==2.18.0
# via sphinx
bandit==1.9.4
# via julee (pyproject.toml)
black==26.1.0
black==26.3.1
# via julee (pyproject.toml)
build==1.4.0
# via pip-tools
Expand All @@ -45,14 +45,16 @@ cffi==2.0.0
# via argon2-cffi-bindings
cfgv==3.5.0
# via pre-commit
charset-normalizer==3.4.4
charset-normalizer==3.4.6
# via requests
click==8.3.1
# via
# black
# julee (pyproject.toml)
# pip-tools
# uvicorn
colorama==0.4.6
# via griffe
coverage[toml]==7.13.4
# via pytest-cov
distlib==0.4.0
Expand All @@ -67,18 +69,20 @@ execnet==2.1.2
# via pytest-xdist
factory-boy==3.3.3
# via julee (pyproject.toml)
faker==40.5.1
faker==40.11.0
# via factory-boy
fastapi==0.135.1
# via
# fastapi-pagination
# julee (pyproject.toml)
fastapi-pagination==0.15.10
# via julee (pyproject.toml)
filelock==3.25.0
filelock==3.25.2
# via
# python-discovery
# virtualenv
griffe==1.15.0
# via julee (pyproject.toml)
h11==0.16.0
# via
# httpcore
Expand All @@ -89,7 +93,7 @@ httpx==0.28.1
# via anthropic
hypothesis==6.151.9
# via julee (pyproject.toml)
identify==2.6.17
identify==2.6.18
# via pre-commit
idna==3.11
# via
Expand Down Expand Up @@ -147,7 +151,7 @@ pathspec==1.0.4
# mypy
pip-tools==7.5.3
# via julee (pyproject.toml)
platformdirs==4.9.2
platformdirs==4.9.4
# via
# black
# python-discovery
Expand Down Expand Up @@ -194,7 +198,7 @@ pytest-cov==7.0.0
# via julee (pyproject.toml)
pytest-xdist==3.8.0
# via julee (pyproject.toml)
python-discovery==1.1.0
python-discovery==1.1.3
# via virtualenv
python-magic==0.4.27
# via julee (pyproject.toml)
Expand Down Expand Up @@ -222,7 +226,7 @@ rpds-py==0.30.0
# via
# jsonschema
# referencing
ruff==0.15.4
ruff==0.15.6
# via julee (pyproject.toml)
six==1.17.0
# via julee (pyproject.toml)
Expand Down Expand Up @@ -256,7 +260,7 @@ types-jsonschema==4.26.0.20260202
# via julee (pyproject.toml)
types-protobuf==6.32.1.20260221
# via temporalio
types-python-dateutil==2.9.0.20260302
types-python-dateutil==2.9.0.20260305
# via julee (pyproject.toml)
types-pyyaml==6.0.12.20250915
# via julee (pyproject.toml)
Expand Down Expand Up @@ -286,7 +290,7 @@ urllib3==2.6.3
# requests
uvicorn==0.41.0
# via julee (pyproject.toml)
virtualenv==21.1.0
virtualenv==21.2.0
# via pre-commit
wheel==0.46.3
# via pip-tools
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ click==8.3.1
# via
# julee (pyproject.toml)
# uvicorn
colorama==0.4.6
# via griffe
distro==1.9.0
# via anthropic
docstring-parser==0.17.0
Expand All @@ -44,6 +46,8 @@ fastapi==0.135.1
# julee (pyproject.toml)
fastapi-pagination==0.15.10
# via julee (pyproject.toml)
griffe==1.15.0
# via julee (pyproject.toml)
h11==0.16.0
# via
# httpcore
Expand Down
4 changes: 4 additions & 0 deletions src/julee/core/infrastructure/__init__.py
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.
"""
4 changes: 4 additions & 0 deletions src/julee/core/infrastructure/repositories/__init__.py
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.

Copy link
Copy Markdown
Collaborator Author

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?

"""
4 changes: 4 additions & 0 deletions src/julee/core/infrastructure/repositories/file/__init__.py
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.
"""
62 changes: 62 additions & 0 deletions src/julee/core/infrastructure/repositories/file/solution_config.py
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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The 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 repositories/introspection should be under repositories/file/introspection

"""
Loading
Loading