Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DotPilot.Core/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Stack: `.NET 10`, class library, feature-aligned contracts and provider-independ

- `DotPilot.Core.csproj`
- `Features/ApplicationShell/AppConfig.cs`
- `Features/ControlPlaneDomain/*`
- `Features/RuntimeFoundation/*`

## Boundaries
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using System.Globalization;

namespace DotPilot.Core.Features.ControlPlaneDomain;

public readonly record struct WorkspaceId(Guid Value)
{
public static WorkspaceId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct AgentProfileId(Guid Value)
{
public static AgentProfileId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct SessionId(Guid Value)
{
public static SessionId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct FleetId(Guid Value)
{
public static FleetId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct ProviderId(Guid Value)
{
public static ProviderId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct ModelRuntimeId(Guid Value)
{
public static ModelRuntimeId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct ToolCapabilityId(Guid Value)
{
public static ToolCapabilityId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct ApprovalId(Guid Value)
{
public static ApprovalId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct ArtifactId(Guid Value)
{
public static ArtifactId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct TelemetryRecordId(Guid Value)
{
public static TelemetryRecordId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

public readonly record struct EvaluationId(Guid Value)
{
public static EvaluationId New() => new(ControlPlaneIdentifier.NewValue());

public override string ToString() => ControlPlaneIdentifier.Format(Value);
}

static file class ControlPlaneIdentifier
{
public static Guid NewValue() => Guid.CreateVersion7();

public static string Format(Guid value) => value.ToString("N", CultureInfo.InvariantCulture);
}
105 changes: 105 additions & 0 deletions DotPilot.Core/Features/ControlPlaneDomain/ControlPlaneStates.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
namespace DotPilot.Core.Features.ControlPlaneDomain;

public enum SessionPhase
{
Plan,
Execute,
Review,
Paused,
Completed,
Failed,
}

public enum ProviderConnectionStatus
{
Available,
Unavailable,
RequiresAuthentication,
Misconfigured,
Outdated,
}

public enum ApprovalState
{
NotRequired,
Pending,
Approved,
Rejected,
}

public enum AgentRoleKind
{
Coding,
Research,
Analyst,
Reviewer,
Operator,
Orchestrator,
}

public enum FleetExecutionMode
{
SingleAgent,
Parallel,
Orchestrated,
}

public enum RuntimeKind
{
Provider,
LocalModel,
}

public enum ToolCapabilityKind
{
Command,
FileSystem,
Git,
Mcp,
Diagnostics,
}

public enum ApprovalScope
{
FileWrite,
CommandExecution,
ToolCall,
NetworkAccess,
SessionResume,
}

public enum ArtifactKind
{
Plan,
Snapshot,
Diff,
Log,
Screenshot,
Transcript,
Report,
}

public enum TelemetrySignalKind
{
Trace,
Metric,
Log,
Event,
}

public enum EvaluationMetricKind
{
Relevance,
Groundedness,
Completeness,
TaskAdherence,
ToolCallAccuracy,
Safety,
}

public enum EvaluationOutcome
{
Passed,
NeedsReview,
Failed,
}
40 changes: 40 additions & 0 deletions DotPilot.Core/Features/ControlPlaneDomain/ParticipantContracts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace DotPilot.Core.Features.ControlPlaneDomain;

public sealed record WorkspaceDescriptor
{
public WorkspaceId Id { get; init; }

public string Name { get; init; } = string.Empty;

public string RootPath { get; init; } = string.Empty;

public string BranchName { get; init; } = string.Empty;
}

public sealed record AgentProfileDescriptor
{
public AgentProfileId Id { get; init; }

public string Name { get; init; } = string.Empty;

public AgentRoleKind Role { get; init; }

public ProviderId? ProviderId { get; init; }

public ModelRuntimeId? ModelRuntimeId { get; init; }

public IReadOnlyList<ToolCapabilityId> ToolCapabilityIds { get; init; } = [];

public IReadOnlyList<string> Tags { get; init; } = [];
}

public sealed record FleetDescriptor
{
public FleetId Id { get; init; }

public string Name { get; init; } = string.Empty;

public FleetExecutionMode ExecutionMode { get; init; } = FleetExecutionMode.SingleAgent;

public IReadOnlyList<AgentProfileId> AgentProfileIds { get; init; } = [];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
namespace DotPilot.Core.Features.ControlPlaneDomain;

public sealed record ToolCapabilityDescriptor
{
public ToolCapabilityId Id { get; init; }

public string Name { get; init; } = string.Empty;

public string DisplayName { get; init; } = string.Empty;

public ToolCapabilityKind Kind { get; init; }

public bool RequiresApproval { get; init; }

public bool IsEnabledByDefault { get; init; }

public IReadOnlyList<string> Tags { get; init; } = [];
}

public sealed record ProviderDescriptor
{
public ProviderId Id { get; init; }

public string DisplayName { get; init; } = string.Empty;

public string CommandName { get; init; } = string.Empty;

public ProviderConnectionStatus Status { get; init; } = ProviderConnectionStatus.Unavailable;

public string StatusSummary { get; init; } = string.Empty;

public bool RequiresExternalToolchain { get; init; }

public IReadOnlyList<ToolCapabilityId> SupportedToolIds { get; init; } = [];
}

public sealed record ModelRuntimeDescriptor
{
public ModelRuntimeId Id { get; init; }

public string DisplayName { get; init; } = string.Empty;

public string EngineName { get; init; } = string.Empty;

public RuntimeKind RuntimeKind { get; init; }

public ProviderConnectionStatus Status { get; init; } = ProviderConnectionStatus.Unavailable;

public IReadOnlyList<string> SupportedModelFamilies { get; init; } = [];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
namespace DotPilot.Core.Features.ControlPlaneDomain;

public sealed record SessionDescriptor
{
public SessionId Id { get; init; }

public WorkspaceId WorkspaceId { get; init; }

public string Title { get; init; } = string.Empty;

public SessionPhase Phase { get; init; } = SessionPhase.Plan;

public ApprovalState ApprovalState { get; init; } = ApprovalState.NotRequired;

public FleetId? FleetId { get; init; }

public IReadOnlyList<AgentProfileId> AgentProfileIds { get; init; } = [];

public DateTimeOffset CreatedAt { get; init; }

public DateTimeOffset UpdatedAt { get; init; }
}

public sealed record SessionApprovalRecord
{
public ApprovalId Id { get; init; }

public SessionId SessionId { get; init; }

public ApprovalScope Scope { get; init; }

public ApprovalState State { get; init; } = ApprovalState.Pending;

public string RequestedAction { get; init; } = string.Empty;

public string RequestedBy { get; init; } = string.Empty;

public DateTimeOffset RequestedAt { get; init; }

public DateTimeOffset? ResolvedAt { get; init; }
}

public sealed record ArtifactDescriptor
{
public ArtifactId Id { get; init; }

public SessionId SessionId { get; init; }

public AgentProfileId? AgentProfileId { get; init; }

public string Name { get; init; } = string.Empty;

public ArtifactKind Kind { get; init; }

public string RelativePath { get; init; } = string.Empty;

public DateTimeOffset CreatedAt { get; init; }
}

public sealed record TelemetryRecord
{
public TelemetryRecordId Id { get; init; }

public SessionId SessionId { get; init; }

public TelemetrySignalKind Kind { get; init; }

public string Name { get; init; } = string.Empty;

public string Summary { get; init; } = string.Empty;

public DateTimeOffset RecordedAt { get; init; }
}

public sealed record EvaluationRecord
{
public EvaluationId Id { get; init; }

public SessionId SessionId { get; init; }

public ArtifactId? ArtifactId { get; init; }

public EvaluationMetricKind Metric { get; init; }

public decimal Score { get; init; }

public EvaluationOutcome Outcome { get; init; } = EvaluationOutcome.NeedsReview;

public string Summary { get; init; } = string.Empty;

public DateTimeOffset EvaluatedAt { get; init; }
}
Loading