Commit 08771e6
## Summary
Resolves the echidna ↔ echidnabot GraphQL contract mismatch surfaced in
#180 by adding the three operations the echidnabot client expects, plus
surfacing the typed REST `/api/verify` taxonomy (`outcome`, optional
`mode` / `smtStatus`) through GraphQL so future clients no longer need
to round-trip via REST to disambiguate Timeout vs NoProofFound.
## New GraphQL operations
| Operation | Kind | Signature | Returns |
|---|---|---|---|
| `verifyProof` | mutation | `(prover: String!, content: String!)` |
`VerifyProofResult!` |
| `suggestTactics` | mutation | `(prover: String!, context: String!,
goalState: String!)` | `[SuggestedTactic!]!` |
| `proverStatus` | query | `(prover: String!)` | `ProverStatusInfo!` |
## New GraphQL types
- `VerifyOutcome` (enum: `PROVED` / `NO_PROOF_FOUND` / `INVALID_INPUT` /
`UNSUPPORTED_FEATURE` / `TIMEOUT` / `INCONSISTENT_PREMISES` /
`PROVER_ERROR` / `SYSTEM_ERROR`) — mirrors the REST `/api/verify`
`outcome` field
- `VerifyProofResult` — `status` + `message` + `proverOutput` +
`durationMs` + `artifacts` (echidnabot client's existing
`VerifyProofData` shape), **plus** `outcome` + `mode` + `smtStatus` (the
typed REST taxonomy newly threaded through)
- `SuggestedTactic` — `tactic` + `confidence` + `explanation` (matches
echidnabot's `TacticSuggestionData`)
- `ProverStatusInfo` — `available` + `message`
## Breaking change
The existing **query** `suggestTactics(proofId, limit)` has been renamed
to `suggestTacticsByProofId(proofId, limit)` to free the
`suggestTactics` name for the new **mutation** the echidnabot client
expects.
- Argument shape and return type (`[Tactic!]!`) are unchanged.
- Any consumer issuing `query { suggestTactics(proofId: ..., limit: ...)
}` must update the operation name to `suggestTacticsByProofId`. The new
`suggestTactics(prover, context, goalState)` on `MutationRoot` is the
only `suggestTactics` field after this PR.
- `interfaces/README.md` updated to reflect the new GraphQL surface.
## DRY
- `verifyProof` delegates to the same `ProverFactory::create` +
`parse_string` + `verify_proof` chain that backs REST `/api/verify`, so
behaviour matches by construction.
- `suggestTactics` (for-goal) tries the Julia ML coprocessor first and
falls back to backend-native suggestions — same pattern as the existing
session-based `suggest_tactics` path, just without requiring a
`proof_id`.
## Tests
`+8` in `src/interfaces/graphql/schema.rs::tests`:
1. `verify_outcome_from_rest_str_covers_taxonomy` — every REST taxon
round-trips to a distinct enum variant
2. `verify_outcome_loose_status_matches_client` — `loose_status()`
aligns with echidnabot's `parse_proof_status`
3. `verify_proof_mutation_unknown_prover_returns_system_error` —
end-to-end execution; structured `SYSTEM_ERROR` outcome
4. `prover_status_unknown_prover_reports_unavailable` — query path;
`available: false` + populated message
5. `suggest_tactics_mutation_unknown_prover_errors` — top-level GraphQL
error (non-null list has no in-band error slot)
6. `suggest_tactics_is_a_mutation` — guard against accidental kind
drift; `suggestTactics` on QueryRoot must not resolve
7. `suggest_tactics_by_proof_id_is_a_query` — renamed legacy query still
registered on QueryRoot
8. `introspection_exposes_all_three_new_operations` — the contract
assertion #180 asked for
Baseline lib tests unchanged: **1070 passed** (`cargo test --lib -p
echidna`).
## Don't-touched
- GraphQL playground / introspection guards
- Existing mutations `submitProof` / `applyTactic` / `cancelProof`
- Existing queries `provers` / `proofState` / `listProofs` / `health`
- REST handlers (already had the typed taxonomy; this PR is
GraphQL-only)
- echidnabot client (separate follow-up to consume the new typed
`outcome`)
## Test plan
- [x] `cargo build -p echidna-graphql` — clean
- [x] `cargo test -p echidna-graphql` — 8/8 new tests pass
- [x] `cargo test --lib -p echidna` — 1070 baseline tests still pass
- [ ] Manual: spin up server, hit `verifyProof` + `suggestTactics` +
`proverStatus` from echidnabot client in `EchidnaApiMode::Graphql`
(deferred — needs a follow-up in echidnabot for the typed `outcome`
consumption)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e045c20 commit 08771e6
3 files changed
Lines changed: 688 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
597 | 682 | | |
598 | 683 | | |
599 | 684 | | |
| |||
0 commit comments