Repository navigation
docs(emitters): verify a generation before, during and after it - #1339
Open
OmarAlJarrah wants to merge 5 commits into
Open
OmarAlJarrah wants to merge 5 commits into
OmarAlJarrah wants to merge 5 commits into
Conversation
Nothing required generated output to build, a target found the constructs it could not lower one at a time inside Generate, a regeneration could not say what changed or why, nothing checked the manifest, and surface verification's records lacked the facts its verdicts turn on. The engine now checks a generation at three points. Before it, the capability-matrix rows a document exercises, a new derived fact, are compared with the rows a target declares, and each one unhonored is reported. During it, every refine step and template carries a version the manifest records. After it, a verify stage builds, lints and tests the staged output and compiles the usage samples, mapping each toolchain message to the entity whose declaration holds it, and the manifest is checked for exact coverage and for symbols that resolve in the build. Change records now carry direction, response optionality and bindings, the seeded severity table gives one verdict per channel, structural for callers' code and behavioral for deployed SDKs, and the version bump follows from them. apidiff is the test oracle for Go's structural verdicts, neither the differ nor the severity.
This was referenced Nov 2, 2026
…to docs/emitters-verification
This was referenced Nov 2, 2026
…to docs/emitters-verification
…to docs/emitters-verification
…to docs/emitters-verification
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.
Summary
How a generation is checked, at the three points where it can be wrong (
docs/emitters/verification.md). These issues are one contract, since each check reads what another records.Before generation: unhonored rows (#707).
irfacts.Rows(docs/ir/derived-facts.md#capability-rows): for each capability-matrix row, by its stable key, the locations exercising it. A test holds one detector per row to the matrix's keys, as the conformance corpus is held.Capabilities.Rows. The engine reports the difference beforeGenerateasemitters/<target>/unhonored-row.During: step versions (#702).
StepgainsVersion(), bumped with every change to what it builds, and templates carry one too. The step-trace golden holds them, as the plan's goldens holdplan.Revision(docs(emitters): make plan.Policy data and define its envelopes #1331).After: the output builds (#704).
Capabilities.Verify.Artifact.Spans, rather than to a path alone, which is allOriginsgives.After: the manifest is checked (#584).
Originrather than inferred, so a tolerance would only hide our bugs.Change records and severities (#715) (
docs/emitters/surface-verification.md).Facts.Usage), response optionality, and bindings in the behavioral channel.whenthat must be exhaustive.apidiff's role (#795). It is decided now rather than deferred, on a spike against
golang.org/x/exp/apidiffat its October 2026 revision (BSD-3-Clause, actively developed). apidiff is the test oracle for Go's structural severity: a differential test over the surface corpus holdsverify.Severity's Go verdicts to apidiff's.x/exp.Spike verdicts (
apidiff.Changeson two type-checked packages): a fieldstring→*stringwas incompatible, an added constant compatible, an added struct field compatible, an added method parameter incompatible.T-41 to T-44 pin the four checks.
Closes #707
Closes #702
Closes #704
Closes #584
Closes #715
Closes #795
Test plan
Verify,Toolchain,CheckandSpandeclarations, extracted verbatim, passgo vet.Stacked on #1337 (#1329 ← #1331 ← #1332 ← #1334 ← #1335 ← #1336 ← #1337). Merge in order. After each base lands, "Update branch" is a merge of
mainthat conflicts nowhere.