Repository navigation
[GEN-E3] ref chains, pure policies and schema-name resolvers get one owner each; an error-union refusal no longer cascades (PR 3/3, #436) - #456
Merged
Conversation
…ers each get one owner, and an error-union refusal no longer cascades RefChain replaces the four ref-chain walks, with one walk and a result naming the last key. The pure Binding and Ingestion/Projection policies become static: comparer-only Binding types go from 10 to 0, the `_comparer` fields from 11 to 0, and their constructor threading and DI registrations go with them. SchemaNameResolver's four facet-root resolvers become their own static collaborators (SchemaNameResolver 410 -> 205 lines). SchemaPlanBinder is 154 lines. The four CA1822/S2325 exemptions in .editorconfig go, with their eight suppression-ledger rows. Latent duplicates that the static conversions made textually identical each get one owner. #436: a refused error union drops its membership claims before the graph is published, so a duplicate-tag refusal reports one error instead of two misleading absent-union errors. Generated output is byte-identical. Closes #436
14 of 39 tasks
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.
Binding's ref-chain walks, pure policies and schema-name resolvers each get one owner. A refused error union no longer cascades into misleading errors (#436). Generated output is byte-identical.
Closes: P44, P38, U7-30, U10-09, P47, P48, P50, #436. This is GEN-E3 PR 3 of 3, following the approved plan (
faz4/GEN-E3/plan.md; amendments A.1–A.4, 14 and 15 bind this PR). PR 1 is #425 and PR 2 is #437. It was developed in parallel with GEN-E6 PR 2b (#455), with disjoint write sets. It was rebased onto7bb2faef, past RT-E2 C, #451 and the preview.12 cut #454. This PR touches no CHANGELOG, and the full local check was rerun on that base.What changes
QueryEnumShapePolicyneeds. The document-basedOperationFacetContext.Resolveis gone, and its twoUpstreamClientQueryTypeTestscallers use RefChain (amendment 14)._comparerfields from 11 to 0 (S4);SchemaPlanBinderkeeps its instance shape;SchemaAliasApplierandPathTemplateValidatorbecome static, along with the four Ingestion/Projection pure types (GraphKeyBuilder,ErrorStyleClassifier,EnumSchemaProjector,LiteralClassifier);ToolApp) andBindingTestHost's hand-wiring go too;SpecIngestion.cschanges only in its GraphKeyBuilder construction and call lines (S1).RequestBodyRootNameResolver,QueryEnumRootNameResolver,EnvelopePayloadRootNameResolverandEffectStreamRootNameResolver(decision 9, S2). SchemaNameResolver goes from 410 to 205 lines.Bind_Should_Refuse_A_Tag_Owned_By_Two_Closure_Schemasa deliberate, red-first change: three errors → the duplicate-tag error alone, as the full ordered list. Its response-collision row keeps its Naming error after it.SpecBinder.Bindpast MA0051's 80 lines, so its orchestration got one private-method extraction insideSpecBinder.cs, keeping the pass order, arguments and results. That is mechanical fallout of a planned move, approved by the lead; there is no new type and no suppression..editorconfig: the four CA1822/S2325 exemption sections go (4 → 0). The SuppressionLedger snapshot loses 8 deletions plus their aggregate count (editorconfig: 158 → 150), edited by hand with no auto-accept (S3, and the lead's OK on the count).Proof (spec)
_comparerfieldsgenerate --verifyTests
cp/cmp:CSharpNamePolicyTests' summary (comment only);ToolAppTestsmarker strings and twoPendingOperationBindabilityProbeTestsmessages, which lose only " in M1";QueryRequestFacetBinderTests' two enum-refusal tests, folded into one data-driven test with every assertion unchanged;new X().Bind→X.Bind, and constructor arguments removed), inBindingTestHost, SpecBinder/OperationPlanBinder/StabilizeDuplicatePolicy/ModelReachCollector/UnionMembershipValidator/UnionMemberHoistBinder tests,UnionHoistPlanData,EmitterPlanFixture, GraphKeyBuilder/LiteralClassifier/SchemaProjector tests and the two projection test hosts.Clone baseline, every entry accounted for
Tools (1.98%): −5 stale, +2.
_keys.AppendagainstGraphKeyBuilder.Append). Each now has one owner, a same-file static helper:LiteralClassifier's two marker prologues;ObjectSchemaProjector.cs:10-23 ↔ PrefixItemsAdapter.cs:12-25andObjectSchemaProjector.cs:12-23 ↔ UnionNormalizer.cs:23-34.Tests (5.38%): −2, +1.
b4bc3f07is freed by the QueryRequestFacetBinderTests fold.EmitterPlanFixture.cs:1041-1067 ↔ UnionHoistPlanData.cs:149-175is a fingerprint swap,94b8d278→e59cfed5. PR 3's compile-forcednew X().Bind→X.Bindedits shifted it. With master's two fixture files restored at this head, the gate shows 0 new clones.Budget (against the merge-base)
Local check and review
verify-clonespassing;--help;generate --verifycurrent; the whole Tools.Tests project (guards included) at 2070/0. This is the rerun after the review fix-up and the rebase, on a quiet host. The first check, on the pre-review head, ran beside a dispatch. CI is the full gate.verify-clonesandgenerate --verify(manual §5.3).git show 695c5557:<file>with the new code behaviour by behaviour. Neither found a behaviour change for any document they constructed: RefChain's four walks, the static conversions, resolver precedence and order, the SpecBinder pass order, and A duplicate-tag error union refusal cascades into misleading 'absent union' membership errors #436's scope. Fixed here:ResolveModelKey(Ref(State), graph)row and a full-pipeline refusal, both red against an "unwrap Nullable inside the walk" mutant;MediaTypeProjector, andProjectArrayItemsto an instance method takingitemsexplicitly, with noDebug.Assert;SchemaBindingContextfactory, replacing two tests' hand copies.ReferencesMarkedUniontoIsMarkedUnionReferencetriggers S3218, because the static method shadowsProjectedBranch.IsMarkedUnionReference. So that rename stays: it was forced, not unrequested.Provenance: Generator lane / opencode dispatch harness (openai/gpt-6.1-sol-1m), coordinated, reviewed and finished in Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need.