|
| 1 | +# Proof for slice 059: MCP capability gap against beam_mcp, and the server seam probe |
| 2 | + |
| 3 | +Agent: Trinity · Coding Agent · Date: 2026-09-21 · Branch: slice/059-mcp-gap · Final commit: (the commit carrying this file; named in the closing correction) |
| 4 | + |
| 5 | +## Summary |
| 6 | +beam_mcp 0.8.0 (its commit `cfa706b`) measured against the fifteen items of the 2026-07-28 checklist, each |
| 7 | +row a path and line at that commit with the command that derived it (`FINDINGS.md`); the two conflicts stated |
| 8 | +against 061, 060 and 062's lines; the `:server` seam probed on a throwaway branch of a local clone (five |
| 9 | +changed lines, one census test's pinned list widened by two entries, the branch deleted); `beam_mcp ~> 0.8` in |
| 10 | +the tree behind `Trinity.MCP`, the one boundary the compiler lets reach it. Nothing was built on the core and |
| 11 | +nothing was sent to it; no ADR-0007 amendment is proposed (NOTES finding 5). Six findings in NOTES.md. |
| 12 | + |
| 13 | +## Gate |
| 14 | +``` |
| 15 | +$ mix gate (this machine, OTP 28.5.0.5, Elixir 1.20.4, under a 32 GiB cgroup, tree 53c9091 with this file, coverage.tsv and the probe diff uncommitted on top) |
| 16 | +2146 mods/funs, found no issues. |
| 17 | +... SCAN COMPLETE ... |
| 18 | +No retired or security advisory packages found |
| 19 | +No vulnerabilities found. |
| 20 | +versions.verify: OK. 103 locked packages, none disagreeing with 53 pins |
| 21 | +Result: 454 passed, 18 excluded |
| 22 | +plan_check: PASS |
| 23 | +exit=0 |
| 24 | +``` |
| 25 | +CI: named in the closing correction. |
| 26 | + |
| 27 | +## Tests |
| 28 | +``` |
| 29 | +$ mix test --cover (tree 53c9091) |
| 30 | +Result: 454 passed, 18 excluded |
| 31 | +| 66.67% | Trinity.MCP | (core_events/0 is a constant read by 090) |
| 32 | +| 80.54% | Total | |
| 33 | +``` |
| 34 | +`coverage.tsv` row: `059 80.54 53c9091 2026-09-21` (from 80.55 at 041: one hundredth, the boundary's |
| 35 | +constant). |
| 36 | + |
| 37 | +The slice's six tests (`mix test test/trinity/mcp --trace`): |
| 38 | +``` |
| 39 | +test/trinity/mcp/boundary_test.exs |
| 40 | + * test beam_mcp is in mix.lock at 0.8.0 and the VERSIONS row reads in mix.lock |
| 41 | + * test the boundary compiler checks calls into beam_mcp everywhere, and Trinity.MCP is the boundary that lists it |
| 42 | + * test the planted reference is a real reference: the file the proof compiles names BeamMCP outside Trinity.MCP |
| 43 | +test/trinity/mcp/findings_test.exs |
| 44 | + * test AC1: fifteen rows, numbered 1 to 15, each naming the pinned commit's paths with a line and a deriving command |
| 45 | + * test AC2: the two conflicts are stated against the slice lines |
| 46 | + * test AC3: the probe reports its diff size and the one census test it touches, and none of it is here |
| 47 | +``` |
| 48 | + |
| 49 | +## Acceptance criteria evidence |
| 50 | + |
| 51 | +### AC1 [auto]: `FINDINGS.md` carries one row per checklist item, each with a path and line at the pinned beam_mcp commit and the command that derived it |
| 52 | +`FINDINGS.md`, rows 1 to 15; the pinned commit derived by `git rev-parse --short 'v0.8.0^{commit}'` → `cfa706b` |
| 53 | +on the clone. `findings_test.exs` "AC1" parses the table and holds every row to a path with a line, a status |
| 54 | +word and a deriving command. The population the rows read: `find lib -name '*.ex' | wc -l` → 25; |
| 55 | +`wc -l docs/public-api.txt` → 142. The baseline suite at the pinned commit on its own toolchain: |
| 56 | +``` |
| 57 | +$ cd <clone> && mix test (Erlang 28.1.1, Elixir 1.18.4-otp-28, .tool-versions of the clone) |
| 58 | +11 properties, 705 tests, 0 failures |
| 59 | +``` |
| 60 | + |
| 61 | +### AC2 [auto]: The two conflicts are stated against slice lines |
| 62 | +`FINDINGS.md` "The two conflicts": A, will-not-implement entry 12 (no MRTR) against 061's `input_required` |
| 63 | +criteria (`slices/061-*/SLICE.md:13-15,38`, which already carry the blocker); B, entries 9 (no client) and 8 |
| 64 | +(no OAuth) against 060's thin driver (`slices/060-*/SLICE.md:14-15`) and 062's roles. `findings_test.exs` "AC2". |
| 65 | + |
| 66 | +### AC3 [auto]: The seam probe reports the diff size and the census tests it touches, with output; no code from it is merged anywhere |
| 67 | +On the clone, branch `probe/server-option` from `cfa706b`: |
| 68 | +``` |
| 69 | +$ git diff --stat |
| 70 | + lib/beam_mcp/transport/http.ex | 5 +++-- |
| 71 | + 1 file changed, 3 insertions(+), 2 deletions(-) |
| 72 | +``` |
| 73 | +The diff is `proof/probe-server-option.diff` (a record, not a patch to apply: SLICE.md's "Out"). Before, at |
| 74 | +`cfa706b`, and on the probe: |
| 75 | +``` |
| 76 | +$ mix test test/beam_mcp/boundary test/beam_mcp/transport (cfa706b) |
| 77 | +180 tests, 0 failures |
| 78 | +$ mix test test/beam_mcp/boundary test/beam_mcp/transport (probe) |
| 79 | +180 tests, 1 failure |
| 80 | + 1) test the catalog is called through three callees: capabilities/0 at five sites, read_resource/1 at one, get_prompt/2 at one (BeamMCP.Boundary.NoCatalogTest) |
| 81 | + test/beam_mcp/boundary/no_catalog_test.exs:102 |
| 82 | + calls through a variable module: |
| 83 | + ... |
| 84 | + {{BeamMCP.Transport.HTTP, :do_dispatch, 3}, :handle_message, 2} |
| 85 | + {{BeamMCP.Transport.HTTP, :do_dispatch, 3}, :new, 1} |
| 86 | +$ mix test (probe, the whole suite) |
| 87 | +11 properties, 705 tests, 1 failure |
| 88 | +$ git checkout -- . && git checkout 'v0.8.0^{commit}' && git branch -D probe/server-option |
| 89 | +Deleted branch probe/server-option (was cfa706b). |
| 90 | +``` |
| 91 | +`findings_test.exs` "AC3": the report names the numbers and the test; `lib/beam_mcp` does not exist in this |
| 92 | +tree and `mix.exs` fetches `beam_mcp` from hex, not a path or a git source. |
| 93 | + |
| 94 | +### AC4 [auto]: `beam_mcp` is in `mix.lock`, its `VERSIONS.md` row reads in `mix.lock`, and `mix compile --warnings-as-errors` fails on a planted `BeamMCP` import outside `Trinity.MCP` |
| 95 | +`boundary_test.exs`: the lock holds `{:hex, :beam_mcp, "0.8.0", …}`, the VERSIONS row reads `✅ in mix.lock` |
| 96 | +(`mix versions.gen` flipped it), `Trinity.MCP.core_version/0` is `"0.8.0"`, mix.exs carries |
| 97 | +`boundary: [default: [check: [apps: [:beam_mcp]]]]`, and the census over `git ls-files lib/*.ex` finds |
| 98 | +`BeamMCP.` in `lib/trinity/mcp.ex` alone. The planted reference (its text kept at |
| 99 | +`test/support/mcp/planted_reference.ex.txt`, which the test holds to be a real reference), compiled by the |
| 100 | +command: |
| 101 | +``` |
| 102 | +$ cat > lib/trinity/planted_beam_mcp.ex <<'EOF' |
| 103 | +defmodule Trinity.PlantedBeamMcp do |
| 104 | + @moduledoc false |
| 105 | + def depth, do: BeamMCP.JSON.max_depth() |
| 106 | +end |
| 107 | +EOF |
| 108 | +$ mix compile --warnings-as-errors |
| 109 | +Compiling 1 file (.ex) |
| 110 | +Generated trinity app |
| 111 | +warning: forbidden reference to BeamMCP.JSON |
| 112 | + (references from Trinity to BeamMCP.JSON are not allowed) |
| 113 | + lib/trinity/planted_beam_mcp.ex:3 |
| 114 | +exit=1 |
| 115 | +$ rm lib/trinity/planted_beam_mcp.ex |
| 116 | +``` |
| 117 | +Why the refusal is pasted and not a test: NOTES, the deviation stated before code. |
| 118 | + |
| 119 | +### AC5 [auto]: Gate green; coverage line reported |
| 120 | +The gate above; the coverage row `059 80.54 53c9091 2026-09-21`. |
| 121 | + |
| 122 | +## Manual verification for the reviewer |
| 123 | +None: every criterion is automatic. The reviewer may read `FINDINGS.md` beside the clone at `cfa706b`; every |
| 124 | +row's last column is the command to rerun. |
| 125 | + |
| 126 | +## Deviations from SLICE.md |
| 127 | +NOTES.md, one stated before code (AC4's refusal pasted from the compiler, the test holding what makes it) and |
| 128 | +one found building (`Trinity.MCP` is a top-level boundary, finding 1). |
| 129 | + |
| 130 | +## Versions touched |
| 131 | +`VERSIONS.md` updated: yes, by `mix versions.gen`: the `beam_mcp` row from 🔍 to ✅ in `mix.lock` (0.8.0). |
| 132 | +`mix versions.verify`: OK, 103 locked packages, none disagreeing with 53 pins. |
| 133 | + |
| 134 | +## Git |
| 135 | +``` |
| 136 | +$ git log --oneline main..HEAD |
| 137 | +(named in the closing correction, after the final commit) |
| 138 | +``` |
0 commit comments