PMFlow/docs/architecture/MASTER_CONTRACT.md

39 lines
1.4 KiB
Markdown

# MASTER CONTRACT
## 1. Unified Response Envelope
- Success: `{ "code": 0, "message": "success", "data": {...} }`
- Failure: `{ "code": <non-zero>, "message": "<error>", "data": null }`
## 2. Cross-Stack Contract Ownership
- Backend source: `backend/app/api/`, `backend/app/schemas/`
- Frontend source: `frontend/src/api/`, `frontend/src/types/`
- Routing source: `backend/.openclaw/pmflow-routing-rules.json`
- Architecture docs source: `docs/architecture/`
## 3. Sync Rules
- Any backend API/schema change must update:
- `docs/architecture/API_CONTRACTS.md`
- frontend TypeScript interfaces (if impacted)
- Any routing/function-name change must update:
- `backend/.openclaw/pmflow-routing-rules.json`
- `docs/architecture/DATAFLOW.md`
- Any new module/page/API must update:
- `CLAUDE.md` structure/reference sections
## 4. Current Core Contracts
- Signal Planner function name: `signal_planner_analyze`
- Signal planner storage fields:
- `signals.planner_status`
- `signals.planner_analyzed_at`
- `signals.planner_assignee_user_id`
- `signals.strategic_analysis.ai_planner`
- Model routing config persistence: `integrations(type='model_routing')`
- Task brief center persistence: `integrations(type='task_briefs')`
## 5. Delivery Checklist
- [ ] API envelope unchanged and validated
- [ ] Backend schema + frontend type synced
- [ ] Dataflow doc synced
- [ ] Routing rule synced
- [ ] CLAUDE.md synced