Add quick_ideas skill and job for Quick dinners (Feature 18)
CI / ci (push) Successful in 5m36s
CI / ci (pull_request) Successful in 5m34s

quick_ideas v1 suggests Quick dinners of one kind, crockpot or under30,
from the household context, never returning a name already shown: the
exclude list is checked against normalized names with harness.Similar.
POST /api/v1/ideas/quick {kind, exclude[]} validates both fields (no
default kind) and answers 202 {jobId}; the quick_ideas job asks for 12
ideas, grounds them through the same GroundEach rounds as
ideas_from_ingredients and keeps up to 6 whose grounded recipe is of the
kind (crockpot: method crockpot; under30: minutes_total <= 30), so the
model's estimate never decides. Fewer survivors make a shorter page,
never a padded one.

The grounding loop, failure clearing and failed-result view are now
shared generic helpers used by both idea jobs rather than a second copy.

Maestro task 243a6812-f52b-4215-a4a2-8eb599914f7e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 20:25:41 -04:00
co-authored by Claude Opus 5.5
parent 3c58e0c7f7
commit 290e3d3cd3
18 changed files with 1800 additions and 110 deletions
+14 -2
View File
@@ -139,7 +139,7 @@ func run(cfg config.Config, logger *slog.Logger) error {
return err
}
ideasSvc, err := ideas.NewService(grounder, ideaFinder(ai, guard), runner, logger)
ideasSvc, err := ideas.NewService(db, grounder, ideaFinder(ai, guard), quickIdeaFinder(ai, guard), runner, logger)
if err != nil {
return err
}
@@ -287,7 +287,7 @@ func newJobRunner(db *store.Store, logger *slog.Logger) (*jobs.Runner, *jobKinds
// starts (dinners.NewService registers dinners.KindGroundDinner and
// suggest.NewService suggest.KindSuggestionBatch, plan.NewService
// plan.KindDraftWeek, shopping.NewService shopping.KindTitleSupplyRun,
// ideas.NewService ideas.KindFromIngredients).
// ideas.NewService ideas.KindFromIngredients and ideas.KindQuick).
func registerJobKinds(runner *jobs.Runner) (*jobKinds, error) {
builtins, err := jobs.RegisterBuiltins(runner)
if err != nil {
@@ -356,6 +356,18 @@ func ideaFinder(ai *aisettings.Service, guard *harness.Guard) ideas.Generator {
}
}
// quickIdeaFinder runs quick_ideas with the AI settings current at each
// run, sharing guard.
func quickIdeaFinder(ai *aisettings.Service, guard *harness.Guard) ideas.QuickGenerator {
return func(ctx context.Context, scope string, in skills.QuickIdeasRequest) (skills.QuickIdeaList, error) {
cfg, err := ai.HarnessConfig(ctx, guard)
if err != nil {
return skills.QuickIdeaList{}, err
}
return skills.QuickIdeas(ctx, cfg, scope, in)
}
}
// logListening logs the startup line. Only the public URL's origin is logged
// so no credential-bearing URL component can reach the log.
func logListening(logger *slog.Logger, cfg config.Config) {