Skip to content

feat(contracts): release candidates, and the agent detail returns its release reference - #764

Merged
nimrodbusany merged 3 commits into
developfrom
feat/release-candidates
Nov 27, 2026
Merged

nimrodbusany merged 3 commits into
developfrom
feat/release-candidates

Conversation

@nimrodbusany

Copy link
Copy Markdown
Contributor

A person must record a release acceptance before an agent's best-config head can move. The acceptance needs digests that only the client's release gate knows. This adds a server-side release candidate record: the client reports a candidate after its gate runs, and a portal lists candidates so a person can accept one. The agent detail read now also returns the server-issued release reference that the release routes take.

Ticket: TRAIG-247
Security note: additive and closed; the candidate record carries ids, digests, a closed verdict enum and timestamps only; recording requires editor access and agent write, and service tokens are refused; every denial is the closed release refusal envelope
Spine-Trail: st_2f85a1623bec

What changes

  • optimization/release_endpoints.json, on /api/v1/projects/{project_id}/agents/{agent_ref}/release-candidates (marked as planned routes):
    • POST: record a candidate, by a signed-in person or an SDK API key with editor access and agent WRITE; service tokens are refused with the closed refusal (401 or 403, depending on where authentication stops the request);
    • GET list: newest first, environment filter, at most 100;
    • GET .../{candidate_ref}: read one.
  • Replay and conflict: a same-body replay returns the original record; a different body for the same agent, environment, config id and version is the closed 409 candidate_conflict.
  • Refusals: the masked 404 reference_not_found and the closed 400; the 429 body accepts the rate limiter's real values and rejects prose. The rate-limit headers are the shared ones every route uses.
  • optimization/release_candidate_schema.json (new):
    • the closed request and record, reusing the acceptance's field definitions by $ref;
    • gate_verdict in promote | reject | no_decision; a real gate digest is required unless the verdict is no_decision;
    • candidate_ref matches ^release_candidate_[0-9a-f]{32}$;
    • the derived state is open | accepted | released | superseded.
  • agents/agent_detail_schema.json (new) and agents/agents_endpoints.json: the agent detail GET gains an optional agent_ref. That's the server-issued release reference, derived one-way from the agent id, which a portal needs to call the release routes.
  • scripts/content_class_lint.py: approves the fixed release_candidate_ reference pattern. That's the only lint change.
  • scripts/breaking_schema_allowlist.json: one exact acknowledgement. A client that validated agent detail responses against the previous closed schema could reject a response once the field is emitted. Neither SDK reads or validates that response.
  • The acceptance request description notes that a portal fills it from a candidate.
  • CHANGELOG; the regenerated manifest, parity and reachability report; tests.

Tests

  • scripts/breaking_schema_check.py --check: passed, one acknowledged change.

  • scripts/content_class_lint.py --report: OK.

  • scripts/schema_reachability.py --check: passed.

  • The parity and manifest checks: up to date.

  • The candidate, acceptance and agent contract tests: all passed. The 429 tests replay real limiter values, including a window of 1 per 10000000000 second.

  • make local-gate: PASSED.

  • Review: independent blockers-only reviews over eight rounds. Each finding was checked against the service and both SDKs and resolved; one earlier lint widening was reverted rather than kept. Final read recorded below.

Merge note: this PR and the production-reactive agent_ref PR share their base, and each regenerates the CHANGELOG, the parity manifest and the content-class manifest. Whichever lands second regenerates those three files on the new base.

🤖 Generated with Claude Code

… release reference

Adds three operations on /api/v1/projects/{project_id}/agents/{agent_ref}/release-candidates:
record a candidate after the client's release gate runs (a signed-in person or an SDK API
key with editor access and agent WRITE; service tokens are refused), list candidates, and
read one. The candidate record carries ids, digests, a closed gate-verdict enum and
timestamps only, with the same field shapes as the release acceptance it feeds. Same-body
replay returns the original record; a different body for the same version is a closed 409.
Denials are the closed release refusal envelope; the 429 body accepts the limiter's values.

The agent detail read gains an optional `agent_ref`: the server-issued release reference a
portal needs to call the release routes. The content-class lint approves the fixed
`release_candidate_` reference pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nimrodbusany
nimrodbusany requested a review from a team as a code owner November 25, 2026 13:33
nimrodbusany and others added 2 commits November 26, 2026 20:54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@nimrodbusany
nimrodbusany added this pull request to the merge queue Nov 27, 2026
Merged via the queue into develop with commit 40d4a86 Nov 27, 2026
18 checks passed
@nimrodbusany
nimrodbusany deleted the feat/release-candidates branch November 27, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant