[P0] Preserve Agent Zero skills through canonical skill graph adapter #296

Closed
opened 2026-09-02 17:25:36 +00:00 by nsaspy · 0 comments
Owner

Goal

Make the canonical rlm_agent_zero_adapter consume Agent Zero's trusted visible skill roots/allowlist through rlm_skill and rlm_skill_graph, so downstream Agent Zero model routing can use ordinary Agent Zero skills plus the pinned Prolog-RLM core skills without flattening them into name/description-only pseudo-units.

This is the upstream adapter slice required by lost-rob0t/a0-symbolics#65 / a0-symbolics issue #8.

Current defect

The existing Agent Zero adapter accepts agent_zero_skill units but synthesizes lexical triggers and hardcodes empty requires / suggests / conflicts / supersedes fields. That bypasses the canonical SKILL.md -> rlm_skill normalization -> prompt_unit + skill graph flow and loses metadata.prolog-rlm semantics.

The current a0-symbolics native turn router also needs a trusted way to provide:

  • Agent Zero skill roots;
  • the Agent Zero-visible skill-name allowlist after profile/project/hidden filtering;
  • explicitly loaded/current-chat skill names;
  • Prolog-RLM's default core skills.

Required contract

Extend agent_zero_context_compile/2 with optional trusted request fields equivalent to:

skill_roots: [absolute directory paths]
visible_skills: [names allowed by Agent Zero]
selected_skills: [names pinned/loaded for the current chat]
include_core_skills: true|false

Requirements:

  • Agent Zero owns root and visible-name policy; Prolog must not invent filesystem roots.
  • rlm_skill owns parsing, bounded package loading, fingerprints, canonical metadata, and body loading.
  • rlm_skill_graph owns graph validation/projection.
  • Prolog-RLM core skills are merged from skill_default_catalog/1 when enabled.
  • Only Agent Zero-visible external skills become provider-visible compiler units; hidden external skills must not be selected merely because another package shares a scanned root.
  • Explicit/current-chat skills are selected through normal compiler semantics and cannot bypass capability/authority boundaries.
  • Core skills retain canonical always/mandatory semantics.
  • Return bounded observability for active skills and the filtered skill graph/fingerprint without leaking skill bodies through graph metadata.
  • Preserve existing name/description agent_zero_skill unit compatibility for callers that do not use the new catalog fields.
  • No Python-side reimplementation of metadata.prolog-rlm parsing or graph policy.

Tests

Add deterministic adapter fixtures proving:

  1. ordinary Agent Zero SKILL.md body reaches compiled context when relevant;
  2. metadata.prolog-rlm category/triggers/relations survive through the graph;
  3. a hidden/non-allowlisted sibling skill under the same root is not provider-visible;
  4. explicit/current-chat skill remains selected on an unrelated query;
  5. default Prolog-RLM core skills are present with canonical graph nodes;
  6. invalid/unresolved hard skill graph relations fail closed;
  7. legacy inert agent_zero_skill units still work.

Run focused adapter/skill/graph tests and the complete deterministic suite before merge.

Non-goals

  • no second skill IR or selector;
  • no model-granted skill authority/capabilities;
  • no arbitrary filesystem scans;
  • no Agent Zero UI/profile policy moved into Prolog-RLM core;
  • no executable Prolog from SKILL.md.
## Goal Make the canonical `rlm_agent_zero_adapter` consume Agent Zero's trusted visible skill roots/allowlist through `rlm_skill` and `rlm_skill_graph`, so downstream Agent Zero model routing can use ordinary Agent Zero skills plus the pinned Prolog-RLM core skills without flattening them into name/description-only pseudo-units. This is the upstream adapter slice required by `lost-rob0t/a0-symbolics#65` / a0-symbolics issue #8. ## Current defect The existing Agent Zero adapter accepts `agent_zero_skill` units but synthesizes lexical triggers and hardcodes empty `requires` / `suggests` / `conflicts` / `supersedes` fields. That bypasses the canonical `SKILL.md -> rlm_skill normalization -> prompt_unit + skill graph` flow and loses `metadata.prolog-rlm` semantics. The current a0-symbolics native turn router also needs a trusted way to provide: - Agent Zero skill roots; - the Agent Zero-visible skill-name allowlist after profile/project/hidden filtering; - explicitly loaded/current-chat skill names; - Prolog-RLM's default core skills. ## Required contract Extend `agent_zero_context_compile/2` with optional trusted request fields equivalent to: ```text skill_roots: [absolute directory paths] visible_skills: [names allowed by Agent Zero] selected_skills: [names pinned/loaded for the current chat] include_core_skills: true|false ``` Requirements: - Agent Zero owns root and visible-name policy; Prolog must not invent filesystem roots. - `rlm_skill` owns parsing, bounded package loading, fingerprints, canonical metadata, and body loading. - `rlm_skill_graph` owns graph validation/projection. - Prolog-RLM core skills are merged from `skill_default_catalog/1` when enabled. - Only Agent Zero-visible external skills become provider-visible compiler units; hidden external skills must not be selected merely because another package shares a scanned root. - Explicit/current-chat skills are selected through normal compiler semantics and cannot bypass capability/authority boundaries. - Core skills retain canonical always/mandatory semantics. - Return bounded observability for active skills and the filtered skill graph/fingerprint without leaking skill bodies through graph metadata. - Preserve existing name/description `agent_zero_skill` unit compatibility for callers that do not use the new catalog fields. - No Python-side reimplementation of `metadata.prolog-rlm` parsing or graph policy. ## Tests Add deterministic adapter fixtures proving: 1. ordinary Agent Zero SKILL.md body reaches compiled context when relevant; 2. `metadata.prolog-rlm` category/triggers/relations survive through the graph; 3. a hidden/non-allowlisted sibling skill under the same root is not provider-visible; 4. explicit/current-chat skill remains selected on an unrelated query; 5. default Prolog-RLM core skills are present with canonical graph nodes; 6. invalid/unresolved hard skill graph relations fail closed; 7. legacy inert `agent_zero_skill` units still work. Run focused adapter/skill/graph tests and the complete deterministic suite before merge. ## Non-goals - no second skill IR or selector; - no model-granted skill authority/capabilities; - no arbitrary filesystem scans; - no Agent Zero UI/profile policy moved into Prolog-RLM core; - no executable Prolog from SKILL.md.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/prolog-rlm#296
No description provided.