Repository navigation
feat: add first-class function wire contracts - #3985
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
❌ Gate recommendation: request changes.
The typed-job direction is worthwhile, but this revision does not yet establish one executable Rust/Python wire contract. I independently confirmed the existing Python result-erasure, numeric canonicalization, and optional-field parity findings.
A viable revision should define one terminal-result policy across Rust, PyO3, Python, and both supported Pydantic majors; preserve result-agnostic Job<()> resume semantics; cover byte-stable defaults and numbers in shared fixtures; and document every exported model.
Problem
Enterprise Function-backed computed columns need a stable SDK contract before Sophon catalog and execution endpoints can be added. The existing
JobAPI can only represent unit terminal results, and there is no shared Rust/Python wire definition for immutable Function versions, applications, bindings, or refresh results.Behavior
This introduces remote-only canonical Function values in Rust and Python, evolves
Job<T = ()>to decode typed remote terminal results while keeping local spawned operations unit-typed, and fixes the cross-language contract with shared JSON golden fixtures. Unknown fields and discriminator values remain forward-decodable, while canonical output contains only fields known to the client. Function models contain secret names only.Sophon remains the sole owner of catalog persistence, environment bake, secret resolution, execution, and publication. This PR does not add authoring/catalog endpoints, local execution, refresh runners, or live Sophon E2E coverage.