Data model — upgrade-project-global-state-01M44538
StateSurface (existing, extended)
| Field | Type | Change | Notes |
|---|---|---|---|
primary_owned | bool (default False) | new | True only when the surface is fully generated by Spec Kitty, carries a "do not edit" marking, is tracked, and is written only by the repository root checkout's upgrade or init. Present in to_dict(). |
Invariants:
primary_owned ⇒ git_class == TRACKED and root == PROJECT. A unit test asserts this.- Initially exactly one surface is primary-owned:
project_metadata(.kittify/metadata.yaml). is_primary_owned_path(rel)matches only an exact, normalised POSIX path relative to the repository root. It never matches by basename.
Integrating worktree (derived, not stored)
is_integrating = branch is None or parse_mission_slug_from_branch(branch) is not None. The branch comes from get_current_branch(worktree).
Integration merge site → resolution side
| Site | Code | Side for a primary-owned conflict |
|---|---|---|
| Stale-lane check | lanes/stale_check.check_lane_staleness | not counted (no merge) |
| Lane → mission merge | lanes/consolidation._merge_branch_into (MERGE) | stage 2: the mission branch |
| Mission → target | lanes/consolidation._run_squash_merge and _merge_branch_into (MERGE) | stage 2: the target |
| Lane sync (auto-rebase) | lanes/auto_rebase._resolve_managed_artifact_conflicts | stage 3: the coordination or mission branch |
| Dependency-lane merge | lanes/worktree_allocator._merge_dependency_lane_tips | stage 2: the dependent lane |
There are no state transitions or events; the mission adds no new persisted state.