[P1] Define the external tool-library loading boundary #48
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Keep
prolog-rlma general-purpose RLM/agent runtime library while allowing concrete tool implementations to be loaded from separate libraries.Core must own the tool contract and loader interface, not the tool catalog.
Required boundary
prolog-rlmshould continue to own:rlm_toolregistry lifecycle;Concrete tools should live outside core, preferably in a companion library such as
prolog-rlm-tools.Public loading API
The loader must support both category-scoped loading and load everything.
Required user-facing predicates:
rlmLoadTools(Category)loads/registers every installed tool belonging to that category.rlmLoadAllToolsloads/registers every installed tool exposed by the configured external tool libraries.Tool loading and capability granting are separate operations: loading a category or all tools makes schemas/handlers available to the registry, but does not grant an agent authority to invoke them.
The category mechanism must be extensible. Third-party tool libraries may advertise additional categories without modifying core.
Acceptance criteria
rlmLoadTools(+Category)for category-scoped tool loading.rlmLoadAllTools/0for loading all installed/discoverable external tools.filesystem,git,process,network, andmcp.prolog-rlmcore.Non-goals
prolog-rlmcore.call/1, ambient filesystem, ambient network, or unrestricted process execution.rlmLoadAllToolsmust not meangrant_all_capabilities.Design principle
prolog-rlmis the reusable execution substrate. Tool implementations are separately loadable libraries. Loading controls availability; capabilities control authority.Live-state reconciliation after PR #62: #48 is partially implemented on canonical main
88b64db41a4c474379a1808b95c761ffc78d9fc2and should not be approached as a greenfield loader.Existing core module
prolog/rlm_tool_loader.plalready provides a multifile trusted external-pack ABI (tool_pack/2), pack discovery (rlm_tool_packs/1), single-pack loading (rlm_load_tools/3), load-all (rlm_load_all_tools/2), structured unknown/ambiguous/invalid-loader errors, and explicitly keeps loading separate from capability grants.test/rlm_tool_loader_test.plalready proves declarative discovery, unknown-pack failure, loading without authority grant, and explicit-capability invocation.Remaining #48 work should therefore focus on the acceptance gaps rather than duplicating this module: category/advertisement semantics versus the current one-pack-one-name model, deterministic repeated loading/idempotency, multiple independent libraries in one registry, duplicate tool-name conflict behavior across libraries, discoverable valid categories/tools, initial category contract (
filesystem,git,process,network,mcp), and documentation/public facade naming as appropriate.This also unlocks the remaining external
mcpcategory work in #52. Keep concrete standard tool implementations in #49/#50 rather than expanding core.PR #66 is the implementation slice for the remaining #48 acceptance gaps on canonical base
88b64db41a4c474379a1808b95c761ffc78d9fc2.Implemented in the current PR head:
tool_pack/2loader ABI;tool_pack_manifest/2metadata (library, one category-scoped pack, advertised tool name/capability/effect);rlm_load_tools/3, legacy exact-pack fallback, and deterministic load-all;loaded/reusedidempotency so repeated loads do not rely on duplicate-registration failure;docs/external-tool-libraries.mddocumenting the extension/security boundary and a third-party category example.The PR also adds the external
mcpcategory adapter needed by #52 without importing concrete standard tools from #49/#50.Keeping #48 open until the exact final PR head passes both deterministic and configured REAL OpenRouter CI and is merged. If those gates stay green, this issue's remaining acceptance should be complete and it can close against the merge SHA.
Closed by squash merge
9ba763d248f6e087b3ff01c651762997f02ee726from PR #66.Final exact PR head was
a4a45a6eb0c753fa626a8db47016654e990d20e2. Deterministic CI was green across static production/live-definition load, full canonical PlUnit, loader/category fixtures, tool/MCP async, authority, scheduler/concurrency, benchmark/conformance (16/16), deep recursion (15/15), CLI/trace, fresh-process graph resume, durable artifact handoff, and whitespace. Production static load was warning-clean for the touched surface.The complete configured REAL OpenRouter job was also green on that head: core including streaming/typed plan/tool/native-tool/recursive completion, structured repair, benchmark, depth 0/1/2, and CLI smoke.
OPENROUTER_TEST_MODELwas unset and every request used the repository's configuredopenrouter/freepath.#48 acceptance is therefore complete on canonical main.