Skip to content

Latest commit

 

History

History
287 lines (220 loc) · 12.9 KB

File metadata and controls

287 lines (220 loc) · 12.9 KB

Software Development Lifecycle

This is the release contract for Agent Bounties. It applies to human and agent contributors, hosted services, payment integrations, verifier policies, and immutable contracts. A change is complete only when its behavior, evidence, failure mode, recovery path, and distribution effect are measurable.

The lifecycle optimizes four outcomes:

  1. more funded bounties complete and settle correctly;
  2. agents can discover and use the protocol without private operator help;
  3. failures recover automatically when recovery is reversible and provable;
  4. value and integrity failures stop safely instead of being hidden by retries.

Non-Negotiable Invariants

  • Only confirmed canonical events change Base bounty lifecycle truth.
  • Only BountySettled proves solver payment.
  • Stripe credits require a verified webhook and one idempotency key.
  • An AI output, plan, comment, signature, broadcast, transaction hash, health check, or database row cannot authorize settlement.
  • Automated recovery cannot sign, fund, verify, settle, deploy a contract, rotate a key, change access, rewrite canonical events, move a cursor backward, or delete durable data.
  • A claimable bounty must be fully funded and verification_ready=true.
  • Public behavior exposed through API, MCP, SDKs, CLI, discovery, and docs must remain contract-compatible or ship with an explicit migration.

Change Classes

Every issue and PR chooses the highest applicable class.

Class Scope Examples Required approval
R0 Read-only or editorial copy, dashboards, diagnostics normal review and checks
R1 Ephemeral and reversible stateless route, process restart, cache normal review, smoke, rollback
R2 Durable but idempotent or rebuildable read models, index replay, verified webhook replay risk review, replay tests, recovery proof
R3 Value, identity, secrets, access, or irreversible data Stripe execution, wallet policy, migration, payout records explicit maintainer risk decision and staged canary
R4 Immutable protocol or contract deployment bounty bytecode, verifier authority, mainnet activation threat model, independent review, testnet rehearsal, exact-bytecode evidence, action-time signing approval

Automatic remediation is limited to R0-R2 actions listed in ops/self-healing-policy.json. Classification does not make an action automatic; all listed prerequisites must also be true.

Lifecycle Gates

0. Observe And Select

Entry: a user problem, incident, metric gap, security finding, or bounty exists.

Required artifacts:

  • problem statement and target user or agent;
  • baseline metric and expected effect on liquidity, trust, verification, or distribution;
  • canonical source of truth;
  • abuse case and privacy classification;
  • open PR queue inspection for maintainer work;
  • public maintainer notice before non-trivial maintainer edits.

Exit: a bounded issue has measurable acceptance criteria, an owner, a change class, and a non-overlapping contributor plan.

1. Specify

Define before implementation:

  • behavior and non-behavior;
  • state transitions and idempotency keys;
  • success, timeout, retry, cancellation, and partial-failure paths;
  • deterministic verifier or review evidence;
  • telemetry required to distinguish healthy, degraded, stale, and corrupt;
  • rollback or forward-repair path;
  • distribution event created after verified value.

R3-R4 changes also require a threat model, custody/data-flow diagram, explicit authority list, economic limits, and emergency containment procedure.

Exit: tests can be written from the specification without guessing intent.

2. Design

Prefer existing boundaries and immutable commitments. Write an ADR when a change introduces a service, durable schema, payment rail, signer, verifier authority, contract, or cross-service protocol.

The design review must answer:

  • What is authoritative and what is only a cache or coordination record?
  • Can the operation be retried without double effects?
  • How is replay detected?
  • What happens if the process stops after each external side effect?
  • Which observation proves recovery?
  • Which conditions must fail closed?
  • Can a malicious contributor, model output, RPC, webhook, or dependency make the platform claim funding or payment incorrectly?

Exit: ownership, interfaces, failure modes, migrations, rollout, and recovery are explicit.

3. Implement

  • Use a focused branch and small reviewable commits.
  • Update equivalent API, MCP, CLI, SDK, discovery, docs, and tests together.
  • Keep secrets and private keys outside source, logs, fixtures, and prompts.
  • Make writes idempotent before adding retries.
  • Persist durable evidence before advancing a cursor or acknowledging an event.
  • Add timeouts and bounded retries only for classified transient failures.
  • Emit structured logs with schema, component, revision, action, attempt, and evidence boundary; redact credentials and user-private data.

Exit: the narrow deterministic tests pass and the diff has no unexplained contract, generated-file, dependency, or migration changes.

4. Verify

Use the narrowest meaningful gate first, then broaden by risk.

Change Minimum gate
R0 formatting, focused unit/docs test
R1 unit, service smoke, restart/retry fixture
R2 property/idempotency tests, Postgres/replay test, recovery fixture
R3 all R2 gates, abuse tests, staging integration, bounded canary, reconciliation evidence
R4 all R3 gates, Foundry unit/fuzz/invariant, static analysis, Base Sepolia full paths, exact mainnet fork replay, independent review

Deterministic systems use hard assertions. Product quality may use AI judges to route review, but AI judge output cannot bypass deterministic safety gates.

Every incident adds a fixture to RecoveryBench or the appropriate deterministic corpus. A proposed repair is retained only when it improves the target recovery case and does not regress any prior case.

Exit: CI evidence maps to every acceptance criterion and known failure path.

5. Review

Review in this order:

  1. payment, custody, authorization, and data-integrity invariants;
  2. failure and rollback behavior;
  3. API/MCP/SDK compatibility;
  4. tests and observability;
  5. maintainability and distribution effect.

External PRs run through the untrusted review harness. Every decision explains what passed, what blocks main, the exact repair command or file, and whether a collaboration branch is appropriate.

Exit: required reviewers and checks pass, unresolved risks are recorded, and the release/rollback owner is known.

6. Stage And Rehearse

  • Run local service smoke and the Docker/Postgres durability gate.
  • Rehearse migrations against a production-like snapshot and prove downgrade or forward repair.
  • Exercise dependency failures, process termination, duplicate delivery, delayed delivery, stale reads, and restart hydration.
  • Use Base Sepolia for contract and wallet flows.
  • Use Stripe test mode for webhook and ledger flows.
  • Prove no test artifact can be presented as live funding or payout.

Exit: the release candidate survives the failure matrix and produces a signed or content-addressed evidence bundle without secrets.

7. Release

The release record contains:

  • exact Git commit and container/deployment revision;
  • change class and linked notice/ADR;
  • database migration range;
  • environment and feature-flag diff without secret values;
  • test and rehearsal evidence;
  • SLO probes and expected dashboards;
  • canary limits and stop conditions;
  • previous known-good revision and rollback/forward-repair command;
  • incident owner and communication channel.

R3 changes start disabled, then progress through test mode, internal canary, low-value public canary, and bounded expansion. R4 changes never deploy or activate from an unattended CI wallet.

Reviewed application releases use the Render Deploy Recovery workflow as an R2 action. It runs only after successful CI for a same-repository push to main, requires the latest successful SHA reachable from current main, deploys that exact SHA through Render's API, waits for API, MCP, the legacy indexer, and the versioned Open Competition indexer to reach terminal live, and verifies API/MCP revision headers. The sole provisioning recovery is an absent allowlisted Open Competition indexer: the controller verifies the exact repository Blueprint identity and synchronizes it. If Render reports the Blueprint healthy without materializing the worker, the controller may create only that worker through the service API using the validated legacy worker's workspace, project environment, database binding, and exact existing environment group. It read-verifies the new worker and revalidates all bindings before deployment. The controller then reconciles only the checked-in hidden-canary manifest, verifier catalog, and explicit false activation gates on the exact shared environment group. Other missing or ambiguous services fail closed. Native provider commit triggers are disabled so two independent deploy authorities cannot race. The Render credential is isolated to this workflow; the scheduled observer and application containers never receive it. This authority does not extend to contracts, wallets, payments, verification, or settlement. Provisioning, rotating, or revoking the Render credential remains an explicit R3 access change; unattended use is limited to the allowlisted R2 application deployment.

Exit: zero-downtime deployment reports the expected revision and post-deploy smoke passes before traffic or feature scope expands.

8. Operate And Heal

The control loop is:

observe -> diagnose -> plan -> contain/apply -> verify -> learn

Availability repairs may retry a read, restart a stateless service, resume the indexer from its persisted monotonic cursor, rebuild a read model, or suppress unready earning inventory. Integrity and money anomalies contain and escalate. See self-healing-operations.md.

Exit: the service is within SLO, the recovery action is verified, and temporary containment is removed through the same review class that introduced it.

9. Learn

Within two business days of SEV0-SEV1 resolution:

  • record timeline, impact, detection gap, root cause, and contributing factors;
  • add the smallest failing deterministic fixture;
  • make the fixture fail before the fix and pass after it;
  • update runbook, SLO, alert, threat model, or policy;
  • assign prevention and distribution follow-ups without blame.

Exit: the same observable failure can no longer recur without a gate or alert.

Supply-Chain Policy

  • Commit Cargo and npm lockfiles; CI builds the reviewed dependency graph.
  • GitHub Dependency Review rejects newly introduced dependencies with known moderate-or-higher vulnerabilities on pull requests.
  • Dependabot proposes weekly Cargo, npm, GitHub Actions, and Docker updates.
  • Dependency updates never auto-merge. Payment, cryptography, wallet, authentication, database, and contract-tooling changes are at least R3 and require focused compatibility, abuse, and rollback evidence.
  • Pin deployable images and release artifacts to an exact reviewed revision. A mutable tag or a successful build is not deployment evidence.

Branch And Release Policy

  • main is always releasable and protected by the canonical ruleset.
  • External work remains untrusted until isolated review passes.
  • Useful non-main-ready work may continue under collab/pr-<number>-<topic>.
  • Release tags identify reviewed source; deployment evidence identifies what is actually running.
  • A rollback restores the last known-good application revision. It never rolls back immutable chain history. Contract defects use containment, migration to a separately reviewed protocol version, and explicit user communication.

Definition Of Done

A change is done when:

  • its issue, risk class, acceptance criteria, and open-PR impact are recorded;
  • implementation and public contracts agree;
  • deterministic, abuse, recovery, and relevant eval gates pass;
  • telemetry distinguishes success from silent partial failure;
  • rollback or forward repair was rehearsed;
  • post-deploy evidence reports the exact expected revision;
  • no payment language exceeds canonical evidence;
  • docs and runbooks are updated;
  • verified value activates the share, tell-your-human, star/upvote, and Post your own bounty loop without implying unproven payment.

Metrics

Track engineering and network outcomes together:

  • change lead time, deployment frequency, failed-change rate, and recovery time;
  • SLO/error-budget consumption by component;
  • incidents detected automatically versus by users;
  • automatic repairs attempted, verified, rolled back, or escalated;
  • funded bounty loops completed and canonically paid;
  • external posters, funders, solvers, and repeat earners;
  • proof-to-new-bounty, share-to-fund, and share-to-claim conversion;
  • false funding, claimability, verification, and payment claims, whose target is always zero.