Skip to content

core: doctrine constants and introspection domain models#106

Merged
absoludity merged 2 commits into
masterfrom
doctrine-test-1
Mar 19, 2026
Merged

core: doctrine constants and introspection domain models#106
absoludity merged 2 commits into
masterfrom
doctrine-test-1

Conversation

@absoludity

@absoludity absoludity commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

First part of #56 as reviewable PRs - doctrine tests for use cases. The series of 4 PRs allows running doctrine tests for use-cases and is just over 2k lines, so I've split it into 4 PRs - this is the first. Some of the code is from #56, but I've made changes in places. I've also reviewed this myself to add questions about things that aren't clear to me in the code imported from #56. Agent description below:

Doctrine tests need to introspect a codebase and reason about what they find.
Before any scanning or testing can happen, we need a shared vocabulary: what
is a bounded context, a use case, a request, a response, a pipeline?

This PR establishes that vocabulary as typed Pydantic models and named
constants. Nothing here does anything yet — it just defines the concepts
that the scanner (next PR) and the tests (final PR) will use.

The naming constants in `doctrine_constants.py` are load-bearing: they are
the single source of truth for suffix conventions (`UseCase`, `Request`,
`Response`) and directory layout (`entities/`, `use_cases/`, etc.). The
doctrine tests enforce these by scanning for them — changing a constant here
will immediately surface violations across the whole codebase.

Part of a stack

  1. This PR — domain models and constants
  2. Griffe-based bounded context scanner
  3. Introspection use cases
  4. Use case doctrine test

@absoludity absoludity left a comment

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.

I'm just reviewing the code since it is mostly from #56 , and part of the point here is to actually understand and review the code (for me). Keen to understand the points below.

@@ -0,0 +1,12 @@
"""Domain models for the shared (core) accelerator.

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.

This docstring is copied from the original #56 , but some of it is unclear to me. How are these entities domain models for the shared (core) accelerator? What accelerator?

I would have thought they are domain models for the core doctrine and policy tests?

@@ -0,0 +1,12 @@
"""Domain models for the shared (core) accelerator.

These models represent the foundational code concepts that julee is built on.

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.

Suggested change
These models represent the foundational code concepts that julee is built on.
These models represent the foundational code concepts that julee is built on and that are verified by the doctrine tests.

@@ -0,0 +1,134 @@
"""BoundedContext domain model.

Represents a bounded context (accelerator) as a code structure, independent

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.

Suggested change
Represents a bounded context (accelerator) as a code structure, independent
Represents a bounded context as a code structure, independent

I don't think a bounded context is an accelerator?

Comment on lines +21 to +23
These markers reflect the Clean Architecture layers present in a
bounded context. Supports both flattened structure ({bc}/entities/)
and legacy structure ({bc}/domain/models/).

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.

Why legacy structure? Is this an artifact of historical changes in the original #56?

Also, I don't see any mention of this structure below - it's just boolean properties and a single calculated property?

Comment on lines +88 to +92
# run_next() pattern attributes
has_run_next_method: bool = False
run_next_has_workflow_decorator: bool = False
run_calls_run_next: bool = False
sets_dispatches_on_response: bool = False

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.

Wasn't the "run_next" a old pattern in julee that we used before the predecessor to handlers? If so, I assume we can remove this and related code?

@absoludity absoludity self-assigned this Mar 16, 2026
@absoludity absoludity marked this pull request as ready for review March 16, 2026 04:01
@absoludity absoludity requested a review from monkeypants March 16, 2026 04:01
@absoludity absoludity merged commit a0a3b08 into master Mar 19, 2026
6 checks passed
@absoludity absoludity deleted the doctrine-test-1 branch March 19, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant