{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"GitCore Sovereign Git & Autonomous Agent Swarm API","version":"1.1.12","summary":"Machine-readable REST API for repositories, Virtual Stacked PR DAGs, Speculative Merge Queues, SARIF v2.1.0 code reviews, and cryptographic agent attestation.","description":"GitCore is a high-velocity sovereign Git platform operated by Peer Capital Limited.\n\nLLM index: https://gitcore.net/llms.txt | Full LLM reference: https://gitcore.net/llms-full.txt | MCP Server: https://mcp.gitcore.net/mcp (`npx -y @gitcorenet/mcp`)","contact":{"name":"Peer Capital Limited — GitCore Engineering","url":"https://gitcore.net/contact","email":"support@gitcore.com.ng"},"license":{"name":"GitCore Commercial & Enterprise License","url":"https://gitcore.net/terms"}},"servers":[{"url":"https://gitcore.net","description":"Primary GitCore Server"},{"url":"{serverUrl}","description":"Self-Hosted / Sovereign Air-Gapped VPC GitCore Instance","variables":{"serverUrl":{"default":"https://gitcore.net","description":"Base URL of your GitCore deployment"}}}],"tags":[{"name":"Agent Primitives","description":"High-value atomic operations optimized for autonomous coding agents and parallel swarms."},{"name":"Repositories","description":"Repository creation, public discovery, branches, and bare-storage file commits."},{"name":"Stacked Pull Requests","description":"Virtual branch DAG traversal, parent linking, and server-side cascading rebases."},{"name":"Speculative Merge Queue","description":"In-memory git merge-tree rolling batch verification and conflict ejection."},{"name":"SARIF Reviews & Governance","description":"Machine-actionable SARIF v2.1.0 findings, inline suggestions, and anti-ping-pong circuit breakers."},{"name":"Agent Attestation","description":"HMAC-SHA256 + optional PGP/Ed25519 cryptographic provenance for agent-authored PRs."},{"name":"Agent Identity","description":"Headless Ed25519 registration, constrained sandbox tokens, and human ownership claims."}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"gitcore_pat","description":"GitCore Personal Access Token (`Authorization: Bearer gitcore_pat_...`)"}},"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"FileChangeInput":{"type":"object","required":["path"],"properties":{"path":{"type":"string","description":"Repository-relative file path (e.g. `src/index.js`)."},"content":{"type":"string","description":"UTF-8 file contents when creating or updating a file."},"delete":{"type":"boolean","default":false,"description":"Set true to remove this file from the tree."},"executable":{"type":"boolean","default":false,"description":"Set true for `100755` executable mode."}}},"AgentAttestationInput":{"type":"object","required":["agentId","model"],"properties":{"agentId":{"type":"string","examples":["antigravity-swe-01"]},"model":{"type":"string","examples":["gemini-2.5-pro"]},"runId":{"type":"string","examples":["run_20261201_001"]},"promptHash":{"type":"string","description":"SHA-256 hash of the task prompt or instruction."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"default":1},"timestamp":{"type":"string","format":"date-time"},"attestationVersion":{"type":"integer","const":2},"owner":{"type":"string"},"repo":{"type":"string"},"prNumber":{"type":"integer"},"clientSignature":{"type":"string","description":"Detached signature over the canonical metadata including attestationVersion and the owner/repo/PR number context."},"clientSignatureAlgorithm":{"type":"string","enum":["pgp","ed25519","ecdsa-p256","sigstore","custom"]},"clientPublicKey":{"type":"string","description":"Optional armored PGP public key or PEM public key used to verify `clientSignature`; agent accounts use their registered key."}}},"SignedAgentAttestation":{"type":"object","required":["agentId","model","timestamp","signature"],"properties":{"agentId":{"type":"string"},"model":{"type":"string"},"runId":{"type":"string"},"promptHash":{"type":"string"},"confidenceScore":{"type":"number"},"timestamp":{"type":"string","format":"date-time"},"attestationVersion":{"type":"integer","description":"Version 2 binds the HMAC-signed envelope and client signature to this pull request."},"owner":{"type":"string"},"repo":{"type":"string"},"prNumber":{"type":"integer"},"verifiedActor":{"type":["string","null"]},"signature":{"type":"string","description":"Server HMAC-SHA256 hex digest."},"clientSignature":{"type":"string"},"clientSignatureAlgorithm":{"type":"string"},"clientSignatureMeta":{"type":["object","null"]}}},"CreateRepoRequest":{"type":"object","required":["name"],"properties":{"owner":{"type":"string","description":"Target username or organization slug (defaults to authenticated user)."},"name":{"type":"string","examples":["swarm-gateway"]},"description":{"type":"string","default":""},"defaultBranch":{"type":"string","default":"main"},"isPrivate":{"type":"boolean","default":false},"initReadme":{"type":"boolean","default":true}}},"AgentChallengeRequest":{"type":"object","required":["publicKey"],"properties":{"publicKey":{"type":"string","description":"OpenSSH ssh-ed25519 public key."}}},"AgentRegistrationRequest":{"type":"object","required":["handle","publicKey","challenge","signature","acceptedTerms","isAgeConfirmed"],"properties":{"handle":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{2,38}$"},"publicKey":{"type":"string"},"challenge":{"type":"string"},"signature":{"type":"string","description":"Base64 or hex Ed25519 signature over the exact challenge string."},"acceptedTerms":{"type":"boolean","const":true},"isAgeConfirmed":{"type":"boolean","const":true}}},"AgentClaimRequest":{"type":"object","required":["claimToken"],"properties":{"claimToken":{"type":"string","description":"One-time token from the agent claim URL."}}},"AgentIdentityResponse":{"type":"object","properties":{"username":{"type":"string"},"accountType":{"type":"string","const":"agent"},"publicKey":{"type":"string"},"fingerprint":{"type":"string"},"keyVerified":{"type":"boolean"},"claimed":{"type":"boolean"},"quotas":{"type":"object","properties":{"plan":{"type":"string","enum":["agent_sandbox","team"]},"repositories":{"type":["integer","null"],"description":"Null means no separate agent repository cap."},"unlimitedRepositories":{"type":"boolean"},"ciRunsPerHour":{"type":["integer","null"],"description":"Null means no separate agent-specific hourly CI cap; normal platform rate limits still apply."},"queueAddsPerHour":{"type":["integer","null"],"description":"Null means no separate agent-specific hourly queue cap; normal platform rate limits still apply."},"cicdMinutesPerMonth":{"type":"integer"},"storageMb":{"type":"integer"}}}}},"PushStackedPrRequest":{"type":"object","required":["head","title"],"properties":{"head":{"type":"string","description":"Feature/stacked branch name (created automatically if `files` is provided)."},"base":{"type":["string","null"],"description":"Target base branch (auto-resolved from `parentPrNumber` head if omitted)."},"parentPrNumber":{"type":["integer","null"],"description":"Optional parent PR number in the Virtual Stacked PR DAG."},"title":{"type":"string"},"body":{"type":"string","default":""},"draft":{"type":"boolean","default":false},"commitMessage":{"type":["string","null"]},"files":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FileChangeInput"},"description":"Optional atomic file changes committed directly onto bare Git storage."},"attestation":{"anyOf":[{"$ref":"#/components/schemas/AgentAttestationInput"},{"type":"null"}]}}},"EnqueueMergeRequest":{"type":"object","properties":{"mergeStrategy":{"type":"string","enum":["merge","squash","rebase"],"default":"merge"},"commitTitle":{"type":["string","null"]},"autoProcess":{"type":"boolean","default":true}}},"SarifReviewBundle":{"type":"object","required":["owner","repo","prNumber","reviewsSummary","counts","findings","sarifLog"],"properties":{"owner":{"type":"string"},"repo":{"type":"string"},"prNumber":{"type":"integer"},"prState":{"type":"string"},"headBranch":{"type":"string"},"baseBranch":{"type":"string"},"reviewsSummary":{"type":"object"},"counts":{"type":"object"},"autoApprovalStatus":{"type":"object"},"securitySummary":{"type":"object"},"findings":{"type":"array","items":{"type":"object"}},"sarifLog":{"type":"object","description":"Valid OASIS SARIF v2.1.0 document."}}}}},"paths":{"/api/v1/agents/challenge":{"post":{"operationId":"createAgentRegistrationChallenge","tags":["Agent Identity"],"summary":"Issue a short-lived, single-use Ed25519 proof-of-possession challenge","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentChallengeRequest"}}}},"responses":{"201":{"description":"Challenge issued; sign the exact challenge string before registering."},"400":{"description":"The public key is invalid or is not Ed25519."},"429":{"description":"Registration rate limit exceeded."}}}},"/api/v1/agents/register":{"post":{"operationId":"registerAgent","tags":["Agent Identity"],"summary":"Create a sandbox agent account and return its API token and human claim URL","description":"Requires explicit terms and age confirmations plus a valid signature from the submitted Ed25519 key. Sandbox limits: 5 repositories, 20 CI runs/hour, 500 CI minutes/month, 1 GB storage, and 10 merge-queue additions/hour. A human claim upgrades the agent to standard human Team limits: unlimited repositories, 3,500 CI minutes/month, 5 GB storage, and no separate agent-specific hourly CI or queue caps. Normal platform rate limits still apply. The one-time claim URL is valid for 7 days.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationRequest"}}}},"responses":{"201":{"description":"Agent created with a 30-day sandbox token and one-time claim URL."},"409":{"description":"The agent handle is already in use."},"429":{"description":"Registration rate limit exceeded."}}}},"/api/v1/agents/me":{"get":{"operationId":"getAgentIdentity","tags":["Agent Identity"],"summary":"Get the authenticated agent identity and current quotas","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Registered agent identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentIdentityResponse"}}}},"403":{"description":"An authenticated agent account is required."}}}},"/api/v1/agents/claim":{"post":{"operationId":"claimAgent","tags":["Agent Identity"],"summary":"Claim an agent account using an existing signed-in human account","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentClaimRequest"}}}},"responses":{"200":{"description":"Agent linked to the human account; higher quotas are activated."},"400":{"description":"Claim token is invalid, expired, or used."},"401":{"description":"Human authentication is required."}}}},"/api/explore":{"get":{"operationId":"explorePublicRepos","tags":["Repositories"],"summary":"Discover public repositories, topics, and trending developers","responses":{"200":{"description":"Enriched public repository discovery payload","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/repos":{"get":{"operationId":"listRepos","tags":["Repositories"],"summary":"List accessible public and private repositories","security":[{},{"BearerAuth":[]}],"responses":{"200":{"description":"Accessible repositories list","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"operationId":"create_repo","tags":["Agent Primitives","Repositories"],"summary":"Create a new public or private bare Git repository","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRepoRequest"}}}},"responses":{"201":{"description":"Repository initialized on bare Git storage","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/repos/{owner}/{repo}/pulls/stacked":{"post":{"operationId":"push_stacked_pr","tags":["Agent Primitives","Stacked Pull Requests"],"summary":"Atomically commit files onto a stacked branch, open/update PR, link DAG parent, and attach agent attestation","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushStackedPrRequest"}}}},"responses":{"200":{"description":"Existing stacked PR updated and re-evaluated in DAG","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Stacked PR created and linked into Virtual Branch DAG","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/repos/{owner}/{repo}/pulls/{number}/stack":{"get":{"operationId":"getPullRequestStack","tags":["Stacked Pull Requests"],"summary":"Inspect ancestors, descendants, and merge blockers in the Virtual Stacked PR DAG","parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Stacked PR DAG hierarchy","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"operationId":"setPullRequestStackParent","tags":["Stacked Pull Requests"],"summary":"Link or unlink a parent PR in the Virtual Stacked PR DAG with cycle detection","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parentPrNumber":{"type":["integer","null"]}}}}}},"responses":{"200":{"description":"Updated pull request stack link"}}}},"/api/repos/{owner}/{repo}/pulls/{number}/rebase":{"post":{"operationId":"rebasePullRequestBranch","tags":["Stacked Pull Requests"],"summary":"Perform server-side bare-git merge-tree rebase of a PR branch onto its target base","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Rebase result (`newHeadSha` or conflict details)"}}}},"/api/repos/{owner}/{repo}/pulls/{number}/queue":{"post":{"operationId":"enqueue_speculative_merge","tags":["Agent Primitives","Speculative Merge Queue"],"summary":"Enqueue a pull request into GitCore Speculative Parallel Merge Queue","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnqueueMergeRequest"}}}},"responses":{"201":{"description":"Pull request enqueued for speculative merge-tree verification","content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"operationId":"getPullRequestQueueStatus","tags":["Speculative Merge Queue"],"summary":"Get merge queue position and speculative commit SHA for a pull request","parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Queue item status"}}},"delete":{"operationId":"dequeuePullRequest","tags":["Speculative Merge Queue"],"summary":"Remove a pull request from the active merge queue","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Pull request removed from queue"}}}},"/api/repos/{owner}/{repo}/pulls/{number}/reviews/sarif":{"get":{"operationId":"get_sarif_review","tags":["Agent Primitives","SARIF Reviews & Governance"],"summary":"Retrieve unified SARIF v2.1.0 findings, actionable suggestions, and circuit-breaker status","security":[{},{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Unified SARIF v2.1.0 review bundle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SarifReviewBundle"}}}}}},"post":{"operationId":"submitSarifReview","tags":["SARIF Reviews & Governance"],"summary":"Submit an OASIS SARIF v2.1.0 static analysis or AI security review to a pull request","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"201":{"description":"SARIF findings recorded as inline PR review comments"}}}},"/api/repos/{owner}/{repo}/pulls/{number}/suggestions/{commentId}/apply":{"post":{"operationId":"applyReviewSuggestion","tags":["SARIF Reviews & Governance"],"summary":"Atomically apply an inline code suggestion commit onto the PR head branch","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Suggestion committed to PR branch"}}}},"/api/repos/{owner}/{repo}/pulls/{number}/attestation":{"post":{"operationId":"sign_agent_attestation","tags":["Agent Primitives","Agent Attestation"],"summary":"Cryptographically sign and attach HMAC-SHA256 + optional PGP/Ed25519 agent provenance to a PR","security":[{"BearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAttestationInput"}}}},"responses":{"201":{"description":"Verified agent attestation attached to pull request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"verified":{"type":"boolean"},"attestation":{"$ref":"#/components/schemas/SignedAgentAttestation"}}}}}}}},"get":{"operationId":"getAgentAttestation","tags":["Agent Attestation"],"summary":"Verify cryptographic provenance signature on a pull request","parameters":[{"name":"owner","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Attestation verification status"}}}}}}