Repository navigation
[GEN-E3] operations bind through returned facet results; one inventory refuses every type-name collision (PR 2/3, #414) - #437
Merged
Conversation
…and one inventory refuses every type-name collision SingleOperationBinder and ErrorMapBinder move out of OperationPlanBinder (593 -> 230 lines). Each facet returns a FacetResult (bound or refused with its own errors), which replaces the shared error-count window, and an independent facet still reports when another refused. ErrorMapBinder reuses the error union's per-target verdicts and resolves the rest directly. - P43: one GeneratedTypeNameInventory, built once after the last declaring pass, feeds one collision wall over every generated name: models and schema names, unions with their Kind and Unknown names, hoisted interfaces, clients, envelopes and streams. The hoist composer records claims; a hoisted name refused against another declaration never reaches placement, and the first of two hoisted claimants keeps its name. - P31: a cursor list that declares a header, a required member or an incompatible signature keeps its method and loses only the pagination companion. - P46: an error schema with no unique C# name reports once, from the error union. - #414: an invalid curated list method name reports once, by its own rule, without the misleading plural error. Generated output is byte-identical.
This was referenced Oct 17, 2026
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.
Operation binding becomes named collaborators that return what they decide. One generated-type-name inventory refuses every collision. Generated output is byte-identical.
Closes: P42, P46, P31, P43, #414. This is GEN-E3 PR 2 of 3, following the approved plan (
faz4/GEN-E3/plan.md, amendments included). PR 1 is #425. PR 3 (graph and statics) waits for TST-E3's first half.What changes
SingleOperationBinderandErrorMapBinderleaveOperationPlanBinder, which goes from 593 to 254 lines.FacetResult<T>. A facet is bound, or refused with its own errors:MissingRowincluded.ErrorMapBinderreuses the error union's verdicts. It does so only for closure members.ErrorStyle.Noneobjects and stream causes still resolve directly. An error schema with no unique C# name reports once, from the error union.GeneratedTypeNameInventory, built once after the last declaring pass, feeds one collision wall. This is the lead's "deferred single wall" (plan amendment A.5).ModelOwnershipPolicy.Tests
Red then green: every behaviour change.
ArgumentException;cmp→ 189/0).Restored-behaviour rows: the fix-up derived each oracle from
git show 04f18994:<file>and pins it as the full orderedErrorslist:Existing-test edits:
Containsor a category filter to the full ordered list:Bind_Should_Refuse_A_Tag_Owned_By_Two_Closure_Schemasand the mixed body/query row;InternalNameCollisionCheckTests.Check,OperationPlanBinderTests.Bind_Should_Preserve_Type_Name_Claim_Order,UnionHoistPlanData.CheckNames, and P31's arrange moved into oneCursorQueryhelper.No existing expected error list was reordered.
E0 guards:
CollectionOrdering.Matching;Contains, and noIsTrueoverAny/All;Found and kept as on master: A duplicate-tag error union refusal cascades into misleading 'absent union' membership errors #436. A duplicate-tag error union refusal still cascades into two "absent union 'IOpenCodeError'" errors. That is base behaviour, which this PR restored exactly and now pins. The fix is the same claim-drop PR 1 used for P36, and it lands in GEN-E3 PR 3, with a deliberate red-first change to this row.
Clone baseline (proven)
tests.baseline.json: −3 / +1, two fewer clones.78811ccc→94b8d278, forEmitterPlanFixture.cs:1041-1067↔UnionHoistPlanData.cs:149-175. With master'sUnionHoistPlanData.csrestored at this head, the gate shows 0 new clones.04551f23went with theOperationPlanBinderTestsarrange, now theCursorQueryhelper.0555dcc5is [GEN-E3] union binding returns its decisions; nested-union and object-or-array defects refuse or bind correctly (PR 1/3) #425'sSpecBinderTestsswap entry, gone with the Generator: an invalid curated method name also reports a misleading 'does not pluralize naively' error #414 rows that moved.UnionHoistPlan.Claimsbecamerequiredin place, without being moved. The EmitPlan ↔ UnionHoistPlan property pair that the first draft showed is gone. Its owner, had it stayed, was GEN-E4 U7-36 (recorded in GEN-E4's plan).Budget (against the merge-base)
Local check and review
Local check at this head, on dev-01, after a root Release build: slopwatch 0 issues; the Release build with 0 warnings; both format passes;
verify-clonespassing;--help;generate --verifycurrent; the whole Tools.Tests project (guards included) at 2033/0. Bun 1.4.3, off the 1.4.2 pin. CI is the full gate.verify.log: for both runs, the harness ran the guards, 13 touched classes, the whole Tools.Tests project (failing only on the 14 packaging rows that need a root build; manual §5.3) and
generate --verify.Review: the coordinator's Claude review and a fresh cross-family review, each comparing old against new code behaviour by behaviour. They found six behaviour changes that
generate --verifycould not see at the pin, all fixed here:The fix-up rule was "restore 04f1899 exactly unless the plan lists the change; finish what is deliberate".
Provenance: Generator lane / opencode dispatch harness (openai/gpt-6.1-sol-1m) for the implementation and the fix-up, coordinated, reviewed and finished in Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need.