Data Model: Doctrine Artifact Domain Models

Date: 2026-02-25 Feature: 046-doctrine-artifact-domain-models

Entity Diagram

DoctrineService
├── DirectiveRepository  → Directive
├── TacticRepository     → Tactic (contains TacticStep, TacticReference)
├── StyleguideRepository → Styleguide (contains AntiPattern)
├── ToolguideRepository  → Toolguide
├── ParadigmRepository   → Paradigm
└── AgentProfileRepository → AgentProfile (existing, unchanged)

Entities

Directive

FieldTypeRequiredYAML KeyNotes
idstrYesidPattern: ^[A-Z][A-Z0-9_-]*$ (SCREAMING_SNAKE_CASE)
schema_versionstrYesschema-versionPattern: ^1\.0$
titlestrYestitleHuman-readable name
intentstrYesintentMultiline: behavioral context and purpose
enforcementEnforcementYesenforcementEnum: required, advisory
tactic_refslist[str]Notactic-refsKebab-case tactic IDs; default empty list
scopestrNoscopeMultiline: when directive applies, exceptions
procedureslist[str]NoproceduresOrdered steps to follow
integrity_ruleslist[str]Nointegrity-rulesHard constraints
validation_criterialist[str]Novalidation-criteriaCompliance verification criteria

Identity: Looked up by id (e.g., "DIRECTIVE_004") or numeric shorthand (e.g., "004"). File convention: {NNN}-{slug}.directive.yaml or {slug}.directive.yaml

Tactic

FieldTypeRequiredYAML KeyNotes
idstrYesidPattern: ^[a-z][a-z0-9-]*$ (kebab-case)
schema_versionstrYesschema-version
namestrYesnameHuman-readable name
purposestrNopurposeMultiline description
stepslist[TacticStep]YesstepsminItems: 1
referenceslist[TacticReference]NoreferencesCross-artifact references

TacticStep:

FieldTypeRequiredNotes
titlestrYesStep name
descriptionstrNoMultiline prose
exampleslist[str]NoIllustrative examples
referenceslist[TacticReference]NoPer-step cross-references

TacticReference:

FieldTypeRequiredNotes
namestrYesReference name
typeReferenceTypeYesEnum: styleguide, tactic, directive, toolguide
idstrYesArtifact ID
whenstrYesWhen to invoke

File convention: {slug}.tactic.yaml

Styleguide

FieldTypeRequiredYAML KeyNotes
idstrYesidKebab-case
schema_versionstrYesschema-version
titlestrYestitle
scopeScopeYesscopeEnum: code, docs, architecture, testing, operations, glossary
principleslist[str]YesprinciplesminItems: 1
anti_patternslist[AntiPattern]Noanti_patterns
quality_teststrNoquality_testMultiline
referenceslist[str]Noreferences

AntiPattern:

FieldTypeRequiredNotes
namestrYes
descriptionstrYes
bad_examplestrYes
good_examplestrYes

File convention: {slug}.styleguide.yaml

Toolguide

FieldTypeRequiredYAML KeyNotes
idstrYesidKebab-case
schema_versionstrYesschema-version
toolstrYestoolTool name
titlestrYestitle
guide_pathstrYesguide-pathPattern: ^src/doctrine/.+\.md$
summarystrYessummary
commandslist[str]Nocommands

File convention: {slug}.toolguide.yaml

Paradigm

FieldTypeRequiredYAML KeyNotes
idstrYesidKebab-case
schema_versionstrYesschema-version
namestrYesname
summarystrYessummaryMultiline

File convention: {slug}.paradigm.yaml

DoctrineService

AttributeTypeNotes
directivesDirectiveRepositoryLazy-initialized
tacticsTacticRepositoryLazy-initialized
styleguidesStyleguideRepositoryLazy-initialized
toolguidesToolguideRepositoryLazy-initialized
paradigmsParadigmRepositoryLazy-initialized
agent_profilesAgentProfileRepositoryLazy-initialized, reuses existing class

Constructor: DoctrineService(shipped_root: Path | None = None, project_root: Path | None = None)

Enumerations

Enforcement

required | advisory

Scope (Styleguide)

code | docs | architecture | testing | operations | glossary

ReferenceType (Tactic)

styleguide | tactic | directive | toolguide

Relationships

  • Directive → Tactic: via tactic_refs list (string IDs, resolved on-demand through TacticRepository)
  • Tactic → other artifacts: via references list (TacticReference with type + ID)
  • AgentProfile → Directive: via directive_references list (existing, unchanged)
  • DoctrineService → all repositories: composition (holds references)

All cross-artifact references are string IDs resolved on-demand — no eager loading or embedded objects.