Implement Prolog-owned automatic SKILL.md activation #117

Closed
opened 2026-08-19 04:26:06 +00:00 by lost-rob0t · 3 comments
lost-rob0t commented 2026-08-19 04:26:06 +00:00 (Migrated from github.com)

Goal

Implement the first skill side of the symbolic prompt compiler so Prolog, not the model, automatically selects relevant skills and injects only their instructions into the model-visible planner context.

Related: #101 prompt-compiler accounting follow-up and research/RLM-RESEARCH-010-symbolic-prompt-compiler.org.

Runtime invariant

The model never receives a skill-selection tool or a flat skill catalog and never decides which skill to activate. Trusted host/user/runtime signals are compiled by Prolog into selected skill units. Skill activation does not grant tool capabilities or authority.

Slice

  • add a domain-neutral skill catalog and safe SKILL.md loader;
  • parse discovery metadata (name, description, explicit-user-only / disable-model-invocation) while treating Markdown bodies as inert instruction data;
  • support deterministic phrase/keyword/intent-like lexical evidence plus explicit selection, negation, priorities, dependencies and hard prompt-token ceilings;
  • preserve structured selected/rejected reasons and stable compiled fingerprint;
  • load skill bodies lazily only after selection;
  • inject selected skill instructions into rlm_completion planner context automatically;
  • keep an opt-out/empty-catalog path for existing callers;
  • vendor/pin the Matt Pocock skills collection as a third-party skill distribution with upstream license/provenance and README thanks;
  • add adversarial tests for explicit-user-only skills, path confinement, negation, dependency closure, stable selection/fingerprint and prompt injection behavior.

Non-goals

  • no model-callable Skill(...) tool;
  • no model-authored needs(skill(...)) authority path;
  • no arbitrary executable Prolog from skill metadata/body;
  • no tool/capability grants from skills;
  • no embeddings/LLM router in this slice.

Acceptance

  • ordinary completion automatically includes a matching skill body before the planner call;
  • unrelated skills remain out of the prompt;
  • explicit-user-only skills activate only from trusted explicit host selection;
  • do not use X suppresses ordinary lexical activation of X;
  • required skill dependencies close transitively and fail closed when invalid;
  • skill-relative resource paths cannot escape the configured root;
  • deterministic compilation has a stable fingerprint and structured explanation evidence;
  • existing completion behavior remains compatible when no skill catalog is configured.
## Goal Implement the first skill side of the symbolic prompt compiler so Prolog, not the model, automatically selects relevant skills and injects only their instructions into the model-visible planner context. Related: #101 prompt-compiler accounting follow-up and `research/RLM-RESEARCH-010-symbolic-prompt-compiler.org`. ## Runtime invariant The model never receives a skill-selection tool or a flat skill catalog and never decides which skill to activate. Trusted host/user/runtime signals are compiled by Prolog into selected skill units. Skill activation does not grant tool capabilities or authority. ## Slice - add a domain-neutral skill catalog and safe `SKILL.md` loader; - parse discovery metadata (`name`, `description`, explicit-user-only / `disable-model-invocation`) while treating Markdown bodies as inert instruction data; - support deterministic phrase/keyword/intent-like lexical evidence plus explicit selection, negation, priorities, dependencies and hard prompt-token ceilings; - preserve structured selected/rejected reasons and stable compiled fingerprint; - load skill bodies lazily only after selection; - inject selected skill instructions into `rlm_completion` planner context automatically; - keep an opt-out/empty-catalog path for existing callers; - vendor/pin the Matt Pocock `skills` collection as a third-party skill distribution with upstream license/provenance and README thanks; - add adversarial tests for explicit-user-only skills, path confinement, negation, dependency closure, stable selection/fingerprint and prompt injection behavior. ## Non-goals - no model-callable `Skill(...)` tool; - no model-authored `needs(skill(...))` authority path; - no arbitrary executable Prolog from skill metadata/body; - no tool/capability grants from skills; - no embeddings/LLM router in this slice. ## Acceptance - ordinary completion automatically includes a matching skill body before the planner call; - unrelated skills remain out of the prompt; - explicit-user-only skills activate only from trusted explicit host selection; - `do not use X` suppresses ordinary lexical activation of X; - required skill dependencies close transitively and fail closed when invalid; - skill-relative resource paths cannot escape the configured root; - deterministic compilation has a stable fingerprint and structured explanation evidence; - existing completion behavior remains compatible when no skill catalog is configured.
lost-rob0t commented 2026-08-22 02:55:29 +00:00 (Migrated from github.com)

RAGE/design dependency update: #173 now freezes the standard-compatible SKILL.md -> normalized Prolog IR + internal skill graph contract. Loader implementation here should consume #173 rather than define another format. Key decisions: ordinary standard Agent Skills remain valid; canonical Prolog enrichment lives in string-valued metadata.prolog-rlm JSON (not a required top-level prolog: block); recognized Claude/OpenCode variants are import adapters; allowed-tools never grants runtime authority; graph edges derive from normalized metadata only; host owns provenance, precedence, fingerprint, authority, provider visibility, and mandatory-context policy. No coding performed in this RAGE slice.

RAGE/design dependency update: #173 now freezes the standard-compatible `SKILL.md` -> normalized Prolog IR + internal skill graph contract. Loader implementation here should consume #173 rather than define another format. Key decisions: ordinary standard Agent Skills remain valid; canonical Prolog enrichment lives in string-valued `metadata.prolog-rlm` JSON (not a required top-level `prolog:` block); recognized Claude/OpenCode variants are import adapters; `allowed-tools` never grants runtime authority; graph edges derive from normalized metadata only; host owns provenance, precedence, fingerprint, authority, provider visibility, and mandatory-context policy. No coding performed in this RAGE slice.
lost-rob0t commented 2026-08-25 00:14:56 +00:00 (Migrated from github.com)

ADARD reconciliation: #183 is now the decision record for default/permanent RLM skills. Per #173, keep this issue's SKILL.md loader/package/security/resource work, but do not preserve a second independent skill routing/scoring/packing engine. Normalize loaded skills into prompt_unit{unit:skill(...), ...} and let the existing rlm_prompt_compiler own activation, dependency closure, packing, explanations, and provider projection. Permanent/mandatory/provider-visible policy is host-owned, not SKILL.md-authored. No code was performed in the ADARD slice.

ADARD reconciliation: #183 is now the decision record for default/permanent RLM skills. Per #173, keep this issue's SKILL.md loader/package/security/resource work, but do **not** preserve a second independent skill routing/scoring/packing engine. Normalize loaded skills into `prompt_unit{unit:skill(...), ...}` and let the existing `rlm_prompt_compiler` own activation, dependency closure, packing, explanations, and provider projection. Permanent/mandatory/provider-visible policy is host-owned, not SKILL.md-authored. No code was performed in the ADARD slice.
lost-rob0t commented 2026-08-25 06:39:46 +00:00 (Migrated from github.com)

Completed through replacement PR #197. The linear candidate passed all exact-head checks and merged to main as b82b975d9ba86c4bd8443aaafe43d15af4cfe88c; issue #117 is now closed as completed.

Completed through replacement PR #197. The linear candidate passed all exact-head checks and merged to `main` as `b82b975d9ba86c4bd8443aaafe43d15af4cfe88c`; issue #117 is now closed as completed.
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#117
No description provided.