Repository navigation
fix(csharp): resolve rc.21 review blockers for the 1.3.0 release - #599
Merged
Merged
Conversation
…ny key spelling; declare a shared enum no sibling entry declares B1: the credential-omitting result found the envelope's rows with env["rows"], which a strict host (PropertyNameCaseInsensitive = false) misses when an upper-case policy writes ROWS, so the rows went out unstripped. One helper, SerializerKeys.StripBody, now serves the generated CredentialOmittingResult and ReportExportHttp.Json: it reads the rows key from the envelope's own serializer contract and refuses (throws) when the key or the array cannot be found. SnakeCaseUpper and KebabCaseUpper strict-host variants join the live host test and the SerializerKeys unit tests. B2: a narrowed EntityGenerator entry skips a shared enum only when another EntityGenerator entry of the same run accepts the enum's home; a single narrowed entry declares it, so its output compiles on its own. L1: origin.function, @union, @unionall, @Grain and @grainOrdinal carry implementedIn ["typescript", "csharp"] (registry manifest, embeds and the metamodel-docs fixture regenerated). L2: with a rename beyond case, the C# sort allowlist accepts the field name as well as the resolved property name. L7: the C# sized @dbColumnType pattern ends at \z, so a trailing newline is refused. CHANGELOG: the credential entry names exactly what is stripped, the G2 and sort entries match the new behaviour, and a computed field reading its own name is listed as refused at load.
…function implementedIn
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
{ rows, total }envelope's rows key from the serializer's own contract instead of the literal"rows", via a singleSerializerKeys.StripBodyhelper used by both the generated routes andReportExportHttp— failing closed (refusing the response) when the key is unreadable or the node is not an array. Fixes the credential leak underSnakeCaseUpper/KebabCaseUpperhosts withPropertyNameCaseInsensitive=false, now covered by live host-variant and unit tests plus re-captured golden routes.EntityGeneratorentry declares a shared enum itself unless another entry in the same run (viactx.Generators) accepts the enum's home object, so a single narrowed entry compiles on its own (fixes the CS0234 build break) while multi-entry runs still declare it exactly once. Also in C#: the?sort=allowlist accepts both the metadata field name and the resolved C# property name when a rename goes beyond case (emitting anOrdinalIgnoreCasedictionary only then), and the sized@dbColumnTyperegex ends in\zso"varchar(10)\n"is refused.implementedIn: ["typescript","csharp"]on the five rc.21 view-vocabulary entries (origin.function,@union,@unionAll,@grain,@grainOrdinal) inspec/metamodel— the canonical source — with the C#/Python byte copies, TS embeds,expected-registry.jsonand metamodel-docs fixtures regenerated from it; corrected the existing[1.3.0]CHANGELOG entries to name exactly what the credential strip removes, the G2 and sort behavior, and the computed-fieldERR_INVALID_ORIGINline. No version bump.Validation
Risk Assessment
✅ Low: The two blocker fixes are tight and fail-closed (B1 refuses rather than sends unstripped; B2's declaring-is-default compiles standalone and declares exactly once per run), the vocabulary edit is metadata-only and byte-consistent across ports, and the sort-allowlist change is byte-identical without renames — no reachable defect, leak path, or intent contradiction found.
Testing
Drove the two release blockers end-to-end at the real product surface: the credential-stripping fix was exercised over live HTTP on generated ASP.NET routes against disposable Testcontainers Postgres under the previously-leaking strict upper-case serializer hosts (all 12 variants pass, including the fail-closed refusal guards), and the shared-enum fix was exercised by running the real C# EntityGenerator narrowed and compiling its emitted output with Roslyn (compiles standalone; declared exactly once across a run's entries). The L2/L6/L7 supporting findings passed their focused suites (renamed sort allowlist golden contract, StripBody under real System.Text.Json options, loader and regex behavior). No source or test files were changed, so the already-passing configured regression run stands. No UI surface exists in this change, so no visual evidence was applicable.
dotnet test MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest— 12/12 passed, incl. (naming:plain, policy:snakeUpper), (naming:rename, policy:kebabUpper)…A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credentialand..._the_subtype_credentialboth passed; StripBody's throw paths for a missing rows pro…GeneratorIncludeTests.A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False)compiles the emitted files via Roslyn (PackageNamespaceTests.CompileErrors, 0 er…PropertyNamingEmitSitesTests+SerializerKeysTests(25/25) andR6Plan2LoaderTests(15/15) — the sort-allowlist assertions run against the generator's emitted golden files (an intentional generat…Evidence: B1 live run: credential host-variants over HTTP (Testcontainers PG) — full log incl. container lifecycle and 12/12 pass summary
Passed MetaObjects.IntegrationTests.Api.ApiContractCredentialHostVariantsTest.A_credential_is_never_returned_and_never_written_whatever_the_host_does_to_keys(naming: "plain", policy: "snakeUpper") Passed ...A_credential_is_never_returned_and_never_written_whatever_the_host_does_to_keys(naming: "rename", policy: "kebabUpper") Passed ...A_subtype_credential_is_never_returned_or_written_on_the_polymorphic_and_subtype_routes(naming: "plain", policy: "snakeUpper") Passed ...A_subtype_credential_is_never_returned_or_written_on_the_polymorphic_and_subtype_routes(naming: "rename", policy: "kebabUpper") Passed ...A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credential Passed ...A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_subtype_credential Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
dotnet test MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest— 12/12 passed, incl. (naming:plain, policy:snakeUpper), (naming:rename, policy:kebabUpper)…A_host_whose_contract_cannot_be_read_refuses_to_start_instead_of_leaking_the_account_credentialand..._the_subtype_credentialboth passed; StripBody's throw paths for a missing rows pro…GeneratorIncludeTests.A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False)compiles the emitted files via Roslyn (PackageNamespaceTests.CompileErrors, 0 er…PropertyNamingEmitSitesTests+SerializerKeysTests(25/25) andR6Plan2LoaderTests(15/15) — the sort-allowlist assertions run against the generator's emitted golden files (an intentional generat…scripts/ci-local.sh --affected --strict-toolchainsBaseline (already run, passing at target commit):scripts/ci-local.sh --affected --strict-toolchainsB1 live:dotnet test server/csharp/MetaObjects.IntegrationTests --filter FullyQualifiedName~ApiContractCredentialHostVariantsTest— 12/12 passed (5+5 host-variant theories incl. plain/snakeUpper and rename/kebabUpper strict hosts, plus 2 fail-closed refusal tests) against Testcontainers Postgres over HTTP; containers removed afterwardsB2:dotnet test server/csharp/MetaObjects.Codegen.Tests --filter "FullyQualifiedName~GeneratorIncludeTests|FullyQualifiedName~PackageKeyedOutputTests"— 19/19 passed, incl.A_single_narrowed_entry_declares_a_shared_enum_whose_home_it_does_not_emit(listed:True/False)which compiles the emitted C# (RoslynCompileErrors) and the three-entries-of-one-run exactly-once caseL2 + StripBody:dotnet test server/csharp/MetaObjects.Codegen.Tests --filter "FullyQualifiedName~PropertyNamingEmitSitesTests|FullyQualifiedName~SerializerKeysTests"— 25/25 passed (renamed sort allowlist maps field name and property name; StripBody under real JsonSerializerOptions incl. SnakeCaseUpper, and fail-closed on unreadable contract / non-array rows)L6 + L7:dotnet test server/csharp/MetaObjects.Conformance.Tests --filter FullyQualifiedName~R6Plan2LoaderTests— 15/15 passed (self-referencing computed field → ERR_INVALID_ORIGIN; trailing-newline sized dbColumnType refused)✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.
Validated by the no-mistakes gate in 1 run (the lint step regenerated one stale site-reference page).