Repository navigation
test(profile): close enforcement test gaps in merged 108-a/b/d (Spec 108-bd-tests) - #1429
Merged
Merged
Conversation
… 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.
Deploying mcpproxy-docs with
|
| Latest commit: |
9b55a92
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://72282320.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-bd-enforcement-test-gaps.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36679878121 --repo smart-mcp-proxy/mcpproxy-go
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/api/v1/tools/call, management tools. When a profile hidesupstream_serversorquarantine_securityfrom a pinned agent token, the caller still gets the unchangedunknown tool: <name>answer, but the refusal is now recorded as a blockedpolicy_decisionactivity row withblock_reason=profile_management, ascontracts/refusals.mdalready 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.TestScopeLatency_ProfileV3VsLegacy, so the existingTestScopeLatency_regex in.github/workflows/scope-latency.ymlnow runs it on HEAD (advisory job, unchanged budget).Coverage added (all Spec 108, enforcement)
TestRESTProfileV3_ToolsCall_PinnedAgentTokenandTestRESTProfileV3_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; hiddenupstream_servers,quarantine_securityandcode_executionanswer byte-identically to an unknown tool once the name is substituted, withprofile_management/profile_code_executionrows;retrieve_toolsmatches the direct handler withhidden_by_profileand noprofilekey; work-full and the admin key keep today's outcomes; a realmcp_cli_client credential is refused on every REST door with no dispatch and no activity row.TestRESTProfileV3_CodeExec_PinnedAgentTokenandTestRESTProfileV3_Replay_PinnedAgentToken:/code/execreturns 403PROFILE_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 noprofile_*block reason.TestSetProfileV3_ManagementAndSwitchingMatrix: the "Management and switching" matrix, all rows except theprofilescolumn (108-h), including theset_profile("")column, the own-pin URL, the dangling binding and the binding guard; uniform refusal bytes and no base-profile naming (FR-018).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.The tests live in
internal/serverrather thaninternal/httpapibecause httpapi cannot import server, which is what a real pinned token plus real dispatch requires;tasks.mdnames the shipped files.Spec docs and tasks
spec.mdFR-015,contracts/enforcement-matrix.mdandcontracts/refusals.mdnow describe what ships: the out-of-profile replay row is the Spec 105 out-of-scope row (noblock_reason); the management refusal is recorded where the shared handler runs; theupstream_serversmutating-operation order isglobal_gatebeforetoken_permissionon 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_profileselection when a binding changes is 108-c T032/T040; the matrix asserts resolution only.