Ship public library packages alongside CLI for both C# and Rust#93
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #92
The single `Foundation.Data.Doublets.Cli` csproj used `PackAsTool=true` plus `OutputType=Exe`, which produces a .NET tool package that cannot be consumed via `PackageReference`. External projects therefore had no supported way to import the parser, query processors, decorators, named/pinned types, persistent transformation triggers, or LiNo I/O that the `clink` CLI is built on top of. Split the C# project so the same source code now ships as two NuGet packages: a reusable library (`Foundation.Data.Doublets.Cli`, with XML doc generation enabled) and a thin CLI tool (`clink`, `PackAsTool=true`, references the library). The release workflow resolves both package ids, waits for both on the flat-container endpoint, and the GitHub release body now embeds version + downloads shields.io badges for both packages. The Rust crate already ships both `[lib]` and `[[bin]]` targets. This commit also rounds out `rust/Cargo.toml` with `documentation` / `homepage` URLs and a `data-structures` category so docs.rs and the crates.io categorization match the dual-purpose intent. Captured the full analysis under `docs/case-studies/issue-92/`, including CI/CD comparisons against the four AI pipeline templates.
Adds a single GitHub Pages deployment that publishes the DocFX-generated docs for the `Foundation.Data.Doublets.Cli` library under `/csharp/` alongside the `cargo doc` output for the `link-cli` crate under `/rust/`, with a small landing page linking into both sub-sites. This lets external .NET and Rust projects browse the same library surface that the `clink` CLIs are composed of. - Add `.github/workflows/docs.yml` covering DocFX build, `cargo doc`, site assembly, and `actions/deploy-pages` (single deployment per repo). - Add `csharp/docfx.json`, `csharp/docs/index.md`, and `csharp/docs/toc.yml` to drive DocFX from the Library project's XML doc comments. - Refresh the root, `csharp/`, and `rust/` READMEs so both the NuGet tool and the NuGet library, plus `cargo install`/`cargo add link-cli`, are documented side by side and linked to the published docs. - Extend `.gitignore` with generated DocFX/`_site/` artifacts.
Documents the crates.io metadata refresh (description, documentation, homepage, keywords, categories) and the README clarification that the `link-cli` crate publishes both `[lib]` and `[[bin]]` targets, so the Rust release pipeline's changelog-fragment guard accepts this PR.
Documents the new `Foundation.Data.Doublets.Cli` library package and the trimmed-down `clink` dotnet tool so the changeset-driven release workflow generates appropriate notes when this PR ships.
Member
Author
Working session summaryPR #93 is now ready for review with all CI checks green on commit Final state:
What shipped to address issue #92:
This summary was automatically extracted from the AI working session output. |
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $15.878948📊 Context and tokens usage:Claude Opus 4.7: (5 sub-sessions)
Total: (17.3K new + 447.7K cache writes + 19.9M cache reads) input tokens, 121.3K output tokens, $15.871801 cost Claude Haiku 4.5:
Total: 5.2K input tokens, 391 output tokens, $0.007147 cost 🤖 Models used:
📎 Log file uploaded as Gist (6731KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Member
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 78fad2d.
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.
Summary
Closes #92.
Issue #92 asked us to double-check that both the C# and Rust
distributions publish a CLI and a public library, and to auto-generate
API documentation for each library so external projects can recreate or
extend the CLI without re-implementing the internals.
Root cause (C# only)
The Rust crate already ships a
[lib]+[[bin]]pair, socargo install link-cliandcargo add link-cliboth work and docs.rs already rendersrustdoc. The defect was on the C# side: a single
Foundation.Data.Doublets.Clicsproj was declared as adotnet toolwith<PackAsTool>true</PackAsTool>. .NET tools cannot be consumed via<PackageReference>(they live undertools/<tfm>/any/, notlib/<tfm>/), so the library surface — parser, query processors,ChangesSimplifier,NamedTypesDecorator,PinnedTypesDecorator,PersistentTransformationDecorator, LiNo I/O,UnicodeStringStorage—was inaccessible to downstream .NET code.
What ships in this PR
C# project split.
csharp/Foundation.Data.Doublets.Cli.Library/becomes a regular library project producing
Foundation.Data.Doublets.Cli.dlland theFoundation.Data.Doublets.CliNuGet.
csharp/Foundation.Data.Doublets.Cli/keeps<PackAsTool>true</PackAsTool>,contains only
Program.csplusSystem.CommandLinewiring, and continuesto publish the
clinkdotnettool — now via a
<ProjectReference>on the library so they share aversion.
<GenerateDocumentationFile>true</GenerateDocumentationFile>embeds XML docs in the library
.nupkg.NuGet release pipeline updated.
.github/workflows/csharp.ymldiscovers both
PackageIds and waits for both to appear on NuGetafter publish.
csharp/scripts/create-github-release.mjsnow acceptsmultiple
--package-idflags and renders shields.io badges + downloadscounters for each one in the GitHub Release body. Two new unit tests in
csharp/scripts/release-scripts.test.mjscover the multi-package badgelogic (22 → 24 tests).
Rust crate metadata.
rust/Cargo.tomlgainsdocumentation,homepage,categories,keywords, and a richerdescriptionsocrates.io and docs.rs surface the library surface alongside the CLI.
Auto-generated API documentation.
csharp/docfx.json,csharp/docs/index.md, andcsharp/docs/toc.ymldrive DocFX from the library's XML doc comments.
.github/workflows/docs.ymlis a single unified workflow that buildsDocFX (
/csharp/) +cargo doc --no-deps --all-features(/rust/)into one
_site/and deploys it throughactions/deploy-pages@v5(GitHub Pages only supports one deployment per repo, so combining
is necessary).
_site/index.htmllinks into both sub-sites.READMEs. Root,
csharp/, andrust/READMEs all document the dualtool + library install paths side by side, link to docs.rs and the new
GitHub Pages site, and add a second NuGet badge for the library.
Changeset / changelog fragment.
csharp/.changeset/issue-92-library-package.mdandrust/changelog.d/20260515_140000_issue_92_library_metadata.mddocument the changes for the existing release pipelines so the next
release picks them up.
Case study.
docs/case-studies/issue-92/captures the originalissue body, fetched comments, PR snapshot, file-trees of all four
*-ai-driven-development-pipeline-templaterepos, snapshots of therelevant csproj / Cargo.toml / docfx.json / release.yml from those
templates, and the full requirements → solution → verification trace.
Template defects observed (R7)
While comparing against the four templates, no functional defects were
found, but neither the C# template nor the Rust template demonstrates the
joint library + CLI case. The csharp template ships only a library;
the rust template ships only a library (no
[[bin]]). That non-coverageis plausibly what nudged the link-cli C# project into the tool-only
configuration that this PR corrects. The case study suggests filing a
follow-up in
link-foundation/csharp-ai-driven-development-pipeline-templateonce this PR ships so other downstream projects don't repeat the mistake.
Test plan
dotnet build csharp/Foundation.Data.Doublets.Cli.sln --configuration Releasedotnet test csharp/Foundation.Data.Doublets.Cli.sln --configuration Releasedotnet pack csharp/Foundation.Data.Doublets.Cli.Library/Foundation.Data.Doublets.Cli.Library.csprojproducesFoundation.Data.Doublets.Cli.<v>.nupkgcontaininglib/net8.0/Foundation.Data.Doublets.Cli.dllandFoundation.Data.Doublets.Cli.xmldotnet pack csharp/Foundation.Data.Doublets.Cli/Foundation.Data.Doublets.Cli.csprojproducesclink.<v>.nupkgwithtools/net8.0/any/contentcargo build --manifest-path rust/Cargo.toml --releasecargo test --manifest-path rust/Cargo.toml --all-featurescargo doc --manifest-path rust/Cargo.toml --no-deps --all-featuresproducesrust/target/doc/link_cli/index.htmldocfx csharp/docfx.json -o csharp/_sitebuilds with 0 warnings, 0 errors and emits 30 HTML filesnode csharp/scripts/release-scripts.test.mjs— 24/24 passing1b4a74e(run #25922536178)
fc40263(C# / Rust / Docs / WebAssembly pipelines all
SUCCESS)