core: griffe-based bounded context introspection#107
Merged
Conversation
0dac6de to
5ab215b
Compare
absoludity
commented
Mar 16, 2026
Comment on lines
+3
to
+4
| Repository implementations that discover entities by inspecting the filesystem | ||
| and code structure, rather than persisting entities. |
Collaborator
Author
There was a problem hiding this comment.
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
| @@ -0,0 +1,4 @@ | |||
| """Repository implementations for Shared. | |||
|
|
|||
| Contains memory, file, and introspection repository implementations. | |||
Collaborator
Author
There was a problem hiding this comment.
Hrm - looks like introspection is explicitly not in file, even though it's a Filesystem repository?
| from pathlib import Path | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| import griffe |
Collaborator
Author
There was a problem hiding this comment.
This is the main difference from the ast of #56 - using griffe to do most of the heavy lifting.
This was referenced Mar 16, 2026
e73f11e to
3f37b8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #106 . Main difference from #56 is using griffe rather than our own code for most of the AST parser. I've left comments/questions for things from #56 that are unclear to me.
Doctrine tests need to scan a codebase and discover its bounded contexts,
use cases, entities, and protocols — without importing any of the code being
scanned. Importing would require all dependencies to be installed and would
conflate scanning with execution.
This PR introduces static analysis via griffe,
a production-grade library used by mkdocstrings. It replaces what would
otherwise be a custom AST parser (the big PR #56 carries one at ~750 lines).
Griffe handles the full surface area of Python syntax edge cases we'd
eventually hit; we get that for free.
The `FilesystemBoundedContextRepository` is the primary output: given a
project root and search path, it discovers all bounded contexts and returns
the typed models from PR 1. The `FileSolutionConfigRepository` reads the
`[tool.julee]` section from `pyproject.toml` so the scanner knows where
to look.
Part of a stack