refactor(store): replace project and skill models with generated models
Some checks failed
CI / build-and-test (push) Failing after -31m25s

* Update project creation and retrieval to use generated models
* Modify skill addition and listing to utilize generated models
* Refactor thought handling to incorporate generated models
* Adjust tool annotations to align with new model structure
* Update API calls in the UI to use new ResolveSpec-based endpoints
* Enhance stats retrieval logic to aggregate thought metadata
This commit is contained in:
2026-04-26 12:56:32 +02:00
parent da7220ad64
commit db7b152852
53 changed files with 3638 additions and 426 deletions

View File

@@ -14,6 +14,19 @@ This uses `relspec` to convert the DBML files into PostgreSQL SQL and writes the
- `migrations/020_generated_schema.sql`
## Generate ResolveSpec models
Run:
```bash
make generate-models
```
This uses `relspec` to convert `schema/*.dbml` into Bun/ResolveSpec-compatible
Go models in:
- `internal/generatedmodels/`
## Check schema drift
Run:
@@ -29,7 +42,8 @@ If the generated output differs, the command fails so CI can catch schema drift.
1. Update the DBML files in `schema/`
2. Run `make generate-migrations`
3. Review the generated SQL
4. Commit both the DBML changes and the generated migration
3. Run `make generate-models`
4. Review generated SQL and generated models
5. Commit DBML changes and generated outputs
Existing handwritten migrations stay in place. Going forward, update the DBML first and regenerate the SQL from there.

View File

@@ -19,6 +19,7 @@ Table projects {
}
Table thought_links {
id serial [pk]
from_id bigint [not null, ref: > thoughts.id]
to_id bigint [not null, ref: > thoughts.id]
relation text [not null]

View File

@@ -20,6 +20,7 @@ Table agent_guardrails {
}
Table project_skills {
id serial [pk]
project_id uuid [not null, ref: > projects.guid]
skill_id uuid [not null, ref: > agent_skills.id]
created_at timestamptz [not null, default: `now()`]
@@ -31,6 +32,7 @@ Table project_skills {
}
Table project_guardrails {
id serial [pk]
project_id uuid [not null, ref: > projects.guid]
guardrail_id uuid [not null, ref: > agent_guardrails.id]
created_at timestamptz [not null, default: `now()`]