feat(prompts): stable bare-name invocation identity and a manage_prompt use verb#1019
Merged
Conversation
…pt use verb (#1008) Database prompts are served over MCP under their bare stored names with deterministic per-viewer precedence (personal > shared-with-me > persona > global), so promoting a prompt never changes the name anyone invokes. A shadowed prompt stays listed under its legacy scope-qualified name with an annotated description, legacy prefixed names keep resolving on prompts/get, and static registry prompts retain bare-name authority so a database prompt cannot shadow a built-in. Every prompt descriptor now carries an MCP title from display_name (new server.prompts[].display_name config field; workflow prompts gained human titles). manage_prompt gains a use command that resolves any handle - bare name, display name (case-insensitive), mcp:prompt:<id> reference, or free text via ranked search with a confidence margin - and returns the rendered content, argument specs, missing required arguments, and provenance, or ranked candidates when ambiguous. Share access on reference lookups is matched by prompt ID. The platform_info instruction baseline and the tool description steer agents to resolve named procedures with use instead of enumerating. Includes an assembled-system integration test (real mcp.Server + prompt visibility middleware + in-memory client) covering a personal prompt shadowing a same-named global, plus docs updates (configuration, tools, portal user guide, llms files).
…ve-first steering Restores the scope-prefixed presentation names for database prompts: the prefix scheme keeps the native MCP prompts surface collision-free by construction, and a personal prompt has an audience of one before promotion, so renaming at promotion carries no cost worth trading that invariant for. ListVisible, GetByName, the visibility middleware, and their tests are back to their previous semantics. What remains from the original change: the manage_prompt use command (resolve any handle - stored name, display name, mcp:prompt:<id>, or free text - to rendered content with argument specs and provenance, ranked candidates when ambiguous, share access matched by prompt ID), MCP titles from display_name on database, operator, and workflow prompt descriptors (new server.prompts[].display_name config field, human titles on the four workflow prompts), and the platform_info steering that tells agents to resolve named procedures with use instead of enumerating. Users never see presented names: use insulates them entirely. Integration tests prove the prefix contract and title propagation through a real mcp.Server with the real prompt-visibility middleware; docs re-pointed accordingly.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1019 +/- ##
==========================================
+ Coverage 89.25% 89.29% +0.04%
==========================================
Files 457 458 +1
Lines 50487 50726 +239
==========================================
+ Hits 45063 45297 +234
- Misses 3611 3616 +5
Partials 1813 1813 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes #1008
Summary
A prompt now has one canonical name for its entire life. Database prompts are served on the native MCP prompts surface under their bare stored names, promotion never renames a prompt, every prompt descriptor carries a human-readable
title, and a newmanage_promptusecommand lets an agent resolve and run a prompt from any handle a user might say out loud. The platform steers agents to resolve named procedures against the prompt library instead of enumerating it.Bare names with per-viewer precedence
Previously each database prompt was presented under a per-viewer scope-prefixed name (
global-<name>,<persona>-<name>,personal-<name>,shared-<name>), so promoting a personal prompt to a shared scope silently renamed it at exactly the moment it became a team SOP. Nowprompts/listandprompts/getserve every visible prompt under its bare stored name, resolved per viewer with deterministic precedence: personal > shared-with-me > persona > global.Shadowing is visible, never silent: when several visible prompts share a name, the winner keeps the bare name and each shadowed prompt is still listed under its legacy scope-qualified fallback name with an annotated description, and
prompts/getresolves those qualified forms. A qualified fallback that would collide with a stored bare name (or another qualified entry) is resolved deterministically so the list andprompts/getalways agree; collisions between qualified entries keep the one the legacy prefix resolution serves.Static registry prompts (the auto-generated overview, operator config, workflow, and toolkit prompts) keep bare-name authority: the handle snapshots their names at registration and the serving callbacks decline them, so a database prompt can never shadow a built-in. Persona prompts now appear once per prompt instead of once per matching persona.
Compatibility
Clients or saved workflows that learned the old prefixed names keep working:
prompts/getstill resolvespersonal-,global-,shared-, and<persona>-prefixed forms through a deprecation window, falling through to persona resolution for personas literally named after reserved tokens, exactly as before.Titles everywhere
promptDescriptor, operator, and workflow prompt registration now set the MCPTitlefield fromdisplay_name, falling back to the machine name.server.prompts[].display_nameis a new config field,registry.PromptInfocarriesdisplay_name, the four built-in workflow prompts gained human titles, and ingested system rows inherit the display name.manage_prompt use: resolve and run
useaccepts any handle innameand returns the prompt ready to run:daily-sales-report), resolved with the same precedence as the native surface and including system rows, so built-ins resolve toomcp:prompt:<id>reference (the same referencesearchresults carry), with visibility enforced per caller and share access matched by prompt IDA resolved response carries the rendered content (values passed in
argsare substituted), the argument specs, any required arguments still missing, and provenance (scope, lifecycle status, approver, owner, reference) so the agent can confirm what it is about to run. An ambiguous handle returnsstatus: "ambiguous"with up to five candidates, never an error and never a silent first match.Agent steering
The platform_info instruction baseline gains a bullet, gated on
manage_promptbeing reachable, telling agents that named procedures are prompts and to resolve them withuserather than enumerate. The tool description carries the same guidance.Testing
mcp.Serverwith the real prompt-visibility middleware and an in-memory client session prove that a personal prompt shadowing a same-named global serves the personal bare, lists the global qualified and annotated, agrees betweenprompts/listandprompts/geton every listed name, carries titles through the protocol, and leaves an unshadowed viewer untouched.useresolution path including ID-scoped share visibility, argument substitution, missing-argument reporting, ranked confidence and ambiguity, and provenance fields.make verifygreen.Docs
Configuration reference (naming and resolution semantics,
display_namefield), tools reference (manage_promptsection and summary row), portal user guide (naming section rewritten), and both llms files updated.