Skip to main content

Validators

ValidatorCommandWhat it checks
Access controlvalidate:access-controlForbidden code patterns in src/server/
Router structurevalidate:routerrouter.ts contains only imports and sub-router registrations
Scopesvalidate:scopesscopes.json cross-referenced against Prisma schema
Workflowsvalidate:workflowsWorkflow definitions in src/server/workflows/ — see the Workflows Framework for full validation details

Blocked code patterns

PatternReasonCorrect alternative
import { getUserScopes }Bypasses declarative enforcementscopedProcedure(['scope'])
import { _unscopedPrisma }Bypasses RLSctx.db
ctx.userScopesEnables conditional securitySeparate procedures per access level
$executeRawBypasses RLS policiesPrisma query methods via ctx.db
$queryRawBypasses RLS policiesPrisma query methods via ctx.db

Scopes validation checks

CheckDescription
Scope referencesEvery scope in roles, table policies, and service configs must be defined in the scopes array
Table existenceEvery table in tables must exist in prisma/schema.prisma
Column existenceEvery ownerColumn, orgColumn, groupAccess column must exist on the referenced table
Role uniquenessNo duplicate role names
Default roleExactly one role can be marked as default
Service clientsEvery service in services must have its @synthetiq/services-* package installed
Group access columnsGroup access membership tables must have a userId column

ESLint rules

RuleScopeEffect
Service client importssrc/web/Error — service clients can only be used in src/server/
no-unsafe-type-assertionAll filesError — prevents unsafe type assertions

Generated artifacts

ArtifactGeneratorUsed by
procedures.jsongenerate:manifestsAI agent, HTTP API, MCP server, docs pages
db-schema.jsongenerate:manifestsAI agent, docs pages
pages.jsongenerate:manifestsAI agent, docs pages
RLS policiesgenerate:rlsPostgreSQL production database
Service mappingsgenerate:service-mappingsService client integrations

Build commands

CommandDescription
synthetiq-app buildFull pipeline (all phases)
synthetiq-app validateRun all validators
synthetiq-app validate:access-controlCheck for security violations
synthetiq-app validate:routerCheck router structure
synthetiq-app validate:scopesCheck scope configuration
synthetiq-app validate:workflowsCheck workflow definitions
synthetiq-app generate:manifestsGenerate API and schema manifests
synthetiq-app generate:rlsGenerate RLS policies
synthetiq-app generate:service-mappingsGenerate service mappings
synthetiq-app sync:scopesSync scopes to database
synthetiq-app register:schedulesRegister scheduled jobs
synthetiq-app seed:publisherSeed default roles