|
10 | 10 |
|
11 | 11 | ## Pre-locked decisions |
12 | 12 |
|
13 | | -| # | Decision | Source | |
14 | | -| --- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | |
15 | | -| L.1 | **Moat-A clean** — `affected-tests` recipe + optional CLI alias `codemap affected` (outcome alias cap: 5 total — audit alias budget). | [Moat A](../roadmap.md#moats-load-bearing) | |
16 | | -| L.2 | Algorithm: reverse BFS on `dependencies` from changed files → filter test paths via `test_suites.file_path` and configurable globs. | Uses existing substrate | |
17 | | -| L.3 | **Stdin support** — accept changed paths from `git diff --name-only` (same ergonomics as CI scripts). | CLI ergonomics | |
18 | | -| L.4 | Not a verdict — output is file paths only; CI composes exit policy. | Moat A | |
| 13 | +| # | Decision | Source | |
| 14 | +| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------ | |
| 15 | +| L.1 | **Moat-A clean** — `affected-tests` recipe satisfies the agent surface; **`query_recipe`** is the MCP/HTTP path. Optional dedicated CLI verb **`codemap affected`** for CI (`stdin` / git path discovery) — not a 6th outcome alias. | [Moat A](../roadmap.md#moats-load-bearing) | |
| 16 | +| L.2 | Algorithm: reverse BFS on `dependencies` from changed files → filter test paths via `test_suites.file_path` and configurable globs. | Uses existing substrate | |
| 17 | +| L.3 | **Stdin support** — accept changed paths from `git diff --name-only` (same ergonomics as CI scripts). | CLI ergonomics | |
| 18 | +| L.4 | Not a verdict — output is file paths only; CI composes exit policy. | Moat A | |
19 | 19 |
|
20 | 20 | --- |
21 | 21 |
|
|
37 | 37 |
|
38 | 38 | --- |
39 | 39 |
|
40 | | -## CLI alias |
| 40 | +## CLI verb (CI) |
41 | 41 |
|
42 | 42 | ```bash |
43 | | -codemap affected --json # git diff vs HEAD |
| 43 | +codemap affected --json # working tree vs HEAD |
44 | 44 | git diff --name-only origin/main | codemap affected --stdin --json |
45 | 45 | ``` |
46 | 46 |
|
47 | | -Implement in `src/cli/aliases.ts` if alias budget allows; else recipe-only with documented shell wrapper. |
| 47 | +Dedicated `cmd-affected.ts` (not an outcome alias — 5-alias cap unchanged). Shipped as **`codemap affected`**, not `aliases.ts`. |
| 48 | + |
| 49 | +## Agent surface (Moat A) |
| 50 | + |
| 51 | +No dedicated MCP tool required — agents call **`query_recipe`** with `recipe: "affected-tests"` and `params.changed_files` (ASCII RS between paths when multiple). The recipe is the Moat-A substrate; the CLI verb is CI ergonomics only. |
48 | 52 |
|
49 | 53 | --- |
50 | 54 |
|
51 | 55 | ## Implementation steps |
52 | 56 |
|
53 | 57 | 1. Recipe SQL + frontmatter + golden query fixture |
54 | | -2. CLI stdin handling in `cmd-query` or dedicated thin `cmd-affected.ts` |
| 58 | +2. CLI stdin handling in dedicated `cmd-affected.ts` |
55 | 59 | 3. Document test-file conventions in recipe `.md` |
56 | 60 | 4. Optional GitHub Action input `mode: affected` in [github-marketplace-action](./github-marketplace-action.md) (follow-up) |
57 | 61 |
|
| 62 | +**Out of scope:** dedicated MCP/HTTP `affected` tool (same outcome reachable via `query_recipe`; revisit only if agent eval shows friction). |
| 63 | + |
58 | 64 | --- |
59 | 65 |
|
60 | 66 | ## Acceptance |
61 | 67 |
|
62 | | -- [ ] Recipe returns test file paths for a known fixture delta |
63 | | -- [ ] Stdin mode works in shell pipeline |
64 | | -- [ ] Documented in README + skill |
| 68 | +- [x] Recipe returns test file paths for a known fixture delta |
| 69 | +- [x] Stdin mode works in shell pipeline |
| 70 | +- [x] Documented in README + skill |
65 | 71 |
|
66 | 72 | --- |
67 | 73 |
|
|
0 commit comments