Skip to content

Commit d0bc3eb

Browse files
committed
Define control-plane domain contracts
1 parent f581d12 commit d0bc3eb

20 files changed

+852
-98
lines changed

DotPilot.Core/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Stack: `.NET 10`, class library, feature-aligned contracts and provider-independ
1212

1313
- `DotPilot.Core.csproj`
1414
- `Features/ApplicationShell/AppConfig.cs`
15+
- `Features/ControlPlaneDomain/*`
1516
- `Features/RuntimeFoundation/*`
1617

1718
## Boundaries
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
using System.Globalization;
2+
3+
namespace DotPilot.Core.Features.ControlPlaneDomain;
4+
5+
public readonly record struct WorkspaceId(Guid Value)
6+
{
7+
public static WorkspaceId New() => new(ControlPlaneIdentifier.NewValue());
8+
9+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
10+
}
11+
12+
public readonly record struct AgentProfileId(Guid Value)
13+
{
14+
public static AgentProfileId New() => new(ControlPlaneIdentifier.NewValue());
15+
16+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
17+
}
18+
19+
public readonly record struct SessionId(Guid Value)
20+
{
21+
public static SessionId New() => new(ControlPlaneIdentifier.NewValue());
22+
23+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
24+
}
25+
26+
public readonly record struct FleetId(Guid Value)
27+
{
28+
public static FleetId New() => new(ControlPlaneIdentifier.NewValue());
29+
30+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
31+
}
32+
33+
public readonly record struct ProviderId(Guid Value)
34+
{
35+
public static ProviderId New() => new(ControlPlaneIdentifier.NewValue());
36+
37+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
38+
}
39+
40+
public readonly record struct ModelRuntimeId(Guid Value)
41+
{
42+
public static ModelRuntimeId New() => new(ControlPlaneIdentifier.NewValue());
43+
44+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
45+
}
46+
47+
public readonly record struct ToolCapabilityId(Guid Value)
48+
{
49+
public static ToolCapabilityId New() => new(ControlPlaneIdentifier.NewValue());
50+
51+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
52+
}
53+
54+
public readonly record struct ApprovalId(Guid Value)
55+
{
56+
public static ApprovalId New() => new(ControlPlaneIdentifier.NewValue());
57+
58+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
59+
}
60+
61+
public readonly record struct ArtifactId(Guid Value)
62+
{
63+
public static ArtifactId New() => new(ControlPlaneIdentifier.NewValue());
64+
65+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
66+
}
67+
68+
public readonly record struct TelemetryRecordId(Guid Value)
69+
{
70+
public static TelemetryRecordId New() => new(ControlPlaneIdentifier.NewValue());
71+
72+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
73+
}
74+
75+
public readonly record struct EvaluationId(Guid Value)
76+
{
77+
public static EvaluationId New() => new(ControlPlaneIdentifier.NewValue());
78+
79+
public override string ToString() => ControlPlaneIdentifier.Format(Value);
80+
}
81+
82+
static file class ControlPlaneIdentifier
83+
{
84+
public static Guid NewValue() => Guid.CreateVersion7();
85+
86+
public static string Format(Guid value) => value.ToString("N", CultureInfo.InvariantCulture);
87+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
namespace DotPilot.Core.Features.ControlPlaneDomain;
2+
3+
public enum SessionPhase
4+
{
5+
Plan,
6+
Execute,
7+
Review,
8+
Paused,
9+
Completed,
10+
Failed,
11+
}
12+
13+
public enum ProviderConnectionStatus
14+
{
15+
Available,
16+
Unavailable,
17+
RequiresAuthentication,
18+
Misconfigured,
19+
Outdated,
20+
}
21+
22+
public enum ApprovalState
23+
{
24+
NotRequired,
25+
Pending,
26+
Approved,
27+
Rejected,
28+
}
29+
30+
public enum AgentRoleKind
31+
{
32+
Coding,
33+
Research,
34+
Analyst,
35+
Reviewer,
36+
Operator,
37+
Orchestrator,
38+
}
39+
40+
public enum FleetExecutionMode
41+
{
42+
SingleAgent,
43+
Parallel,
44+
Orchestrated,
45+
}
46+
47+
public enum RuntimeKind
48+
{
49+
Provider,
50+
LocalModel,
51+
}
52+
53+
public enum ToolCapabilityKind
54+
{
55+
Command,
56+
FileSystem,
57+
Git,
58+
Mcp,
59+
Diagnostics,
60+
}
61+
62+
public enum ApprovalScope
63+
{
64+
FileWrite,
65+
CommandExecution,
66+
ToolCall,
67+
NetworkAccess,
68+
SessionResume,
69+
}
70+
71+
public enum ArtifactKind
72+
{
73+
Plan,
74+
Snapshot,
75+
Diff,
76+
Log,
77+
Screenshot,
78+
Transcript,
79+
Report,
80+
}
81+
82+
public enum TelemetrySignalKind
83+
{
84+
Trace,
85+
Metric,
86+
Log,
87+
Event,
88+
}
89+
90+
public enum EvaluationMetricKind
91+
{
92+
Relevance,
93+
Groundedness,
94+
Completeness,
95+
TaskAdherence,
96+
ToolCallAccuracy,
97+
Safety,
98+
}
99+
100+
public enum EvaluationOutcome
101+
{
102+
Passed,
103+
NeedsReview,
104+
Failed,
105+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
namespace DotPilot.Core.Features.ControlPlaneDomain;
2+
3+
public sealed record WorkspaceDescriptor
4+
{
5+
public WorkspaceId Id { get; init; }
6+
7+
public string Name { get; init; } = string.Empty;
8+
9+
public string RootPath { get; init; } = string.Empty;
10+
11+
public string BranchName { get; init; } = string.Empty;
12+
}
13+
14+
public sealed record AgentProfileDescriptor
15+
{
16+
public AgentProfileId Id { get; init; }
17+
18+
public string Name { get; init; } = string.Empty;
19+
20+
public AgentRoleKind Role { get; init; }
21+
22+
public ProviderId? ProviderId { get; init; }
23+
24+
public ModelRuntimeId? ModelRuntimeId { get; init; }
25+
26+
public IReadOnlyList<ToolCapabilityId> ToolCapabilityIds { get; init; } = [];
27+
28+
public IReadOnlyList<string> Tags { get; init; } = [];
29+
}
30+
31+
public sealed record FleetDescriptor
32+
{
33+
public FleetId Id { get; init; }
34+
35+
public string Name { get; init; } = string.Empty;
36+
37+
public FleetExecutionMode ExecutionMode { get; init; } = FleetExecutionMode.SingleAgent;
38+
39+
public IReadOnlyList<AgentProfileId> AgentProfileIds { get; init; } = [];
40+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace DotPilot.Core.Features.ControlPlaneDomain;
2+
3+
public sealed record ToolCapabilityDescriptor
4+
{
5+
public ToolCapabilityId Id { get; init; }
6+
7+
public string Name { get; init; } = string.Empty;
8+
9+
public string DisplayName { get; init; } = string.Empty;
10+
11+
public ToolCapabilityKind Kind { get; init; }
12+
13+
public bool RequiresApproval { get; init; }
14+
15+
public bool IsEnabledByDefault { get; init; }
16+
17+
public IReadOnlyList<string> Tags { get; init; } = [];
18+
}
19+
20+
public sealed record ProviderDescriptor
21+
{
22+
public ProviderId Id { get; init; }
23+
24+
public string DisplayName { get; init; } = string.Empty;
25+
26+
public string CommandName { get; init; } = string.Empty;
27+
28+
public ProviderConnectionStatus Status { get; init; } = ProviderConnectionStatus.Unavailable;
29+
30+
public string StatusSummary { get; init; } = string.Empty;
31+
32+
public bool RequiresExternalToolchain { get; init; }
33+
34+
public IReadOnlyList<ToolCapabilityId> SupportedToolIds { get; init; } = [];
35+
}
36+
37+
public sealed record ModelRuntimeDescriptor
38+
{
39+
public ModelRuntimeId Id { get; init; }
40+
41+
public string DisplayName { get; init; } = string.Empty;
42+
43+
public string EngineName { get; init; } = string.Empty;
44+
45+
public RuntimeKind RuntimeKind { get; init; }
46+
47+
public ProviderConnectionStatus Status { get; init; } = ProviderConnectionStatus.Unavailable;
48+
49+
public IReadOnlyList<string> SupportedModelFamilies { get; init; } = [];
50+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
namespace DotPilot.Core.Features.ControlPlaneDomain;
2+
3+
public sealed record SessionDescriptor
4+
{
5+
public SessionId Id { get; init; }
6+
7+
public WorkspaceId WorkspaceId { get; init; }
8+
9+
public string Title { get; init; } = string.Empty;
10+
11+
public SessionPhase Phase { get; init; } = SessionPhase.Plan;
12+
13+
public ApprovalState ApprovalState { get; init; } = ApprovalState.NotRequired;
14+
15+
public FleetId? FleetId { get; init; }
16+
17+
public IReadOnlyList<AgentProfileId> AgentProfileIds { get; init; } = [];
18+
19+
public DateTimeOffset CreatedAt { get; init; }
20+
21+
public DateTimeOffset UpdatedAt { get; init; }
22+
}
23+
24+
public sealed record SessionApprovalRecord
25+
{
26+
public ApprovalId Id { get; init; }
27+
28+
public SessionId SessionId { get; init; }
29+
30+
public ApprovalScope Scope { get; init; }
31+
32+
public ApprovalState State { get; init; } = ApprovalState.Pending;
33+
34+
public string RequestedAction { get; init; } = string.Empty;
35+
36+
public string RequestedBy { get; init; } = string.Empty;
37+
38+
public DateTimeOffset RequestedAt { get; init; }
39+
40+
public DateTimeOffset? ResolvedAt { get; init; }
41+
}
42+
43+
public sealed record ArtifactDescriptor
44+
{
45+
public ArtifactId Id { get; init; }
46+
47+
public SessionId SessionId { get; init; }
48+
49+
public AgentProfileId? AgentProfileId { get; init; }
50+
51+
public string Name { get; init; } = string.Empty;
52+
53+
public ArtifactKind Kind { get; init; }
54+
55+
public string RelativePath { get; init; } = string.Empty;
56+
57+
public DateTimeOffset CreatedAt { get; init; }
58+
}
59+
60+
public sealed record TelemetryRecord
61+
{
62+
public TelemetryRecordId Id { get; init; }
63+
64+
public SessionId SessionId { get; init; }
65+
66+
public TelemetrySignalKind Kind { get; init; }
67+
68+
public string Name { get; init; } = string.Empty;
69+
70+
public string Summary { get; init; } = string.Empty;
71+
72+
public DateTimeOffset RecordedAt { get; init; }
73+
}
74+
75+
public sealed record EvaluationRecord
76+
{
77+
public EvaluationId Id { get; init; }
78+
79+
public SessionId SessionId { get; init; }
80+
81+
public ArtifactId? ArtifactId { get; init; }
82+
83+
public EvaluationMetricKind Metric { get; init; }
84+
85+
public decimal Score { get; init; }
86+
87+
public EvaluationOutcome Outcome { get; init; } = EvaluationOutcome.NeedsReview;
88+
89+
public string Summary { get; init; } = string.Empty;
90+
91+
public DateTimeOffset EvaluatedAt { get; init; }
92+
}

0 commit comments

Comments
 (0)