Skip to content

feat: add experimental Python spec authoring - #372

Open
armstrongsam25 wants to merge 2 commits into
vercel-labs:mainfrom
armstrongsam25:feat/python-authoring
Open

armstrongsam25 wants to merge 2 commits into
vercel-labs:mainfrom
armstrongsam25:feat/python-authoring

Conversation

@armstrongsam25

@armstrongsam25 armstrongsam25 commented Oct 2, 2026 •

Copy link
Copy Markdown

Python backends currently have to assemble json-render's UI wire format by hand. This change adds an installable, typed Python package with Spec, Element, and ActionBinding dataclasses that emit the existing field names, check element references, and preserve event/state bindings and false/empty/null values.

Catalog consumes JSON Schema exported by the application's TypeScript catalog instead of recreating Zod in Python. It validates the supplied schema exactly, returns detached JSON, and does not fetch external references. This is a proposed first slice for #7; API naming, distribution ownership, dependency policy, and future native Python catalog definitions still need maintainer agreement. The package is alpha, source-install only, and has no PyPI publishing workflow.

The current React export omits runtime on, watch, and state fields and is lenient about props when multiple components exist. The package documents those limits, preserves the original wire JSON, and checks event/action compatibility separately. Rendering, prompt generation, expression/action execution, streaming, and Pydantic catalog authoring remain outside this initial version.

Validation:

  • Built a wheel and source distribution; installed the wheel and passed isolated import/serialization checks on Python 3.10 and 3.14.
  • 16 Python tests pass on 3.10, 3.12, and 3.14. Four TypeScript interoperability checks pass, including a real catalog export with invalid-spec controls and state-bound action resolution. The interop suite's TypeScript check passes.
  • pnpm type-check passes across all 60 tasks; web dependency and production builds pass; all 122 docs route/parity checks pass. Only the intentionally changed Specs-page parity entry was updated.
  • Added Python 3.10/3.14 CI jobs, package/root/Specs documentation, and core skill guidance.

Contributed by Sam Armstrong with Personal AI Labs.

@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@armstrongsam25 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub/​actions/​setup-python@​a26af69be951a213d495a4c3e4e4022e16d870659810010010080
Addedpypi/​hatchling@​1.32.496100100100100
Addedpypi/​jsonschema@​4.26.099100100100100
Addedpypi/​referencing@​0.37.0100100100100100

View full report

@armstrongsam25
armstrongsam25 marked this pull request as ready for review October 2, 2026 22:49

This branch has not been deployed

No deployments
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