feat(symbolics): route model turns through Prolog-RLM natively #91

Closed
nsaspy wants to merge 18 commits from fix/prolog-rlm-native-routing into main
Owner

Summary

  • Fold _prolog_context_compiler into the single _prolog_rlm plugin: one fail-closed call_chat_model_turn extension compiles provider context in Prolog-RLM, invokes the model, and returns native Agent Zero tool calls through the normal host lifecycle.
  • Preserve Agent Zero as the visibility/tool-execution authority while Prolog-RLM owns symbolic selection, budgeting, SKILL.md normalization, skill-graph validation, and provider projection.
  • Keep response and skills_tool permanently visible so the model can always finish a turn or discover/load a skill; other tools remain relevance-selected by Prolog.
  • Project Agent Zero's already-filtered visible skill catalog as exact {name,path} packages plus the current-chat loaded-skill ledger. Hidden/shadowed skill names never cross the ABI.
  • Enable Prolog-RLM core skills by default. The canonical upstream adapter candidate is lost-rob0t/prolog-rlm#340 / issue #339: it parses those exact packages with rlm_skill, merges skill_default_catalog/1, validates the same normalized catalog with rlm_skill_graph, and returns active-skill/graph observability.
  • Do not reimplement metadata.prolog-rlm in Python and do not grant capability/authority from skill metadata.
  • Drop the old exec/git/patch plugin tool pack and standalone context-compiler plugin; shared transport remains under _prolog_rlm/helpers/transport.py.

Supersedes

  • Closed draft #51. Its toggle-based dual-plugin runtime-mode design is retired in favor of this single-router/single-plugin architecture.

Skill graph contract

  • Agent Zero owns project/profile/plugin precedence and hidden-skill policy.
  • Agent Zero sends exact admitted package directories, not broad roots.
  • selected_skills contains only currently loaded names that are still visible.
  • Prolog-RLM owns SKILL.md parsing, bounded resources/fingerprints, canonical metadata, selection, and graph validation.
  • Prolog-RLM core skills join the same graph when include_core_skills is enabled.
  • skills_tool remains available for runtime discovery/loading; a loaded skill is pinned through ordinary compiler semantics on later turns.

Verification

  • Added exact-head Symbolics RLM CI. It checks out the a0-symbolics PR head and the exact Prolog-RLM #340 candidate, temporarily resolves that candidate as the future flake pin, then runs the focused _prolog_rlm/prompt-budget pytest gate plus the full Prolog-RLM deterministic suite under a 4 GiB cap and checks flake evaluation.
  • Current upstream candidate under test: b12561cf888f62c5bfe692cc6669eae50eb1b634.
  • Do not merge this PR until that exact integration gate is green and the resulting Prolog-RLM revision is committed in both flake.nix and flake.lock.
## Summary - Fold `_prolog_context_compiler` into the single `_prolog_rlm` plugin: one fail-closed `call_chat_model_turn` extension compiles provider context in Prolog-RLM, invokes the model, and returns native Agent Zero tool calls through the normal host lifecycle. - Preserve Agent Zero as the visibility/tool-execution authority while Prolog-RLM owns symbolic selection, budgeting, SKILL.md normalization, skill-graph validation, and provider projection. - Keep `response` and `skills_tool` permanently visible so the model can always finish a turn or discover/load a skill; other tools remain relevance-selected by Prolog. - Project Agent Zero's already-filtered visible skill catalog as exact `{name,path}` packages plus the current-chat loaded-skill ledger. Hidden/shadowed skill names never cross the ABI. - Enable Prolog-RLM core skills by default. The canonical upstream adapter candidate is `lost-rob0t/prolog-rlm#340` / issue #339: it parses those exact packages with `rlm_skill`, merges `skill_default_catalog/1`, validates the same normalized catalog with `rlm_skill_graph`, and returns active-skill/graph observability. - Do not reimplement `metadata.prolog-rlm` in Python and do not grant capability/authority from skill metadata. - Drop the old exec/git/patch plugin tool pack and standalone context-compiler plugin; shared transport remains under `_prolog_rlm/helpers/transport.py`. ## Supersedes - Closed draft #51. Its toggle-based dual-plugin runtime-mode design is retired in favor of this single-router/single-plugin architecture. ## Skill graph contract - Agent Zero owns project/profile/plugin precedence and hidden-skill policy. - Agent Zero sends exact admitted package directories, not broad roots. - `selected_skills` contains only currently loaded names that are still visible. - Prolog-RLM owns SKILL.md parsing, bounded resources/fingerprints, canonical metadata, selection, and graph validation. - Prolog-RLM core skills join the same graph when `include_core_skills` is enabled. - `skills_tool` remains available for runtime discovery/loading; a loaded skill is pinned through ordinary compiler semantics on later turns. ## Verification - Added exact-head `Symbolics RLM` CI. It checks out the a0-symbolics PR head and the exact Prolog-RLM #340 candidate, temporarily resolves that candidate as the future flake pin, then runs the focused `_prolog_rlm`/prompt-budget pytest gate plus the full Prolog-RLM deterministic suite under a 4 GiB cap and checks flake evaluation. - Current upstream candidate under test: `b12561cf888f62c5bfe692cc6669eae50eb1b634`. - Do not merge this PR until that exact integration gate is green and the resulting Prolog-RLM revision is committed in both `flake.nix` and `flake.lock`.
Fold the context compiler into _prolog_rlm as a single fail-closed
call_chat_model_turn extension: Prolog compiles context and executes the
provider turn, returning native Agent Zero tool calls for normal
lifecycle execution. Drop the exec/git/patch tool pack and hide-eager
hooks, move transport under _prolog_rlm, pin prolog-rlm to b891c27 in
the flake, and update smoke checks plus plugin DOX accordingly.
Point PROLOG_RLM_TEST_ROOT at the pinned prolog-rlm pack checkout, add a
root conftest so repo-root modules import under bare pytest, and state
the 4 GB nix cap as an ulimit wrapper instead of systemd-run.
Make the sentence-transformers import in models.py lazy and gate the
torch-chain packages in the devshell Python behind A0_TEST_LITE so
impure evaluation can build a bounded test environment; document the
ulimit-wrapped test invocation in the root DOX.
docs(symbolics): document canonical skill graph bridge
Some checks failed
Symbolics RLM / skill-graph-integration (push) Failing after 10s
Symbolics RLM / skill-graph-integration (pull_request) Failing after 10s
56f7ffe974
ci(symbolics): fetch install-nix-action by full URL
Some checks failed
Symbolics RLM / skill-graph-integration (push) Has been cancelled
Symbolics RLM / skill-graph-integration (pull_request) Failing after 1m0s
4566258dc8
cachix/install-nix-action is not mirrored on data.forgejo.org, so the
runner fails action resolution before any step runs. Reference the
action by its fully-qualified URL instead.
ci(symbolics): clone prolog-rlm from github and drop forgejo token for nix
Some checks failed
Symbolics RLM / skill-graph-integration (push) Has been cancelled
Symbolics RLM / skill-graph-integration (pull_request) Has been cancelled
cf53e46dde
- actions/checkout with repository: lost-rob0t/prolog-rlm resolves
  against the local Forgejo instance where the repo does not exist;
  clone it from github.com with a fetch-by-sha step instead.
- secrets.GITHUB_TOKEN on Forgejo is an instance token, not a GitHub
  one; nix tarball fetches with it get HTTP 401 from api.github.com.
  Fetch the public flake inputs anonymously.
fix(nix): build nixpkgs mcp without its upstream test suite
Some checks failed
Symbolics RLM / skill-graph-integration (push) Has been cancelled
Symbolics RLM / skill-graph-integration (pull_request) Has been cancelled
95deae8362
Skip mcp's upstream permission tests (they fail under root single-user
nix on the docker CI runner) and retrigger nix CI when nix/ changes.
nsaspy closed this pull request 2026-09-06 12:58:31 +00:00
Some checks failed
Symbolics RLM / skill-graph-integration (push) Has been cancelled
Symbolics RLM / skill-graph-integration (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No description provided.