You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The observed pattern is not random breakage. The queue clusters around a small number of domain seams where several command surfaces independently infer or mutate the same truth. That creates whack-a-mole behavior: one command is patched, then the invariant fails at the next boundary.
The goal is to make each domain invariant executable once, then route every CLI surface, JSON surface, dry-run, real execution path, dashboard reader, review gate, and sync side effect through it.
Core Architectural Diagnosis
Spec Kitty currently has too many places acting as if they own workflow truth:
spec-kitty next
spec-kitty agent action implement/review
spec-kitty agent tasks move-task
spec-kitty agent tasks status
spec-kitty review
spec-kitty merge --dry-run
real spec-kitty merge
dashboard/status materializers
SaaS sync/final-sync fan-out
release and mission-review gates
The alien-intelligence reading: these are not separate problems. They are projections of a few aggregates whose invariants are not yet centralized.
North Star Invariants
A Work Package has exactly one lifecycle authority.
A Review Cycle has exactly one artifact/verdict/pointer/override authority.
Merge dry-run and real merge evaluate the same readiness object.
Local state transitions and SaaS publication are separate outcomes with explicit failure classification.
TeamSpace ingress accepts only canonical envelopes, and repair/import tooling proves that before live projection.
Release review cannot silently skip a required gate for a newly created mission.
Compatibility cleanup cannot use "green enough" test output to hide contract drift.
Open PR Intake: TeamSpace Cutover Set
These four PRs are open, non-draft, merge-clean, and green as of 2026-05-05. They should be treated as the current implementation front of the TeamSpace migration boundary, not duplicated by this epic.
Add TeamSpace mission-state repair and dry-run #980: Add TeamSpace mission-state repair and dry-run. Head 01db3e0b. Adds doctor mission-state --fix, --teamspace-dry-run, canonical TeamSpace envelope synthesis, CLI sync expectation alignment, and 3.2.0rc2.
Priivacy-ai/spec-kitty-saas#150: Enforce TeamSpace ingress event contracts. Head 342e77a5. Enforces canonical ingress, rejects historical/raw/legacy keys recursively, fixes 5.0.0 lane handoff, and hardens websocket test cleanup.
Priivacy-ai/spec-kitty-tracker#14: Guard tracker TeamSpace mission payloads. Head 7fdde89. Ensures tracker egress stays on canonical mission_id and does not become rollout/import authority.
Land these PRs as one coordinated cutover set, then run a post-merge import-readiness pass against the same repositories. The queue-draining work below should consume their new boundaries instead of creating parallel validators.
Workstream 0: TeamSpace Canonical Import Boundary
Domain Problem
TeamSpace launch introduces a hard boundary between historical local mission state and canonical SaaS projection. The open PR set repairs and guards that boundary, but the queue drain must treat the boundary as a product invariant after merge.
runtime logs are classified as local side logs, never status authority.
tracker emits canonical mission payloads and does not own rollout/import semantics.
spec-kitty-events==5.0.0 is the published shared contract.
Acceptance
All four open PRs land against current main without semantic reroll.
spec-kitty-events==5.0.0 is published and downstream Git source overrides are removed.
doctor mission-state --audit --json, --fix, and --teamspace-dry-run --json are run on the selected active repositories.
Generated repair manifests are reviewed before import/projection.
SaaS ingress rejects raw historical rows, recursive forbidden legacy keys, missing build identity, and non-canonical envelopes.
Runtime/tracker tests prove they are not TeamSpace status/import authorities.
Workstream 1: WorkPackageLifecycle Authority
Domain Problem
next, explicit agent action, move-task, dashboard/status, and merge currently infer claimability, readiness, and terminal state from overlapping but non-identical rules.
Introduce or harden a single WorkPackageLifecycle domain service that answers:
What is the current state?
What transitions are allowed?
What actor may claim/review/approve?
What is claimable next?
What evidence is required?
Which command surfaces may present or serialize this decision?
Acceptance
next --json, agent action implement, agent action review, move-task, status board, and dashboard agree on claimable and blocked WPs for the same fixture.
Planning-artifact and lane-backed WPs use the same lifecycle decision API.
No command writes WP lifecycle state except through the canonical transition pipeline.
Workstream 2: ReviewCycle As A Real Aggregate
Domain Problem
Recent fixes created a narrow review-cycle boundary, but current open issues show the boundary is still too file-shaped. Review artifact creation, verdicts, pointers, overrides, status transitions, dry-run gates, real merge gates, and fix-mode prompt loading must all share one domain model.
Some older queue items are not part of the current release firefight but point to the same pattern: implicit file/content assumptions made at many call sites.
File any post-merge failures under Workstream 0, not as one-off TeamSpace cleanup.
Phase 0: Safety Rail
Add a cross-surface fixture harness that can run the same mission state through next, agent action, move-task, status, dashboard scanner, review, merge --dry-run, and real merge preflight.
Establish diagnostic-code inventory for lifecycle, review, merge, sync, and release evidence blockers.
All current open bug issues listed above are closed or explicitly moved to a successor epic with a current repro and deferral rationale.
Each recently fixed bug family has at least one cross-boundary regression test that proves the invariant at the next boundary, not only at the original symptom boundary.
The TeamSpace cutover PR set is either landed and post-merge verified, or explicitly split with launch-blocking rationale.
No release-blocking command reports success while silently skipping a required new-mission gate.
Dry-run output is a faithful serialization of the same domain decision real execution uses.
SaaS sync publication failures cannot be mistaken for local mutation failures, and local mutation success cannot hide a non-retryable publication blocker.
The final smoke includes local mode and SaaS-enabled mode with SPEC_KITTY_ENABLE_SAAS_SYNC=1.
Non-Goals
This epic should not become a product expansion vehicle.
Do not rewrite the CLI surface wholesale.
Do not close old issues merely because this epic references them.
Do not add broad suppressions, skips, or compatibility fallbacks unless they are typed, diagnosed, and issue-backed.
Purpose
Drain the Spec Kitty bug queue by repairing the domain boundaries that keep producing symptom fixes.
This epic is based on a holistic survey of:
bugissues as of 2026-05-05.bugissues closed since 2026-04-21.The observed pattern is not random breakage. The queue clusters around a small number of domain seams where several command surfaces independently infer or mutate the same truth. That creates whack-a-mole behavior: one command is patched, then the invariant fails at the next boundary.
The goal is to make each domain invariant executable once, then route every CLI surface, JSON surface, dry-run, real execution path, dashboard reader, review gate, and sync side effect through it.
Core Architectural Diagnosis
Spec Kitty currently has too many places acting as if they own workflow truth:
spec-kitty nextspec-kitty agent action implement/reviewspec-kitty agent tasks move-taskspec-kitty agent tasks statusspec-kitty reviewspec-kitty merge --dry-runspec-kitty mergeThe alien-intelligence reading: these are not separate problems. They are projections of a few aggregates whose invariants are not yet centralized.
North Star Invariants
Open PR Intake: TeamSpace Cutover Set
These four PRs are open, non-draft, merge-clean, and green as of 2026-05-05. They should be treated as the current implementation front of the TeamSpace migration boundary, not duplicated by this epic.
01db3e0b. Addsdoctor mission-state --fix,--teamspace-dry-run, canonical TeamSpace envelope synthesis, CLI sync expectation alignment, and 3.2.0rc2.342e77a5. Enforces canonical ingress, rejects historical/raw/legacy keys recursively, fixes 5.0.0 lane handoff, and hardens websocket test cleanup.ba167541. Establishes runtime logs as local side logs, not TeamSpace status authority or direct import payloads.7fdde89. Ensures tracker egress stays on canonicalmission_idand does not become rollout/import authority.Open PR Follow-Up Queue
spec-kitty-events==5.0.0.spec-kitty-eventslower bound after 5.0.0 PyPI release.Integration Rule
Land these PRs as one coordinated cutover set, then run a post-merge import-readiness pass against the same repositories. The queue-draining work below should consume their new boundaries instead of creating parallel validators.
Workstream 0: TeamSpace Canonical Import Boundary
Domain Problem
TeamSpace launch introduces a hard boundary between historical local mission state and canonical SaaS projection. The open PR set repairs and guards that boundary, but the queue drain must treat the boundary as a product invariant after merge.
Issues And PRs Covered
Target Shape
The launch boundary has one explicit contract:
spec-kitty-events==5.0.0is the published shared contract.Acceptance
mainwithout semantic reroll.spec-kitty-events==5.0.0is published and downstream Git source overrides are removed.doctor mission-state --audit --json,--fix, and--teamspace-dry-run --jsonare run on the selected active repositories.Workstream 1: WorkPackageLifecycle Authority
Domain Problem
next, explicitagent action,move-task, dashboard/status, and merge currently infer claimability, readiness, and terminal state from overlapping but non-identical rules.Open Issues Covered
spec-kitty next --jsoncan miss claimable WPs available to explicitagent action.Latent Regression Debt From Recently Closed Bugs
nextreported discovery after finalized task board.mark-statusfailed on missing checkbox task IDs.for_review -> in_progressinstead offor_review -> in_review.Target Shape
Introduce or harden a single
WorkPackageLifecycledomain service that answers:Acceptance
next --json,agent action implement,agent action review,move-task, status board, and dashboard agree on claimable and blocked WPs for the same fixture.Workstream 2: ReviewCycle As A Real Aggregate
Domain Problem
Recent fixes created a narrow review-cycle boundary, but current open issues show the boundary is still too file-shaped. Review artifact creation, verdicts, pointers, overrides, status transitions, dry-run gates, real merge gates, and fix-mode prompt loading must all share one domain model.
Open Issues Covered
Latent Regression Debt From Recently Closed Bugs
in_reviewcould fail without structuredreview_result.feedback://instead ofreview-cycle://.agent action implementauto-inflates the review-cycle counter #676 re-runningagent action implementauto-inflated review-cycle counter.Target Shape
Promote the review boundary from "rejected artifact helper" to
ReviewCycle/ReviewDecisionaggregate:review-cycle://;Acceptance
move-task, fix-mode prompt loading,review,merge --dry-run, and real merge use the sameReviewCycleConsistencyevaluator.merge --dry-run --jsonreportsREJECTED_REVIEW_ARTIFACT_CONFLICTwhenever real merge would.feedback://remains readable only as a migration compatibility path and never persists on new transitions.Workstream 3: MergeReadiness Parity
Domain Problem
Dry-run and real merge have repeatedly diverged. Fixing one missing preflight at a time is a symptom pattern.
Open Issues Covered
Latent Regression Debt From Recently Closed Bugs
done.Target Shape
Create a single
MergeReadiness.evaluate()decision object used by both dry-run and real merge.The decision should include:
Acceptance
Workstream 4: SyncPublication And Auth/Teamspace Classification
Domain Problem
Local command success and SaaS sync publication are separate outcomes, but bugs show they are sometimes conflated, hidden, or misclassified.
Open Issues Covered
sync nowmisclassifies teamspace ingress rejection asserver_error.Latent Regression Debt From Recently Closed Bugs
bad_request: unknown.spec-kitty agent mission setup-planhangs indefinitely on unix-socket / websockets read; zombie processes block subsequent calls #936 websocket/unix-socket hang and zombie processes.Target Shape
Create a
SyncPublicationoutcome model:Acceptance
server_error.sync doctordetects missing Private Teamspace beforesync nowdrains.SPEC_KITTY_ENABLE_SAAS_SYNC=1on this machine.Workstream 5: ReleaseEvidence And Review Gates
Domain Problem
Release and mission-review gates sometimes report pass/skip rather than enforcing a domain invariant. That hides missing evidence.
Open Issues Covered
baseline_merge_commitskip dead-code review.Latent Regression Debt From Recently Closed Bugs
--agentcolon string silently discarded model/profile/role.Target Shape
Create a
ReleaseEvidencecontract:baseline_merge_commitor fail with repair guidance;Acceptance
spec-kitty reviewfails or repairs when a new mission lacksbaseline_merge_commit.Workstream 6: Input/Upgrade/Encoding Boundary Hygiene
Domain Problem
Some older queue items are not part of the current release firefight but point to the same pattern: implicit file/content assumptions made at many call sites.
Open Issues Covered
Latent Regression Debt From Recently Closed Bugs
spec-kitty upgradesilently deletes user-customized commands and skills #674 upgrade silently deleted customized commands/skills..kittify/overridesmostly dead under current runtime resolution.require_main_repomissed external worktrees.Target Shape
Make input and persisted artifact boundaries explicit:
Acceptance
Queue Drain Order
Phase -1: Land The Green TeamSpace PR Set
Phase 0: Safety Rail
next,agent action,move-task, status, dashboard scanner,review,merge --dry-run, and real merge preflight.Phase 1: Stop Active Release Bleeding
next --jsonclaimability parity for bug: spec-kitty next --json can miss claimable WPs available to explicit agent action #988.baseline_merge_commithandling for bug: new missions without baseline_merge_commit skip dead-code review #989.Phase 2: Collapse Symptom Families
Phase 3: Drain Older Boundary Debt
Definition Of Done
SPEC_KITTY_ENABLE_SAAS_SYNC=1.Non-Goals
Suggested Labels
bug,workflow,release,epic