Design foundation for POC. Monorepo: FastAPI+Postgres backend, Vue 3 frontend, Python packages (llm-gateway, artifacts, connectors). Approval gate and token budgets are architectural constraints per measured prototype findings.
2.1 KiB
2.1 KiB
API contract (POC)
Base: /api. JSON everywhere. Errors as {error: {code, message}} with proper HTTP status.
Profile & CV
GET /profile-> profile object (create default if none)PUT /profile-> update profile fieldsGET /profile/sections-> list of cv_section ordered by kind, sort_orderPOST /profile/sections-> create sectionPUT /profile/sections/{id}-> updateDELETE /profile/sections/{id}POST /profile/sections/{id}/ai-assistbody{instruction: str}->{suggestions: [str]}(LLM, cheap->strong routing per config)POST /profile/render-cv->{artifact_id, url}rendered PDF from current profile + sections (packages/artifacts)
Job postings
POST /postingsbody{url}-> fetch via connectors (manual_url for POC), create job_posting + application(state=discovered)GET /postings-> listPOST /postings/{id}/score-> run scoring rubric vs profile -> application.state=scored, returns{score, rationale}
Applications (kanban)
GET /applications-> list with posting info joinedPOST /applications/{id}/transitionbody{to}-> guarded per data-model.md table; 409 if illegal or guard failsPOST /applications/{id}/artifactsmultipart upload or{kind, content}-> creates artifact with content_hashPOST /applications/{id}/artifacts/cover-letterbody{letter_text}-> stores user draft, returns artifact + AI critique{comments: [{quote, suggestion, severity}]}(LLM review, does not rewrite)GET /applications/{id}/artifacts-> list
Approval & outbox (the gate)
POST /applications/{id}/approvalsbody{action, artifact_id}-> creates pending approval (expires_at = now+24h)POST /approvals/{id}/confirm-> user confirms; verified artifact.content_hash == approval.artifact_hash or 409POST /approvals/{id}/rejectPOST /outbox/sendbody{approval_id, payload}-> fails 409 unless approval confirmed, unexpired, hash match. On success: outbox.status=sent (POC: log/echo transport pluggable; real SMTP later)
Telemetry
GET /telemetry/tasks-> task_run list (tokens, model, cost) — shows users their burn
Health
GET /health->{status: "ok"}