mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-07-29 05:16:17 -04:00
# Description of Changes Fixes stale and missing API guidance in the server skills and core-concepts docs, found by triaging the periodic LLM benchmark (C# and TypeScript both scored 0 passes while all golden answers publish) and cross-referenced against external developer feedback ([SIMPLI FEEDBACK.md](https://github.com/Viivek16/simpli-app/blob/main/FEEDBACK.md)). Key corrections: - **Table accessor casing.** `typescript-server/SKILL.md` and `tables.md` claimed `ctx.db` accessors are the camelCase form of the table name. Since #4263 (2026-02-20) accessors are the literal key passed to `schema({...})`, verbatim. This was the single biggest TS benchmark failure and matches SIMPLI's casing complaint. - **Canonical-first skills.** Both server skills now open with a short complete module and list the full set of imports / column modifiers / attributes. Targets the ~85% of benchmark failures where models emitted the old decorator/attribute API. - **C# gaps.** Fully-qualified `[SpacetimeDB.Index.BTree]` (avoids `System.Index` ambiguity, CS0104); tagged-enum declaration + variant construction (avoids CS8910); scheduled table and reducer kept in one class so `nameof(...)` resolves (CS0103). - **Wrong type name in TS docs.** `ReducerContext` does not exist in TypeScript; models generated it 55x in the benchmark. Skill now names the real type: `ReducerCtx<InferSchema<typeof spacetimedb>>`. - **Rust syntax error.** `Entity { ..existing, name }` does not parse; `..existing` must come last. - **Prefix-scan fix.** A multi-column prefix scan passes the bare leading value, not a shorter array. - **Token/identity guidance.** Corrected the auth notes in three quickstarts and the Unity/Unreal skills: server-issued (not "self-issued") identity, persisting the token keeps identity on reconnect, and the token is non-expiring so production should use an OIDC provider such as SpacetimeAuth. Consistent with the auth doc and FAQ. - Smaller doc touch-ups from SIMPLI feedback: client-binding casing note, reducer-arg array support, RLS how-to. Net: the two server skills are ~74 lines smaller than before. # API and ABI breaking changes None. Docs and skills only. # Expected complexity level and risk 1. Documentation and skill markdown, no code paths touched. The skills ship in the CLI binary (`crates/cli/build.rs`) and sync to `docs/static/.well-known/`, so the only interaction is that these files are embedded at build time. # Testing - [x] Compiled a module exercising the full TypeScript skill surface (builders, modifiers, custom types, indexes, scheduled tables, views, `ReducerCtx` helpers) against `crates/bindings-typescript` at 2.7. The camelCase accessor spelling reproduces the exact CI error. - [x] Traced every C# claim to `crates/bindings-csharp` source or to CI-validated goldens. - [ ] Reviewer: confirm `cd docs && pnpm generate-llms` builds clean (regenerates `llms.md`, fails on broken links). - [ ] Reviewer: sanity-check the next periodic benchmark run shows TS/C# publish failures dropping on the accessor-casing and CS0104/CS8910 tasks.