Skip to content

Commit a8c09ec

Browse files
OgeonX-AiAitomates
andauthored
docs: Phase 36 README + docs/wiki refresh (#19)
* docs(36-01): refresh README with coverage-gate status and freshness footer - Remove stale static 35-tests badge - Add Test Coverage section describing in-progress PR #16 branch-rate gate - Append docs-verified freshness footer * docs(36-03): add docs/wiki tree (Home, Architecture, Operations, Decisions) - Architecture.md documents the goal state machine and contrasts current main failure handling with the not-yet-landed Phase 28-01 typed-failure retry/halt path (local unpushed branch, no open PR) - Operations.md verified build/test/CI commands - Decisions.md indexes phase history and open PRs --------- Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi>
1 parent b3d131e commit a8c09ec

5 files changed

Lines changed: 242 additions & 1 deletion

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ opens a pull request with durable workflow state.
1010
**Stack:** .NET 10 (C#) · GitHub MCP Server · Anthropic Claude · Polly
1111

1212
[![CI](https://github.com/Coding-Autopilot-System/gsd-orchestrator/actions/workflows/ci.yml/badge.svg)](https://github.com/Coding-Autopilot-System/gsd-orchestrator/actions/workflows/ci.yml)
13-
[![Tests](https://img.shields.io/badge/tests-35%20passing-brightgreen)](https://github.com/Coding-Autopilot-System/gsd-orchestrator/actions/workflows/ci.yml)
1413
[![.NET 10](https://img.shields.io/badge/.NET-10-512BD4)](https://dotnet.microsoft.com/download/dotnet/10.0)
1514
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
1615

@@ -39,6 +38,18 @@ not just "AI edits code." The stronger signal is the operational model around th
3938

4039
See [docs/portfolio-proof.md](docs/portfolio-proof.md) for a concise reviewer-oriented summary.
4140

41+
## Test Coverage
42+
43+
The CI `Test` step runs the full xUnit suite (`src/GsdOrchestrator.Tests`) via `dotnet test`
44+
with `--collect:"XPlat Code Coverage"` and uploads the Cobertura results as a workflow
45+
artifact, but `main` does not yet fail the build on a coverage regression. A ratcheted
46+
branch-coverage gate is **in progress (PR #16)**: it adds a new `coverlet.runsettings`
47+
collector config and an "Enforce coverage" CI step that reads `branch-rate` (not line-rate)
48+
from the produced Cobertura XML and fails closed if it drops below a ratcheted baseline
49+
(measured at ~0.73 branch-rate in the PR, up from a ~0.69 starting point), emitting CAS JSON
50+
telemetry on pass/fail. Until PR #16 merges, coverage is collected and published as an
51+
artifact but not enforced.
52+
4253
## How It Works
4354

4455
```text
@@ -232,3 +243,5 @@ GithubMCP/
232243
|-- Models/
233244
`-- States/
234245
```
246+
247+
<!-- docs-verified: a01b130c98cb7833d45cc7406f6002009f33557a 2026-07-08 -->

docs/wiki/Architecture.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Architecture
2+
3+
## Goal state machine
4+
5+
The orchestrator is a durable `GsdStateMachine` built around the `WorkflowState` enum
6+
(`src/GsdOrchestrator/Workflows/GsdStateMachine.cs`, `Models/WorkflowState.cs`). Every issue
7+
run walks the same linear path unless it is triaged out early or a state raises an unhandled
8+
exception, which transitions the workflow to `Failed`. State is checkpointed to disk after
9+
every transition (`FileCheckpointStore`), so `--resume <workflow-id>` can continue an
10+
interrupted run instead of restarting it.
11+
12+
```mermaid
13+
stateDiagram-v2
14+
direction LR
15+
[*] --> Idle
16+
Idle --> Triaging
17+
Triaging --> Analyzing: actionable issue
18+
Triaging --> Done: non-actionable or --triage
19+
Analyzing --> Branching
20+
Branching --> Editing
21+
Editing --> TestGenerating
22+
TestGenerating --> Validating
23+
Validating --> Committing
24+
Validating --> Failed: blocking gate
25+
Committing --> PrCreating
26+
PrCreating --> Reviewing
27+
Reviewing --> Documenting: issue mode
28+
[*] --> Reviewing: --pr mode
29+
Reviewing --> Done: PR-review mode
30+
Documenting --> Done
31+
Done --> [*]
32+
Failed --> [*]
33+
```
34+
35+
<!-- codex:generate-image prompt="A conveyor-belt state machine: a glowing token labeled ISSUE travels through eleven numbered gates (Idle, Triaging, Analyzing, Branching, Editing, TestGenerating, Validating, Committing, PrCreating, Reviewing, Documenting) each rendered as a small illuminated archway, ending at a checkered-flag PR gate; one side-branch peels off downward into a red Failed gate with a retry arrow looping back; isometric, enterprise blue/graphite palette" style="isometric, enterprise, clean" replaces="mermaid-above" -->
36+
37+
## Failure handling on `main` today
38+
39+
`ResumeAsync` checks `ctx.CurrentState == WorkflowState.Failed`: if `ctx.FailedState` is set,
40+
it clears the failure and re-enters that state for a retry; if the retry fails again it maps
41+
the exception to a `TerminalStopReason` (`BudgetExhausted`, `NoProgress`, `RuntimeExceeded`,
42+
or `Unknown`) and halts. On the primary path, an unhandled exception during a state currently
43+
rolls the workflow back through the SDLC phase map (`Discovery``Design``Change`
44+
`Assurance``Closure`) before settling into `Failed`, recording the *rolled-back* state as
45+
`FailedState` rather than the state where the exception actually occurred.
46+
47+
## Typed-failure retry/halt path (Phase 28-01 — not yet on `main`)
48+
49+
Phase 28-01 hardens this: transient `McpException` failures should bypass the SDLC rollback
50+
cascade entirely and persist the *actual* failed state, so `ResumeAsync` retries the state
51+
that really failed (once) before halting — proven by `FaultInjectionTests.cs` and
52+
`CheckpointCorruptionTests.cs` (see [`28-01-SUMMARY.md`](../../.planning/phases/28-fault-injection-recovery/28-01-SUMMARY.md)
53+
in the root workstation repo for the full design). **This work exists only on a local,
54+
unpushed branch (`feat/phase-28-fault-injection`) in the operator's workstation checkout —
55+
it is not present on `origin/main` and there is no open PR for it yet.** Treat the failure
56+
handling described in the previous section as the current state of `main` until that branch
57+
is pushed and reviewed.
58+
59+
## Component topology
60+
61+
```mermaid
62+
flowchart LR
63+
subgraph Orchestrator["GSD Orchestrator (.NET 10)"]
64+
SM[GsdStateMachine]
65+
MCP[McpStdioClient]
66+
LLM[Anthropic.SDK]
67+
CP[FileCheckpointStore]
68+
end
69+
subgraph GitHub["GitHub"]
70+
MCPS[github-mcp-server.exe]
71+
GHAPI[GitHub API]
72+
end
73+
subgraph Anthropic["Anthropic"]
74+
CLAUDE[Claude API]
75+
end
76+
subgraph Storage["Local Storage"]
77+
CKPT[.gsd/state/]
78+
end
79+
SM --> MCP
80+
MCP -->|stdio| MCPS
81+
MCPS --> GHAPI
82+
SM --> LLM
83+
LLM --> CLAUDE
84+
SM --> CP
85+
CP --> CKPT
86+
```
87+
88+
## SDLC phase mapping
89+
90+
Beyond the linear states, the orchestrator maps operations to SDLC batches — `Discovery`
91+
(Triaging, Analyzing), `Design`, `Change` (Branching, Editing, TestGenerating), `Assurance`
92+
(Validating, Reviewing), `Closure` (Committing, PrCreating, Documenting). A `Block`-level
93+
validation status triggers a `TerminalStopReason` and rolls the branch back.
94+
95+
<!-- docs-verified: a01b130c98cb7833d45cc7406f6002009f33557a 2026-07-08 -->

docs/wiki/Decisions.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Decisions
2+
3+
## ADR convention
4+
5+
`docs/adr/README.md` establishes the convention (sequential numbering, Context/Decision/
6+
Consequences, mandatory for major technical decisions or new dependencies) but **no numbered
7+
ADR files exist in the repo yet** — decisions to date live in phase plans/summaries under
8+
`.planning/phases/` instead. This index points at those until the first formal ADR is filed.
9+
10+
## Phase history (`.planning/phases/`, this repo's own GSD project)
11+
12+
19 phases completed in this repo's local planning history, covering foundation setup through
13+
portfolio polish:
14+
15+
| Phase | Topic |
16+
|---|---|
17+
| 01 | Foundation quick wins |
18+
| 02 | CI diagrams |
19+
| 03 | Wiki release |
20+
| 04–05 | Promptimprover / autogen cross-repo polish |
21+
| 06 | Coherence / personal profile |
22+
| 07 | Emergency ci-autopilot fix |
23+
| 08 | Secondary repos level A |
24+
| 09–11 | Portfolio AI-reframe and cross-portfolio coherence |
25+
| 12 | Robustness foundation |
26+
| 13 | Smarter issue triage |
27+
| 14 | Autonomous test generation |
28+
| 15 | PR review loop |
29+
| 16 | Multi-repo support |
30+
| 17 | CI hardening |
31+
| 18 | State/test coverage |
32+
| 19 | Portfolio polish |
33+
34+
See each `.planning/phases/<NN-topic>/*-SUMMARY.md` for the detailed record of what shipped.
35+
36+
## Open decisions tracked in this Phase 36 refresh
37+
38+
- **PR #16** (`feat/phase-26-coverage-gates`) — ratchets CI to a `branch-rate` coverage gate;
39+
open, not yet merged.
40+
- **PR #17** (`fix/checkpoint-corruption`) — checkpoint corruption/replay-error hardening;
41+
open, not yet merged.
42+
- **PR #18** (`ci/sha-pin-and-least-privilege`) — pins third-party GitHub Actions to commit
43+
SHAs and adds least-privilege permissions; open, not yet merged.
44+
- **Phase 28-01 typed-failure retry/halt path** — designed and implemented locally
45+
(`feat/phase-28-fault-injection`, unpushed) but not yet a PR; see
46+
[Architecture](./Architecture.md) for the current-vs-designed failure-handling contrast.
47+
48+
<!-- docs-verified: a01b130c98cb7833d45cc7406f6002009f33557a 2026-07-08 -->

docs/wiki/Home.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# gsd-orchestrator Wiki
2+
3+
## Role in the CAS portfolio
4+
5+
`gsd-orchestrator` is the **Control plane** of the Coding-Autopilot-System three-plane model
6+
(Control / Execution / Governance — see the root [`docs/VISION.md`](https://github.com/OgeonX-Ai/cas-workstation)
7+
architecture diagram). Its job: admit goals as typed, bounded, budgeted work items and drive
8+
dependency-aware scheduling through a durable state machine — issue in, PR out, with every
9+
step checkpointed so a crashed or interrupted run can be resumed rather than restarted.
10+
11+
| Plane | This repo's responsibility |
12+
|---|---|
13+
| Control | Goal admission, state-machine scheduling, checkpoint/resume, PR lifecycle |
14+
| Execution | *(not this repo — see `autogen`)* |
15+
| Governance | *(not this repo — see `Promptimprover`, `cas-contracts`, `cas-evals`)* |
16+
17+
## Quickstart
18+
19+
- [README.md](../../README.md) — setup, `.env` configuration, running the orchestrator against a real issue
20+
- [docs/portfolio-proof.md](../portfolio-proof.md) — concise reviewer-oriented summary
21+
- [Architecture](./Architecture.md) — state machine, component topology, typed-failure path
22+
- [Operations](./Operations.md) — build, test, and CI commands (verified against the live tree)
23+
- [Decisions](./Decisions.md) — index of phase summaries and the ADR convention
24+
25+
## Ecosystem links
26+
27+
Part of the [Coding-Autopilot-System](https://github.com/Coding-Autopilot-System) org:
28+
[autogen](https://github.com/Coding-Autopilot-System/autogen) (execution plane) ·
29+
[Promptimprover](https://github.com/Coding-Autopilot-System/Promptimprover) (prompt governance) ·
30+
[cas-contracts](https://github.com/Coding-Autopilot-System/cas-contracts) (shared schemas) ·
31+
[cas-evals](https://github.com/Coding-Autopilot-System/cas-evals) (evidence gate)
32+
33+
<!-- docs-verified: a01b130c98cb7833d45cc7406f6002009f33557a 2026-07-08 -->

docs/wiki/Operations.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Operations
2+
3+
## Build
4+
5+
```bash
6+
dotnet restore src/GsdOrchestrator/GsdOrchestrator.csproj
7+
dotnet build src/GsdOrchestrator/GsdOrchestrator.csproj --no-restore --configuration Release
8+
```
9+
10+
## Test
11+
12+
```bash
13+
dotnet restore src/GsdOrchestrator.Tests/GsdOrchestrator.Tests.csproj
14+
dotnet build src/GsdOrchestrator.Tests/GsdOrchestrator.Tests.csproj --no-restore --configuration Release
15+
dotnet test src/GsdOrchestrator.Tests/GsdOrchestrator.Tests.csproj --configuration Release --no-build
16+
```
17+
18+
Contract-compatibility gate only (consumer-side check against the pinned `cas-contracts` v1.1
19+
release, fails red on drift):
20+
21+
```bash
22+
dotnet test src/GsdOrchestrator.Tests/GsdOrchestrator.Tests.csproj --configuration Release --no-build --filter "FullyQualifiedName~ContractCompatibilityTests"
23+
```
24+
25+
## CI (`.github/workflows/ci.yml`, `windows-latest`, 30-minute timeout)
26+
27+
1. `actions/checkout@v7`
28+
2. `actions/setup-dotnet@v5` (.NET `10.0.1xx`)
29+
3. Restore + build `GsdOrchestrator.csproj`
30+
4. Restore + build `GsdOrchestrator.Tests.csproj`
31+
5. **Contract compatibility**`ContractCompatibilityTests` filter, fails red on pinned-contract drift
32+
6. **Test** — full suite with `--collect:"XPlat Code Coverage"`, results to `./TestResults`
33+
7. **Upload coverage**`actions/upload-artifact@v7`, `coverage-results` artifact (always runs)
34+
35+
There is currently **no coverage-threshold enforcement step** on `main` — coverage is
36+
collected and published as an artifact only. A ratcheted `branch-rate` gate is in progress;
37+
see [Architecture — Test Coverage](../../README.md#test-coverage) and PR #16.
38+
39+
A separate `.github/workflows/codeql.yml` runs CodeQL analysis (badge in the root `README.md`).
40+
41+
## Run the orchestrator locally
42+
43+
```bash
44+
cd src/GsdOrchestrator
45+
dotnet run -- --issue 42
46+
dotnet run -- --resume <workflow-id>
47+
```
48+
49+
Requires `.env` with `GITHUB_PERSONAL_ACCESS_TOKEN`, `ANTHROPIC_API_KEY`,
50+
`GSD_GITHUB_OWNER`, `GSD_GITHUB_REPO` set (copy from `.env.example`).
51+
52+
<!-- docs-verified: a01b130c98cb7833d45cc7406f6002009f33557a 2026-07-08 -->

0 commit comments

Comments
 (0)