Skip to content

Commit 4c0837c

Browse files
rcursoragent
andcommitted
v0.46.0: morph session namespace + flat morph eval surface
Vocabulary unification, part 1 — fourth release of the multi-phase "make morph intuitive" effort. Introduce `morph session` as the user-facing noun for what's stored internally as a Run+Trace pair, and flatten `morph eval` so cases and suites stop leaking from the storage model into the CLI. Added - `morph session list|show|record|export` — wraps `morph run list`, `morph run show`, `morph run record-session`, and the `morph inspect export` path under one coherent namespace. - Flat `morph eval add|show|rebuild` replaces the verbose `eval add-case`, `eval suite-show`, `eval suite-from-specs`. Identical semantics; same default-suite update behavior. - Specs: session.yaml (8), eval_flat.yaml (4), session_eval_deprecated_aliases.yaml (6). Changed - `morph --help` "SESSIONS" group replaces "INSPECT", listing session, inspect, show, head, identify, refs, annotate, annotations. The deprecated `morph run` namespace is hidden. - Doc + site + asset sweep: README, EVAL-DRIVEN, v0-spec, SECURITY, SESSION-TRACKING, AOE/OPENCODE/CURSOR setup guides, cursor + opencode rule files, opencode plugin script, and site/index.html rewritten to the new spellings. Freshly-installed opencode hooks now call `morph session record` directly. Deprecated (removal in v0.48) - `morph run {list, show, record-session}` — use `morph session`. - `morph eval {add-case, suite-show, suite-from-specs}` — use `morph eval {add, show, rebuild}`. Each deprecated invocation prints a one-line stderr `git`-style deprecation notice; behavior is otherwise unchanged. Tests - Workspace: 1244 / 1244 passing (1226 baseline + 18 new acceptance cases). Cucumber: 34 / 37 (3 skipped, 0 failed) — no change. - Quality gates clean: cargo build --workspace, cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 62a9c02 commit 4c0837c

27 files changed

Lines changed: 955 additions & 373 deletions

‎.cursor/rules/branch-merge-eval.mdc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ If the merge is rejected because metrics regressed:
5050

5151
1. Identify which metrics dropped below the parent thresholds.
5252
2. Fix the regression — improve the code, add missing acceptance cases via
53-
`morph eval add-case`, optimize performance.
53+
`morph eval add`, optimize performance.
5454
3. Re-run the eval suite (`morph eval run`), commit from the new run, and
5555
retry the merge.
5656

@@ -60,6 +60,6 @@ failure mode — Morph prevents it.
6060
## Creating branches
6161

6262
When branching for experimental work, write the acceptance cases that
63-
define "done" *first*, register them with `morph eval add-case`, and let
63+
define "done" *first*, register them with `morph eval add`, and let
6464
the merge gate enforce them. This sets explicit expectations and gives the
6565
eventual merge real evidence to evaluate.

‎.cursor/rules/eval-driven-development.mdc‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ fixture you would hand to a reviewer.
3535
Run *before* implementing:
3636

3737
```bash
38-
morph eval add-case morph-cli/tests/specs/<feature>.yaml
38+
morph eval add morph-cli/tests/specs/<feature>.yaml
3939
# or, for a cucumber feature:
40-
morph eval add-case morph-e2e/features/<flow>.feature
40+
morph eval add morph-e2e/features/<flow>.feature
4141
```
4242

4343
This appends an `EvalCase` to the default `EvalSuite` (creating one if none
@@ -47,9 +47,12 @@ the contract every future commit must satisfy.
4747
Sanity-check the suite:
4848

4949
```bash
50-
morph eval suite-show
50+
morph eval show
5151
```
5252

53+
> The older spellings `morph eval add-case` and `morph eval suite-show` keep
54+
> working through v0.47 with a stderr deprecation notice.
55+
5356
### 3. Watch the case fail
5457

5558
Run the eval suite and confirm the new case is *red*:
@@ -131,7 +134,7 @@ possible.
131134
## Checklist before you say "done"
132135

133136
- [ ] Acceptance case written (YAML or `.feature`) covering the change
134-
- [ ] `morph eval add-case` run; case visible in `morph eval suite-show`
137+
- [ ] `morph eval add` run; case visible in `morph eval show`
135138
- [ ] `morph eval run -- <test command>` produced a run with full metrics
136139
- [ ] `morph_eval_gaps` reports zero gaps
137140
- [ ] `morph commit --from-run <hash> --new-cases <ids>` recorded

‎CHANGELOG.md‎

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,104 @@ metrics — see `.cursor/rules/behavioral-commits.mdc`.
1616

1717
## [Unreleased]
1818

19+
## [0.46.0] — 2026-05-02
20+
21+
Vocabulary unification, part 1: introduce `morph session` as the
22+
user-facing namespace for what's stored internally as a Run+Trace
23+
pair, and flatten the `morph eval` surface so cases and suites
24+
stop leaking from the storage model into the CLI. Fourth release
25+
of the multi-phase "make morph intuitive" effort. The old
26+
`morph run *`, `morph eval add-case`, `morph eval suite-show`,
27+
and `morph eval suite-from-specs` spellings continue to work in
28+
v0.46 and v0.47 with a one-line stderr deprecation notice; they're
29+
removed in v0.48. No on-disk format changes.
30+
31+
### Added
32+
33+
- **`morph session` namespace.** Subsumes the most common
34+
`morph run *` operations plus the `morph inspect export` path
35+
under a single user-facing noun:
36+
37+
```text
38+
morph session list [--json] # was: morph run list
39+
morph session show <hash> [--json] [--with-trace] # was: morph run show
40+
morph session record [--prompt P --response R | # was: morph run record-session
41+
--messages JSON]
42+
[--model-name N --agent-id A]
43+
morph session export [--mode prompt-only|with-context|agentic]
44+
[--output FILE] [--model M]
45+
[--agent A] [--min-steps N] # was: morph inspect export
46+
```
47+
48+
All four subcommands share their implementations with the
49+
existing `morph_*` MCP tools (no MCP changes needed in v0.46).
50+
- **Flat `morph eval` surface.** New top-level subcommands that
51+
drop the Suite/Case noun split:
52+
53+
```text
54+
morph eval add <files>... [--suite H] [--no-default]
55+
[--no-set-default] # was: morph eval add-case
56+
morph eval show [--suite H] [--json] # was: morph eval suite-show
57+
morph eval rebuild <dirs>... [--no-set-default] # was: morph eval suite-from-specs
58+
```
59+
60+
Identical semantics to the v0.45 spellings (and the same
61+
policy-default-suite update behavior).
62+
- New specs: `session.yaml` (8 cases covering list / show /
63+
record / export and the messages-array form), `eval_flat.yaml`
64+
(4 cases covering add / show / rebuild including default-suite
65+
pickup), `session_eval_deprecated_aliases.yaml` (6 cases pinning
66+
the deprecation-notice text on every old command).
67+
68+
### Changed
69+
70+
- **`morph --help` "SESSIONS" group** replaces the old "INSPECT"
71+
group, listing `session, inspect, show, head, identify, refs,
72+
annotate, annotations`. The deprecated `morph run` namespace is
73+
hidden from `--help`. The flat `morph eval` subcommands inherit
74+
the existing `EVALS & METRICS` heading.
75+
- Doc + site sweep: every `morph run record-session` / `morph run
76+
list` / `morph eval add-case` / `morph eval suite-show` / `morph
77+
eval suite-from-specs` mention in `README.md`,
78+
`docs/EVAL-DRIVEN.md`, `docs/v0-spec.md`, `docs/SECURITY.md`,
79+
`docs/SESSION-TRACKING.md`, `docs/AOE-SETUP.md`,
80+
`docs/OPENCODE-SETUP.md`, `docs/CURSOR-SETUP.md`,
81+
`morph-cli/assets/opencode/AGENTS.md`,
82+
`morph-cli/assets/opencode/plugins/morph-record.ts`,
83+
`morph-cli/assets/cursor/rules/*.mdc`,
84+
`.cursor/rules/*.mdc`, and `site/index.html` rewritten to use
85+
the new spellings. The opencode hook script now calls
86+
`morph session record` directly so freshly-installed users get
87+
the new spelling without a re-setup.
88+
89+
### Deprecated
90+
91+
- **`morph run list`**, **`morph run show <hash>`**, **`morph run
92+
record-session ...`** — use `morph session list`,
93+
`morph session show`, `morph session record`. Removed in v0.48.
94+
- **`morph run record <file>`** — JSON-file ingest will be folded
95+
into `morph session import` in v0.48; for now the existing
96+
`morph_run_record` MCP path is unchanged.
97+
- **`morph eval add-case <files>`** — use `morph eval add <files>`.
98+
Removed in v0.48.
99+
- **`morph eval suite-show [--suite H] [--json]`** — use
100+
`morph eval show`. Removed in v0.48.
101+
- **`morph eval suite-from-specs <dirs>`** — use
102+
`morph eval rebuild`. Removed in v0.48.
103+
104+
Each deprecated invocation prints a one-line stderr notice in
105+
the `git`-style format:
106+
107+
```text
108+
warning: `morph eval add-case` is deprecated; use `morph eval add` instead (removed in v0.48).
109+
```
110+
111+
### Tests
112+
113+
- Workspace **1244 / 1244 passing** (1226 baseline + 18 new
114+
acceptance cases). Cucumber 34 / 37 (3 skipped, 0 failed) — no
115+
change.
116+
19117
## [0.45.0] — 2026-05-02
20118

21119
Inspection collapse: three near-synonymous CLIs (`morph trace`,
@@ -1237,7 +1335,8 @@ Three coordinated changes to repo setup, adoption, and migration.
12371335
- 15 new YAML acceptance spec cases in the default eval suite:
12381336
`init_at_latest:*` ×4, `init_in_git_dir:*` ×6, `upgrade:*` ×5.
12391337

1240-
[Unreleased]: https://github.com/r/morph/compare/v0.45.0...HEAD
1338+
[Unreleased]: https://github.com/r/morph/compare/v0.46.0...HEAD
1339+
[0.46.0]: https://github.com/r/morph/compare/v0.45.0...v0.46.0
12411340
[0.45.0]: https://github.com/r/morph/compare/v0.44.0...v0.45.0
12421341
[0.44.0]: https://github.com/r/morph/compare/v0.43.0...v0.44.0
12431342
[0.43.0]: https://github.com/r/morph/compare/v0.42.2...v0.43.0

‎Cargo.lock‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ resolver = "2"
33
members = ["morph-core", "morph-cli", "morph-mcp", "morph-serve", "morph-e2e"]
44

55
[workspace.package]
6-
version = "0.45.0"
6+
version = "0.46.0"

‎README.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,16 @@ morph fetch <remote>
155155
morph pull <remote> <branch> [--merge]
156156
morph sync [<branch>]
157157

158-
morph eval add-case <files>... | suite-from-specs <dirs>... | suite-show [--suite H] [--json]
158+
morph eval add <files>... | rebuild <dirs>... | show [--suite H] [--json]
159159
morph eval run -- <cmd>... | from-output [--runner R] [--record] <file> | record <file.json>
160160
morph eval gaps [--json] [--fail-on-gap]
161161
morph policy init|show|set|require-metrics|set-default-eval ...
162162
morph certify --metrics(-file) ... [--commit <hash>] [--runner ...]
163163
morph gate [--commit <hash>] [--json]
164164

165+
morph session list | show <hash> [--with-trace] | record [--prompt ... --response ...]
166+
morph session export [--mode prompt-only|with-context|agentic] [--output FILE]
167+
165168
morph inspect summary | recent | show <hash> | diagnose [<hash>] | export ...
166169
| stats <trace_hash> | preview <run_hash>
167170
| task <ref> | target <ref> | artifact <ref>
@@ -188,9 +191,9 @@ The IDE hooks parse the agent's full transcript (tool calls, file reads/edits, s
188191
- `morph inspect summary` — repo-level overview of recorded runs.
189192
- `morph inspect show <run-hash>` — grouped steps for one run (or pass a trace hash for raw events).
190193
- `morph inspect recent` / `morph inspect task <ref>` / `morph inspect artifact <ref>` — structured task views for replay or eval generation.
191-
- `morph run record-session --prompt "..." --response "..."` — record a session manually.
194+
- `morph session record --prompt "..." --response "..."` — record a session manually (v0.46+; was `morph run record-session`).
192195

193-
The older `morph trace` / `morph tap` / `morph traces` spellings still work in v0.45 and v0.46 with a deprecation notice; they're removed in v0.47.
196+
The older `morph trace` / `morph tap` / `morph traces` spellings still work in v0.45 and v0.46 with a deprecation notice; they're removed in v0.47. Likewise `morph run` / `morph eval add-case` / `morph eval suite-show` / `morph eval suite-from-specs` work in v0.46 and v0.47 and are removed in v0.48; new code should use `morph session` and the flat `morph eval add` / `show` / `rebuild`.
194197

195198
See [docs/SESSION-TRACKING.md](docs/SESSION-TRACKING.md).
196199

‎docs/AOE-SETUP.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ on_create = [
4747
"morph add . && morph commit -m \"aoe-create: ${AOE_INSTANCE_ID:-unknown}\" --allow-empty-metrics 2>/dev/null || true",
4848
]
4949
on_launch = [
50-
"morph run record-session --prompt \"aoe-launch instance=${AOE_INSTANCE_ID:-unknown} branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)\" --response \"\" --model-name aoe --agent-id aoe 2>/dev/null || true",
50+
"morph session record --prompt \"aoe-launch instance=${AOE_INSTANCE_ID:-unknown} branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)\" --response \"\" --model-name aoe --agent-id aoe 2>/dev/null || true",
5151
]
5252
on_destroy = [
5353
"morph add . && morph commit -m \"aoe-destroy: ${AOE_INSTANCE_ID:-unknown}\" --allow-empty-metrics 2>/dev/null || true",
54-
"morph run record-session --prompt \"aoe-destroy instance=${AOE_INSTANCE_ID:-unknown}\" --response \"\" --model-name aoe --agent-id aoe 2>/dev/null || true",
54+
"morph session record --prompt \"aoe-destroy instance=${AOE_INSTANCE_ID:-unknown}\" --response \"\" --model-name aoe --agent-id aoe 2>/dev/null || true",
5555
]
5656
```
5757

@@ -162,10 +162,10 @@ This repo has unreviewed hooks. Trust them?
162162
morph init --quiet 2>/dev/null || true
163163
morph add . && morph commit -m "aoe-create: ..." ...
164164
on_launch:
165-
morph run record-session --prompt "aoe-launch ..." ...
165+
morph session record --prompt "aoe-launch ..." ...
166166
on_destroy:
167167
morph add . && morph commit -m "aoe-destroy: ..." ...
168-
morph run record-session --prompt "aoe-destroy ..." ...
168+
morph session record --prompt "aoe-destroy ..." ...
169169
[T]rust / [r]eject?
170170
```
171171

@@ -188,9 +188,9 @@ After `morph setup aoe` and `aoe add .`:
188188
morph log --limit 5
189189
# Expect to see "aoe-create: <instance-id>" in the latest commit.
190190

191-
# Confirm at least one Run was recorded on launch:
192-
morph run list | head
193-
# Expect a recent Run with prompt starting "aoe-launch instance=...".
191+
# Confirm at least one session was recorded on launch:
192+
morph session list | head
193+
# Expect a recent session with prompt starting "aoe-launch instance=...".
194194

195195
# When you tear the session down with `aoe rm`, expect another commit
196196
# ("aoe-destroy: ...") followed by an "aoe-destroy" Run.

‎docs/CURSOR-SETUP.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ morph commit -m "implement feature" --from-run <run_hash> --new-cases spec:my_ca
151151

152152
For commits that genuinely have no test results (rebases, content-only changes), pass `--allow-empty-metrics` (or `morph_commit { allow_empty_metrics: true }`). The flag is audited in the trace.
153153

154-
`--pipeline` and `--eval-suite` remain optional. When no eval suite is supplied, Morph picks up `policy.default_eval_suite` so the suite registered by `morph eval add-case` flows into every commit automatically.
154+
`--pipeline` and `--eval-suite` remain optional. When no eval suite is supplied, Morph picks up `policy.default_eval_suite` so the suite registered by `morph eval add` (was `morph eval add-case` pre-v0.46) flows into every commit automatically.
155155

156156
---
157157

‎docs/EVAL-DRIVEN.md‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Example (`specs/login.yaml`):
6060
## 2. Register the case in the eval suite
6161
6262
```bash
63-
morph eval add-case specs/login.yaml
63+
morph eval add specs/login.yaml
6464
```
6565

6666
The first call creates a fresh `EvalSuite`, appends the case, and wires
@@ -70,20 +70,24 @@ the same suite (deduping by case `id`).
7070
For bulk ingestion of an entire directory tree (mixed YAML + cucumber):
7171

7272
```bash
73-
morph eval suite-from-specs specs/
73+
morph eval rebuild specs/
7474
```
7575

76-
`suite-from-specs` rebuilds the suite from scratch — useful when the
77-
canonical spec lives in version control and you want the suite to track
78-
it exactly.
76+
`rebuild` rebuilds the suite from scratch — useful when the canonical
77+
spec lives in version control and you want the suite to track it
78+
exactly.
7979

8080
Sanity-check the suite at any time:
8181

8282
```bash
83-
morph eval suite-show # human-readable
84-
morph eval suite-show --json # structured for tooling
83+
morph eval show # human-readable
84+
morph eval show --json # structured for tooling
8585
```
8686

87+
> The older spellings `morph eval add-case`, `morph eval suite-from-specs`,
88+
> and `morph eval suite-show` continue to work in v0.46 and v0.47 with a
89+
> stderr deprecation notice; they're removed in v0.48.
90+
8791
## 3. Watch the case fail
8892

8993
Run the eval suite via `morph eval run`. This shells out, captures stdout,
@@ -260,9 +264,9 @@ analogous to a text conflict in Git, but at the semantic level.
260264

261265
| CLI | MCP tool | Purpose |
262266
|-----|----------|---------|
263-
| `morph eval add-case <file>...` | `morph_add_eval_case` | Add YAML/cucumber cases to the default suite. |
264-
| `morph eval suite-from-specs <dir>` | `morph_eval_suite_from_specs` | Rebuild the default suite from a directory. |
265-
| `morph eval suite-show [--suite H] [--json]` | `morph_eval_suite_show` | Print the cases in a suite. |
267+
| `morph eval add <file>...` | `morph_add_eval_case` | Add YAML/cucumber cases to the default suite (was `eval add-case`). |
268+
| `morph eval rebuild <dir>` | `morph_eval_suite_from_specs` | Rebuild the default suite from a directory (was `eval suite-from-specs`). |
269+
| `morph eval show [--suite H] [--json]` | `morph_eval_suite_show` | Print the cases in a suite (was `eval suite-show`). |
266270
| `morph eval run -- <cmd>` | `morph_eval_run` | Run a test command and record a metric-bearing `Run`. |
267271
| `morph eval from-output [--runner R] [--record] <file>` | `morph_eval_from_output` | Parse captured stdout into metrics; optional `--record` writes a `Run`. |
268272
| `morph eval record <file.json>` | `morph_record_eval` | Ingest precomputed `{"metrics": {...}}` JSON. |

‎docs/OPENCODE-SETUP.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ To reference it from `opencode.json`, ensure the instructions array includes it:
7676
OpenCode supports [plugins](https://open-code.ai/docs/en/plugins) that hook into session lifecycle events. `morph setup opencode` installs a plugin at `.opencode/plugins/morph-record.ts` that:
7777

7878
- Tracks prompts and responses via `message.updated` events
79-
- On `session.idle`, calls `morph run record-session` to persist the turn as a Morph Run + Trace
79+
- On `session.idle`, calls `morph session record` to persist the turn as a Morph Run + Trace (was `morph run record-session` pre-v0.46)
8080

8181
This is **best-effort** supplementary recording. The primary recording path is agent-driven (the agent calls `morph_record_session` via MCP as instructed in `AGENTS.md`). The plugin catches turns where the agent doesn't call the tool.
8282

@@ -143,7 +143,7 @@ If OpenCode detects the MCP server but `.morph/runs/` stays empty after a prompt
143143

144144
2. **Test recording manually from the project root:**
145145
```bash
146-
morph run record-session --prompt "test" --response "test"
146+
morph session record --prompt "test" --response "test"
147147
```
148148
This should print a 64-character hash. If it errors, fix the reported issue first (usually a missing `.morph/` directory or `morph` not on PATH).
149149

0 commit comments

Comments
 (0)