Skip to content

refactor: guard that every MCP tool the platform prompt names is a published tool #4486

Open

Description

@vybe

Summary

The platform prompt (src/backend/services/platform_prompt_service.py) teaches agents MCP tool names on every turn. Nothing checks that those names still exist: only the delegation contract is pinned against the real tool surface (tests/unit/test_ent568_delegation_contract.py). A tool renamed or removed while another section still names it fails silently — the agent calls a name that is not there.

Context

The prompt is updated ad hoc by whichever feature PR touches it. Individual sections have guard tests (report display hints, canvas kinds, the operator-ask contract), but there is no general check and no review step that asks "does the agent need to be told about this change?". All names are valid today; this is a guard against drift, not a fix for a live defect.

Acceptance Criteria

  • A unit test fails when any mcp__trinity__<name> in the prompt module is not a tool the MCP server publishes
  • The same test fails when a bare backticked tool name in the rendered platform instructions (e.g. ask_operator) stops being a published tool, at every prompt tier
  • Non-tool tokens (arguments, statuses, field names) are listed explicitly, and a stale entry in that list fails
  • The PR review checklist asks, for a PR that changes an agent-facing tool or behaviour, whether the platform prompt was updated or deliberately left

Technical Notes

Activity

  1. added
    priority-p2
    type-refactor
    theme-devex
    complexity-low
    status-ready
    on Nov 12, 2026
  2. added
    status-in-dev
    on Nov 17, 2026
  3. removed
    status-ready
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p2status-in-devtheme-devextype-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions