Skip to content

test(profile): close enforcement test gaps in merged 108-a/b/d (Spec 108-bd-tests) - #1429

Merged
github-actions[bot] merged 5 commits into
mainfrom
108-bd-enforcement-test-gaps
Sep 30, 2026
Merged

github-actions[bot] merged 5 commits into
mainfrom
108-bd-enforcement-test-gaps

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 30, 2026

Copy link
Copy Markdown
Member

Spec: specs/108-profiles-v3 (108-b and 108-d test-gap follow-up). No functional requirement or deliverable is added.

What changes for users

  • REST /api/v1/tools/call, management tools. When a profile hides upstream_servers or quarantine_security from a pinned agent token, the caller still gets the unchanged unknown tool: <name> answer, but the refusal is now recorded as a blocked policy_decision activity row with block_reason=profile_management, as contracts/refusals.md already promised. The row has no server name, so scoped activity readers never see it, and its reason is the non-disclosing text the caller already received. This is the only production change (internal/server/mcp.go); it applies to the REST path and to the MCP publication-gap case, because on MCP mcp-go's tool filter answers a hidden built-in before any handler runs.
  • CI. The SC-007 v3 scope-latency measurement is renamed to TestScopeLatency_ProfileV3VsLegacy, so the existing TestScopeLatency_ regex in .github/workflows/scope-latency.yml now runs it on HEAD (advisory job, unchanged budget).
  • No CLI, MCP schema, Web UI or macOS change; no REST contract change, so no swagger or frontend type regeneration.

Coverage added (all Spec 108, enforcement)

  • T046a TestRESTProfileV3_ToolsCall_PinnedAgentToken and TestRESTProfileV3_ClientCredentialRefusedOnREST: a real stored agent token pinned to work-readonly through the real REST router and auth middleware. Tier refusal is a 403 with the contract text and no profile name; hidden upstream_servers, quarantine_security and code_execution answer byte-identically to an unknown tool once the name is substituted, with profile_management / profile_code_execution rows; retrieve_tools matches the direct handler with hidden_by_profile and no profile key; work-full and the admin key keep today's outcomes; a real mcp_cli_ client credential is refused on every REST door with no dispatch and no activity row.
  • T046b TestRESTProfileV3_CodeExec_PinnedAgentToken and TestRESTProfileV3_Replay_PinnedAgentToken: /code/exec returns 403 PROFILE_BLOCKED (also with the global flag off, where the profile wins), work-full runs, the admin key is unchanged; replay of an over-tier record is a 403 with the tier text, replay of an out-of-profile server is byte-identical to an unknown id, and the out-of-scope row carries no profile_* block reason.
  • T048 TestSetProfileV3_ManagementAndSwitchingMatrix: the "Management and switching" matrix, all rows except the profiles column (108-h), including the set_profile("") column, the own-pin URL, the dangling binding and the binding guard; uniform refusal bytes and no base-profile naming (FR-018).
  • T049 TestRefusalPrecedence_ProfileV3ExplainerOrder: each adjacent pair of the explainer chain that the call paths implement on main, asserting the earlier gate's exact text, zero upstream calls and the reason key.
  • T025 rename above.

The tests live in internal/server rather than internal/httpapi because httpapi cannot import server, which is what a real pinned token plus real dispatch requires; tasks.md names the shipped files.

Spec docs and tasks

  • spec.md FR-015, contracts/enforcement-matrix.md and contracts/refusals.md now describe what ships: the out-of-profile replay row is the Spec 105 out-of-scope row (no block_reason); the management refusal is recorded where the shared handler runs; the upstream_servers mutating-operation order is global_gate before token_permission on main (left unchanged, follow-up for the 108-f explainer).
  • tasks.md: Phases 1 to 3 and 5 reconciled with what merged (T004 to T015, T044 to T055a ticked, obsolete T004a/T009 text marked, T015's docs point moved to T124). Phase 4 (108-c) lines are untouched.

Not covered here

Client-credential rows are tests-only, since main has no surface that mints a client credential yet (connect minting is 108-c). Clearing a stored set_profile selection when a binding changes is 108-c T032/T040; the matrix asserts resolution only.

… tools

A pinned token calling upstream_servers or quarantine_security that its
profile hides now writes the blocked policy_decision row with
block_reason=profile_management that contracts/refusals.md promises. The
caller-visible answer is unchanged. Adds REST tests driving real pinned
agent tokens through /tools/call, /code/exec and replay (Spec 108
T046a/T046b).
Covers the enforcement-matrix Management and switching table (every
column except profiles) and the explainer-order refusal precedence
(Spec 108 T048/T049).
…ency.yml

Rename it to TestScopeLatency_ProfileV3VsLegacy so the workflow's
TestScopeLatency_ regex picks it up (Spec 108 T025).
Tick the merged 108-a/b/d tasks, correct file names, and align FR-015,
the enforcement matrix and refusals.md with the shipped replay row,
management refusal recording and management-op precedence.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 108-bd-enforcement-test-gaps

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (25 MB)
  • installer-dmg-darwin-arm64 (22 MB)
  • smart-mcp-proxymcpproxy-go681GKT.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 36679878121 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (Model B): Paperclip review verdicts = ACCEPT and qa-gate green at this head SHA. Arming auto-merge; GitHub merges when all required checks pass.

@github-actions
github-actions Bot merged commit 6a25a92 into main Sep 30, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants