M2: the four V1 atoms + Git sync (Gitea / filesystem)
- Author the four V1 skill atoms in skills/ (Git is the source of truth): spec-writing & story-breakdown (product-owner), test-plan-generation & diff-review (qa) — each with risk-tagged actions, golden tests, and a body. - SharedKernel: IGitProvider seam (read-only, provider-agnostic) + GitFile. - Integrations module (its first real code): FileSystemGitProvider (dogfood/local) and a GiteaGitProvider (Gitea REST: recursive tree → SKILL.md blobs → base64 contents); the provider is chosen by GitSource:Provider config. - Skills: SkillSyncService consumes IGitProvider (never Integrations) and indexes each file; POST /api/skills/sync and a POST /api/skills/webhook/gitea (re-sync on push; signature verification + changed-file-only + queue offload come later). Verified: build green; ArchitectureTests 8/8 (Skills & Integrations reference only SharedKernel; the Git seam lives in SharedKernel); IntegrationTests 22/22 incl. a sync that indexes the four real atoms from skills/, published and queryable by role. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,20 +3,33 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using TeamUp.Modules.Integrations.Git;
|
||||
using TeamUp.SharedKernel.Git;
|
||||
using TeamUp.SharedKernel.Modularity;
|
||||
|
||||
namespace TeamUp.Modules.Integrations;
|
||||
|
||||
/// <summary>BYOK API configs, the Git connection, the encrypted-credential store (M3).</summary>
|
||||
/// <summary>
|
||||
/// BYOK API configs, the Git connection, the encrypted-credential store. In M2 it provides the
|
||||
/// <see cref="IGitProvider"/> (filesystem for dogfood, Gitea over REST). BYOK lands in M3.
|
||||
/// </summary>
|
||||
public sealed class IntegrationsModule : IModule
|
||||
{
|
||||
public string Name => "integrations";
|
||||
|
||||
public void Register(IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
// Skeleton: no services yet. M3 introduces this module's (internal) DbContext, the
|
||||
// encrypted ApiConfig store, and the provider-agnostic model-client seam interface.
|
||||
// The concrete model client (Microsoft.Extensions.AI) is deferred to M3-M4.
|
||||
services.Configure<GitSourceOptions>(configuration.GetSection(GitSourceOptions.SectionName));
|
||||
var options = configuration.GetSection(GitSourceOptions.SectionName).Get<GitSourceOptions>() ?? new GitSourceOptions();
|
||||
|
||||
if (string.Equals(options.Provider, "gitea", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
services.AddHttpClient<IGitProvider, GiteaGitProvider>();
|
||||
}
|
||||
else
|
||||
{
|
||||
services.AddSingleton<IGitProvider, FileSystemGitProvider>();
|
||||
}
|
||||
}
|
||||
|
||||
public void MapEndpoints(IEndpointRouteBuilder endpoints)
|
||||
|
||||
Reference in New Issue
Block a user