Phase 1 — Data Model

Mission: Functional Ownership Map (functional-ownership-map-01KPDY72) Scope: Define the structural shape of the Markdown map and the YAML manifest. These shapes are validated by the schema test in tests/architecture/test_ownership_manifest_schema.py.


1. Slice Entry (common to map + manifest)

A slice entry is the unit of ownership information for one functional slice. Each slice has exactly one entry in the Markdown map and exactly one entry in the YAML manifest, keyed identically.

1.1 Required fields

FieldTypeCardinalitySpec refsNotes
canonical_packagestring1..1FR-003Filesystem-form path (e.g. src/runtime/) or dotted name (e.g. charter). Must be non-empty.
current_statelist[string]1..nFR-003Files or directories where the slice lives today. Non-empty. No trailing slash convention enforced — authored consistently.
adapter_responsibilitieslist[string]0..nFR-003CLI-only work that legitimately remains in src/specify_cli/ post-extraction. Empty list is valid.
shimslist[mapping]0..nFR-003See §1.2. Empty list is valid.
seamslist[string]0..nFR-003Free-form "slice X reads slice Y through Z" sentences. Empty list is valid.
extraction_sequencing_notesstring1..1FR-003Short paragraph describing when this slice extracts relative to others; references downstream missions by number.

1.2 shims sub-entry shape

FieldTypeCardinalityNotes
pathstring1..1Filesystem path to the shim module or package, relative to repo root (e.g. src/specify_cli/runtime/home.py).
canonical_importstring1..1Dotted import of the canonical replacement (e.g. kernel.paths).
removal_releasestring1..1Target removal release (e.g. 3.4.0). Empty string is not permitted; if a removal date is undecided the entry should not exist.
notesstring0..1Optional free-form note (e.g. "re-export shim; silent; no DeprecationWarning").

1.3 Runtime-only: dependency_rules

Required on — and only on — the runtime_mission_execution slice entry (FR-004).

FieldTypeCardinalityNotes
may_calllist[string]0..nSlice canonical keys that runtime is permitted to call into (e.g. charter_governance, doctrine, lifecycle_status).
may_be_called_bylist[string]0..nSlice canonical keys permitted to call into runtime (e.g. cli_shell).

Any slice key cited in may_call or may_be_called_by must exist as a top-level key in the manifest.


2. Manifest Top-Level Shape

# architecture/2.x/05_ownership_manifest.yaml
cli_shell:
  canonical_package: …
  current_state: […]
  adapter_responsibilities: […]
  shims: […]
  seams: […]
  extraction_sequencing_notes: "…"
charter_governance:
  …
doctrine:
  …
runtime_mission_execution:
  canonical_package: src/runtime/
  current_state: […]
  adapter_responsibilities: […]
  shims: […]
  seams: […]
  extraction_sequencing_notes: "…"
  dependency_rules:
    may_call: […]
    may_be_called_by: […]
glossary:
  …
lifecycle_status:
  …
orchestrator_sync_tracker_saas:
  …
migration_versioning:
  …

2.1 Canonical slice keys (8, fixed set)

KeySpec refCanonical package targetNotes
cli_shellFR-002src/specify_cli/cli/ (stays)CLI shell is the permanent home for CLI-only code; not extracted.
charter_governanceFR-002, FR-006charter (= src/charter/)Already extracted. shims: [] after this mission lands (FR-012).
doctrineFR-002doctrine (= src/doctrine/)Already extracted.
runtime_mission_executionFR-002, FR-004src/runtime/Target for mission #612. Carries dependency_rules (FR-004).
glossaryFR-002src/glossary/Target for mission #613. Canonical path pinned by parent-scope context.
lifecycle_statusFR-002src/lifecycle/Target for mission #614. Canonical path pinned in plan.md Structure Decisions.
orchestrator_sync_tracker_saasFR-002src/orchestrator/ (forward-looking)Fragmented today across 7 subdirectories; not extracted by this mission. Target recorded for later work.
migration_versioningFR-002src/specify_cli/migration/ + upgrade/ (stays for now)No near-term extraction. Entry documents current state honestly.

3. Markdown Map Structural Shape

architecture/2.x/05_ownership_map.md consists of these sections in order:

#SectionPurposeFR refs
1Front matter + legendTitle, status, date, links to spec, manifest, and exemplar mission. Terminology legend stating "Mission / Work Package" canon (C-005).FR-001
2How to use this mapTwo-audience quickstart: extraction-PR author and reviewer. Mirrors quickstart.md.FR-001
3Eight slice entries (in canonical order)One H2 heading per slice key. Each slice section renders every required field from §1.1 plus the runtime-only §1.3 fields as sub-sections.FR-002, FR-003
4Charter slice — reference exemplarA callout box under the charter slice entry (§3.2) naming mission 01KPD880 as the exemplar pattern that other slices follow.FR-006
5Safeguards and directionMap references #393 (architectural tests), #394 (deprecation scaffolding), #395 (import-graph tooling), #461 (direction). States which safeguards must land before which slice extracts (from R-003).FR-008, FR-009
6Downstream missionsTable listing #612, #613, #614, #615 with one-sentence summaries of what each consumes from the map.FR-001
7Change controlShort paragraph: map is a living document; edits land in-place; each extraction PR confirms its slice entry is honoured.Spec §Edge cases

4. Test Contract

tests/architecture/test_ownership_manifest_schema.py asserts:

1. architecture/2.x/05_ownership_manifest.yaml exists. 2. It parses as YAML. 3. Its top-level is a mapping whose keys exactly match the set {cli_shell, charter_governance, doctrine, runtime_mission_execution, glossary, lifecycle_status, orchestrator_sync_tracker_saas, migration_versioning}. 4. For each slice entry, every required field in §1.1 is present with the right type. 5. For the runtime_mission_execution slice entry, dependency_rules is present with may_call and may_be_called_by as lists. 6. For every other slice entry, dependency_rules is absent. 7. charter_governance.shims is an empty list (captures acceptance scenario 4). 8. Every may_call / may_be_called_by entry is a recognised slice key. 9. Test completes in ≤1s (NFR-002, asserted by a pytest fixture or pytest-timeout plug-in if available — soft check otherwise).


5. Traceability

FR / NFR / CData-model anchor
FR-001§3 (map document)
FR-002§2.1 (eight canonical slice keys)
FR-003§1.1 (required slice-entry fields)
FR-004§1.3 (runtime-only dependency_rules); §4 checks 5 and 6
FR-005§3 row 3 (doctrine slice entry carries the model_task_routing disposition); parent kind pinned in research.md R-006
FR-006§3 row 4 (charter exemplar callout)
FR-007See contracts/cross_reference.md
FR-008§3 row 5 (safeguards)
FR-009§3 row 5 (direction)
FR-010§2 (manifest shape)
FR-011§4 (test contract)
FR-012Shim deletion is code-level, not data-model. Verified by §4 check 7 (charter shims: []).
FR-013See contracts/changelog_entry.md
FR-014Commit-message Closes #611 — verified at merge time, not by schema test.
FR-015No data-model item permits adding movement of any other slice; out-of-scope enforcement is by review.
NFR-001§3 structural readability (human review during /spec-kitty.review).
NFR-002§4 check 9 (≤1s).
NFR-003Not a data-model item. Verified by running existing test suite.
NFR-004Not a data-model item. Verified by a runtime check in the deletion WP (optional one-liner test).
C-001No mention of pyproject.toml version anywhere in map or manifest.
C-002Slice entries describe current state and a future canonical target; they do not perform extraction.
C-003shims[] sub-entries reference #615 rulebook in the notes field where appropriate; the manifest does not define the rulebook.
C-004The doctrine slice entry records model_task_routing disposition only; it does not port the doctrine.
C-005Map legend calls out Mission / Work Package canon explicitly.
C-006change_mode: standard; no occurrence_map.yaml in the mission directory.