Skip to content

feat: port 10 missing endpoints for feature parity with hosted service#15

Merged
govindkavaturi-art merged 1 commit intomainfrom
feat/execution-parity
Apr 6, 2026
Merged

feat: port 10 missing endpoints for feature parity with hosted service#15
govindkavaturi-art merged 1 commit intomainfrom
feat/execution-parity

Conversation

@govindkavaturi-art
Copy link
Copy Markdown
Member

Summary

Ports 10 endpoints from the hosted service to cueapi-core so self-hosters have full execution management.

Endpoints added

# Endpoint Purpose
1 GET /v1/executions List with filters (status, cue_id, outcome_state)
2 GET /v1/executions/{id} Get single execution
3 POST /v1/executions/{id}/heartbeat Worker lease extension
4 POST /v1/executions/{id}/replay Replay failed execution
5 POST /v1/executions/{id}/verify Mark verified
6 POST /v1/executions/{id}/verification-pending Mark pending verification
7 PATCH /v1/executions/{id}/evidence Append evidence
8 POST /v1/cues/{id}/fire Manual fire
9 POST /v1/auth/session/refresh Refresh JWT
10 PATCH /v1/auth/me Update profile

Model changes

15 columns added to Execution: outcome_state, outcome_deadline_, triggered_by, last_heartbeat_at, evidence_ fields

Tests

28 new tests, 389 total passing.

🤖 Generated with Claude Code

Endpoints added:
1. GET /v1/executions — list with pagination, status/cue_id/outcome filters
2. GET /v1/executions/{id} — get single execution
3. POST /v1/executions/{id}/heartbeat — worker lease extension
4. POST /v1/executions/{id}/replay — replay failed execution
5. POST /v1/executions/{id}/verify — mark outcome as verified
6. POST /v1/executions/{id}/verification-pending — mark pending verification
7. PATCH /v1/executions/{id}/evidence — append evidence after outcome
8. POST /v1/cues/{id}/fire — manually fire a cue
9. POST /v1/auth/session/refresh — refresh session JWT
10. PATCH /v1/auth/me — update user profile

Also added 15 columns to Execution model: outcome_state, outcome_deadline,
triggered_by, last_heartbeat_at, evidence_* fields.

28 new tests covering all 10 endpoints (happy path, auth, 404, validation).
389 total tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@govindkavaturi-art govindkavaturi-art enabled auto-merge (squash) April 6, 2026 01:29
Copy link
Copy Markdown
Collaborator

@argus-qa-ai argus-qa-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by Argus QA — cueapi-core tests passing.

@govindkavaturi-art govindkavaturi-art merged commit 6befe5b into main Apr 6, 2026
4 checks passed
auto-merge was automatically disabled April 6, 2026 01:35

Pull Request is not mergeable

govindkavaturi-art pushed a commit that referenced this pull request Apr 17, 2026
Ports the outcome-verification feature from the hosted monorepo into
cueapi-core and fixes the partial /verify endpoint that PR #15 left
behind.

Schema:
- VerificationMode enum (none, require_external_id, require_result_url,
  require_artifacts, manual) + VerificationPolicy on CueCreate/CueUpdate.
- OutcomeRequest accepts evidence fields inline (external_id, result_url,
  result_ref, result_type, summary, artifacts). Legacy shape still works.

Model:
- Migration 017: verification_mode column on cues (String(50), nullable,
  CHECK-constrained enum). NULL == 'none'. evidence_* columns already
  existed from PR #15 and are reused.

Services:
- outcome_service computes outcome_state from (success, mode, evidence).
  Missing required evidence -> verification_failed. Manual mode parks in
  verification_pending. Failure bypasses verification entirely.
- cue_service _check_transport_verification_combo rejects worker+evidence
  at create and update. Lifted in a follow-up PR once cueapi-worker 0.3.0
  lands on PyPI.

Router:
- POST /v1/executions/{id}/verify now accepts {valid: bool, reason: str?}.
  valid=true preserves legacy behavior; valid=false -> verification_failed
  with reason recorded on evidence_summary. Accepted starting states
  expanded to include reported_failure. Empty body defaults to valid=true
  for full backward compat.

Tests:
- 35 new tests across 4 files (verification_modes, transport_verification_combo,
  outcome_evidence, verify_endpoints).
- Amended test_execution_parity.py::test_verify_wrong_state to use a
  pre-outcome state (reported_failure is now a valid starting state).
- Full-suite delta: +35 passing, 0 new failures. Pre-existing SDK-integration
  failures (cueapi Python package not installed locally) unchanged.

Alert firing for verification_failed deferred to PR 2 (alerts feature).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants