Skip to content

fix(csharp): scope generators with Include and apply project naming on directory load - #456

Merged
dmealing merged 3 commits into
mainfrom
fm/mo-csharp-skills-455
Oct 24, 2026
Merged

dmealing merged 3 commits into
mainfrom
fm/mo-csharp-skills-455

Conversation

@dmealing

@dmealing dmealing commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Fixes #455

No-mistakes took 1 run.

What Changed

  • Adds an Include predicate to the C# generators (PerEntityGenerator, EntityGenerator, DbContextGenerator) and a GenContext.Narrow(...) helper. A hosted runner can scope a generator to a subset of objects, and report row models are held to the same predicate through the new GenContext.Scope.
  • MetaDataLoader.FromDirectory now reads the project's naming from .metaobjects/config.json and applies it to the loaded root. Before, a host that composed its own registry got snake_case regardless of the project setting. MetadataLocation.ConfigFor is now internal, and the MetaRoot.PhysicalNaming doc comment is updated to match.
  • meta upgrade now prints a first step: refresh the agent context with meta init --docs-only --refresh-docs before acting on the upgrade guide. The upgrade guide and the metaobjects-codegen skills (and their conformance fixtures) are updated to match, and CHANGELOG.md records the 1.1.2 fixes.
Validation

Risk Assessment

✅ Low: The change is mostly docs plus an additive, default-null Include property and a naming read in FromDirectory that mirrors the existing MetadataLocation path. The one doc defect I found (the example predicate never matching) is fixed inline.

Testing

Baseline passed. Two CLI scenarios driven live and pass. C# Include and FromDirectory naming verified only by unit tests (untested live, no disposable C# host). Full C# regression suites pass.

  • Live validation: ✅ go - 2 of 4 scenarios driven live against the product
Scenario Result Live Evidence
meta upgrade prints refresh-first instruction ✅ pass live Live run of meta upgrade in disposable project
meta init --docs-only --refresh-docs scaffolds agent context ✅ pass live Live run in disposable project; 36 files
C# Include scopes generators ⏸️ untested no Needs hosted C# CodegenRunner host; no disposable host built.
FromDirectory applies project naming ⏸️ untested no Needs hosted C# loader host; no disposable host built.

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ℹ️ agent-context/skills/metaobjects-codegen/references/csharp.md:255 - The codegen skill's C# Include example read o.Package == "acme::orders". MetaData.Package holds only an explicit node-level package; objects do not inherit the file's metadata.root package (Parser.cs ~line 650 'Objects and other types: don't inherit'). That value is in FileDefaultPackage. The predicate therefore matched nothing in the usual layout, and an agent copying it would silently generate no entities and no DbContext. I changed both lines to NamingRefs.EffectivePackageOf(o) == "acme::orders" (public, in namespace MetaObjects, returns Package ?? FileDefaultPackage ?? "").
  • ℹ️ server/csharp/MetaObjects.Codegen.Tests/GeneratorIncludeTests.cs:78 - The new GenContext.Scope plumbing is untested. Narrow composes Scope, and ReportRows.WithReportRows uses it to filter report row models. GeneratorIncludeTests has no model with a view-backed report, so a regression that stops Include from scoping report rows (routes, filter-allowlist, entity, db-context) would pass. Also, csharp.md option 2 tells a hand-built GenContext to 'copy all of those members' and lists Root, Config, Warn and Applicability but not Scope.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 4 scenarios driven live against the product
Scenario Result Live Evidence
meta upgrade prints refresh-first instruction ✅ pass live Live run of meta upgrade in disposable project
meta init --docs-only --refresh-docs scaffolds agent context ✅ pass live Live run in disposable project; 36 files
C# Include scopes generators ⏸️ untested no Needs hosted C# CodegenRunner host; no disposable host built.
FromDirectory applies project naming ⏸️ untested no Needs hosted C# loader host; no disposable host built.
  • scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains
  • dotnet test server/csharp/MetaObjects.Codegen.Tests --filter GeneratorIncludeTests (4 passed)
  • dotnet test server/csharp/MetaObjects.Conformance.Tests --filter MetadataLocationTests (8 passed)
  • Live: meta upgrade in disposable project prints refresh-first line
  • Live: meta init --docs-only --refresh-docs scaffolds 36 agent-context files
  • Regression: dotnet test Codegen.Tests (987 passed, 1 skipped), Conformance.Tests (2077 passed), Cli.Tests (305 passed)
⚠️ **Document** - 2 infos
  • ℹ️ agent-context/skills/metaobjects-codegen/references/owning-generators.md:54 - Fixed stale Python row: narrowing is a filter= factory argument, not a filter(self, obj) method. Mirrored in SKILL.md and the six agent-context fixture copies; fixture copies match source byte-for-byte.
  • ℹ️ CHANGELOG.md:1 - Captain asked for a note that language standards are the normal path (no cross-port uniformity for conformance convenience). No docs owner exists for that principle; CLAUDE.md is human-owned and was not edited. Record as a feedback memory or a design-principles entry if wanted.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@dmealing
dmealing merged commit fbcae70 into main Oct 24, 2026
1 check passed
@dmealing
dmealing deleted the fm/mo-csharp-skills-455 branch October 24, 2026 17:14
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.

Skills/upgrade guide: agent upgraded on the stale skill, and C# has no documented way to scope a generator (no 'filter'), hosted runner skips naming

1 participant