Skip to content

Commit a7ff6f8

Browse files
author
clockwork-labs-bot
committed
Merge origin/master into shub/table-name-to-accessor
2 parents 29da61e + 124808c commit a7ff6f8

7 files changed

Lines changed: 81 additions & 10 deletions

File tree

.github/GREMLINS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# GREMLINS.md — Who Lives in the Pipes
2+
3+
This file documents the automated agents and bots that operate on this repository.
4+
5+
## Clawd 🔧
6+
7+
- **What:** Anti-entropy gremlin / CI watchdog
8+
- **GitHub account:** `clockwork-labs-bot`
9+
- **Discord channel:** #gremlins (CL - SpacetimeDB)
10+
- **Powered by:** [OpenClaw](https://github.com/openclaw/openclaw) + Claude
11+
12+
### What Clawd does
13+
14+
- **Monitors CI** — watches for failures, flaky tests, and regressions
15+
- **Reviews PRs** — comments on obvious bugs (never approves)
16+
- **Surfaces stale PRs** — finds approved PRs that just need a rebase
17+
- **Documents testing** — creates and maintains `DEVELOP.md` files explaining CI and test infrastructure
18+
- **Alerts the team** — posts findings in #gremlins, pings DevOps when something needs attention
19+
20+
### What Clawd does NOT do
21+
22+
- Approve or merge PRs
23+
- Take any destructive action (delete branches, close PRs, force push)
24+
- Modify production infrastructure
25+
26+
### Contacting Clawd
27+
28+
- Mention `@Openclaw` in #gremlins on Discord
29+
- Tag `@clockwork-labs-bot` on GitHub PRs/issues
30+
31+
---
32+
33+
*To add a new gremlin, document it here.*

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ jobs:
164164
}
165165
cargo ci smoketests -- --test-threads=1
166166
167+
- name: Check for changes
168+
run: |
169+
tools/check-diff.sh crates/smoketests || {
170+
echo 'Error: There is a diff in the smoketests directory.'
171+
exit 1
172+
}
173+
167174
smoketests-python:
168175
needs: [lints]
169176
name: Smoketests (Python Legacy) (${{matrix.name}})

crates/bindings-csharp/Runtime/Internal/Autogen/ExplicitNameEntry.g.cs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bindings-typescript/src/lib/autogen/explicit_name_entry_type.ts

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bindings-typescript/src/lib/schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ export class ModuleContext {
150150
views: [],
151151
lifeCycleReducers: [],
152152
caseConversionPolicy: { tag: 'SnakeCase' },
153-
explicitNames: { entries: [] },
153+
explicitNames: {
154+
entries: [],
155+
},
154156
};
155157

156158
get moduleDef(): ModuleDef {

crates/lib/src/db/raw_def/v10.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ pub enum RawModuleDefV10Section {
8484

8585
RowLevelSecurity(Vec<RawRowLevelSecurityDefV10>), //TODO: Add section for Event tables, and Case conversion before exposing this from module
8686

87+
/// Case conversion policy for identifiers in this module.
8788
CaseConversionPolicy(CaseConversionPolicy),
8889

90+
/// Names provided explicitly by the user that do not follow from the case conversion policy.
8991
ExplicitNames(ExplicitNames),
9092
}
9193

92-
/// Specifies how identifiers should be converted when interpreting module definitions.
9394
#[derive(Debug, Clone, Copy, Default, SpacetimeType)]
9495
#[cfg_attr(feature = "test", derive(PartialEq, Eq, PartialOrd, Ord))]
9596
#[sats(crate = crate)]
@@ -111,7 +112,26 @@ pub enum CaseConversionPolicy {
111112
#[cfg_attr(feature = "test", derive(PartialEq, Eq, Ord, PartialOrd))]
112113
#[non_exhaustive]
113114
pub struct NameMapping {
115+
/// The original name as defined or generated inside module.
116+
///
117+
/// Generated as:
118+
/// - Tables: value from `#[spacetimedb::table(accessor = ...)]`.
119+
/// - Reducers/Procedures/Views: function name
120+
/// - Indexes: `{table_name}_{column_names}_idx_{algorithm}`
121+
///
122+
/// During validation, this may be replaced by `canonical_name`
123+
/// if an explicit or policy-based name is applied.
114124
pub source_name: RawIdentifier,
125+
126+
/// The canonical identifier used in system tables and client code generation.
127+
///
128+
/// Set via:
129+
/// - `#[spacetimedb::table(name = "...")]` for tables
130+
/// - `#[spacetimedb::reducer(name = "...")]` for reducers
131+
/// - `#[name("...")]` for other entities
132+
///
133+
/// If not explicitly provided, this defaults to `source_name`
134+
/// after validation. No particular format should be assumed.
115135
pub canonical_name: RawIdentifier,
116136
}
117137

@@ -122,13 +142,18 @@ pub struct NameMapping {
122142
pub enum ExplicitNameEntry {
123143
Table(NameMapping),
124144
Function(NameMapping),
145+
Index(NameMapping),
125146
}
126147

127148
#[derive(Debug, Default, Clone, SpacetimeType)]
128149
#[sats(crate = crate)]
129150
#[cfg_attr(feature = "test", derive(PartialEq, Eq, Ord, PartialOrd))]
130151
#[non_exhaustive]
131152
pub struct ExplicitNames {
153+
/// Explicit name mappings defined in the module.
154+
///
155+
/// These override policy-based or auto-generated names
156+
/// during schema validation.
132157
entries: Vec<ExplicitNameEntry>,
133158
}
134159

crates/smoketests/modules/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)