feat(skills): durable Cosmos-backed skills + Skill Builder - #14
Merged
Conversation
Move agent skills off the backend's ephemeral local filesystem (skills/ + SKILL.md) into Azure Cosmos DB as the durable, shared source of truth — mirroring the Cosmos agent-memory (011) and autonomous directive (012) patterns. The skills/ directory now only seeds defaults at startup; Cosmos is the runtime store for every create/edit/delete from the admin Skill Builder. The /api/skills* REST contract and the React frontend are unchanged. - cosmos_memory: skills live in a new `skills` container (partition /id). The per-container repos now share a `_CosmosContainer` base (the database/container bootstrap was copy-pasted across 5 classes), and the two identical /id stores (autonomous directives + skills) collapse into one generic `_CosmosByIdRepository` (list_all/get/create/upsert/delete) — the per-user analogue of user_data.CosmosUserScopedRepository. - skills_manager: async Cosmos-backed SkillManager (validation retained) + idempotent seed_skills()/filesystem_skill_docs() (never overwrites edits). The id is the single canonical skill name (no redundant stored `name`). - agent_factory: CosmosSkillsSource (lazy async get_skills) via FilteringSkillsSource. - validators/session_orchestration: available_skill_names() reads from Cosmos. - main: skill endpoints await the async manager; lifespan seeds skills. - infra: new `skills` Cosmos container fully wired (var/output/app setting). - tests: one InMemoryByIdRepository double backs both stores; new test_skills_cosmos (seeding, durability, emulator repo CRUD); autonomous + skills suites updated to the generic API. Offline + emulator suites green. No non-durable fallback. Authorization model (authenticated-user, consistent with sibling admin endpoints) documented in spec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move agent skills off the backend's ephemeral local filesystem (skills/ + SKILL.md) into Azure Cosmos DB as the durable, shared source of truth — mirroring the Cosmos agent-memory (011) and autonomous directive (012) patterns. The skills/ directory now only seeds defaults at startup; Cosmos is the runtime store for every create/edit/delete from the admin Skill Builder. The /api/skills* REST contract and the React frontend are unchanged.
skillscontainer (partition /id). The per-container repos now share a_CosmosContainerbase (the database/container bootstrap was copy-pasted across 5 classes), and the two identical /id stores (autonomous directives + skills) collapse into one generic_CosmosByIdRepository(list_all/get/create/upsert/delete) — the per-user analogue of user_data.CosmosUserScopedRepository.name).skillsCosmos container fully wired (var/output/app setting).Offline + emulator suites green. No non-durable fallback. Authorization model (authenticated-user, consistent with sibling admin endpoints) documented in spec.