refactor(skill): move orchestration into core

This commit is contained in:
huanghuoguoguo
2026-09-06 12:37:09 +08:00
parent cba842fbee
commit 2fe4b117a4
3 changed files with 24 additions and 11 deletions
+10 -2
View File
@@ -34,7 +34,7 @@ def _repository(tmp_path) -> SkillRepository:
'local': {
'host_root': str(tmp_path / 'box'),
},
}
},
}
),
)
@@ -47,6 +47,14 @@ def test_repository_prefers_standalone_skill_root(tmp_path):
assert repository._store.root == str((tmp_path / 'skill-store').resolve())
def test_repository_locks_are_workspace_scoped(tmp_path):
repository = _repository(tmp_path)
first = repository._workspace_lock('workspace-a')
assert repository._workspace_lock('workspace-a') is first
assert repository._workspace_lock('workspace-b') is not first
def test_repository_keeps_old_box_root_only_for_online_upgrade(tmp_path):
app = SimpleNamespace(
workspace_service=SimpleNamespace(get_execution_binding=_binding),
@@ -89,7 +97,7 @@ async def test_repository_crud_and_reads_do_not_require_box(tmp_path):
skill = await repository.get_skill(_CONTEXT, 'docs-only', snapshot=True)
assert skill is not None
assert skill['revision'].startswith('sha256:')
assert skill['revision'].startswith('stat-v1:')
assert [item['name'] for item in await repository.list_skills(_CONTEXT)] == ['docs-only']
listed = await repository.list_skill_resources(