Skip to content

Commit 8de7bbb

Browse files
authored
Merge pull request #73 from managedcode/codex/vertical-slice-core-foundation
Add vertical-slice runtime foundation for issue #12
2 parents 4dabc6a + f581d12 commit 8de7bbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1693
-687
lines changed

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ This file defines how AI agents work in this solution.
2121
- Solution root: `.` (`DotPilot.slnx`)
2222
- Projects or modules with local `AGENTS.md` files:
2323
- `DotPilot`
24+
- `DotPilot.Core`
25+
- `DotPilot.Runtime`
2426
- `DotPilot.ReleaseTool`
2527
- `DotPilot.Tests`
2628
- `DotPilot.UITests`
@@ -136,13 +138,16 @@ For this app:
136138
- coverage uses the `coverlet.collector` integration on `DotPilot.Tests` with the repo runsettings file to keep generated Uno artifacts out of the coverage path
137139
- desktop release publishing uses `dotnet publish DotPilot/DotPilot.csproj -c Release -f net10.0-desktop`; the validation workflow stays focused on build and automated tests, while the release workflow owns desktop publish outputs for macOS, Windows, and Linux
138140
- `LangVersion` is pinned to `latest` at the root
141+
- prefer the newest stable `.NET 10` and `C#` language features that are supported by the pinned SDK and do not weaken readability, determinism, or analyzability
139142
- the repo-root lowercase `.editorconfig` is the source of truth for formatting, naming, style, and analyzer severity
140143
- local and CI build commands must pass `-warnaserror`; warnings are not an acceptable "green" build state in this repository
141144
- quality gates should prefer analyzer-backed build failures over separate one-off CI tools; for overloaded methods and maintainability drift, enable build-time analyzers such as `CA1502` instead of adding a formatting-only gate
142145
- `Directory.Build.props` owns the shared analyzer and warning policy for future projects
143146
- `Directory.Packages.props` owns centrally managed package versions
144147
- `global.json` pins the .NET SDK and Uno SDK version used by the app and tests
145148
- `DotPilot/DotPilot.csproj` keeps `GenerateDocumentationFile=true` with `CS1591` suppressed so `IDE0005` stays enforceable in CI across all target frameworks without inventing command-line-only build flags
149+
- architecture work must keep a vertical-slice shape: each feature owns its contracts, orchestration, and tests behind clear boundaries instead of growing a shared horizontal service layer
150+
- keep the Uno app project presentation-only; domain, runtime host, orchestration, integrations, and persistence code must live in separate class-library projects so UI composition does not mix with feature implementation
146151
- GitHub Actions workflows must use descriptive names and filenames that reflect their purpose; do not use a generic `ci.yml` catch-all because build validation and release automation are separate operator flows
147152
- GitHub Actions must be split into at least one validation workflow for normal builds/tests and one release workflow for CI-driven version resolution, release-note generation, desktop publishing, and GitHub Release publication
148153
- the release workflow must run automatically on pushes to `main`, build desktop apps, and publish the GitHub Release without requiring a manual dispatch
@@ -259,16 +264,20 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
259264
- Tests must prove the real user flow or caller-visible system flow, not only internal implementation details.
260265
- Tests should be as realistic as possible and exercise the system through real flows, contracts, and dependencies.
261266
- Tests must cover positive flows, negative flows, edge cases, and unexpected paths from multiple relevant angles when the behaviour can fail in different ways.
267+
- All caller-visible feature flows must have API or integration-style automated coverage through public contracts; structure-only unit tests are not enough for this repository.
262268
- Prefer integration, API, and UI tests over isolated unit tests when behaviour crosses boundaries.
263269
- Do not use mocks, fakes, stubs, or service doubles in verification.
264270
- Exercise internal and external dependencies through real containers, test instances, or sandbox environments that match the real contract.
265271
- Flaky tests are failures. Fix the cause.
272+
- Because CI does not guarantee Codex, Claude Code, or GitHub Copilot availability, keep a deterministic test AI client in-repo so core agent flows stay testable without external provider CLIs.
273+
- Tests that require real Codex, Claude Code, or GitHub Copilot toolchains must run only when the corresponding toolchain and auth are available; their absence is an environment condition, not a reason to block the provider-independent test baseline.
266274
- Changed production code MUST reach at least 80% line coverage, and at least 70% branch coverage where branch coverage is available.
267275
- Critical flows and public contracts MUST reach at least 90% line coverage with explicit success and failure assertions.
268276
- Repository or module coverage must not decrease without an explicit written exception. Coverage after the change must stay at least at the previous baseline or improve.
269277
- Coverage is for finding gaps, not gaming a number. Coverage numbers do not replace scenario coverage or user-flow verification.
270278
- The task is not done until the full relevant test suite is green, not only the newly added tests.
271279
- UI tests are mandatory for this repository and must run in normal agent verification; missing local browser-driver setup is a harness bug to fix, not a reason to skip the suite.
280+
- UI coverage must validate complete end-to-end operator flows and also assert the presence and behavior of each interactive element introduced by a feature.
272281
- GitHub Actions PR validation is mandatory for every PR and must enforce the real repo verification path so test failures are caught in CI, not only locally.
273282
- GitHub Actions PR validation must run full automated test verification, especially the real UI suite; build-only or smoke-only checks are not an acceptable substitute for pull-request gating.
274283
- GitHub Actions validation must also produce downloadable app artifacts for macOS, Windows, and Linux so every PR and mainline run has test results plus installable build outputs.
@@ -322,6 +331,7 @@ Ask first:
322331

323332
- Follow the canonical MCAF tutorial when bootstrapping or upgrading the agent workflow.
324333
- Commit cohesive code-change batches promptly while debugging, especially before switching focus or starting long verification runs, so the branch state stays inspectable and pushable.
334+
- After opening or updating a PR, create a fresh working branch before continuing with the next slice of work so follow-up changes do not pile onto the already-reviewed branch.
325335
- Keep the root `AGENTS.md` at the repository root.
326336
- Keep the repo-local agent skill directory limited to current `mcaf-*` skills.
327337
- Keep the solution file name cased as `DotPilot.slnx`.

DotPilot.Core/AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AGENTS.md
2+
3+
Project: `DotPilot.Core`
4+
Stack: `.NET 10`, class library, feature-aligned contracts and provider-independent runtime foundations
5+
6+
## Purpose
7+
8+
- This project owns non-UI contracts, typed identifiers, and feature slices that must stay independent from the Uno presentation host.
9+
- It provides the stable public shapes for runtime, orchestration, providers, and shell configuration so UI and future runtime implementations can evolve without circular coupling.
10+
11+
## Entry Points
12+
13+
- `DotPilot.Core.csproj`
14+
- `Features/ApplicationShell/AppConfig.cs`
15+
- `Features/RuntimeFoundation/*`
16+
17+
## Boundaries
18+
19+
- Keep this project free of `Uno Platform`, XAML, brushes, and page/view-model concerns.
20+
- Organize code by vertical feature slice, not by shared horizontal folders such as generic `Services` or `Helpers`.
21+
- Prefer stable contracts, typed identifiers, and public interfaces here; concrete runtime integrations can live in separate libraries.
22+
- Keep provider-independent testing seams real and deterministic so CI can validate core flows without external CLIs.
23+
24+
## Local Commands
25+
26+
- `build-core`: `dotnet build DotPilot.Core/DotPilot.Core.csproj`
27+
- `test-core`: `dotnet test DotPilot.Tests/DotPilot.Tests.csproj --filter FullyQualifiedName~RuntimeFoundation`
28+
29+
## Applicable Skills
30+
31+
- `mcaf-dotnet`
32+
- `mcaf-dotnet-features`
33+
- `mcaf-testing`
34+
- `mcaf-solid-maintainability`
35+
- `mcaf-architecture-overview`
36+
37+
## Local Risks Or Protected Areas
38+
39+
- These contracts will become shared dependencies across future slices, so naming drift or unclear boundaries will amplify quickly.
40+
- Avoid baking provider-specific assumptions into the core runtime contracts unless an ADR or feature spec explicitly requires them.

DotPilot.Core/DotPilot.Core.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6+
<NoWarn>$(NoWarn);CS1591</NoWarn>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace DotPilot.Core.Features.ApplicationShell;
2+
3+
public sealed record AppConfig
4+
{
5+
public string? Environment { get; init; }
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace DotPilot.Core.Features.RuntimeFoundation;
2+
3+
public interface IAgentRuntimeClient
4+
{
5+
ValueTask<AgentTurnResult> ExecuteAsync(AgentTurnRequest request, CancellationToken cancellationToken);
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace DotPilot.Core.Features.RuntimeFoundation;
2+
3+
public interface IRuntimeFoundationCatalog
4+
{
5+
RuntimeFoundationSnapshot GetSnapshot();
6+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace DotPilot.Core.Features.RuntimeFoundation;
2+
3+
public sealed record RuntimeSliceDescriptor(
4+
int IssueNumber,
5+
string IssueLabel,
6+
string Name,
7+
string Summary,
8+
RuntimeSliceState State);
9+
10+
public sealed record ProviderToolchainStatus(
11+
string DisplayName,
12+
string CommandName,
13+
ProviderConnectionStatus Status,
14+
string StatusSummary,
15+
bool RequiresExternalToolchain);
16+
17+
public sealed record RuntimeFoundationSnapshot(
18+
string EpicLabel,
19+
string Summary,
20+
string DeterministicClientName,
21+
string DeterministicProbePrompt,
22+
IReadOnlyList<RuntimeSliceDescriptor> Slices,
23+
IReadOnlyList<ProviderToolchainStatus> Providers);
24+
25+
public sealed record AgentTurnRequest(
26+
SessionId SessionId,
27+
AgentProfileId AgentProfileId,
28+
string Prompt,
29+
AgentExecutionMode Mode);
30+
31+
public sealed record AgentTurnResult(
32+
string Summary,
33+
SessionPhase NextPhase,
34+
ApprovalState ApprovalState,
35+
IReadOnlyList<string> ProducedArtifacts);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System.Globalization;
2+
3+
namespace DotPilot.Core.Features.RuntimeFoundation;
4+
5+
public readonly record struct WorkspaceId(Guid Value)
6+
{
7+
public static WorkspaceId New() => new(Guid.CreateVersion7());
8+
9+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
10+
}
11+
12+
public readonly record struct AgentProfileId(Guid Value)
13+
{
14+
public static AgentProfileId New() => new(Guid.CreateVersion7());
15+
16+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
17+
}
18+
19+
public readonly record struct SessionId(Guid Value)
20+
{
21+
public static SessionId New() => new(Guid.CreateVersion7());
22+
23+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
24+
}
25+
26+
public readonly record struct FleetId(Guid Value)
27+
{
28+
public static FleetId New() => new(Guid.CreateVersion7());
29+
30+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
31+
}
32+
33+
public readonly record struct ProviderId(Guid Value)
34+
{
35+
public static ProviderId New() => new(Guid.CreateVersion7());
36+
37+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
38+
}
39+
40+
public readonly record struct ModelRuntimeId(Guid Value)
41+
{
42+
public static ModelRuntimeId New() => new(Guid.CreateVersion7());
43+
44+
public override string ToString() => Value.ToString("N", CultureInfo.InvariantCulture);
45+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace DotPilot.Core.Features.RuntimeFoundation;
2+
3+
public static class RuntimeFoundationIssues
4+
{
5+
private const string IssuePrefix = "#";
6+
7+
public const int EmbeddedAgentRuntimeHostEpic = 12;
8+
public const int DomainModel = 22;
9+
public const int CommunicationContracts = 23;
10+
public const int EmbeddedOrleansHost = 24;
11+
public const int AgentFrameworkRuntime = 25;
12+
13+
public static string FormatIssueLabel(int issueNumber) => string.Concat(IssuePrefix, issueNumber);
14+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace DotPilot.Core.Features.RuntimeFoundation;
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+
}
18+
19+
public enum ApprovalState
20+
{
21+
NotRequired,
22+
Pending,
23+
Approved,
24+
Rejected,
25+
}
26+
27+
public enum RuntimeSliceState
28+
{
29+
Planned,
30+
Sequenced,
31+
ReadyForImplementation,
32+
}
33+
34+
public enum AgentExecutionMode
35+
{
36+
Plan,
37+
Execute,
38+
Review,
39+
}

0 commit comments

Comments
 (0)