Skip to content

feat: make-now constraint and custom filters UI#29

Merged
featurecreep-cron merged 6 commits intomainfrom
feat/makenow-and-custom-filters
Mar 23, 2026
Merged

feat: make-now constraint and custom filters UI#29
featurecreep-cron merged 6 commits intomainfrom
feat/makenow-and-custom-filters

Conversation

@featurecreep-cron
Copy link
Copy Markdown
Owner

Summary

  • New makenow constraint type: queries Tandoor with makenow=true to find recipes where all ingredients are on-hand, then feeds matching recipes to the solver as a constraint (require or prefer N make-now recipes)
  • Custom filters UI: exposes Tandoor saved searches (custom filters) in the profile editor dropdown — the backend already supported filters in profile configs, this adds the admin interface
  • New /api/custom-filters proxy endpoint for the frontend to list available Tandoor filters

Closes #15

Test plan

  • 231 tests pass (2 new tests for makenow parsing and preparation)
  • Ruff lint + format clean
  • Manual: create a profile with a makenow constraint, verify generation respects it
  • Manual: select a Tandoor custom filter in profile editor, verify recipe pool is narrowed
  • Verify admin UI shows "Make Now" in the Add Rule menu and "Saved Filters" section (advanced tier)

…overy

Remove clear_before_generate from scheduler — generation already
overwrites atomically, clearing first risks data loss on failure.
Remove the UI toggle and clear_callback plumbing.

Improve frontend empty states: distinguish "no profiles visible" from
"no menu generated". Add retry button that re-triggers generation
instead of just reloading. Check generation status on 404 to surface
errors or in-progress state instead of silently showing empty.

Rename clearRecipes to clearMenu for consistency. Show Current Menu
section even when empty so the clear button remains accessible.
Move write permissions from top-level to individual jobs that need them.
Top-level permissions now default to contents: read across all workflows.
This follows the principle of least privilege and should improve the
Token-Permissions scorecard check (currently 0/10).
Add makenow constraint type that queries Tandoor for recipes where all
ingredients are marked on-hand. Works as a solver constraint so profiles
can require or prefer N make-now recipes alongside other rules.

Expose Tandoor custom filters (saved searches) in the profile editor UI.
The backend already supported filters in profile configs — this adds the
admin dropdown to select them.
history_service: 29% → 100% (14 tests covering CRUD, pagination,
analytics, persistence, corruption recovery)

settings_service: 58% → 100% (13 tests covering defaults, updates,
bounds clamping, public key filtering, timezone, migration)

menu_service: 41% → 54% (rating condition builder, date constraint
parsing, custom filters passthrough)

Overall: 56% → 59% (265 tests, +36 new)
Replace superficial unit tests with integration tests that exercise the
full prepare_data → select_recipes pipeline through PuLP solver. Covers
keyword, food, book, rating, cookedon, makenow, exclude, and soft
constraint paths. menu_service coverage: 41% → 99%.

Also adds date parsing mirror branch tests and rating condition tests.
Add safe_path() utility that resolves symlinks and verifies paths stay
within their base directory. Applied to config_service, template_service,
custom_icon_service, and weekly_generation_service. Resolves 29 CodeQL
py/path-injection alerts.
@featurecreep-cron featurecreep-cron merged commit bb9214e into main Mar 23, 2026
6 checks passed
featurecreep-cron added a commit that referenced this pull request Apr 6, 2026
…-filters

feat: make-now constraint and custom filters UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: pantry-aware generation (prefer recipes using ingredients on hand)

1 participant