|
| 1 | +Feature: Hosted inspection workflow |
| 2 | + Teams use the Morph hosted service to inspect commits, |
| 3 | + runs, traces, pipelines, and behavioral status through |
| 4 | + a stable HTTP/API surface. |
| 5 | + |
| 6 | + Scenario: Team inspects a certified commit through the hosted service |
| 7 | + Given a morph repo |
| 8 | + And a file "src/main.py" with content "print('hello')" |
| 9 | + When I run "morph add ." |
| 10 | + Then the last command succeeded |
| 11 | + When I run "morph commit -m initial --metrics {\"acc\":0.95,\"f1\":0.88}" |
| 12 | + Then the last command succeeded |
| 13 | + When I capture the last output as "commit_hash" |
| 14 | + When I create a JSON file "metrics.json" with metrics "acc=0.95,f1=0.88" |
| 15 | + When I run "morph certify --metrics-file metrics.json --runner ci-bot" |
| 16 | + Then the last command succeeded |
| 17 | + When I start the morph server on port "19871" |
| 18 | + And I query the server at "/api/repos/default/commits/<commit_hash>" |
| 19 | + Then the JSON response field "behavioral_status.certified" equals "true" |
| 20 | + And the JSON response field "behavioral_status.certification.runner" equals "ci-bot" |
| 21 | + And the JSON response field "eval_contract.observed_metrics.acc" equals "0.95" |
| 22 | + When I query the server at "/api/repos/default/summary" |
| 23 | + Then the JSON response field "commit_count" equals "1" |
| 24 | + And I stop the morph server |
| 25 | + |
| 26 | + Scenario: Team inspects merge status through the hosted service |
| 27 | + Given a morph repo |
| 28 | + And the identity pipeline and a minimal eval suite exist |
| 29 | + And a file "a.txt" with content "aaa" |
| 30 | + When I run "morph add ." |
| 31 | + Then the last command succeeded |
| 32 | + When I run "morph pipeline create prog.json" |
| 33 | + And I capture the last output as "prog_hash" |
| 34 | + When I run "morph commit -m main-commit --pipeline <prog_hash> --metrics {\"acc\":0.8}" |
| 35 | + Then the last command succeeded |
| 36 | + When I run "morph branch feature" |
| 37 | + And I run "morph checkout feature" |
| 38 | + Then the last command succeeded |
| 39 | + When I run "morph commit -m feature-commit --pipeline <prog_hash> --metrics {\"acc\":0.85}" |
| 40 | + Then the last command succeeded |
| 41 | + When I run "morph checkout main" |
| 42 | + Then the last command succeeded |
| 43 | + When I run "morph merge feature -m merged --pipeline <prog_hash> --metrics {\"acc\":0.9}" |
| 44 | + Then the last command succeeded |
| 45 | + When I capture the last output as "merge_hash" |
| 46 | + When I start the morph server on port "19872" |
| 47 | + And I query the server at "/api/repos/default/commits/<merge_hash>" |
| 48 | + Then the JSON response field "behavioral_status.is_merge" equals "true" |
| 49 | + And the JSON response field "behavioral_status.merge_status.dominates_a" is present |
| 50 | + And the JSON response field "behavioral_status.merge_status.dominates_b" is present |
| 51 | + And I stop the morph server |
| 52 | + |
| 53 | + Scenario: Team inspects extracted pipeline and source run |
| 54 | + Given a morph repo |
| 55 | + And a file "code.py" with content "print('hi')" |
| 56 | + When I run "morph add ." |
| 57 | + Then the last command succeeded |
| 58 | + When I run record-session with prompt "Build feature X" and response "Feature X built" |
| 59 | + Then the last command succeeded |
| 60 | + When I capture the last output as "run_hash" |
| 61 | + When I run "morph pipeline extract --from-run <run_hash>" |
| 62 | + Then the last command succeeded |
| 63 | + When I capture the last output as "pipeline_hash" |
| 64 | + When I run "morph commit -m snap" |
| 65 | + Then the last command succeeded |
| 66 | + When I start the morph server on port "19873" |
| 67 | + And I query the server at "/api/repos/default/runs/<run_hash>" |
| 68 | + Then the JSON response field "agent.id" is present |
| 69 | + And the JSON response field "trace" is present |
| 70 | + When I query the server at "/api/repos/default/pipelines/<pipeline_hash>" |
| 71 | + Then the JSON response field "provenance.method" equals "extracted" |
| 72 | + And the JSON response field "provenance.derived_from_run" equals "<run_hash>" |
| 73 | + And the JSON response field "node_count" equals "2" |
| 74 | + And I stop the morph server |
| 75 | + |
| 76 | + Scenario: Invalid repo or missing object returns clear service error |
| 77 | + Given a morph repo |
| 78 | + When I start the morph server on port "19874" |
| 79 | + And I query the server at "/api/repos/default/commits/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
| 80 | + Then the JSON response code is "404" |
| 81 | + And the JSON response field "code" equals "not_found" |
| 82 | + When I query the server at "/api/repos/nonexistent/summary" |
| 83 | + Then the JSON response code is "404" |
| 84 | + And the JSON response field "code" equals "repo_not_found" |
| 85 | + When I query the server at "/api/repos/default/commits/not-a-hash" |
| 86 | + Then the JSON response code is "400" |
| 87 | + And the JSON response field "code" equals "bad_hash" |
| 88 | + And I stop the morph server |
0 commit comments