feat(tasks): add skill-templated task graph execution

This commit is contained in:
2026-06-23 10:22:58 +08:00
parent 6843d89b2c
commit 53b13e8eac
53 changed files with 4773 additions and 756 deletions

View File

@ -11,6 +11,7 @@ from beaver.services.user_files import (
UserFileNotFoundError,
UserFilePathError,
UserFileSizeError,
UserFileStorageError,
UserFileService,
normalize_user_path,
)
@ -151,3 +152,68 @@ def test_minio_storage_rejects_paths_that_escape_namespace() -> None:
with pytest.raises(UserFilePathError):
storage._user_path("users/bob/uploads/secret.txt")
@pytest.mark.asyncio
async def test_minio_storage_translates_s3_errors_to_user_file_errors() -> None:
from minio.error import S3Error
class FakeMinioClient:
def list_objects(self, *args, **kwargs):
raise S3Error(
None,
"SignatureDoesNotMatch",
"The request signature we calculated does not match",
"/beaver-user-files",
"request-id",
"host-id",
bucket_name="beaver-user-files",
)
storage = object.__new__(MinIOUserFileStorage)
storage.config = MinIOStorageConfig(
endpoint="minio.local:9000",
access_key="alice-access",
secret_key="alice-secret",
bucket="beaver-user-files",
namespace="users/alice",
)
storage.client = FakeMinioClient()
with pytest.raises(UserFileStorageError) as exc_info:
await storage.list_dir("uploads")
assert "SignatureDoesNotMatch" in str(exc_info.value)
@pytest.mark.asyncio
async def test_minio_storage_does_not_report_auth_errors_as_missing_files() -> None:
from minio.error import S3Error
class FakeMinioClient:
def stat_object(self, *args, **kwargs):
raise S3Error(
None,
"SignatureDoesNotMatch",
"The request signature we calculated does not match",
"/beaver-user-files/uploads/input.txt",
"request-id",
"host-id",
bucket_name="beaver-user-files",
object_name="users/alice/uploads/input.txt",
)
storage = object.__new__(MinIOUserFileStorage)
storage.config = MinIOStorageConfig(
endpoint="minio.local:9000",
access_key="alice-access",
secret_key="alice-secret",
bucket="beaver-user-files",
namespace="users/alice",
)
storage.client = FakeMinioClient()
with pytest.raises(UserFileStorageError) as exc_info:
await storage.read_file("uploads/input.txt")
assert "SignatureDoesNotMatch" in str(exc_info.value)