Repository navigation
feat(csharp): consume shared dependency models at build time - #508
Merged
Merged
Conversation
dotnet meta reads `dependencies` from .metaobjects/config.json at every rung of its source ladder, verifies the committed snapshot against deps.lock.json offline, and loads the snapshots ahead of the project's own files under `dep:<name>/<artifact>` source ids. Same ERR_DEPENDENCY_* codes as TypeScript and Python; the Node `meta deps sync` stays the only writer of lock and snapshot. Imported nodes load but are not generated: the codegen runner, report rows, shared enums, API-docs model, template scope walk, the verify --codegen regeneration and the requirement gate's coverage denominator all leave them out unless scope.include names their package. An imported value object a generated entity holds is still emitted, since the entity's property type needs it. C# runs all 23 cases of fixtures/dependency-conformance/ on the neutral ladder and the explicit metadata-directory rung, plus codegen, CLI and unit tests.
…basing onto main main's corpus now carries 11 deps-check cases (expectCheck) beside the 24 resolution cases; C# has no check yet, so its runner skips them. Update the Phase 2 prose and the changelog count to match.
# Conflicts: # CHANGELOG.md # docs/CONFORMANCE.md # docs/features/metadata-dependencies.md # fixtures/dependency-conformance/README.md
… S6); stale "C# doesn't read dependencies" claims fixed in README, cli, metadata-sources, metadata-dependencies, spec/roadmap, and the agent-context codegen reference plus its five mirrored fixture copies.
Member
Author
|
no-mistakes runs: 3. Runs 1 and 2 ended on infrastructure failures (a git fetch and the rebase agent were killed with signal: terminated); run 1's review had already fixed its three findings. Run 3 passed every step with one info finding (a doc sentence, fixed inline). CI step skipped by design (ci_mode: local); full C# suites run locally before the run: Codegen 1060, Cli 339, Render 336, Conformance 2167. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
dotnet metareadsdependenciesfrom.metaobjects/config.jsonon every source-ladder rung, including the explicit metadata directory. It verifies the committed snapshot againstdeps.lock.jsonoffline and loads snapshots underdep:<name>/<artifact>source ids, with the sameERR_DEPENDENCY_*codes as the TypeScript and Python ports. The newConfig/Dependencies.csimplements this.verify --codegenregeneration, requirement-gate coverage) unlessscope.includenames their package. An imported value object that a generated entity holds is still emitted, because the entity's property type needs it.DependencyUnitTests,DependencyConformanceTests,DependencyCodegenTests,DependencyCliTests). Updates docs, the README, and the agent-context codegen reference and its fixture copies to state that C# consumes shared models. Out of scope: publishing, Maven/NuGet transports,verify --deps(S7), and any C# writer of the lock or snapshot.Validation
Risk Assessment
✅ Low: The change is additive and bounded: a project with no dependencies and no lock loads exactly as before. It mirrors the Python reference (lock validation, offline integrity check, collision and not-owned refusals, inScope formula). The import filter is applied at every selection point the intent lists. Shared-model artifacts never carry template.* nodes, so the template-tier seeds only ever see local templates. Corpus, unit, codegen and CLI tests cover the new paths.
Testing
Drove dotnet meta against a disposable app with a committed dependency snapshot and lock. Verified offline verify OK on a good lock. Verified stale snapshot, missing lock and metamodel-major mismatch fail with their ERR_DEPENDENCY_* codes. Verified gen drops imported Customer and emits imported Address, both directly and when nested in a local value object. Verified scope.include naming the package selects its nodes. Full C# suites pass: Codegen 1060 (1 skip), Cli 339, Render 336, Conformance 2167. Not driven live: ERR_DEPENDENCY_NODE_COLLISION (my attempt hit ERR_SOURCE_MULTIPLE_PRIMARY instead), and the explicit-rung error cases, which are covered only by conformance tests.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
docs/features/metadata-dependencies.md:590- The C# paragraph said an imported value object's POCO is emitted only when a generated ENTITY holds it. Since the round-1 closure fix, the POCO is also emitted when a local value object holds it or when a local template's @payloadRef/@responseRef names it. Reworded the sentence to match the code (EntityGenerator.ReferencedValueObjects).✅ **Test** - passed
✅ No issues found.
scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsdotnet build server/csharp/MetaObjects.Cli(branch CLI built)dotnet test server/csharp/MetaObjects.Conformance.Tests/MetaObjects.Conformance.Tests.csproj --filter FullyQualifiedName~Dependency(57 pass)Disposable app in mktemp dir: acme-common snapshot from fixtures/dependency-conformance/artifacts/acme-common-v1.json, lock with matching sha256, config.json dependencylivedotnet meta verify metaobjects --templates templateson current lock: OKlive tampered snapshot (appended byte): ERR_DEPENDENCY_SNAPSHOT_STALE with hash detailslive missing deps.lock.json: ERR_DEPENDENCY_SNAPSHOT_STALElive lock metamodelVersion 2.0 vs toolchain 1.2: ERR_DEPENDENCY_METAMODEL_INCOMPATIBLElivedotnet meta initthendotnet meta gen metaobjects --out gen-outwith EntityGenerator, codegen project pointed at branch MetaObjects.Codegen via ProjectReference (published 1.1.4 package lacks dependency support): Order.g.cs and Address.g.cs written, Customer and Audited not writtenlive adversarial: local object.value Wrapper with field.object @objectRef acme::common::Address and no entity holding Address: Address.g.cs emitted, Wrapper.g.cs references Addresslive scope.include ["app::**","acme::common::**"]: Customer.g.cs also writtenlive bad dependency path ../nope with lock intact: verify OK (offline verify reads committed snapshot, by design)dotnet test MetaObjects.Codegen.Tests (restore enabled): 1060 pass, 1 skipdotnet test MetaObjects.Cli.Tests: 339 passdotnet test MetaObjects.Render.Tests: 336 passdotnet test MetaObjects.Conformance.Tests: 2167 passScratch tree and /tmp files removed; git status clean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.