spike: spock gen provider — assembly-layer tables from the contract#29
Draft
k08200 wants to merge 4 commits into
Draft
spike: spock gen provider — assembly-layer tables from the contract#29k08200 wants to merge 4 commits into
k08200 wants to merge 4 commits into
Conversation
Evidence spike for gridaco/uhura#29, in the home RFD 0010 assigns to generation: the binary. A new gen subcommand consumes the compiled contract (typed, in-process — no JSON parsing seam) plus a per-app assembly declaration, validates every referenced table/fn/error against the contract, and emits the provider tables module: snapshot GraphQL document, machine contract types, dispatch switch, refusal whitelist, mutation routing, and the Play asset table. Nine golden tests hold each artifact char-equal with the hand-written instagram provider it replaces; declaration syntax is a spike and not proposed for adoption.
…ence The generic runtime (serialized settlement queue, resnapshot-on-accept, whitelist refusal admission) plus its fake-server harness and the live E2E script travel with the spike so the evidence is self-contained; the node-based check is ignore-by-default and never a CI requirement.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
k08200
force-pushed
the
spike/gen-provider
branch
from
July 23, 2026 12:28
e586ec4 to
d2c951e
Compare
This was referenced Jul 26, 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.
Summary
Evidence spike for gridaco/uhura#29: the client-owned assembly layer between the contract and an app (projections, intent-to-fn mapping, refusal policy — 2,089 hand-written lines in the uhura instagram provider) declared in one per-app file and generated by the binary, where RFD 0010 assigns generation. Draft on purpose; the declaration syntax is a spike and nothing here is proposed for adoption.
Compiles the program, consumes the typed contract in-process (no JSON seam), validates every table / fn / error the declaration references, and emits the provider tables module: snapshot GraphQL document, machine contract types, dispatch switch, refusal whitelist, mutation routing, and the Play asset table. The generic runtime the tables plug into travels under
tests/provider_runtime/with a fake-server harness and a live-server E2E script.Change classification
Language-change gate
spock gen providersubcommand only — nothing invokes it by default; code is isolated incrates/spock-cli/src/provider_gen/with its own fixtures/tests; default validation and all existing suites unchanged; owner @yongrean; review at the disposition of RFD: the assembly layer between the Spock contract and an app uhura#29, removal is a single directory plus one match armBefore and after
Before: every app hand-writes its provider assembly (the uhura instagram example carries 2,089 lines: snapshot query, dispatch, refusal whitelist, asset table, projections).
After (opt-in only):
spock gen provideremits the equivalent tables module from a 91-line declaration, char-equal with the hand-written artifacts. Default behavior is unchanged; no existing command or output differs.Scope and tradeoffs
Out of scope: the declaration syntax itself (spike vocabulary, not proposed), shipping the generic runtime, uhura machine-type generation ownership, and any normative documentation. New dependencies (
pest,pest_derive,serde) are limited tospock-cli. Removal cost is one directory and one subcommand arm.Verification
cargo test -p spock-cli— 29 + 15 + 9 green (nine new goldens hold each generated artifact char-equal with the hand-written instagram provider; fixtures mechanically extracted from the uhura example, MIT © Grida; each golden shown to fail on injected errors)cargo test -p spock-cli --test provider_gen -- --ignored— opt-in node harness executes the emitted module against the shared runtime (branching, three settlement paths, queue serialization); never a CI requirementtests/provider_runtime/e2e.mjsrun against a livespock startbackend: generated snapshot query accepted with exact seed counts, like/unlike round-trip restores state, unauthenticated refusal code matches the generated whitelistcontract_exposes_the_storage_object_system_tablerecords why the contract (not.spocksource parsing) is the input: source parsing missed the compiler-owned 11th tablecargo clippy -p spock-cli --all-targetsclean; workspace build cleanI read and followed CONTRIBUTING.md.
I added or updated focused tests, or explained why no test applies.
I updated user-facing documentation and the normative specification when authorized behavior changed.
I kept unrelated changes out of this PR.
If this is experimental, I prominently marked it and kept it isolated from default behavior, the normative specification, and conformance expectations.
I have not presented a working-group study or community preference as an accepted language decision.