Creating a Regular now enqueues a ground_dinner job and returns at once
with its grounding_job_id. The job grounds the dinner's recipe_url with
GroundURL, else its name with Ground, and sets grounding_status grounded
(recipe, photo, method, minutes, difficulty) or failed with a
grounding_error reason code (migration 0009). It writes only a dinner
still pending, so a fix made meanwhile wins.
GET /api/v1/dinners/{id}/recipe-candidates returns up to 3 ranked
candidates {candidate_id, title, site_name, photo_url, minutes} without
downloading photos or running the model. POST /api/v1/dinners/{id}/ground
takes exactly one of {candidate_id}, {recipe_url} or {manual: {...}} and
sets grounded or manual.
PhotoCache takes an ImageFetcher interface and recipestest provides fakes
so other packages can test grounding with fake search, fetch and model.
main wires the Grounder with normalize_recipe over the AI settings.
Maestro task: 0cbaa5bf-8be4-4cbd-aab2-891e7f1bc2b5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
318 lines
6.2 KiB
Go
318 lines
6.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package db
|
|
|
|
import (
|
|
"database/sql"
|
|
)
|
|
|
|
type AiRun struct {
|
|
ID string
|
|
Skill string
|
|
SkillVersion string
|
|
Provider string
|
|
Model string
|
|
Temperature float64
|
|
Status string
|
|
LatencyMs sql.NullInt64
|
|
TokensIn sql.NullInt64
|
|
TokensOut sql.NullInt64
|
|
Error sql.NullString
|
|
RequestRedacted string
|
|
ResponseRedacted sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type AiSetting struct {
|
|
ID int64
|
|
Provider string
|
|
BaseUrl string
|
|
Model string
|
|
Temperature float64
|
|
SystemPrompt sql.NullString
|
|
ApiKeyCt []byte
|
|
ApiKeyLast4 sql.NullString
|
|
KeyVerifiedAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type ChatSetting struct {
|
|
ID int64
|
|
WebhookUrlCt []byte
|
|
SpaceLabel sql.NullString
|
|
LastTestAt sql.NullString
|
|
LastTestStatus sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type Dinner struct {
|
|
ID string
|
|
Name string
|
|
NormalizedName string
|
|
Status string
|
|
Origin string
|
|
Method sql.NullString
|
|
MinutesTotal sql.NullInt64
|
|
Difficulty sql.NullString
|
|
Cuisine sql.NullString
|
|
IsFavorite int64
|
|
RecipeID sql.NullString
|
|
PhotoID sql.NullString
|
|
GroundingStatus string
|
|
UpdatedBy sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
RecipeUrl sql.NullString
|
|
GroundingError sql.NullString
|
|
}
|
|
|
|
type HouseholdSetting struct {
|
|
ID int64
|
|
Timezone string
|
|
DinnerTime string
|
|
ReminderTime string
|
|
ReviewTime string
|
|
PlanDraftDow int64
|
|
PlanDraftTime string
|
|
SuggestionsDow int64
|
|
SuggestionsTime string
|
|
ChatAutosendDow int64
|
|
ChatAutosendTime string
|
|
OnboardingCompletedAt sql.NullString
|
|
UpdatesSeenAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
UpdatedBy sql.NullString
|
|
}
|
|
|
|
type IntegrationsGoogle struct {
|
|
ID int64
|
|
RefreshTokenCt []byte
|
|
CalendarID sql.NullString
|
|
CalendarName sql.NullString
|
|
ConnectedAt string
|
|
LastSyncError sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type Job struct {
|
|
ID string
|
|
Kind string
|
|
Status string
|
|
Payload string
|
|
Result sql.NullString
|
|
Error sql.NullString
|
|
StartedAt sql.NullString
|
|
FinishedAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type NotificationOutbox struct {
|
|
ID string
|
|
EventKey string
|
|
Channel string
|
|
Payload string
|
|
Status string
|
|
Attempts int64
|
|
NextAttemptAt sql.NullString
|
|
LastError sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type NotificationPref struct {
|
|
Event string
|
|
Push int64
|
|
Chat int64
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type Photo struct {
|
|
ID string
|
|
SourceUrl string
|
|
LocalPath string
|
|
Width int64
|
|
Height int64
|
|
Sha256 string
|
|
FetchedAt string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type PlanDay struct {
|
|
ID string
|
|
PlanID string
|
|
Date string
|
|
DinnerID sql.NullString
|
|
IsNew int64
|
|
CalendarEventID sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type PushSubscription struct {
|
|
ID string
|
|
Endpoint string
|
|
P256dh string
|
|
Auth string
|
|
UserAgent sql.NullString
|
|
FailureCount int64
|
|
LastSuccessAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type Recipe struct {
|
|
ID string
|
|
SourceUrl string
|
|
SiteName sql.NullString
|
|
Title string
|
|
TotalMinutes sql.NullInt64
|
|
PrepMinutes sql.NullInt64
|
|
CookMinutes sql.NullInt64
|
|
Yield sql.NullString
|
|
RawJsonld string
|
|
FetchedAt string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
PhotoID sql.NullString
|
|
Method sql.NullString
|
|
Difficulty sql.NullString
|
|
MinutesTotal sql.NullInt64
|
|
}
|
|
|
|
type RecipeIngredient struct {
|
|
ID string
|
|
RecipeID string
|
|
Position int64
|
|
RawText string
|
|
Name sql.NullString
|
|
Qty sql.NullString
|
|
Unit sql.NullString
|
|
Note sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type RecipeSearchSetting struct {
|
|
ID int64
|
|
Provider string
|
|
BaseUrl sql.NullString
|
|
ApiKeyCt []byte
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
ApiKeyLast4 sql.NullString
|
|
}
|
|
|
|
type RecipeStep struct {
|
|
ID string
|
|
RecipeID string
|
|
Position int64
|
|
Text string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type RotationReview struct {
|
|
ID string
|
|
DinnerID string
|
|
PlanDate string
|
|
Status string
|
|
Decision sql.NullString
|
|
DecidedAt sql.NullString
|
|
UpdatedBy sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type ScheduleRun struct {
|
|
ID string
|
|
Schedule string
|
|
PeriodKey string
|
|
CreatedAt string
|
|
}
|
|
|
|
type Session struct {
|
|
IDHash string
|
|
Subject string
|
|
Email string
|
|
Name string
|
|
Groups string
|
|
CsrfToken string
|
|
CreatedAt string
|
|
LastSeenAt string
|
|
ExpiresAt string
|
|
}
|
|
|
|
type ShoppingGroup struct {
|
|
ID string
|
|
ListID string
|
|
DinnerID string
|
|
Position int64
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type ShoppingItem struct {
|
|
ID string
|
|
GroupID string
|
|
Name string
|
|
Qty sql.NullString
|
|
Needed int64
|
|
Position int64
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type ShoppingList struct {
|
|
ID string
|
|
WeekStart string
|
|
PlanID string
|
|
Title string
|
|
Status string
|
|
SentToChatAt sql.NullString
|
|
FrozenAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type Suggestion struct {
|
|
ID string
|
|
DinnerID string
|
|
BatchID string
|
|
Reason string
|
|
CitedRegularIds string
|
|
Status string
|
|
DecidedAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type SuggestionBatch struct {
|
|
ID string
|
|
Trigger string
|
|
Status string
|
|
AiRunID sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|
|
|
|
type WeekPlan struct {
|
|
ID string
|
|
WeekStart string
|
|
Status string
|
|
AiNote sql.NullString
|
|
AiRunID sql.NullString
|
|
CalendarSyncedAt sql.NullString
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
}
|