Skip to content

feat: add cueapi executions replay / verify / verification-pending#31

Merged
govindkavaturi-art merged 1 commit into
mainfrom
feat/cli-executions-replay-and-verify
May 4, 2026
Merged

feat: add cueapi executions replay / verify / verification-pending#31
govindkavaturi-art merged 1 commit into
mainfrom
feat/cli-executions-replay-and-verify

Conversation

@mikemolinet
Copy link
Copy Markdown
Collaborator

Summary

Drains 3 entries from cueapi-cli #25's endpoints_missing:

Command Endpoint
cueapi executions replay <id> POST /v1/executions/{id}/replay
cueapi executions verification-pending <id> POST /v1/executions/{id}/verification-pending
cueapi executions verify <id> [--valid | --invalid] [--reason \"...\"] POST /v1/executions/{id}/verify

All three slot into the existing cueapi executions group — no new top-level surface, the manifest gap closes by adding subcommands.

Design notes

  • verify is tri-state for valid. --valid sends True, --invalid sends False, neither sends an empty body. The empty-body path matches the server's pre-schema legacy callers (server treats absent body as valid=true). Pinned by test_executions_verify_default_omits_valid_field so a refactor can't silently start always-sending the field.

  • --reason length cap (500) enforced client-side. The user gets a clean error before any HTTP round-trip. Matches the server's hard limit from VerifyRequest.

  • replay carries forward payload_override. Server-side behavior (handled in replay_execution at app/routers/executions.py); the CLI surfaces the new execution_id so users can chain commands.

  • Helpful 409 messages. replay 409 produces "in flight" / "in progress" copy instead of raw status code (matches server's execution_in_flight error code). verify 409 produces "cannot transition from current outcome_state."

Tests

12 new (36 → 48 total). Mock-based body capture using the same _FakeClient pattern as PR #26-#30. Pinned behaviors:

  • replay POSTs empty body
  • replay 409 in-flight produces helpful error
  • verification-pending POSTs empty body
  • verify default sends {} (no valid key)
  • verify --invalid sends {valid: false, reason: \"...\"}
  • verify --valid sends {valid: true}
  • --reason >500 rejected client-side with clear message
  • 404 surfaces "not found"
  • executions --help includes the 3 new subcommands

All 48 pass locally.

No hosted-PR dependency

All 3 endpoints already shipped on prod (per app/routers/executions.py). Pure CLI catch-up.

Test plan

  • python3 -m pytest tests/test_cli.py -q → 48 passed
  • Manual smoke against staging:
    • cueapi executions replay <terminal-exec-id> → returns new execution_id
    • cueapi executions replay <in-flight-exec-id> → 409 with helpful copy
    • cueapi executions verification-pending <id> → outcome_state=verification_pending
    • cueapi executions verify <id> → outcome_state=verified_success
    • cueapi executions verify <id> --invalid --reason \"x\" → outcome_state=verification_failed

Parity Impact

Closes 3 entries from endpoints_missing in cueapi-cli #25's parity-manifest.json:

  • POST /v1/executions/{id}/replay
  • POST /v1/executions/{id}/verification-pending
  • POST /v1/executions/{id}/verify

Manifest update follows after #25 merges to main.

Companion PRs

  • #26 — port for hosted #589 + #590
  • #27 — executions-list filter parity
  • #28cueapi agents command group
  • #29cueapi messages command group
  • #30 — remaining create + update flags

🤖 Generated with Claude Code

Copy link
Copy Markdown
Member

@govindkavaturi-art govindkavaturi-art left a comment

Choose a reason for hiding this comment

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

Replay/verify/verification-pending commands with proper terminal-state semantics. The 409 "in-flight" handling on replay surfaces the right error message instead of dumping HTTP code. Approve.

@govindkavaturi-art
Copy link
Copy Markdown
Member

@mikemolinet — this PR is approved but has conflict with main since #28 (cueapi agents command group) just landed. Conflict is in cueapi/cli.py (new command groups added at the end of the file collide) and tests/test_cli.py (test class definitions overlap — _AgentsClient from #28 vs your test client class).

Action: rebase onto main, keep both class definitions / both command groups.

git fetch origin main
git rebase origin/main
# In tests/test_cli.py: keep BOTH _AgentsClient AND your test class
# In cueapi/cli.py: keep BOTH the agents group from #28 AND your additions
git add -u
git rebase --continue
git push --force-with-lease

I'll re-merge as soon as it's green. Sorry for the cascade — it's the cost of merging the agents group first; the rest of your stack just needs a quick rebase. ✅

@mikemolinet mikemolinet force-pushed the feat/cli-executions-replay-and-verify branch 5 times, most recently from 8dd4e43 to 2091ca9 Compare May 4, 2026 19:15
…(rebase v6)

3 new subcommands. verify tri-state. --reason capped at 500 chars.
Tests: 12 new (109+12=121 total).
Rebased against main 2026-05-04 (post-#26, #27, #28, #30, #33).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@mikemolinet mikemolinet force-pushed the feat/cli-executions-replay-and-verify branch from 2091ca9 to f5cdd6f Compare May 4, 2026 19:17
@govindkavaturi-art govindkavaturi-art merged commit 3601b2e into main May 4, 2026
3 checks passed
mikemolinet added a commit that referenced this pull request May 4, 2026
4 commands. Tests: 18 new (115 → 133 total).
Rebased against main 2026-05-04 (post-#26, #27, #28, #30, #31, #33).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
govindkavaturi-art pushed a commit that referenced this pull request May 4, 2026
4 commands. Tests: 18 new (115 → 133 total).
Rebased against main 2026-05-04 (post-#26, #27, #28, #30, #31, #33).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
govindkavaturi-art pushed a commit that referenced this pull request May 6, 2026
…38)

Updates `parity-manifest.json` to reflect the 8-PR parity wave landed today.

`commands_covered` block extended with the new commands (now 35 total):
- 3 new executions subcommands (replay / verification-pending / verify) from PR #31
- 9 new agents commands (messaging primitive identity surface) from PR #28
- 4 new messages commands (messaging primitive lifecycle) from PR #29
- 2 new workers commands (list / delete) from PR #33
- 2 new `key webhook-secret` subcommands from PR #33
- `--send-at` flag on `cueapi fire` from PR #37 (in flight, depends on hosted #618)

`command_drift`:
- `cueapi create`: 6 new flags moved missing → covered (--require-payload-override, --required-keys, --delivery, --alerts, --catch-up, --verification, --on-success-fire). Only `--transport` remains in missing — flagged as refactor scope, not a simple flag-add.
- `cueapi update`: 9 new flags moved missing → covered. missing_flags now empty.
- `cueapi fire`: new entry capturing the 3 covered flags including --send-at.
- `cueapi executions get`: missing_display cleared (PR #589 ported in #26).
- `cueapi executions list`: 4 new filters moved missing → covered (no remaining gap).

`endpoints_missing`:
- All 8 entries from the seed manifest cleared except `POST /v1/worker/heartbeat`.
- That endpoint stays in missing with documented rationale: cueapi-worker is
  the canonical wrapper with proper heartbeat-loop semantics. Direct CLI
  registration is redundant. Decision documented in the manifest entry +
  cueapi workers group docstring.

`ported_pr_history`:
- 9 entries with merge timestamps, replacing the pre-port forward-looking
  notes.
- Each entry cross-references the cueapi-cli PR + the hosted PR (when
  applicable) + the merge timestamp for forensics.

`cli_version_at_audit`: bumped 0.1.x → 0.2.x to reflect the new surface
area.

`last_full_audit`: kept at 2026-05-04 (this update is the post-merge
snapshot of the 2026-05-04 audit, not a fresh audit).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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