Skip to content

feat(db): db schema rules and the Hub's schema design warnings - #78

Merged
Domantas merged 4 commits into
mainfrom
fix/schema-design-rules
Oct 14, 2026
Merged

Domantas merged 4 commits into
mainfrom
fix/schema-design-rules

Conversation

@Domantas

Copy link
Copy Markdown
Contributor

A coding agent building a schema through the CLI saved an app link, an email, language and currency as bare text and created_by_user_id as text (ux-fixes item 13). The CLI now shows the rules and the Hub's warnings:

  • norbix db schema rules [--json] prints the schema design rules with the exact dataSchema shape per field (email / uri format, taxonomy picker for language / currency / country, user reference, money, date). Offline.
  • db schema create, hub database schema save and hub account schema validate print the Hub's design warnings on stderr (stdout stays one JSON document with --json); the bundle dry run's validation carries them too. Only these methods print them (IdResponse.warnings is shared).
  • The agent recipe / Claude skill (norbix ai init), docs/AGENTS.md, docs/database.md, README and the create / update / database help point at db schema rules.

Gateway side (shipped to refactoringV2, f19c1e862): save_database_schema returns IdResponse.Warnings, validate_schema returns Warnings.

No new SDK method: warnings is read from the response JSON through an unknown guard, so this works with @norbix.ai/ts 4.26.0. Regenerating hub2.dtos.ts (typed warnings) is a follow-up in sdk-ts.

Tests: npx vitest run → 35 files, 980 tests passed (12 new in tests/schema-rules.test.ts; ai-init and the norbix schema snapshot updated).

Task file: /Users/djovaisas/Projects/norbix/docs/tasks/ux-fixes-2026-10-14/schema-guidance.md (workspace root, not a git repo)

🤖 Generated with Claude Code

Domantas and others added 4 commits October 14, 2026 13:56
…ct field shapes

Emails and links need a format, language / currency / country and every list
people pick from are taxonomy pickers (enum only for developer flags), user ids
are user references. Works offline (ux-fixes item 13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a schema check and in the bundle dry run

Warnings go to stderr so --json stdout stays one document; only
saveDatabaseSchema and validateSchema print them. The database help and the
create / update help point at db schema rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ma rules before writing a schema

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndle dry run, and the agent files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Domantas
Domantas merged commit bd88537 into main Oct 14, 2026
11 checks passed
@Domantas
Domantas deleted the fix/schema-design-rules branch October 14, 2026 11:04
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant