Skip to content

Gates API

Gates are quality review checkpoints in the execution pipeline. After an AI agent completes a task, a gate review is created for human approval.

List Pending Gates

Returns all pending gate reviews across all projects the user has access to.

http
GET /api/v1/gates/pending
Authorization: Bearer <token>

Response 200 OK

json
[
  {
    "id": "uuid",
    "node_id": "uuid",
    "result": "pending",
    "gate_score": 78.5,
    "auto_scores": {
      "test_pass_rate": 0.95,
      "coverage": 0.72,
      "static_check": 0.88,
      "security": 0.60,
      "diff_risk": 0.80,
      "requirement_coverage": 0.70,
      "ai_review": 0.70
    },
    "ai_summary": "Implementation looks solid with good test coverage...",
    "created_at": "2026-01-01T00:00:00Z"
  }
]

List Project Gates

Returns enriched gate reviews for a project, including requirement and work item context.

http
GET /api/v1/gates/project/{project_id}
Authorization: Bearer <token>

Get Gate Review

http
GET /api/v1/gates/{gate_id}
Authorization: Bearer <token>

List Gates for Node

http
GET /api/v1/gates/node/{node_id}
Authorization: Bearer <token>

Approve Gate

Approves a pending gate. This moves the associated work item to done and fires deployment webhooks.

http
POST /api/v1/gates/{gate_id}/approve
Authorization: Bearer <token>
Content-Type: application/json

{
  "comment": "Looks good, approved"
}

Reject Gate

Rejects a gate review. This moves the work item back to in_progress and automatically creates a fix execution graph for the agent to address the feedback.

http
POST /api/v1/gates/{gate_id}/reject
Authorization: Bearer <token>
Content-Type: application/json

{
  "comment": "Missing error handling for edge cases. See attached screenshot.",
  "attachment_ids": ["uuid"]
}

Gate Score Dimensions

The gate score is computed as a weighted average of 7 dimensions (0–1 per dimension, multiplied to 0–100 total):

DimensionWeightDescription
test_pass_rate25%Unit tests 100%, integration ≥95%
security20%High vulns = 0, medium ≤ threshold (Semgrep/Trivy)
coverage15%Line ≥80%, branch ≥70%
static_check15%Lint + type check pass
diff_risk10%Risk from touching auth/payment/migration files
requirement_coverage10%Supplementary requirements implemented (review-phase open_risks)
ai_review5%Critic Agent assessment (advisory weight only)

Thresholds (configurable via WORKFLOW.md gate_scores):

  • Auto-approve: score ≥ 85 AND risk level = low
  • Human review: score ≥ 60
  • Auto-reject: score < 40

Gate Attachments

Upload Attachment

Upload a file to attach to a gate review (max 50 MB).

http
POST /api/v1/gates/project/{project_id}/gates/{gate_id}/attachments/upload
Authorization: Bearer <token>
Content-Type: multipart/form-data

file: <binary>

List Attachments

http
GET /api/v1/gates/{gate_id}/attachments
Authorization: Bearer <token>

Forgexa — AI Software Factory