Skip to content

One catalogue of operations for the library, the terminal and the MCP #1684

Closed

Description

@Rafael-SOWNet

Part of #746: v8.0's tool interface, and v9.0's terminal. From #1649.

Simplify, Expand, Factorize, Differentiate, Integrate and Limit on Entity are already adapters over the transformation catalogue in Core/Transformations/Transformation.Catalogue.cs. Nothing else the terminal or the MCP offers is in it, and the three surfaces are kept in step by hand.

Proposal: one catalogue with two kinds of entry.

  • Transformations, as now: Entity → Entity, each carrying its claim (Equivalence or Derivation).
  • Queries: Entity → a set, a number, text or a table. Solving, evaluation, LaTeX, a series and a truth table are queries.

Each entry carries its name, its arguments and a one-line description.

  • The Entity methods stay the C# API, as thin adapters over the catalogue.
  • amcli's one-shot commands and the MCP's tools are generated from the catalogue, or checked against it by a test. An operation added to the library then reaches all three, or the build fails.

The change is additive, so it does not wait for v3. Renaming amcli's commands is item 16 of #1019, and the catalogue would use the names that item settles.

🤖 Generated with Claude Code

Activity

  1. added this to the 2.7.0 milestone on Oct 2, 2026
  2. Rafael-SOWNet commented on Oct 22, 2026

    @Rafael-SOWNet
    MemberAuthor

    A plan, before code

    What exists today:

    • The catalogue. Transformation.Catalogue.cs holds about twenty Entity -> Entity transformations, each with its claim. Simplify, Expand, Factorize, Differentiate, Integrate and Limit already go through it.
    • The terminal. amcli has eight one-shot commands in OneShot.fs: eval simp fsimp diff solve sub latex info.
    • The MCP server. Tools.cs has 23 tools, each with a routing description and guards of its own.

    The proposal. It is additive.

    1. Queries. A Query sits beside Transformation: Entity -> a set, a number, text or a table. It has a name, typed arguments and a one-line description. Solving, numerical evaluation, LaTeX, SymPy code, the truth table, the domain and the series become queries.

    2. One registry. It lists every transformation and query by name.

    3. A test, not generation. The MCP descriptions are routing prompts, and its tools add guards, budgets and formatting that the library should not own. So both surfaces stay hand-written, and a test checks them against the registry:

      • every terminal command and MCP tool names an entry, or is on a short list of surface-only tools such as am_check_steps;
      • every entry is reachable from both surfaces, or is on a library-only list.

      An entry added to the library then fails the build until a surface takes it or a list says why not.

    4. Names. The test reads the entries' names, so it does not wait on Pending breakages: changes agreed or arguable that cannot ship before a major version #1019 item 16. That renaming changes one table when it comes.

    Two questions for you:

    • Where the registry lives: beside Transformation in AngouriMath.Core.Transformations, or in a namespace of its own.
    • Whether Query is public API in 2.7.0, or internal until v3.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  3. Rafael-SOWNet commented on Oct 25, 2026

    @Rafael-SOWNet
    MemberAuthor

    Decided:

    • Query stays internal until v3.
    • The catalogue has a namespace of its own, AngouriMath.Core.Operations. Transformation and its factories stay where they are, since moving them would break callers.
    • The MCP server gets its computations from the catalogue's entries instead of calling the library's methods itself. Its descriptions, guards and formatting stay its own, as planned.

    Since the catalogue is internal and the library is strong-named, the MCP assembly is signed with the library's key and named in its InternalsVisibleTo, as the unit tests already are. It ships inside amcli with the library it was built against.

    Names follow #1019 item 16's v3 column (evaluate, simplify, normalize, differentiate, substitute, …). That item then renames amcli's commands and leaves the catalogue alone.

    Two PRs: the catalogue with its tests, then the MCP on it with the test that checks both surfaces against it.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  4. Rafael-SOWNet commented on Oct 25, 2026

    @Rafael-SOWNet
    MemberAuthor

    Done in #2121 and #2122.

    • A catalogue of the library's operations, by name #2121, the catalogue: Core/Operations/Catalogue.cs lists 33 operations by name, internal, in AngouriMath.Core.Operations. Each entry answers exactly what the method it names answers. Its test places every factory of Transformation as an entry or as a building block with its reason, so a new factory fails the build until it is placed.
    • The MCP server's tools answer from the catalogue of operations #2122, the MCP: the server's tools answer from the catalogue's entries, with no answer changed. Tools.Offers, OwnComputations and NotOffered are checked against the tools and the catalogue, so a new entry fails the build until a tool offers it or NotOffered says why none does. amcli's one-shot commands get the same check, with the commands still calling the library directly.

    Two things left to other issues:

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

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

    No labels
    No labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions