Skip to content

#2 V6 Domain Model #54

Description

Milestone (LOAD-BEARING). The frozen V6 domain schema. Everything else reads/writes against it. Delegate FIRST.

Scope:

  • Extend apps/ai/src/entities/models.py (strict Pydantic, extra=forbid) with: BusinessPillar (Marketing/Sales/Operations/Finance enum), Process + ProcessStep (owner->Stakeholder, objective, scope, decision rules, DoD, KPIs, dependencies, allowed actions, review cadence), SOP + SOPVersion (objective, scope, owner, prerequisites, steps, decision rules, DoD, FAQ, linked systems, revision history, last_reviewed_at), Mission + MissionEvent + MissionSnapshot, Action + ActionResult, Outcome, Employee (role config), Review. Reuse existing Evidence/Source/KPI/Decision/Policy/Workspace.
  • Add matching ontology object types + link types in apps/ai/src/ontology/object_types.py and link_types.py (Stakeholder-owns-Process, Process-has-SOP, SOP-versions-SOPVersion, Employee-runs-Mission, ...).
  • New migration apps/core/migrations/012_v6_domain.sql (business_pillars, processes, process_steps, sops, sop_versions, employees, missions, actions) following 011_knowledge_catalog.sql style (IF NOT EXISTS + GIN indexes). Reconcile the sparse numbering + the missing 010_ontologyai_v51.sql reference noted in ontologyai_v51.sql.
  • Governed writes: every new entity write goes through @governed_write. mission_state table untouched.

Contract freeze: after this milestone passes gates, the schema is FROZEN — later milestones build against it.

Tests (TDD): apps/ai/tests/entities/test_v6_domain.py — entity round-trips, extra=forbid strictness, pillar enum validity, SOP versioning, process->owner FK semantics, ontology link types resolve. Write failing tests first.

Do NOT touch: prd.md, README.md, apps/core/internal/v6/handlers.go (owned by #1), mission/employee.py (owned by #3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions