tool kind lifted to Standard
Platform spec ADR
tool kind lifted to Standard
Spec standingStandard
- No directly attached article pages for this node.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Context
Section titled “Context”D-TOOL-PCKG-0002 reserved tool as a forbidden packageKind while validator profiles, CLI routing, and registry UI surfaces remained undefined. By the v0.3 baseline, three concrete needs converged:
- External tool packs (custom diagnostics, formatter rule packs, language-server extensions) want to ship through pckg without being mis-classified as
library(which forcesapi.jsongeneration) ortemplate(which forces.beskid/template.json). - The registry dashboard already routes
libraryandtemplatekinds to distinct surfaces viaPackageDetails.razor. A third surface — with no Docs / Source tabs — is straightforward to add given the existing_isTemplatePackagepattern. - The Beskid CLI already supports per-profile packing in
beskid_pckg::pack::PackProfile. Extending the enum with aToolvariant and a--package-kind toolCLI flag is a localized change.
The platform-spec leads code: this ADR makes the validator profile, CLI routing, and dashboard surface normative so the implementation can land without ambiguity.
Decision
Section titled “Decision”Lift packageKind: tool from Reserved to Standard with the following normative profile:
- Server validator (
PackageArtifactValidator) must acceptpackageKind: toolartifacts. The artifact must not contain.beskid/template.json; the artifact may contain.beskid/docs/api.json, but it must not be required byPckg:Publish:RequireStructuredApiDoc. The packedpackage.jsonmust not includedocumentation.apiJsonfor the tool kind. - Publish persistence must record the resolved
packageKindin the version metadata via the existingPackageManifestMetadataReaderpath. - Dashboard routing (
PackageDetails.razor) must mirror the template-kind pattern: an_isToolPackageflag selects an install/usage card and suppresses the Docs / Source tabs by default. The Ratings tab and Versions tab remain unchanged. - Rust pack flow (
beskid_pckg::pack) must add aPackProfile::Toolvariant and thebuild_package_jsonpath must emit"packageKind": "tool"without adocumentationblock. A newstrip_tool_pack_excludeshelper must remove.beskid/docs/api.jsonfrom the artifact body when the tool profile is selected. - CLI surface (
beskid_pckg::cli) must add a--package-kind <library|template|tool>flag topack. When set totool, the CLI must skip theapi.jsonpre-generation pass inbeskid_cli::cli::maybe_generate_docs_for_pack. The flag must refuse to combine with aProject.projwhoseproject.type = Template.
Consequences
Section titled “Consequences”- Forwards-compatible: Existing
libraryandtemplateartifacts are unaffected; pre-existingtool-rejection tests are updated rather than removed. - Server-side migration:
PackageKinds.IsSupportednow returns true fortool. Operators running validator policyRequireStructuredApiDoc = truesee no behavior change for library packages; tool packages explicitly bypass that requirement. - CLI ergonomics: Publishers who want to ship a developer tool through the registry no longer need to hand-author
package.json; thebeskid pckg pack --package-kind toolflow handles it. - Dashboard parity: The pckg UI uses Fluent UI Blazor patterns for the new tool card, matching the existing template install card. No new design tokens are introduced.
Verification anchors
Section titled “Verification anchors”pckg/src/Server.Tests/Unit/PackageArtifactValidatorTests.cs::ValidateAsync_Accepts_Tool_Artifact_Without_Api_Jsonpckg/src/Server.Tests/Unit/PackageArtifactValidatorTests.cs::ValidateAsync_Rejects_Tool_With_Template_Jsonpckg/src/Server.Tests/Integration/ToolPackagePublishIntegrationTests.cscompiler/crates/beskid_pckg/src/pack.rs::tests::build_package_json_tool_profile_omits_api_doc_pointercompiler/crates/beskid_pckg/src/pack.rs::tests::strip_tool_pack_excludes_removes_api_jsoncompiler/crates/beskid_pckg/src/cli.rs::tests::pack_args_accepts_package_kind_tool