skills: read-only catalog for introspection bodies

An ordinary skill body may not reach into the agent (`ctx.admin` is the
housekeeping-only mutation surface), but a body that reports the agent's own
capabilities legitimately needs to see the tree. Add that sanctioned surface:

- `SkillCatalog` (skills.py): a read-only view — `categories()` (id -> scope
  description) and `skills(category)` (leaf names) — over a live provider.
- `ActionContext.catalog`: supplied by the scheduler as a locked tree snapshot,
  passed to every body.
- The runner now passes `admin` only to the `housekeeping` category (it was
  previously handed to every body despite the documented rule); ordinary bodies
  get `catalog` instead.

Consumed by the essentials pack's new `skills.list_categories` /
`skills.list_skills` seeds. Docs (CODEGEN.md, AGENTS.md, README.md) updated;
tests cover the catalog, the catalog/admin split on the run context, and the
new pack seeds.
This commit is contained in:
gabby committed 2026-10-17 07:34:39 +00:00
1 parent ed894bd329
commit ec3e6b1b97
8 files changed
+126 -13

No files matched your search

+10 -1
View File
@@ -54,6 +54,7 @@ from .skills import (
CreateSkill,
DeletedSkills,
Skill,
SkillCatalog,
SkillDraft,
SkillStore,
apply_tombstones,
@@ -435,8 +436,16 @@ class Scheduler:
for category in disabled_categories(config, self.packs):
self.tree.pop(category, None)
self.timers = TimerService(trace=self.trace, timezone=config.get("timezone"))
# Read-only introspection of the live tree for introspection skills
# (listing categories / the skills in one), supplied as a locked
# snapshot so a body never reaches into the scheduler.
self.catalog = SkillCatalog(self._tree_snapshot)
self.ctx = ActionContext(
engine=self.engine, config=config, timers=self.timers, admin=self
engine=self.engine,
config=config,
timers=self.timers,
admin=self,
catalog=self.catalog,
)
self.runner = SkillRunner(
self.ctx,