Prompt: spec-kitty-saas Team
Use this file as the input to /spec-kitty.specify in the spec-kitty-saas
repo.
Prompt
Architect and implement the spec-kitty-saas control-plane and dashboard work
required by the accepted ADR
2026-04-04-1-tracker-binding-context-is-discovered-not-user-supplied.md.
Problem:
The current SaaS architecture already resolves project_slug -> Project -> ServiceResourceMapping -> external resource, but the API and mapping UX do not
yet expose enough inventory and resolution behavior for the CLI to bind without
asking the user for hidden tracker metadata. The host should be authoritative
for installation inventory, bindable resource inventory, mapping resolution, and
the persistence of provider-specific routing metadata.
Scope this feature to the spec-kitty-saas repo only.
Required behavior:
- Add or expand control-plane APIs so clients can:
- inspect tracker installation state without an existing local bind,
- list bindable resources under an installation,
- resolve local Spec Kitty project identity into:
- an existing mapping,
- candidate mappings,
- candidate bindable resources when no mapping exists.
- Ensure
ServiceResourceMappingstores enough provider-specificrouting_metadatato reconstruct hosted connector params and display useful labels later. - Update mapping creation/edit flows for supported SaaS-backed providers so admins select from discovered resources instead of typing free-form external IDs in the normal case.
- Make installation-wide status and mapping reads available where appropriate so the CLI can inspect state before a bind exists.
- Define a stable binding reference that the CLI can persist locally after resolution.
- Preserve the existing runtime policy model where mapped project context is the authority for push/run/search behavior.
Relevant current code:
apps/connectors/models.pyapps/connectors/forms.pyapps/connectors/installation_views.pyapps/connectors/tracker_views.pyapps/connectors/runtime_policy.pyapps/connectors/mission_origin_search.py
Non-goals:
- Do not move tracker discovery into the SaaS app; consume the richer discovery
contract from
spec-kitty-tracker. - Do not keep free-text raw ID entry as the primary happy path for Jira, Linear, GitHub, or GitLab mappings.
- Do not redesign runtime doctrine or authority policy in this feature.
Acceptance criteria:
- The CLI can bind to an existing mapping or a newly chosen discovered resource without asking the user for raw tracker-native metadata.
- The new API contract can represent zero, one, or many candidate resolutions, with enough metadata for the CLI to display good labels and choose safely.
- Mapping persistence preserves provider-native routing metadata in a stable and testable way.
- Jira, Linear, GitHub, and GitLab are all covered by the new contract shape, even if some provider-specific UX details vary.
- Tests cover resolution, ambiguity, mapping persistence, and dashboard mapping creation from discovered resources.