feat(csharp)!: verify strict-by-default with --lax escape (complete #96)#107
Merged
Conversation
`dotnet meta verify` loaded metadata LAX, so an unregistered or typo'd own `@attr` silently passed verify in C# while Java's force-strict Maven goal and the strict TS/Python verify CLIs (#101) reject it — a port-dependent provenance verdict (ADR-0023). This completes the C# half of #96. - Thread `strict` through both verify load sites (`VerifyCommand.Run` and the `--codegen` gate) via a new `Options.Strict` (default true). The convenience `MetaDataLoader.FromDirectory` gains a `strict` param (default false / lax); `gen`/`docs`/`agent-docs` keep loading lax. - Add a `--lax` flag to `verify` arg parsing (sets strict=false) to restore the legacy open-attr load. - On a strict `ERR_UNKNOWN_ATTR` failure, print an actionable three-exit hint (register a provider / use an `attr.properties` bag / pass `--lax`). The loader error code/text is unchanged. TDD: VerifyStrictTests — a metadata dir with one made-up `@attr` FAILS verify by default (ERR_UNKNOWN_ATTR, exit 1) and PASSES with `--lax`. Cli/Conformance/ Codegen/Render suites all green; no repo-own fixture surfaced an unregistered attr. Part of #96. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuZWKnWzYGVnESijL7uuky
dmealing
added a commit
that referenced
this pull request
Jun 29, 2026
…t (4 ports), formFile (#109) The squash-merges didn't carry per-PR CHANGELOG entries to [Unreleased]. Consolidate: - Correct + complete the verify strict-by-default entry to cover all four CLI ports and the #108 finding that Java was record-not-draining (silently passing), now a real fail-on-recorded-error gate + -Dmeta.lax (#101/#107/#108). - Add the jsonb open-bag → parsed-JSON-value contract change across all five ports (#98). - Add the formFile nested value-object sub-forms feature (#95). Claude-Session: https://claude.ai/code/session_01LuZWKnWzYGVnESijL7uuky Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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 & why
dotnet meta verifyloaded metadata lax, so an unregistered or typo'd own@attrsilently passed verify in C# while Java's force-strict Maven goal andthe strict TS/Python verify CLIs (#101) reject it — a port-dependent provenance
verdict (ADR-0023). This completes the C# half of #96.
LoaderOptions.create(false,false,true))--lax(#101)--laxThe fix
strictthrough both verify load sites —VerifyCommand.Run(templates gate) and the
--codegengate — via a newOptions.Strict(default
true). The convenienceMetaDataLoader.FromDirectorygains astrictparam (defaultfalse/ lax), sogen/docs/agent-docskeeploading lax — only
verifydefaults strict.--laxflag toverifyarg parsing (setsstrict=false) to restorethe legacy open-attr load.
ERR_UNKNOWN_ATTRfailure, print an actionable three-exit hint(register the attr on a provider / move it into an
attr.propertiesbag / pass--lax). The loader error code and text are unchanged — only the commandoutput gains the hint.
Before / after
Test evidence (TDD)
MetaObjects.Cli.Tests/VerifyStrictTests.cs— a metadata dir with one made-up@attr:ERR_UNKNOWN_ATTRload error, non-zero exit (templates andcodegen gates);
--lax→ no load error, passes.RED (new
Options.Strict/Run(..., strict:)API absent) → GREEN.Suites run (no Docker):
MetaObjects.Cli.Tests— 42 passedMetaObjects.Conformance.Tests— 666 passedMetaObjects.Codegen.Tests— 242 passed, 1 skipped (opt-in regen fixture)MetaObjects.Render.Tests— 290 passedCLI smoke: strict → exit 1 + hint;
--lax→ exit 0. No repo-own fixturesurfaced an unregistered attr under the new strict default.
MetaObjects.IntegrationTests(Testcontainers Postgres) not run — requires Docker.
Part of #96.
🤖 Generated with Claude Code