Context and Problem Statement
Spec Kitty 2.x treats Mission as the central control entity, but primitive hardening is uneven:
- Built-in missions are not uniformly runtime-template compatible.
- Primitive context mutability and bridge wiring are functional but not yet uniformly constrained by compatibility gates.
- New post-merge audit behavior must be mission-declarable, deterministic, and portable across local + SaaS projections.
- Current built-in mission template baseline is mixed (for example, some missions still rely on legacy
mission.yamlstate-machine shape while others have runtime sidecars).
At the same time, product policy requires no new feature work on 1.x.
Decision Drivers
- Make mission primitives reliable enough to be the primary abstraction for future growth.
- Ensure audit behavior is mission-controlled, not ad hoc command logic.
- Prevent branch-policy ambiguity between 1.x and 2.x.
- Enforce fail-fast behavior on invalid mission contracts.
Considered Options
- Implement post-merge audit as CLI-only logic outside mission primitive system.
- Implement audit as mission primitive with hardening gates and 2.x-only policy (chosen).
- Delay primitive hardening and ship ad hoc audit now.
Decision Outcome
Chosen option: "Implement audit as mission primitive with hardening gates and 2.x-only policy", because this preserves architectural coherence and makes mission primitives a defensible long-term foundation.
Hardening Contract
- Audit is a mission primitive declared in mission runtime configuration.
- Runtime compatibility checks are required for built-in missions used in 2.x rollout.
- Invalid/partial mission config results in explicit fail-fast behavior.
- Primitive output schema for audit is typed and deterministic.
- Mission audit checkpoint decisions integrate with existing decision-required flow.
Branch Policy
- All audit primitive and verify repurpose work is 2.x only.
- 1.x receives no new feature implementation for this initiative.
- Any compatibility shims in shared code must avoid introducing new 1.x product capability.
Consequences
Positive
- Mission primitives become stronger as a reusable abstraction for future capabilities.
- Audit behavior stays composable and policy-driven per mission.
- Rollout discipline improves through explicit 2.x/1.x separation.
Negative
- Upfront migration effort for mission runtime templates and tests.
- Potential short-term blocked states while mission compatibility gaps are closed.
Neutral
- Some built-in missions may remain temporarily unsupported until compatibility gates pass.
Confirmation
This decision is validated when:
- Built-in mission templates targeted for 2.0 pass runtime compatibility checks.
- Audit primitive behavior is deterministic across repeated runs.
next/decision flow can process audit checkpoints end-to-end.- No new 1.x feature scope appears in release changelogs for this initiative.
Pros and Cons of the Options
Option 1: CLI-only audit, no mission primitive
Attach audit behavior directly to commands.
Pros:
- Fastest path to initial feature.
- Low immediate runtime dependency.
Cons:
- Weakens mission as central control abstraction.
- Harder to compose, test, and extend reliably.
Option 2: Mission-declared audit primitive with hardening gates
Extend runtime contract and enforce compatibility.
Pros:
- Strong architecture alignment and composability.
- Better long-term maintainability.
Cons:
- Requires template/schema and testing investment.
- Requires cross-repo sequencing discipline.
Option 3: Delay hardening and ship ad hoc audit first
Ship quickly, refactor later.
Pros:
- Short-term delivery speed.
- Defers hard compatibility work.
Cons:
- High refactor risk and technical debt.
- Increases probability of contract drift across repos.
More Information
- PRD reference:
<spec-kitty-planning-repo>/product-ideas/mission-collaboration-platform-ddd/prd-mission-post-merge-audit-and-verify-repurpose-v1.md - Existing primitive context model:
src/doctrine/missions/primitives.py - Runtime bridge integration point:
src/specify_cli/next/runtime_bridge.py - Built-in mission runtime templates:
src/doctrine/missions/*/mission-runtime.yamlsrc/doctrine/missions/*/mission.yaml