Contributor Open Source Protocol (COSP) Specification
JSON Schema: https://cosp.dev/schemas/cosp-0.1.schema.json
1. Overview & Design Goals
COSP (Contributor Open Source Protocol) defines a vendor-neutral, harness-agnostic contract between open-source repositories maintained by humans and local contributor workers running any AI coding agent harness under the contributor's own compute budget.
- Compute, never credentials: Contributors execute work locally using their own subscriptions or API keys. Credentials are never pooled or shared.
- Serverless by design: No central broker or coordinator server. All coordination state lives on the code forge (GitHub in v0.1; Linear, GitLab, and Forgejo via
WorkForge). - Deterministic discovery: Matching issues to worker budgets uses deterministic YAML rules and local calibration — never LLM calls.
- Explicit safety boundaries: Maintainers gate eligible issues; contributors allowlist trusted repos and explicitly approve every post-PR steering comment.
2. The Four Protocol Primitives
| Primitive | Side | Responsibility |
|---|---|---|
| 1. Manifest | Repository | Declares eligibility, ownership rules, token/complexity estimates, verification commands, and human guidelines. |
| 2. Claims | Forge + Worker | Serverless work acquisition via Draft PRs (or comment leases), tie-breaking, lease expiry, and optional reputation automation. |
| 3. Handoffs | Worker → Forge | Running verification commands, attaching structured COSP trailers, and promoting Draft PRs to Ready for Review. |
| 4. Steering | Forge → Human → Worker | Filtering post-PR review comments to authorized maintainers and requiring human approval before injecting feedback into an agent session. |
3. Primitive 1: Manifest
A repository opts into COSP by providing a YAML manifest conforming to cosp-0.1.schema.json.
3.1 Discovery Precedence
- YAML frontmatter (
---...---) at the top ofCONTRIBUTING.mdcontaining the keycosp. .cosp.yamlat the repository root..github/cosp.yaml.
When embedded in CONTRIBUTING.md, clients SHOULD pass the Markdown body following the closing --- into the coding agent session as repository contribution instructions.
3.2 Schema Sections
cosp(required): Protocol version,"0.1".eligibility:required_labels,excluded_labels,require_maintainer_gate(defaulttrue),allowed_gate_roles(OWNER,MEMBER,COLLABORATOR).ownership:mode(exclusive|competitive|capped),max_active_prs,claim_method(draft_pr|comment_lease),lease_ttl_hours(default24),in_progress_label,contributor_label_prefix.reputation:trusted_merged_prs_threshold(default3, "Rule of 3").estimates:label_map, optionaltoken_label_patternregex (e.g.,^tokens:([0-9]+)k$),default_estimate, vendor-neutralcapabilitytiers (coding-fast,coding-standard,reasoning-deep).verification: Ordered shellcommandsthat must exit0before promoting a PR, plusmax_fix_attempts.pr_contract:branch_prefix,draft_on_claim,include_cosp_trailer.
4. Primitive 2: Claims (Serverless Coordination)
External contributors on public GitHub repositories cannot edit labels or assign issues directly. COSP uses initial Draft PRs (from a fork, or a branch for collaborators) so any contributor can claim work without write permissions.
4.1 Claim Trailer Format
Refs #142
<!-- cosp
version: "0.1"
issue: 142
worker_handle: "ArtluxDM"
capability: "coding-standard"
lease_expires_at: "2026-11-26T20:00:00Z"
-->
4.2 Optimistic Tie-Break (exclusive mode)
- Push an initial claim commit and open the Draft PR containing the
<!-- cosp ... -->trailer. - Wait a brief jitter window (
5–10s) and re-query active non-stale open PRs referencing issue#N. - If another active COSP PR has a lower PR number, close your own Draft PR cleanly with a brief note and select the next issue.
4.3 Optional GitHub Action (Rule of 3)
Repositories MAY install .github/workflows/cosp.yml to mirror claims onto in-progress and cosp:<handle> labels, and automatically tag/assign contributors once they reach trusted_merged_prs_threshold merged PRs.
5. Primitive 3: Handoffs & Pause/Resume
- Execute each claimed issue in an isolated git worktree (v0.1) or sandboxed container (v0.2+).
- Pause, not destroy: When a contributor's local quota governor pauses a task near a personal reserve floor or quiet hours, keep the Draft PR open and resume in the same worktree/session once budget restores.
- Pass every command in
verification.commands, push commits, preserve the<!-- cosp ... -->trailer in the PR body, and mark the PR Ready for Review.
6. Primitive 4: Steering & Security Model
- Explicit repo allowlist: Harnesses MUST only poll repositories explicitly allowlisted by the contributor.
- Maintainer-gated issue ingestion: When
require_maintainer_gate: true, verify author or label provenance againstallowed_gate_rolesand exclude non-maintainer issue comments from prompt context by default. - Human-in-the-loop PR Review Steering Gate: Harnesses MUST ignore PR comments from non-maintainers (default:
OWNERonly) and MUST require explicit contributor approval (Approve, Edit, or Dismiss) before forwarding any maintainer comment as steering into an agent session.