Skip to content

feat(t27f): visual factory contract and validator (T27F-002) - #13227

Merged
gHashTag merged 1 commit into
masterfrom
claude/t27f-vertical-stack-0.3.0
Nov 7, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/t27f-vertical-stack-0.3.0

Conversation

@gHashTag

@gHashTag gHashTag commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Checklist

  • PR title follows semantic convention: feat(t27f): ...
  • PR body includes Closes #13216
  • Tests added: 11 test blocks in the new spec; both gates pass (commands below)
  • Specs changed -> seals refreshed: not done. A seal has to come from a master-built 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.

  • 8 primitive kinds: container, stack, text, button, input, card, badge, list, plus none. card reuses container as its base.
  • Fixed per kind:
    • a role: group, text, button, textbox, status, list or article;
    • whether it is interactive and how many children it may have;
    • the allowed props, variants and states, as bit masks.
  • Also defined:
    • layout enums: display, direction, align, justify;
    • breakpoints: sm / md / lg at 0 / 640 / 1024;
    • per-theme colour tokens for light, dark and high contrast. The theme ids are imported from ui_plan.t27.
  • vf_validate returns 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_node points at the node that failed. Graph-level codes return 16, which means "no node".
  • Output-contract field lists: artifact, manifest, preview viewports and snapshot fields, plus the snapshot determinism flags. These are what later T27F issues will produce.

The spec reuses specs/t27f/ui_plan.t27 (bit, has_bit, theme ids) and does not replace it. ui_plan places 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):

t27c test-report specs/t27f/visual_factory_contract.t27
#   tests 11, pass 11, FAIL 0, vacuous passes 0 of 11 (2 comptime-verified), rc=0
t27b test specs/t27f/visual_factory_contract.t27
#   11 passed, 0 failed, 11 total, rc=0

t27_check (parse + typecheck): ok, 0 errors, 0 warnings.

each_bad_fixture_gets_its_own_code builds one bad fixture for each code from 1 to 18. It asserts that vf_validate returns 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

  • Masks are integer literals. VF_PROPS, VF_VARIANTS and VF_STATES are written as integers, not bit(...) sums: t27b cannot fold function calls inside a const array initializer. It fails with unsupported construct ConstDecl ... struct field is not a compile-time value, while t27c accepts them. The ; comment above each const lists the members.
  • Seal not saved. The seal for this new spec is not in this PR. If the seal check asks for it, it has to come from a master-built t27c (t27c seal ... --save).
  • Merge is the owner's. Auto-merge is off.

φ² + 1/φ² = 3 | TRINITY

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-11-07 07:18:49 UTC

Summary

Status Count
Total Open PRs 42
PRs with Failing Checks 39
PRs with All Checks Green 3
READY 2
FAILING 39
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 39 + 0 + 0 = 41, and there are 42 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e75b498e5e79 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant