Ship typed configuration and hook contexts in a new Buildvana.Runtime package - #319
Conversation
Buildvana.Runtime is a new packaged library holding the typed model of buildvana.json / buildvana.jsonc plus a lean, strict loader suitable for file-based apps: deserialization goes through a source-generated System.Text.Json context, so it works with reflection-based serialization disabled. bv, Buildvana SDK tasks, and repository-owned hooks all share the same types. Buildvana.Core.Configuration keeps the validating loader, schema generation, and diagnostics, now referencing the packaged model. Since the packaged model cannot reference the unpackaged Buildvana.Core.JsonSchema, the schema title is supplied programmatically (JsonSchemaGenerator gains an optional title parameter; the attribute is still honored), and nuget.feeds becomes a typed record (prerelease/release properties) instead of a dictionary constrained by [JsonAllowedKeys] - which also gives each feed its own description in the schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The release/post-release hook context becomes a public type in
Buildvana.Runtime, shared verbatim between bv (which serializes it) and
hooks (which load it via PostReleaseHookContext.Load()); the bv-internal
duplicate and the generic BvHookContext shape are gone. The context is
now structured: a BuildvanaPaths record (home, artifacts, and scratch
directories), a ReleaseInfo record (version forms and release flags),
plus the hook-specific ProducedPackages and Dogfooded members.
Context files move from the single .buildvana-temp/hook-context.json to
per-hook paths, .buildvana-temp/hook-contexts/{command}/{moment}.json,
mirroring the .buildvana/hooks/{command}/{moment}.cs convention - so the
context of one hook can no longer be clobbered by another hook's run and
re-running a hook by hand stays reliable. The path pattern lives in
WellKnownPaths, next to the scratch-directory constant that bv's
CommonPaths now aliases.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The BvHookContext and BvConfig sources that Buildvana SDK injected into hook compilations are gone before ever shipping, replaced by the Buildvana.Runtime package: a hook adds an unversioned `#:package Buildvana.Runtime` directive, and the SDK pins the package to its own version for every file-based app built in the repository (a PackageVersion item under central package management, a version stamped onto the directive's PackageReference otherwise). Hooks get the same typed configuration and hook-context API as bv itself, and the hook-path-detection machinery in the Hooks module is no longer needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 41.64% 41.97% +0.33%
==========================================
Files 114 118 +4
Lines 3523 3564 +41
Branches 625 634 +9
==========================================
+ Hits 1467 1496 +29
- Misses 1990 1997 +7
- Partials 66 71 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@claude please review this PR. |
|
Claude finished @rdeago's task in 4m 32s —— View job Review of #319
Solid PR overall — the split between the lean, packaged One correctness concern:
<PackageReference Update="Buildvana.Runtime" Version="$(BuildvanaSdkVersion)" Condition="'$(ManagePackageVersionsCentrally)' != 'true'" />uses MSBuild Minor notes (non-blocking):
|
The SDK version pin for file-based apps overwrote an explicitly versioned `#:package Buildvana.Runtime@X` directive (non-CPM) and duplicated a user-supplied PackageVersion item (CPM). Both branches are now guarded with item-function conditions so an explicit user pin wins, and the comment no longer suggests VersionOverride, which a file-based app cannot express (a versioned directive under CPM fails with NU1008 upstream). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Good catch — confirmed and fixed in 83448fe, and the CPM branch turned out to have its own variant of the problem. Non-CPM: a versioned CPM: a versioned directive under CPM fails upstream with NU1008 — the SDK generates All four scenarios (non-CPM ±explicit version, CPM ±user pin) verified against the edited targets file with a test harness. On the two non-blocking notes, no changes in this PR:
@claude please review the PR again. |
|
Claude finished @rdeago's task in 3m 16s —— View job Re-review of #319 (after 83448fe)
The correctness issue from the last review is resolved. Since that review only one new commit landed,
<PackageVersion Include="Buildvana.Runtime" Version="$(BuildvanaSdkVersion)"
Condition="'$(ManagePackageVersionsCentrally)' == 'true' and '@(PackageVersion->WithMetadataValue('Identity','Buildvana.Runtime'))' == ''" />
<PackageReference Update="Buildvana.Runtime" Version="$(BuildvanaSdkVersion)"
Condition="'$(ManagePackageVersionsCentrally)' != 'true' and '@(PackageReference->WithMetadataValue('Identity','Buildvana.Runtime')->Metadata('Version'))' == ''" />Traced both branches by hand:
CI on No new issues found. The two non-blocking notes from the previous review (missing |
Follow-up to #312/#318, replacing the SDK-injected hook loader sources before they ever ship.
Buildvana.Runtime: the typed model ofbuildvana.json/buildvana.jsoncplus the run-time informationbvshares with repository-owned hooks. Serialization is source-generated, so the same types work in file-based apps, where reflection-based JSON serialization is disabled. Hooks reference it with an unversioned#:package Buildvana.Runtimedirective; Buildvana SDK pins the version to its own for every file-based app built in the repository.PostReleaseHookContext(shared verbatim between bv and hooks) structured intoPathsandReleasesections; context files move to.buildvana-temp/hook-contexts/<command>/<moment>.jsonso hooks can't clobber each other's replay context.Buildvana.Core.Configurationkeeps schema validation and diagnostics on top of the packaged model;nuget.feedsis now a typed record (same JSON shape, better schema descriptions).ReleaseHooks.md), CHANGELOG, and architecture rules updated.Note:
.github/workflows/claude.ymlwas also updated in this branch (model/effort settings for the Claude workflow).🤖 Generated with Claude Code