-
Notifications
You must be signed in to change notification settings - Fork 677
Small docs improvement #4071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Small docs improvement #4071
Conversation
- Update table_name() to convert lowercase singular names to appropriate case per language (C#: PascalCase, Rust: snake_case) - Update all spec.rs files to use table_name() instead of hardcoded names - Update Rust task prompts to use singular table names (users → user) - Update Rust golden answers to use singular table/struct names and accessor methods (ctx.db.users() → ctx.db.user()) This fixes the C# benchmark test failures caused by table name mismatches where the LLM generates "User" but tests query for "users".
- Add compute_processed_context_hash() for language-specific hash computation after tab filtering is applied - Update CI check to verify both rustdoc_json and docs modes for Rust - Fix hash-only mode to skip golden builds - Update benchmark analysis with latest results
The llm-benchmark-update workflow builds the tool from master to save benchmark results. The CI check must also use master's tool to compute hashes the same way, otherwise hash mismatches occur when the PR branch has different hash computation logic.
- Add detection for WASI SDK tar extraction failures (wasi-sdk + tar, MSB3073 with exit code 2) as transient errors that should be retried - Increase max retries from 2 to 3 for build commands - Add 1-3 seconds of jitter to retry delays to desynchronize parallel builds that fail simultaneously, reducing the chance of repeated collisions
…missions - Add pagination_next to React quickstart to fix "Next" button linking to itself - Fix Rust type table: Duration → TimeDuration to match example code - Fix TypeScript optional column indexing to use table-level syntax
Documents that module-level state does not persist across reducer calls and that all persistent state must be stored in tables.
Covers inline binary storage, external storage with references, and hybrid approaches for thumbnails. Includes practical examples for all three server languages.
Adds a practical Quick Start example showing how to: - Set up subscriptions - Use row callbacks (onInsert, onDelete, onUpdate) - Understand the subscription flow Examples provided for TypeScript, C#, and Rust clients.
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
b0732c8 to
721eae2
Compare
… non-persistent Explains the multiple reasons why relying on module-level state is undefined: fresh instances, module updates, concurrent execution, crash recovery, non-transactional updates, and replay safety.
- Change generate output path from ../client-unity/Assets/autogen to ../Assets/autogen - Fix Rust directory references from server-rust to spacetimedb to match what spacetime init creates
- Update inline storage recommendations to reflect ~100MB capability - Add pricing context ($1/GB) for choosing between inline and external storage - Fix Unity tutorial generate command path (../Assets/autogen not ../client-unity/Assets/autogen) - Fix Rust directory references from server-rust to spacetimedb
Strip volatile fields that change every run: - Timestamps (started_at, finished_at) - Local paths (work_dir_golden, work_dir_llm) - Temp database names (golden_db, llm_db) - Server port numbers from scorer notes Also clear llm_output for passing tests (keep for failures for debugging).
Add documentation for calling between reducers and procedures: - Add "Calling Reducers from Procedures" section showing how to invoke reducer functions within withTx blocks - Add "Scheduling Procedures" section explaining how reducers can schedule procedures via schedule tables - Add tip to schedule-tables.md clarifying procedure scheduling
- Wrap code snippets inside reducer functions - Fix TypeScript: ctx.timestamp.microseconds → ctx.timestamp.microsSinceUnixEpoch - Fix Rust: use std::time::Duration instead of spacetimedb::Duration All examples verified to compile in TypeScript, Rust, and C#.
- Add TypeScript benchmark run to ci-quickfix command - Add TypeScript results to CI comment markdown table - Add TypeScript failures to benchmark analysis - Add TypeScript to display name mapping in analysis sections
…ents The context builder was including absolute file paths which caused hash mismatches when the tool was compiled/run in different environments (different workspace paths between CI runners). This fix uses relative paths (stripped of the base directory prefix) so hashes are stable. This will require re-running the benchmark after merge to update the saved hashes with the new stable values.
|
/update-llm-benchmark |
LLM Benchmark Results (ci-quickfix)
Compared against master branch baseline Generated at: 2026-01-22T01:58:47.982Z Failure Analysis (click to expand)Benchmark Failure AnalysisGenerated from: Summary
Analysis of SpacetimeDB Benchmark Test FailuresRust / rustdoc_json Failures (10 Total)Compile/Publish Errors (2 Failures)1. t_002_scheduled_table
2. t_017_scheduled_columns
Other Failures (8 Failures)1. t_001_basic_tables
2. t_003_struct_in_table
Additional Recommendations for General Documentation Improvement
This analysis identifies significant points where documentation can be improved through examples, clarity on API use, and specific error handling instructions to mitigate the observed test failures. |
docs/docs/00200-core-concepts/00200-functions/00300-reducers/00300-reducers.md
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00200-functions/00300-reducers/00300-reducers.md
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00200-functions/00300-reducers/00300-reducers.md
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00200-functions/00300-reducers/00300-reducers.md
Show resolved
Hide resolved
jdetter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/docs/00200-core-concepts/00300-tables/00210-file-storage.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00230-auto-increment.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md
Outdated
Show resolved
Hide resolved
docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md
Outdated
Show resolved
Hide resolved
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Added C# examples for: - Accessing the database with WithTx - Fallible database operations - Reading values out of the database - HTTP requests (Get and Send) - Calling reducers from procedures - External AI API example (server and client)
Update all C# code examples in procedures.md to compile correctly: - WithTx lambdas now return a value as required by the API - Table names use PascalCase to match generated accessors - HTTP Result uses pattern matching with OkR/ErrR variants - HttpMethod uses SpacetimeDB.HttpMethod.Post enum - HttpBody uses HttpBody.FromString() factory method - HttpHeader uses constructor syntax - Response body uses ToStringUtf8Lossy() Add test project to verify C# snippets compile.
Change UploadToS3 procedure to return string instead of Result<string, string> since sum types cannot be used as procedure return types for client code generation. Use exceptions for error handling instead of Result.Err.
Add missing C# tab showing how to generate pre-signed URLs for client-side uploads and confirm uploads via reducer.
Wrap C# code snippets in public static partial class Module to match the standard SpacetimeDB C# module pattern and ensure examples compile.
|
/update-llm-benchmark |
LLM Benchmark Results (ci-quickfix)
Compared against master branch baseline Generated at: 2026-01-22T23:45:28.101Z Failure Analysis (click to expand)Benchmark Failure AnalysisGenerated from: Summary
SpacetimeDB Benchmark Test Failures AnalysisThis document analyzes the SpacetimeDB benchmark test failures. Each failure is broken down into its components, specifying the discrepancies between the generated code and the expected golden examples. Specific, actionable recommendations for documentation adjustments are provided to avoid such issues in the future. Rust / rustdoc_json Failures1. General Errors with Code GenerationFailures Overview: The following tests failed due to various issues regarding table definitions, missing
|

Description of Changes
Two documentation improvements:
Reducers documentation: Clarified that using global/static variables in reducers is undefined behavior, not just "values won't persist". Added six specific reasons why this is undefined:
Access permissions documentation: Replaced the "Combining Both Techniques" example that used indexes on Option fields (which SpacetimeDB doesn't support) with a working example that filters by a required
departmentfield instead.API and ABI breaking changes
None. Documentation only.
Expected complexity level and risk
1 - Documentation changes only.
Testing