Repository navigation
V0.13.0/docfx and csrun - #50
Merged
Merged
Conversation
Executable C# evidence is needed when documentation examples and API claims must be proven by running the exact source. The new skill provides small complete console examples and genuine xUnit v3 tests through csrun, with exact package pins and an honest verified, compiled-only, or unverified status.
The csrun skill ships a deterministic validator and a template check that keeps the published SKILL.md example identical to its console fixture and verifies its local links. Both run offline so regressions are caught without invoking a model.
The README now lists dotnet-csrun in the available skills table, install examples, and a short rationale section so users can discover the skill and understand when executable evidence is worth using.
[Medium impact] The reviewed changes appear safe to merge. SummaryThis PR adds executable C# examples through
Reviews (18) · Last reviewed commit: "💄 update contextual source references a..." · Reviewed by Greptile |
The csrun validator sets its own output encoding to UTF-8 but left the console encoding unset, so captured child output could be decoded inconsistently. Setting [Console]::OutputEncoding keeps both sides on the same encoding.
Eval case 6 runs a net11.0 example, so it now references a dedicated fixture for that case instead of sharing the generic console input.
The execution validator now runs the four new feasibility fixtures through the engine and checks their observations. The artifact validator locks the original InventoryWorker source and the new fixtures' manifest shape and package pins, so a false repair cannot silently pass.
Agents were choosing manifest construction before judging whether an application entrypoint or separate assembly could run under csrun, and sometimes repaired samples by changing what they were meant to prove. The workflow now assesses feasibility first and classifies failures before repair, with the detailed rules kept in a dedicated reference.
Adds review specifications and source fixtures for genuine application startup, compatible hosting, multiple entrypoints, safe import adaptation, and top-level test source, so the feasibility rules are exercised by the validator.
Sample identity and artifact helpers give csrun verify and repair a single deterministic source of truth for manifest-derived paths, so the lifecycle workflow does not reimplement them in prose.
The csrun validator and repository validator now check the create, verify, repair, and audit contracts, so lifecycle regressions fail deterministically instead of surfacing only in prose review.
csrun previously covered only creating new examples. Existing source now has an explicit read-only verify path, an authorized repair path with preserved semantics, and a scoped audit path, with a reference for composing them from dotnet-docfx-digest.
New eval fixtures cover verify, repair, and audit outcomes, including diverged source and incorrect package pins, so the lifecycle contract is exercised against concrete inputs rather than described only in prose.
Standalone runtime examples can now be created, verified, or repaired through dotnet-csrun while docfx-digest keeps ownership of API discovery, placement, and DocFX builds. The composition reference defines that boundary.
The README skill table and csrun summary now describe the create, verify, repair, and audit lifecycle and the paired native and Docker commands, so the public entry matches the skill.
The README describes the source-bound sample contract so consumers know that maintained examples declare their project and source context explicitly and that the validator checks those bindings rather than skipping them.
The skill contract now covers csrun composition, the source-binding requirement for maintained examples, and the example-architecture reference that explains the split application and test assembly case for ManagedApplicationFixture.
Samples can now bind to a maintained project and source file, and the validator rejects unresolvable bindings. It also refuses to collapse a ManagedApplicationFixture entry point into a test-owned source unit and skips .bot directories during source discovery.
Regression coverage for the full completion boundary with a project-bound example, and for the new context and entry-point diagnostics, so the checks stay enforced.
Adds eval case 115 and the InventoryWorker fixture tree that the managed application example regression depends on. Tests copy these fixtures to a temp directory before building, so they are never built in place.
Bound sample context was validated from source paths alone, so unchanged pages could go unchecked when their bound source or project changed, deleted or moved, and a shared batch build failure could mark unrelated projects as failed. Validation now reads the disposable MSBuild binary log for actual Csc invocations and per-project outcomes, selects pages through their bindings, and rejects excerpts excluded by conditional compilation.
The validator changes need regression coverage for changed-only selection of pages whose bound source or project changes, deleted or moved inputs, conditional compilation excluding displayed code, and per-project batch attribution. The new cases use small SDK projects so they run without network access or an external test runner.
The sample context rules changed: bound pages are selected by their source and project inputs, compiler evidence comes from the native build log, and conditionally excluded excerpts are rejected. The architecture and diagnostics references need to describe what validation now proves and what it does not.
Allow scaffold package selection to follow current compatible releases instead of fixed major lines.
Expose listed stable releases across major lines so compatibility can be checked against each target framework.
Keep generated project guidance aligned with dynamically resolved test packages.
Check candidate discovery and exercise scaffold expectations against the current runtime matrix.
Provide the LTS and STS SDKs required by the template validation matrix.
Clarify that the scaffold README is tracked while other bot working material stays local.
Catch contradictions between the tracked bot README and local-only working material guidance.
The generated native block and the sample helper no longer pin csrun v0.2.1. They resolve the latest stable release at runtime and verify the downloaded script against the SHA-256 digest GitHub publishes for that asset.
The csrun guidance now describes runtime release resolution and points to the csrun source and releases, and recommends a reviewed local engine or a pinned Docker digest for reproducible runs.
The run-actions entry point is now named dotnet-docfx-digest csrun, which matches the csrun engine it drives. The previous generate-run-actions name remains accepted so existing invocations keep working.
The DocFX digest section of the README now names the csrun command so it matches the renamed skill entry point.
Run action examples must now execute the C# shown on the page, so hidden harness members are no longer composed into standalone scripts. Legacy harness recipes fail generation with a clear instruction to move the executable code into the visible sample.
Run action recipes now derive their standalone scripts from the C# shown on the page. The skill, reference, and eval expectations describe that contract, so authors put the complete executable sample in the visible fence and label pinned repository tests separately.
The Docker wrapper ran the image entry point, so it did not verify the csrun release that Native runs. Both wrappers now download the latest stable engine, check its SHA-256 digest, and execute the same asset. The Docker image supplies only the SDK and PowerShell.
Both csrun wrappers now fetch and verify the latest stable release, and the Docker path runs the verified asset inside the SDK image. The skill and execution reference describe that behavior and drop the stale claim that no host or network setup is needed.
The README described the old harness and Docker-only behavior. It now states that standalone scripts run the visible C#, that pinned repository tests are named, and that both transports verify the latest csrun release.
Run action recipes must show the xUnit using directive so the visible C# compiles as written. Short Fact and Assert names now replace fully qualified attributes, making the sample readable and self-contained.
The run action sample test now expects the visible source to import Xunit and use short Fact and Assert names. This keeps the regression check aligned with the updated recipe contract in run-actions.md.
Copying a run action script now swaps the button icon for a brief check mark, giving visible confirmation without changing the code block layout. The status message is visually hidden in that case so the feedback is not shown twice, and the browser test asserts the check icon and the restored play icon.
Existing sites can now pick up toolbar changes without regenerating their examples. The instructions say to run the generator even when examples are current, verify the refreshed module against the skill asset, and keep existing scripts and their verification evidence intact.
A stale toolbar module must be replaced on refresh while every existing PowerShell payload stays byte-identical and keeps its verification status. The test now seeds a stale module, runs the generator, and checks the refreshed module is published into the rendered site.
The copy checkmark used a fixed link-success class, so its color and size could drift from the DocFX clipboard feedback. Measure DocFX's own success markup in the same code block and copy its computed color and font size, so the feedback matches in both themes.
The browser test now measures the DocFX clipboard checkmark and compares the run action checkmark against it, in light and dark themes. This guards the styling fix against regressions that only appear in one theme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces the dotnet-csrun skill, which turns documentation examples and API claims into small runnable C# programs and genuine xUnit v3 tests executed through csrun. It also adds deterministic validation so the published example and its fixtures cannot drift apart silently.
New skill:
Validation:
Documentation: