[P0] Implement normalized skill catalog graph projection and validation #250
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#250
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?
Parent: #173
Related: #117/#197, #168-#172, #183
Live baseline
Canonical
main:267697bef10a3fffff7c093e1435ece770e7444b.Merged #197 already provides the confined standard-compatible
SKILL.mdloader, closedmetadata.prolog-rlmnormalization, normalized relationship fields (requires,suggests,conflicts,supersedes), prompt-unit conversion into the onerlm_prompt_compiler, progressive body/resource disclosure, and host-owned activation policy.Current
prolog/rlm_skill.plstores those relationship fields on the normalized skill record, but repository search finds no public/internalskill_graphprojection. This is the remaining implementation gap from #173; do not create another loader, selector, prompt compiler, or separately-authored graph file.Goal
Derive an inspectable typed skill graph only from the existing normalized skill catalog records.
The graph is routing/dependency metadata. It is inert and must never grant capability, authority, effect permission, execution, permanence, or trusted provenance.
Smallest public contract
Follow current structured-outcome conventions. API may be named to fit the repository, but should provide one canonical catalog-to-graph operation, conceptually:
Successful output should be closed/ground metadata containing deterministic nodes, typed edges, diagnostics, and a stable material fingerprint derived from the normalized catalog graph material.
Do not load SKILL.md bodies or resource contents to build/query the graph.
Node contract
Every active normalized catalog skill is one node, including standard-only isolated skills.
Expose bounded inert metadata sufficient for graph/lifecycle consumers, including:
skill(Name)identity;Do not copy instruction bodies into graph nodes.
Edge contract
Derive only explicit normalized relationships:
Targets may be closed compiler units such as
skill(Name),tool(Name), orresource(Name)exactly as already normalized byrlm_skill.For deterministic graph output, normalize/deduplicate emitted edges. A single authored conflict may project a canonical symmetric representation, but do not make the skill body or natural-language description a source of graph edges.
Required validation
TDD the graph validator against current normalized records. At minimum:
requires,conflicts, orsupersedes=> structural error;skill(...)requirement cycle => structural error with deterministic cycle evidence;supersedescycle among skills => structural error;requiresandconflictsthe same target => structural error;requiresandsupersedesthe same target => structural error;requires(..., skill(Missing))=> structural error;suggests/conflicts/supersedestargets => explicit diagnostics unless another existing host catalog resolves that closed unit; do not invent a target;Do not silently repair contradictions to obtain a graph.
Analysis / design boundary
Reuse
skill_catalog_skills/2and the already-normalized skill dicts. Graph projection must not reparse YAML/JSON or maintain a second skill record.Keep compiler ownership unchanged:
Graph validation may reject an invalid catalog graph, but graph membership alone must not activate a skill or influence provider packing outside the existing compiler contract.
Adversarial cases
allowed-toolscompatibility metadata attempts authority grant: no graph/authority grant;Decision gate
GO only for a read-only graph projection/validation layer over existing normalized catalog records. HOLD/re-design if implementation requires a second loader, selector, compiler, lifecycle database, executable metadata, or downstream product-specific policy.
Verification
Any changed head invalidates prior evidence.
Non-goals
RAGE realization + exact-head verification for the normalized skill catalog graph.
Baseline: canonical
mainremained267697bef10a3fffff7c093e1435ece770e7444b. The existing transactionrage/250-skill-catalog-graphfirst produced exact head6f7d809049aace02e1604330dcb82469ea631525; canonical CI discovered 79 suites / 898 tests and passed 897 with exactly one failure:standard_skill_projects_to_isolated_inert_nodefailed with an instantiation error because the test boundNodeinsideassertion(Graph.nodes = [Node])and dereferenced it afterward. No production/load failure was present.Recovery: commit
3d391781e20421c94635ebd92d16178883b7e6ddchanges exactly one test line, movingGraph.nodes = [Node]outsideassertion/1. It does not modify production graph behavior or weaken any assertion.Adversarial decision: GO for this slice. The implementation is read-only over normalized
rlm_skillcatalog records; graph membership is not activation/authority; no body/resource text creates edges; no handler/callable is introduced; structural cycles/contradictions and unresolved hard dependencies fail explicitly; soft/external targets remain diagnostics; ordering and graph material are canonicalized;rlm_prompt_compilerremains the sole provider-selection authority. Downstream Agent Zero / AgentProlog product policy is not duplicated here.Fresh exact-head verification on
3d391781e20421c94635ebd92d16178883b7e6ddis green:PR #256 now owns this transaction. Engineering decision is GO; merge remains subject to the repository's explicit merge-on-green authorization gate.