Skip to content

Adding assembly name gen class - #39

Merged
kieronlanning merged 9 commits into
mainfrom
adding-assembly-name-gen-class
Oct 15, 2026
Merged

kieronlanning merged 9 commits into
mainfrom
adding-assembly-name-gen-class

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

No description provided.

Skills are now authored in a tracked repository-root skills/ folder. The .agents/
mirror is gitignored in every consuming repository, so it is absent from a git
clone and cannot be the source the skills CLI reads.

ResolvePurviewSkillSources maps restored packages to their git source and commit
using metadata the package already carries - .agents/skills/* and the nuspec
<repository url commit /> element - so no custom skills.json is introduced and the
resolved ref matches the restored package version. A package that cannot be pinned
is reported (PRSKL0002), never installed from a guessed default branch.

ListPurviewSkills and InstallPurviewSkills are explicit targets with no
BeforeTargets/AfterTargets, so an ordinary restore or build installs nothing.
Installation is delegated to the skills CLI, which owns the agent-specific
destinations and the lockfile. The CLI is detected on PATH ('skills', then 'npx')
and a missing one is PRSKL0004 naming the fix rather than a raw shell error.

PurviewSkillsToPack lets one repository ship different skills in different
packages; PurviewSkillsSource installs from an explicit git source.
A malformed skill fails quietly where it hurts most: the skills CLI skips a SKILL.md
whose frontmatter it cannot parse, so the skill never appears and a consumer cannot
tell that from one that was never written.

ValidatePurviewSkills checks that every skill folder has a SKILL.md, that it opens
with frontmatter carrying name and description, that the name matches the folder,
and that every references/ link resolves. IncludePurviewSkillsInPackage depends on
it, so the repository that owns the skill sees the failure (PRSKL0005) rather than
shipping it. PurviewSkillsToPack scopes the check so one project is not failed by
another project's skill.
The policy and its enforcement lived inside one repository's test project, so any
other repo could only adopt them by copying five C# files plus a schema - about
sixty files across the ecosystem, each free to drift. That is the DRY failure the
policy itself exists to prevent.

Three layers, separated so the rules are testable without a repository on disk:
ArchitecturePolicy/ProjectGraph read the policy and the csproj graph;
ArchitecturePolicyEvaluator holds the rules and returns typed violations per rule;
PurviewArchitectureTests is a thin TUnit base class over it. The evaluator takes an
in-memory graph, so each rule is tested as a three-project fixture.

Adoption is a policy file and one derived class. [InheritsTests] is required and
load-bearing: TUnit does not walk base types during discovery, so without it the
class compiles, the run is green and nothing is enforced. InheritedBaseClassTests
proves discovery works against a temporary fixture repository.

The schema is embedded for offline validation and published at its raw GitHub URL
for editors, mirroring how Purview.Build ships purview-build.schema.json.
Two discovery defects, both of which produced a fully green architecture suite
that checked nothing - the worst result this package can give.

ProjectGraph hardcoded 'src' and returned an empty graph when it was absent. An
empty graph satisfies every rule by construction, so a repository with any other
layout enforced nothing. Source roots are now configurable via 'sourceRoots' in
the policy (default ["src"], empty array scans the repository root), and emptiness
is itself a violation: the new graphDiscovery rule runs before the rules it
protects and names the folders that were searched.

RepositoryRoot walked up from the test binary with no upper bound, so a policy in
a parent folder - a sibling checkout, or a stray file in the directory everything
is cloned into - would be found and silently applied to the wrong repository. The
walk now stops at the .git boundary and says so.
@kieronlanning
kieronlanning merged commit b180793 into main Oct 15, 2026
4 checks passed
@kieronlanning
kieronlanning deleted the adding-assembly-name-gen-class branch October 15, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant