feat(scribe): add solution-local analyzer support (auto-pack & inject without LocalScribe)#9
Conversation
Agent-Logs-Url: https://github.com/BulletsForHumanity/Scribe/sessions/ea27be1c-a52e-4dac-aa4f-6fac868887c5 Co-authored-by: crazycrank <11194014+crazycrank@users.noreply.github.com>
…on-local analyzers Agent-Logs-Url: https://github.com/BulletsForHumanity/Scribe/sessions/a0a87e65-138d-464f-bb3a-d0393d5bfd40 Co-authored-by: crazycrank <11194014+crazycrank@users.noreply.github.com>
…tion Agent-Logs-Url: https://github.com/BulletsForHumanity/Scribe/sessions/65805b99-d304-4fa6-aa9e-c36044fb2184 Co-authored-by: crazycrank <11194014+crazycrank@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds first-class solution-local analyzer support to the Scribe SDK so analyzer/generator projects inside the same solution can auto-pack on build, publish into the solution’s artifacts directory, and be consumed via normal PackageReference without LocalDev / .localscribe.
Changes:
- Introduces
ScribeSolutionAnalyzer=trueworkflow: timestamp versioning (0.0.0-dev.yyyyMMddHHmmss), auto-pack-on-build, and artifacts/packages output. - Generates per-analyzer
*.Directory.Packages.targetsoverride files after packing (LocalDev-style pinning via wildcard import). - Updates SDK wiring and documentation to describe setup, mechanics, and infrastructure architecture.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Scribe/build/Scribe.SolutionAnalyzer.props | Adds early-phase MSBuild properties for solution-local analyzers (timestamp version, auto-pack, artifacts output, restore source). |
| Scribe/build/Scribe.SolutionAnalyzer.targets | Adds late-phase target to generate a PackageVersion Update override file after Pack. |
| Scribe.Sdk/Sdk/Sdk.props | Imports the SolutionAnalyzer props into the SDK early phase. |
| Scribe.Sdk/Sdk/Sdk.targets | Imports the SolutionAnalyzer targets into the SDK late phase. |
| Scribe.Sdk/Scribe.Sdk.csproj | Packs SolutionAnalyzer props/targets into the SDK NuGet package. |
| Scribe.Sdk/README.md | Documents the new ScribeSolutionAnalyzer=true workflow and links to the full guide. |
| README.md | Adds Solution-Local Analyzers to the component table and documentation index. |
| docs/solution-local-analyzers.md | New/rewritten full setup guide and rationale for the workflow. |
| docs/project-setup.md | Adds a Solution-Local Analyzers section pointing to the dedicated guide. |
| docs/architecture-infrastructure.md | Updates infrastructure architecture to include SolutionAnalyzer alongside LocalDev. |
| <PropertyGroup Condition="'$(ScribeSolutionAnalyzer)' == 'true' and '$(ArtifactsPath)' != ''"> | ||
| <PackageOutputPath>$(ArtifactsPath)packages\</PackageOutputPath> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
PackageOutputPath is built by string-concatenating $(ArtifactsPath) and packages\. This assumes $(ArtifactsPath) already ends with a directory separator; if a consuming solution sets ArtifactsPath without a trailing slash, output and restore paths become invalid (e.g. C:\repo\.artifactspackages\). Consider normalising ArtifactsPath to a guaranteed trailing separator (or introducing an internal _ScribeSaArtifactsDir with a trailing slash) and using that for PackageOutputPath and RestoreAdditionalProjectSources.
| and '$(ArtifactsPath)' != ''" | ||
| > | ||
| <PropertyGroup> | ||
| <_ScribeSaVersion>$(PackageVersion)</_ScribeSaVersion> |
There was a problem hiding this comment.
The override file pins to $(PackageVersion), but Pack ultimately uses the normalised $(NuGetPackageVersion) (and LocalDev already prefers that with a fallback). If these ever differ (e.g., version normalisation or an injected suffix), the generated .Directory.Packages.targets could pin a version that doesn’t match the produced .nupkg. Consider reading $(NuGetPackageVersion) first and falling back to $(PackageVersion) (mirroring Scribe.LocalDev.targets).
| <_ScribeSaVersion>$(PackageVersion)</_ScribeSaVersion> | |
| <_ScribeSaVersion Condition="'$(NuGetPackageVersion)' != ''">$(NuGetPackageVersion)</_ScribeSaVersion> | |
| <_ScribeSaVersion Condition="'$(_ScribeSaVersion)' == ''">$(PackageVersion)</_ScribeSaVersion> |
| <_ScribeSaVersion>$(PackageVersion)</_ScribeSaVersion> | ||
| <_ScribeSaOverridePath>$(ArtifactsPath)$(PackageId).Directory.Packages.targets</_ScribeSaOverridePath> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
_ScribeSaOverridePath is formed as $(ArtifactsPath)$(PackageId)..., which assumes $(ArtifactsPath) ends with a directory separator. If it doesn’t, the override file will be written to an unintended path/name. Consider using a normalised artifacts directory property with a guaranteed trailing slash (or System.IO.Path::Combine) before concatenating.
…eVersion Agent-Logs-Url: https://github.com/BulletsForHumanity/Scribe/sessions/3989b1e3-e54b-418a-ad37-33ad71a09acf Co-authored-by: crazycrank <11194014+crazycrank@users.noreply.github.com>
Scribe.Sdk.csprojXML header comment — mention SolutionAnalyzer alongside LocalDevScribe.Sdk.csproj<Description>— mention SolutionAnalyzer alongside LocalDev$(ArtifactsPath)viaEnsureTrailingSlashin.propsand.targets(review comment fix(scribe): fix bug in using resolution #1 and feat(scribe): the local dev flow is now configured with a .localscrib… #3)$(NuGetPackageVersion)with fallback to$(PackageVersion)in.targets(review comment Feat/cleanup #2)