Feat v0.7.6 code hygiene (#60)
All checks were successful
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m48s
CI/CD / build-and-deploy (push) Successful in 25s
CI/CD / test-sqlite (push) Successful in 2m55s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #60.
This commit is contained in:
2026-04-02 17:39:41 +00:00
committed by xcaliber
parent 5e830c04de
commit e02b13dc12
22 changed files with 850 additions and 144 deletions

View File

@@ -15,8 +15,8 @@
// rows = db.view("users", filters={"id": "abc"})
//
// All table access is scoped to ext_{package_id}_{table_name}.
// Platform views (ext_view_users, ext_view_channels) are accessible
// via db.view() and are read-only regardless of permission level.
// Platform views (ext_view_users) are accessible via db.view()
// and are read-only regardless of permission level.
//
// Queries are parameterized — no raw SQL is ever accepted from scripts.
// Dialect differences (placeholder style) are handled internally.
@@ -44,8 +44,7 @@ type DBModuleConfig struct {
// allowedViews is the set of platform views extensions may query via db.view().
var allowedViews = map[string]bool{
"users": true,
"channels": true,
"users": true,
}
// BuildDBModule creates the "db" starlark module for an extension.
@@ -435,7 +434,7 @@ func dbView(ctx context.Context, cfg DBModuleConfig) func(*starlark.Thread, *sta
}
if !allowedViews[viewName] {
return nil, fmt.Errorf("db.view: unknown view %q (allowed: users, channels)", viewName)
return nil, fmt.Errorf("db.view: unknown view %q (allowed: users)", viewName)
}
physView := "ext_view_" + viewName

View File

@@ -61,9 +61,6 @@ type RunContext struct {
// UserID is the acting user for provider resolution (BYOK chain).
UserID string
// ChannelID is the context identifier, if any.
ChannelID string
// TeamID is the team context for settings cascade resolution.
// When set, team-scoped package settings are included in the cascade.
TeamID string

View File

@@ -187,4 +187,4 @@ func goValToStarlark(v interface{}) starlark.Value {
}
// workflowRoute routes the workflow to a named stage.
// Starlark: workflow.route(channel_id, target_stage, reason)
// Starlark: workflow.route(instance_id, target_stage, reason)