test(coverage): ratchet gsd-orchestrator branch gate - #16
Conversation
…me to prevent checkpoint corruption and replay errors
…clusions - Configure XPlat Code Coverage collector: cobertura format, SkipAutoProps, ExcludeByAttribute (Obsolete/GeneratedCode/CompilerGenerated/ExcludeFromCodeCoverage), ExcludeByFile globs for obj/, generated .g.cs, and the Program.cs bootstrap entrypoint - Measured branch-rate baseline under new settings: 0.6913 (line-rate 0.9082) - Gitignore TestResults/ build-artifact output
…add coverage tests - ci.yml "Test" step now passes --settings coverlet.runsettings - Replace the permanently-red line-rate==100% gate with "Enforce branch coverage (ratchet)": parses branch-rate (not line-rate) from coverage.cobertura.xml, compares to $Baseline = 0.7314, fails closed with CAS JSON telemetry on regression or missing coverage file - Add CoverageGapClosingTests.cs: 37 new tests with meaningful assertions (state, telemetry payload, thrown exception type) targeting previously uncovered branches in SdlcWorkflowMap.PhaseIdForState (0.14 -> full switch), SdlcProfile.ResolveRollbackOrigin fallback paths, GsdWorkflowContext.Transition Failed-state branch, WithSdlcVerification passed-branch, LoopPolicyGuard happy-path/unknown-action branches, NativeProcessCommandExecutor (real cross-platform process spawns, was 0% branch-rate), and McpTerminalOutcomePublisher status-mapping switch (was 0% branch-rate) - Branch-rate raised from measured Task-1 baseline 0.6913 to 0.7314 (branches-covered 730/998), line-rate 0.9082 -> 0.9349 - All 268 tests pass (231 existing + 37 new)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bffdee793f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <Configuration> | ||
| <Format>cobertura</Format> | ||
| <SkipAutoProps>true</SkipAutoProps> | ||
| <ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute,ExcludeFromCodeCoverageAttribute</ExcludeByAttribute> |
There was a problem hiding this comment.
With CI now passing this runsettings file, CompilerGeneratedAttribute causes generated async/iterator state machines to be excluded from the coverage report; Microsoft's runsettings docs warn that excluding this attribute removes code using async, await, yield return, and auto-properties from coverage (https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis). Most workflow/MCP execution paths in this repo are async, so the branch-rate ratchet can pass while no longer measuring those production branches; remove this attribute and rely on GeneratedCodeAttribute, ExcludeFromCodeCoverageAttribute, and SkipAutoProps for narrower boilerplate exclusions.
Useful? React with 👍 / 👎.
* 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>
The reusable workflow was pinned to f288e5e3b67b29a2c08880b76da7b852f4a132d0, a pre-squash-merge branch-tip commit in Coding-Autopilot-System/.github that became unreachable when .github PR #16 squash-merged and the source branch was deleted. Every push-triggered release-please run has since failed with 'workflow was not found'. Repin to 64c1673088ff7802f1270a44f03bc4d7a10631f2, which is the merged commit on .github's main branch containing .github/workflows/release-please-reusable.yml. Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi>
Summary
coverlet.runsettingsdeclaring the XPlat Code Coverage collector config (cobertura format, SkipAutoProps, ExcludeByAttribute for Obsolete/GeneratedCode/CompilerGenerated/ExcludeFromCodeCoverage, ExcludeByFile globs for obj/, *.g.cs, Program.cs bootstrap)line-rate < 1.0check to a ratchetedbranch-rate >= $Baselinegate, with CAS JSON telemetry emitted on pass/fail and on missing coverage fileCoverageGapClosingTests.cs) with meaningful assertions targeting previously-uncovered branches:SdlcWorkflowMap.PhaseIdForStatefull switch,SdlcProfile.ResolveRollbackOriginfallback paths,GsdWorkflowContext.Transition/WithSdlcVerificationbranches,LoopPolicyGuardhappy/unknown-action paths,NativeProcessCommandExecutorreal process spawns (was 0% branch coverage),McpTerminalOutcomePublisherstatus-mapping switch (was 0% branch coverage)Executed per
.planning/phases/26-test-coverage-automation/26-01-PLAN.md. See26-01-SUMMARY.mdfor full details and deferred low-coverage items.Test plan
dotnet test --settings coverlet.runsettings --collect:"XPlat Code Coverage"green locally (Debug and Release)