Compare commits
No commits in common. "c418d04c305ae49c12b1ca863369f5822f69696e" and "32ec9d8a41cc9ad2ec597ef7bae1d2bcd8d3760b" have entirely different histories.
c418d04c30
...
32ec9d8a41
6 changed files with 115 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
# CLAUDE.md — gitignored per BSL 1.1 commercial policy
|
||||
CLAUDE.md
|
||||
|
||||
# Superpowers brainstorming artifacts
|
||||
.superpowers/
|
||||
|
||||
|
|
|
|||
28
LICENSE-BSL
Normal file
28
LICENSE-BSL
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Business Source License 1.1
|
||||
|
||||
Licensor: Circuit Forge LLC
|
||||
Licensed Work: Kiwi — Pantry tracking and leftover recipe suggestions
|
||||
Copyright (c) 2026 Circuit Forge LLC
|
||||
Additional Use Grant: You may use the Licensed Work for personal,
|
||||
non-commercial pantry tracking and recipe suggestion
|
||||
purposes only.
|
||||
Change Date: 2030-01-01
|
||||
Change License: MIT License
|
||||
|
||||
For the full Business Source License 1.1 text, see:
|
||||
https://mariadb.com/bsl11/
|
||||
|
||||
---
|
||||
|
||||
This license applies to the following components of Kiwi:
|
||||
|
||||
- app/services/recipe/recipe_engine.py
|
||||
- app/services/recipe/assembly_recipes.py
|
||||
- app/services/recipe/llm_recipe.py
|
||||
- app/services/expiration_predictor.py
|
||||
- app/tasks/scheduler.py
|
||||
- app/tasks/runner.py
|
||||
- app/tiers.py
|
||||
- app/cloud_session.py
|
||||
- frontend/src/components/RecipesView.vue
|
||||
- frontend/src/stores/recipes.ts
|
||||
34
LICENSE-MIT
Normal file
34
LICENSE-MIT
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2026 Circuit Forge LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
This license applies to the following components of Kiwi:
|
||||
|
||||
- app/api/endpoints/inventory.py
|
||||
- app/api/endpoints/ocr.py
|
||||
- app/db/store.py
|
||||
- app/db/migrations/
|
||||
- app/core/config.py
|
||||
- scripts/pipeline/
|
||||
- scripts/download_datasets.py
|
||||
- scripts/backfill_texture_profiles.py
|
||||
|
|
@ -219,7 +219,7 @@ def get_session(request: Request) -> CloudUser:
|
|||
if not raw_header:
|
||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||
|
||||
token = _extract_session_token(raw_header)
|
||||
token = _extract_session_token(raw_header) # gitleaks:allow — function name, not a secret
|
||||
if not token:
|
||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||
|
||||
|
|
|
|||
|
|
@ -14,3 +14,25 @@ CREATE VIRTUAL TABLE IF NOT EXISTS recipes_fts USING fts5(
|
|||
);
|
||||
|
||||
INSERT INTO recipes_fts(recipes_fts) VALUES('rebuild');
|
||||
|
||||
-- Triggers to keep the FTS index in sync with the recipes table.
|
||||
-- Without these, rows inserted after the initial rebuild are invisible to FTS queries.
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_ai
|
||||
AFTER INSERT ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(rowid, ingredient_names)
|
||||
VALUES (new.id, new.ingredient_names);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_ad
|
||||
AFTER DELETE ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(recipes_fts, rowid, ingredient_names)
|
||||
VALUES ('delete', old.id, old.ingredient_names);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_au
|
||||
AFTER UPDATE ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(recipes_fts, rowid, ingredient_names)
|
||||
VALUES ('delete', old.id, old.ingredient_names);
|
||||
INSERT INTO recipes_fts(rowid, ingredient_names)
|
||||
VALUES (new.id, new.ingredient_names);
|
||||
END;
|
||||
|
|
|
|||
27
app/db/migrations/016_recipe_fts_triggers.sql
Normal file
27
app/db/migrations/016_recipe_fts_triggers.sql
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
-- Migration 016: Add FTS5 sync triggers for the recipes_fts content table.
|
||||
--
|
||||
-- Migration 015 created recipes_fts and did a one-time rebuild, but omitted
|
||||
-- triggers. Without them, INSERT/UPDATE/DELETE on recipes does not update the
|
||||
-- FTS index, so new rows are invisible to MATCH queries.
|
||||
--
|
||||
-- CREATE TRIGGER IF NOT EXISTS is idempotent — safe to re-run.
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_ai
|
||||
AFTER INSERT ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(rowid, ingredient_names)
|
||||
VALUES (new.id, new.ingredient_names);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_ad
|
||||
AFTER DELETE ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(recipes_fts, rowid, ingredient_names)
|
||||
VALUES ('delete', old.id, old.ingredient_names);
|
||||
END;
|
||||
|
||||
CREATE TRIGGER IF NOT EXISTS recipes_fts_au
|
||||
AFTER UPDATE ON recipes BEGIN
|
||||
INSERT INTO recipes_fts(recipes_fts, rowid, ingredient_names)
|
||||
VALUES ('delete', old.id, old.ingredient_names);
|
||||
INSERT INTO recipes_fts(rowid, ingredient_names)
|
||||
VALUES (new.id, new.ingredient_names);
|
||||
END;
|
||||
Loading…
Reference in a new issue