diff --git a/docs/diagrams/axme-complete-architecture.mmd b/docs/diagrams/axme-complete-architecture.mmd index 4b684f8..30cfc02 100644 --- a/docs/diagrams/axme-complete-architecture.mmd +++ b/docs/diagrams/axme-complete-architecture.mmd @@ -96,16 +96,21 @@ flowchart TB direction TB subgraph CORE_SERVICES["Core Services"] - GW["Gateway\nFastAPI — 85+ endpoints\nPublic API surface"]:::gateway - AC["Agent Core\nWorkflow orchestration\nStep dispatch"]:::service + GW["Gateway\nFastAPI — 85+ endpoints\nSync: INSERT + COMMIT + Pub/Sub → 200\nAdmin: /admin/probes/*, /admin/maintenance/*"]:::gateway + WORKER["Gateway Worker\nBackground processing\nPub/Sub push receiver\nLifecycle, threads, webhooks, jobs"]:::service + AC["Agent Core\nWorkflow DAG engine\nStep dispatch + lifecycle"]:::service AUTH_SVC["Auth Service\nJWT issuance\nAPI key validation"]:::service end subgraph SUPPORT_SERVICES["Support Services"] - SCHED["Scheduler\nTick loop\nDeadline enforcement\nRetries"]:::service TOOLREG["Tool Registry\nAction catalog\nWorkflow compilation"]:::service - POLICY["Policy Engine\nAccess decisions\nConsent checks\nRisk evaluation"]:::service - MCP["MCP Platform\n48 JSON-RPC tools\nMirrors CLI"]:::service + POLICY["Policy Engine\nAccess decisions\nConsent checks"]:::service + MCP["MCP Platform\n48 JSON-RPC tools\nProxy to Gateway REST\nNo DB access"]:::service + end + + subgraph INFRA_SERVICES["Infrastructure"] + CLOUD_TASKS["Cloud Tasks\naxme-timeout-jobs (50/s)\naxme-reminder-jobs (20/s)\nPush to Worker (OIDC)"]:::datastore + CLOUD_SCHED["Cloud Scheduler\nworkflow-tick + webhook-tick (1 min)\ndaily-cleanup + weekly-vacuum\nAll with OIDC auth"]:::datastore end end @@ -230,19 +235,23 @@ flowchart TB PROTOCOL --> GW %% Gateway ↔ Core Services - GW <--> AC + GW <-->|OIDC HTTP| AC GW <--> AUTH_SVC - GW --> SCHED GW --> TOOLREG GW --> POLICY CLIENTS --> MCP - MCP --> GW + MCP -->|proxy REST| GW AC --> TOOLREG - AC --> POLICY + AC -->|dispatch step intents| GW - %% Scheduler connections - SCHED --> T_INTENTS - SCHED --> T_SCHEDJOBS + %% Gateway → Worker → Agent Core (async pipeline) + GW -->|publish intent.created| PUBSUB_TOPIC + PUBSUB_TOPIC -->|push subscription| WORKER + WORKER -->|publish lifecycle events| AC + + %% Cloud Tasks + Scheduler + CLOUD_TASKS -->|push TIMEOUT/REMINDER| WORKER + CLOUD_SCHED -->|tick + maintenance| GW %% Gateway → Delivery GW --> DELIVERY @@ -254,19 +263,16 @@ flowchart TB %% Addressing → Agent Core ADDR_ROUTING --> AC - %% Gateway → Data + %% Gateway + Worker → Data GW --> PG_INTENT GW --> PG_USER GW --> PG_INBOX GW --> PG_ENTERPRISE GW --> PG_WEBHOOK + WORKER --> PG_INTENT + WORKER --> PG_INBOX AC --> PG_WORKFLOW - %% Pub/Sub - GW --> PUBSUB_TOPIC - AC --> PUBSUB_TOPIC - PUBSUB_TOPIC --> T_PUBSUB - %% Human Tasks GW --> HUMANTASK HT_CLI --> GW diff --git a/docs/openapi/gateway.v1.json b/docs/openapi/gateway.v1.json index 73cca3a..c3e74cf 100644 --- a/docs/openapi/gateway.v1.json +++ b/docs/openapi/gateway.v1.json @@ -2471,6 +2471,90 @@ } } }, + "/internal/jobs/TIMEOUT/{job_id}": { + "post": { + "summary": "Internal Job Timeout", + "description": "Process a TIMEOUT job pushed by Cloud Tasks.", + "operationId": "internal_job_timeout_internal_jobs_TIMEOUT__job_id__post", + "parameters": [ + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response Internal Job Timeout Internal Jobs Timeout Job Id Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/internal/jobs/REMINDER/{job_id}": { + "post": { + "summary": "Internal Job Reminder", + "description": "Process a REMINDER job pushed by Cloud Tasks.", + "operationId": "internal_job_reminder_internal_jobs_REMINDER__job_id__post", + "parameters": [ + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "title": "Response Internal Job Reminder Internal Jobs Reminder Job Id Post" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/v1/intents/{intent_id}/resolve": { "post": { "summary": "Resolve Intent",