Repository navigation
feat(t27f): visual factory contract and validator (T27F-002) - #13227
Merged
Merged
Conversation
A typed UI object graph of 8 primitive components (container, stack, text, button, input, card, badge, list). Each kind has a fixed role and fixed sets of allowed props, variants and states. The spec also defines layout enums, breakpoints, per-theme tokens and the output-contract field lists. vf_validate returns one of 19 VF codes; vf_first_bad_node points at the failing node. Reuses ui_plan.t27 and does not replace it. Tests: t27c test-report 11/11 with 0 vacuous, t27b test 11/11. The const masks are integer literals because t27b cannot fold bit() calls inside const array initializers. Closes #13216 Refs #13214 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Nov 7, 2026
This was referenced Nov 7, 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.
Pull Request Checklist
feat(t27f): ...Closes #13216testblocks in the new spec; both gates pass (commands below)t27c(see Review Notes)Description
T27F-002 of epic #13214 (Refs #13214; this PR does not close the epic).
This PR adds the visual factory contract: a typed UI object graph that is validated before anything renders. It covers only the contract, the validator and the contract tests. Layout, components, preview, snapshots, CLI and artifacts are out of scope; they are the later T27F issues.
none.cardreusescontaineras its base.ui_plan.t27.vf_validatereturns exactly one of 19 stable codes,VF000..VF018. They cover version, theme, viewport, node count, root, parent order, unknown component, child not allowed, too many children, prop / variant / state not allowed, accessible name, input label, empty text, test id, layout enum and layout range.vf_first_bad_nodepoints at the node that failed. Graph-level codes return 16, which means "no node".The spec reuses
specs/t27f/ui_plan.t27(bit,has_bit, theme ids) and does not replace it.ui_planplaces domain widgets on a grid; this spec is the primitive layer underneath.Changes
specs/t27f/visual_factory_contract.t27: new, 671 lines.No
gen/,bootstrap/or seal changes.Testing
Both gates were run in a T27 OS shell cell (not on the Mac host):
t27_check(parse + typecheck): ok, 0 errors, 0 warnings.each_bad_fixture_gets_its_own_codebuilds one bad fixture for each code from 1 to 18. It asserts thatvf_validatereturns exactly that code, so every diagnostic has a negative test.Documentation
None. The spec's header comments state what it claims and what it does not.
Review Notes
VF_PROPS,VF_VARIANTSandVF_STATESare written as integers, notbit(...)sums:t27bcannot fold function calls inside a const array initializer. It fails withunsupported construct ConstDecl ... struct field is not a compile-time value, whilet27caccepts them. The;comment above each const lists the members.t27c(t27c seal ... --save).φ² + 1/φ² = 3 | TRINITY
🤖 Generated with Claude Code