From cd2d5b509d218eb881b0a706d8369056e6deefbf Mon Sep 17 00:00:00 2001 From: rgarcia <72655+rgarcia@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:56:25 +0000 Subject: [PATCH] Make MCP coverage reports cover the whole evergreen PR --- .github/prompts/update-mcp-coverage.md | 15 ++++++++++++--- .github/workflows/update-mcp-coverage.yml | 8 ++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/prompts/update-mcp-coverage.md b/.github/prompts/update-mcp-coverage.md index bf086d07..99ac9046 100644 --- a/.github/prompts/update-mcp-coverage.md +++ b/.github/prompts/update-mcp-coverage.md @@ -8,7 +8,9 @@ Do not downgrade or change that version. ## Audit and implement 1. Read `$RUNNER_TEMP/sdk-diff.patch`, `../sdk/api.md`, and the parameter types in - `../sdk/src/resources`. Enumerate SDK methods and their parameters, including + `../sdk/src/resources`. The diff covers every release since the SDK version on + origin/main, so earlier runs may already have covered part of it on this branch. + Enumerate SDK methods and their parameters, including nested options, new enum values, pagination, streaming, and changed signatures. 2. Read `src/lib/mcp/register.ts`, `src/lib/mcp/tools/`, and shared MCP schemas. Map SDK methods/parameters to registered MCP tools, actions, and input fields. @@ -31,10 +33,15 @@ Do not downgrade or change that version. The Kernel API spec as of this SDK release is at `$RUNNER_TEMP/kernel-api/packages/api/openapi.yaml`, and `$RUNNER_TEMP/openapi-diff.patch` -shows spec changes between the previous SDK release and this one. The SDK is generated +shows spec changes between origin/main's SDK release and this one. The SDK is generated from this spec, so its endpoint, parameter, and schema descriptions are the source of truth for what the API does. +The spec is taken from the API's main branch at release time and can be ahead of the +released SDK. The SDK defines what exists: never add tools, actions, or inputs for +operations or fields `../sdk` does not have. Use the spec only for the meaning of +things the SDK has. + 1. For every changed `summary` or `description` in the spec diff that belongs to an endpoint, parameter, or field the MCP server exposes, update the matching tool description, action description, or input `.describe()` text. Use the spec text @@ -68,7 +75,9 @@ unrelated code, workflows, generated App bundles, or authentication configuratio Read the complete diff against origin/main before finishing. Remove unnecessary comments, type casts, defensive wrappers, and unrelated changes. -Write `$RUNNER_TEMP/mcp-coverage-report.md` with concise sections describing: +Write `$RUNNER_TEMP/mcp-coverage-report.md`. It replaces the PR description, so it +must describe every change in the diff against origin/main, including changes earlier +runs left on this branch, not only this run's. Use concise sections describing: - Added or updated MCP tools, actions, and fields, with their SDK counterparts. - Descriptions updated to match spec changes, with the spec operation or field each diff --git a/.github/workflows/update-mcp-coverage.yml b/.github/workflows/update-mcp-coverage.yml index 33d39ec7..11562ebe 100644 --- a/.github/workflows/update-mcp-coverage.yml +++ b/.github/workflows/update-mcp-coverage.yml @@ -147,11 +147,15 @@ jobs: exit 0 fi + # The report replaces the PR description, so audit every release since + # main's SDK version, not only the ones since the last run. + old_version=$(git show origin/main:package.json | jq -er '.dependencies["@onkernel/sdk"]') if git -C ../sdk rev-parse --verify "refs/tags/v$old_version" >/dev/null 2>&1; then - git -C ../sdk diff "refs/tags/v$old_version" "$SDK_SHA" -- api.md src/resources > "$RUNNER_TEMP/sdk-diff.patch" + git -C ../sdk diff "refs/tags/v$old_version" "$SDK_SHA" \ + -- api.md src/client.ts src/lib src/resources > "$RUNNER_TEMP/sdk-diff.patch" echo "old_date=$(TZ=UTC git -C ../sdk log -1 --date=format-local:%Y-%m-%dT%H:%M:%SZ --format=%cd "refs/tags/v$old_version")" >> "$GITHUB_OUTPUT" else - printf 'Baseline %s unavailable; audit all of api.md and src/resources.\n' "$old_version" > "$RUNNER_TEMP/sdk-diff.patch" + printf 'Baseline %s unavailable; audit all of api.md, src/client.ts, src/lib, and src/resources.\n' "$old_version" > "$RUNNER_TEMP/sdk-diff.patch" fi echo "new_date=$(TZ=UTC git -C ../sdk log -1 --date=format-local:%Y-%m-%dT%H:%M:%SZ --format=%cd "$SDK_SHA")" >> "$GITHUB_OUTPUT" echo "update=true" >> "$GITHUB_OUTPUT"