# Source traceability and service ownership

## Service boundaries

| Capability family | Primary source | Important dependencies |
|---|---|---|
| Web UI and review screens | kinship-shared `app/**/page.tsx` | all other services, wallet, login service |
| Web/API proxy and auth | kinship-shared `app/api`, `server`, `lib` | external login service, agent backend, blockchain RPC |
| Market/DUNA/governance | kinship-shared `app/api/v1`, `server`, `prisma` | Solana/Anchor, MetaDAO/futarchy, Meteora, Squads |
| Agent lifecycle | kinship-agent-be `app/api/agents.py`, schemas/models | LLMs, graph, knowledge, tools |
| Chat and voice | kinship-agent-be `app/api/chat*.py`, `voice.py` | LangGraph/LLMs, Gemini Live, tools, approvals |
| Skills and approvals | kinship-agent-be `skills.py`, `approvals.py`, services | scheduler, tools, notifications |
| Agent wisdom/vector | kinship-agent-be `knowledge.py`, embedding/vector services | Pinecone on main; pgvector on dev; Voyage/OpenAI embedding config |
| Agent/member graph | kinship-agent-be `graph.py`, graph services/tools | PostgreSQL graph extension/storage and operational source APIs |
| Game generation/knowledge | kinship-knowledge APIs, agents, graphs, pipeline | Claude, Pinecone, Voyage, asset service |
| Runtime/progress/analytics | kinship-knowledge runtime, WebSocket, score/progress/analytics APIs | PostgreSQL, Flutter/Flame client |
| Asset/media/scene storage | kinship-assets routes/services/models | PostgreSQL, Google Cloud Storage, Sharp |
| CMS/sites | kinship-shared Payload collections/config | PostgreSQL, media storage, Payload MCP |
| Account/signup/payment | kinship-shared signup/auth/checkout UI | external login/OTP service, payment/onramp, wallet |

## High-value evidence locations

### kinship-shared

- `app/(studio)` — 105 Studio review surfaces and their interactions.
- `app/market` — market, proposal, treasury, elector, operator, token, and run screens.
- `app/api/v1` — market/DUNA/governance/treasury execution endpoints.
- `server/permissions.ts`, `server/market-auth.ts`, `server/auth.ts` — authorization model.
- `prisma/schema.prisma` — market, objective, proposal, elector, trade, settlement, alliance, redemption, and registration models.
- `lib/onchain` — proposal/market transaction phases and on-chain reads.
- `components/landing/SignupWizard` and `app/onboarding` — account and agent-first onboarding flows.

### kinship-agent-be

- `app/api/agents.py` — full agent lifecycle, relationships, predefined avatars, tool mapping.
- `app/api/knowledge.py` — knowledge base/item ingestion/search lifecycle.
- `app/api/prompts.py` — tiered prompts and AI prompt generation.
- `app/api/skills.py`, `approvals.py`, `tools.py`, `voice.py`, `codes.py`, `context.py` — operational capabilities not fully represented by page routes.
- `app/agents/deep`, `app/agents/orchestrator.py` — supervisor/deep-agent behavior.
- `app/services/graph_*`, `pgvector_store.py`, `token_usage.py` — dev graph/vector/usage capabilities.
- `app/db/models.py` and Alembic migrations — persisted lifecycle/audit states.

### kinship-knowledge

- `app/api/pipeline_routes.py`, `game_plan.py`, `game_generation_api.py` — game planning/generation/editing.
- `app/graphs` and `app/agents` — scene, prompt, dialogue, HEARTS, route, and planning graphs.
- `app/validators` and `app/edit` — validation, repair, patch, merge, undo/redo semantics.
- `app/api/asset_embed.py`, `asset_knowledge.py`, `knowledge.py` — game/asset knowledge and vector operations.
- `app/api/runtime.py`, `websocket_routes.py`, `progress_routes.py`, `analytics.py` — runtime and telemetry.

### kinship-assets

- `src/routes/assets.ts`, `scenes.ts`, `platforms.ts`, `projects.ts`, `games.ts`, `scores.ts`, `upload.ts` — service actions.
- `src/types/index.ts` — asset physics, semantic knowledge, scenes, platforms/projects/games.
- `src/models/validators.ts` — accepted fields, validation, types, and defaults.
- `src/db/migrations` — asset knowledge, sprite metadata, platform/project/game, score, and scene evolution.

## Machine-readable evidence

- Use `resources/api-endpoints.csv` to locate an endpoint declaration by repository, branch, method, path, file, and line.
- Use `resources/data-models.csv` to locate model/type evidence.
- Use `resources/ui-control-evidence.csv` to locate current visible controls.
- Use `resources/review-v1-screens.csv` to map a design route to the live review link and source route.

