Spaces:
Running
Running
Sync ShopStack HEAD 6f8adfc
Browse filesUploaded clean HEAD snapshot from /Users/pranay/Projects/shopstack to keep the HF Space aligned with the current working app.
This view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .commandcode/settings.local.jsonAdded+1
- .commandcode/taste/taste.mdAdded+4
- .dockerignoreAdded+35
- .gitattributes+8
- .github/workflows/ci.ymlAdded+91
- .github/workflows/doc-health.ymlAdded+57
- .github/workflows/quality-gates.ymlAdded+143
- .github/workflows/wcag.ymlAdded+72
- .gitignoreAdded+49
- .pre-commit-config.yaml+12
- .tmp-workspace-click.pngAdded
- Docs/README.mdAdded+13
- MODEL_CATALOG.mdAdded+225
- README.md+4-4
- SUBMISSION_SMOKE.mdAdded+85
- app.py+55-32
- benchmarks/__init__.pyAdded
- benchmarks/bench_planner_tool_calling.pyAdded+252
- benchmarks/conftest.pyAdded+718
- benchmarks/pytest.iniAdded+4
- benchmarks/test_accessibility_timing.pyAdded+154
- benchmarks/test_baseline_benchmarks.pyAdded+111
- benchmarks/test_benchmarks.pyAdded
- benchmarks/test_db_operations.pyAdded+161
- benchmarks/test_portability.pyAdded+100
- benchmarks/test_services.pyAdded+71
- benchmarks/trends/.gitkeepAdded
- data/parser_training_real.jsonlAdded+111
- data/receipts/20260615T121358_Demo_Mart.jsonAdded+19
- data/swiggy_fresh_vegetables_cards_6jun26.csvAdded+90
- data/swiggy_fresh_vegetables_cards_6jun26.jsonAdded+1337
- data/swiggy_fresh_vegetables_extraction_summary__6jun26.mdAdded+185
- fly.tomlAdded+32
- freebuff_transcript_extracted.mdAdded+166
- issue_review_2026-06-13_improvement_opportunities.mdAdded+150
- motto_v2.mdAdded+1222
- motto_v3.mdAdded+1222
- pyproject.tomlAdded+85
- railway.jsonAdded+14
- render.yamlAdded+26
- scripts/capture_blinkit.pyAdded+96
- scripts/capture_dmart.pyAdded+96
- scripts/capture_zepto.pyAdded+96
- scripts/demo_walkthrough.pyAdded+224
- scripts/download_birefnet.pyAdded+51
- scripts/import_swiggy_snapshot.pyAdded+26
- scripts/repo_truth.pyAdded+148
- scripts/seed_demo.pyAdded+462
- scripts/seed_walkthrough.pyAdded+123
- scripts/verify.pyAdded+264
1{}1234# Taste (Continuously Learned by [CommandCode][cmd])
[cmd]: https://commandcode.ai/
1234567891011121314151617181920212223242526272829303132333435__pycache__*.py[cod]*.egg-infodistbuild.venvdata/*.dbdata/*.db-shmdata/*.db-walshopstack/data/models.coverage.pytest_cache.python-version.git.gitignore.env*.md# -- media / binary assets (keep out of Docker image) --*.pdf*.png*.jpg*.jpeg*.gif*.svg*.mp3*.wav*.mp4*.mov*.webm.DS_StorebenchmarkstestsDocs.agents.agent*32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363738394041424332 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text.tmp-workspace-click.png filter=lfs diff=lfs merge=lfs -textshopstack-audit-2.png filter=lfs diff=lfs merge=lfs -textshopstack-audit-final.png filter=lfs diff=lfs merge=lfs -textshopstack-audit-updated.png filter=lfs diff=lfs merge=lfs -textshopstack-audit.png filter=lfs diff=lfs merge=lfs -textshopstack-first-principles-final.png filter=lfs diff=lfs merge=lfs -textshopstack-flow-audit.png filter=lfs diff=lfs merge=lfs -textshopstack-home-flow-final.png filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091name: CI
on: push: branches: [main] pull_request: branches: [main]
jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.11", "3.12", "3.13"]
steps: - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }}
- name: Install uv run: pip install uv
- name: Install dependencies (uses uv.lock for reproducible installs) run: uv sync --extra dev
- name: Run tests run: uv run pytest tests/ -v --tb=short
- name: Run annotate benchmarks (quick regression gate) run: uv run pytest benchmarks/ -v -m benchmark -k "Annotate or BboxFormat or annotate"
- name: Run full benchmark suite run: uv run pytest benchmarks/ -v -m benchmark
- name: Verify app builds run: uv run python -c "from app import build_app; app = build_app(); print(f'Builds OK: {app.title}')"
# ── Python 3.14 compatibility gate ────────────────────────────────── # 3.14 is the documented development runtime (AGENTS.md) and the version # where the mlx C-extension segfault was diagnosed (addendum 2026-06-09). # We run it as an experimental, non-blocking job so 3.14 regressions # (e.g. a new C-extension imported at module top-level) surface in CI # without breaking the main gate until the stack is confirmed stable. # The test_import_audit suite is the key defense — it verifies no # C-extensions load at provider import time. test-py314: runs-on: ubuntu-latest continue-on-error: true steps: - uses: actions/checkout@v4
- name: Set up Python 3.14 uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Install uv run: pip install uv
- name: Install dependencies run: uv sync --extra dev
- name: Run import audit (C-extension segfault guard) run: uv run pytest tests/test_import_audit.py -v
- name: Run full test suite run: uv run pytest tests/ -v --tb=short
lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.13"
- name: Install uv run: pip install uv
- name: Install dependencies (uses uv.lock for reproducible installs) run: uv sync --extra dev
- name: Check imports run: uv run python -c "import shopstack; import app; print('All imports OK')"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657name: Doc Health Audit
on: push: branches: [main, develop] pull_request: branches: [main, develop] schedule: # Run weekly (Sunday midnight) so docs don't drift unnoticed - cron: "0 0 * * 0" workflow_dispatch:
permissions: contents: read
jobs: doc-health: name: Doc health audit runs-on: ubuntu-latest timeout-minutes: 10
steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Cache pip dependencies uses: actions/cache@v4 with: path: ~/.cache/uv key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml', 'uv.lock') }} restore-keys: | ${{ runner.os }}-uv-
- name: Install uv run: pip install uv
- name: Install dependencies run: uv sync --frozen
- name: Run doc health audit (strict) id: audit # Omit continue-on-error so a non-zero exit naturally fails this # step. The output is captured to a file for artifact upload. run: uv run python -m shopstack.tools.doc_health --strict 2>&1 | tee doc_health_output.txt
- name: Upload audit report if: always() uses: actions/upload-artifact@v4 with: name: doc-health-report path: doc_health_output.txt if-no-files-found: ignore123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143name: Quality Gates
on: push: branches: [main, develop] pull_request: branches: [main, develop] workflow_dispatch:
permissions: contents: read
jobs: # ── Copy audit (engineering jargon in UI) ───────────────────── copy-audit: name: Consumer copy audit runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Install dependencies run: | python -m pip install --upgrade pip pip install -e .
- name: Run copy audit id: copy run: | python -m shopstack.tools.copy_audit # Exit code: 0 = clean, 1 = violations found. # We check the report's count to fail only on real # regressions (the audit may be 0 on a clean run; if # it's > 0 we fail). COUNT=$(python -c "import json; d=json.load(open('Docs/COPY_AUDIT.json')); print(d['violation_count'] if 'violation_count' in d else len(d.get('violations', [])))") echo "Copy audit: $COUNT violations" if [ "$COUNT" -gt 0 ]; then echo "::error::Consumer copy audit found $COUNT violations." echo "See Docs/COPY_AUDIT.md for the list." exit 1 fi
- name: Upload report if: always() uses: actions/upload-artifact@v4 with: name: copy-audit-report path: | Docs/COPY_AUDIT.md Docs/COPY_AUDIT.json if-no-files-found: ignore
# ── JS validator (SyntaxError in app.load/click js= snippets) ── js-validate: name: JS snippet validator runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Install Node.js (for node --check) uses: actions/setup-node@v4 with: node-version: "20"
- name: Install dependencies run: | python -m pip install --upgrade pip pip install -e .
- name: Run JS validator id: js run: | python -m shopstack.tools.js_validate ERRORS=$(python -c "import json; d=json.load(open('Docs/JS_VALIDATION.json')); print(d.get('error_count', 0))") echo "JS validator: $ERRORS syntax errors" if [ "$ERRORS" -gt 0 ]; then echo "::error::JS validator found $ERRORS syntax errors." echo "See Docs/JS_VALIDATION.json for the list." exit 1 fi
- name: Upload report if: always() uses: actions/upload-artifact@v4 with: name: js-validation-report path: Docs/JS_VALIDATION.json if-no-files-found: ignore
# ── State dashboard (canonical current-state) ───────────────── state-dashboard: name: State dashboard generator runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Install dependencies run: | python -m pip install --upgrade pip pip install -e .
- name: Generate state dashboard id: state run: | python -m shopstack.tools.generate_state # Check for test-count drift (the report reads pytest # --collect-only and fails if the count is implausible). TESTS=$(python -c "import json; d=json.load(open('Docs/STATE_DASHBOARD.json')); print(d['test_count'])") echo "State dashboard: $TESTS tests" if [ "$TESTS" -lt 100 ]; then echo "::error::State dashboard reports only $TESTS tests — something is broken." exit 1 fi
- name: Upload report if: always() uses: actions/upload-artifact@v4 with: name: state-dashboard path: | Docs/SYSTEM_STATE.md Docs/STATE_DASHBOARD.json if-no-files-found: ignore123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172name: WCAG Audit
on: push: branches: [main, develop] pull_request: branches: [main, develop] workflow_dispatch:
permissions: contents: read
jobs: wcag: name: Static WCAG 2.1 AA audit runs-on: ubuntu-latest timeout-minutes: 10
steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.14"
- name: Cache pip dependencies uses: actions/cache@v4 with: path: ~/.cache/uv key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml', 'uv.lock') }} restore-keys: | ${{ runner.os }}-uv-
- name: Install uv run: pip install uv
- name: Install dependencies run: uv sync --frozen
- name: Run WCAG 2.1 AA audit id: audit run: | uv run python -m shopstack.tools.audit_wcag > wcag_output.txt 2>&1 cat wcag_output.txt continue-on-error: true
- name: Enforce score threshold (≥ 85) run: | SCORE=$(uv run python -c " from shopstack.tools.audit_wcag import run_audit r = run_audit('.') print(r.score) ") echo "WCAG score: $SCORE / 100" if [ "$SCORE" -lt 85 ]; then echo "::error::WCAG score $SCORE is below the 85 threshold." echo "Fix the failing criteria listed in Docs/WCAG_AUDIT_2026-06-13.md" exit 1 fi echo "WCAG score $SCORE meets the 85 threshold."
- name: Upload audit report if: always() uses: actions/upload-artifact@v4 with: name: wcag-audit-report path: | wcag_output.txt Docs/WCAG_AUDIT_*.md if-no-files-found: ignore12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849__pycache__/*.py[cod]*.egg-info/dist/build/.venv/.env.commandcode/.claude/*.bakbenchmarks/.bench_results.jsonbenchmarks/RESULTS.mdbenchmarks/trends/*!benchmarks/trends/.gitkeep
*.db*.db-shm*.db-waldata/*.dbdata/*.db-shmdata/*.db-waldata/receipts/data/*.pngdata/location_photos/data/receipt_benchmark_results.jsondata/models/shopstack/data/models/PROJECT_INTELLIGENCE.md.coverage.python-versionmcp-shell.log.pytest_cache/benchmarks/.pytest_cache/*.swp.DS_Store.agent*.agents*.agent-start*.mcp/Docs/!Docs/!Docs/README.mddocs/**AGENTS.md.playwright-mcp/.runtime/benchmarks/modal/benchmarks/model_lab/shopstack/model_lab/29 unmodified lines30313229 unmodified lines# Strict by default — blocks the commit if stale test counts are found.# The pre-commit hook uses --strict so the developer catches issues# locally before CI.29 unmodified lines30313233343536373839404142434429 unmodified lines# Strict by default — blocks the commit if stale test counts are found.# The pre-commit hook uses --strict so the developer catches issues# locally before CI.- id: js-syntax-validatename: JS snippet syntax validationdescription: Walk every `js=...` kwarg in shopstack/ and validate via `node --check`. Catches SyntaxError at commit time so a broken Gradio JS helper doesn't ship and produce infinite "Loading..." spinners (Item #56, motto_v3 §0.5).entry: uv run python -m shopstack.tools.js_validatelanguage: systempass_filenames: falsealways_run: true# Non-strict: the validator exits 0 when there are 0 errors,# 1 when there are errors. The hook fails the commit on any# SyntaxError. Disable with `SKIP=js-syntax-validate git commit ...`# when refactoring large UI files in a multi-commit workstream.
12345678910111213# Docs Folder
**Last updated:** 2026-06-14
This repository keeps historical design docs and context files out of Git tracking to keep PRs focused on code and runtime behavior.
The active runtime truth remains in source code under `shopstack/` and `app.py`.
For historical planning context, keep files in your local workspace copy of `Docs/` as needed.
## Local housekeeping
- `Docs/local-cleanup-policy.md` documents the local cleanup cron script, Codex cleanup automation, protected paths, and the cleanup actions taken in this session.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225# Model Catalog — Usage-Based View
> **Purpose:** Map every model in `shopstack/model_registry.py` to the product> workflows it powers. This is the decision maker's view: given a workflow,> which model handles it, and what are the alternatives?
---
## 1. Provider Capability Map
Models enter the app through **provider backends**, each wired by`ShopStack.config.SHOPSTACK_*_BACKEND`. The table below shows which backendhandles which capability group.
| Backend Config | Provider Class | Capabilities | Runtime | Status ||---------------------------------|-------------------------|----------------------------------------------------------|----------------|-----------------|| `SHOPSTACK_PLANNER_BACKEND` | `LocalProvider` | Text generation, planning, embeddings | `mlx`/`llama.cpp` | Active || `SHOPSTACK_PLANNER_BACKEND` | `OpenAIProvider` | Text generation, vision, embeddings | Cloud (API) | Available || `SHOPSTACK_PLANNER_BACKEND` | `MockPlannerProvider` | Mock text, planning | Mock | Default (dev) || `SHOPSTACK_STT_BACKEND` | `LocalWhisperProvider` | Speech-to-text | `mlx`/`faster-whisper` | Active || `SHOPSTACK_STT_BACKEND` | `WhisperProvider` | Speech-to-text (cloud) | Cloud (API) | Available || `SHOPSTACK_STT_BACKEND` | `MockSTTProvider` | Mock STT | Mock | Default (dev) || `SHOPSTACK_VISION_BACKEND` | `OpenAIProvider` | Vision understanding (object detection, grounding) | Cloud (API) | Available || `SHOPSTACK_VISION_BACKEND` | `MockVisionProvider` | Mock vision, detection | Mock | Default (dev) || `SHOPSTACK_OCR_BACKEND` | `MockOCRProvider` | OCR/extraction | Mock | Default (dev) || `SHOPSTACK_SEGMENTATION_BACKEND`| `MockSegmentationProvider` | Image segmentation | Mock | Default (dev) || `SHOPSTACK_TTS_BACKEND` | `MockTTSProvider` | Text-to-speech | Mock | Default (dev) || `SHOPSTACK_EMBEDDINGS_BACKEND` | `LocalProvider` / `OpenAIProvider` | Embeddings (planned fallback) | Shared | Inherited || `SHOPSTACK_IMAGE_EDIT_BACKEND` | `MockImageEditProvider` | Image generation, annotation | Mock | Default (dev) |
> **Key:** "Active" = wired to real local inference. "Available" = dependencies> installable. "Default (dev)" = mock provider used during development.
---
## 2. Full Model Registry
All entries from `shopstack/model_registry.py`, organized by provider group.
### 2a. STT — Speech-to-Text
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||-------------------------|-----------------------------------------|--------|--------------|---------------|------------|--------------------------------------|| `local-whisper-tiny` | `mlx-community/whisper-tiny-mlx` | 0.04B | MIT | `mlx` | **Active** | Default local Whisper backend || `qwen3-asr-1.7b` | `Qwen/Qwen3-ASR-1.7B` | 1.7B | Apache-2.0 | `transformers`| Candidate | Top candidate for household commands || `parakeet-0.6b` | `nvidia/parakeet-ctc-0.6b` | 0.6B | CC-BY-4.0 | `custom` | Candidate | Lightweight streaming ASR || `sense-voice-small` | `funasr/SenseVoiceSmall` | 0.2B | MIT | `transformers`| Candidate | Very fast, multilingual || `whisper-large-v3-turbo`| `openai/whisper-large-v3-turbo` | 0.8B | MIT | `transformers`| Candidate | Baseline only |
### 2b. TTS — Text-to-Speech
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||------------------|----------------------------|---------|------------|---------------|-----------|------------------------------------|| `qwen3-tts-0.6b` | `Qwen/Qwen3-TTS-0.6B` | 0.6B | Apache-2.0 | `transformers`| Candidate | Lightweight TTS candidate || `kokoro-82m` | — | 0.082B | Apache-2.0 | `custom` | Candidate | Extremely lightweight (`off_grid`) |
### 2c. Vision / Object Detection / Grounding
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||---------------------|----------------------------------|--------|------------|---------------|-----------|------------------------------------|| `minicpm-v-8b` | `openbmb/MiniCPM-V-2_6` | 8.0B | Apache-2.0 | `transformers`| Candidate | Strong VLM for household items |
### 2d. Planner — LLM / Text Generation
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||-------------------------|---------------------------------------------|--------|--------------------|---------------|------------|------------------------------------------|| `llama-3.2-3b-instruct` | `mlx-community/Llama-3.2-3B-Instruct-4bit` | 3.0B | Llama 3.2 Community| `mlx` | **Active** | Default MLX backend (auto-downloaded) || `llama-3.2-3b-gguf` | `unsloth/Llama-3.2-3B-Instruct-GGUF` | 3.0B | Llama 3.2 Community| `gguf` | **Active** | Downloaded GGUF, llama.cpp fallback || `minicpm5-1b` | `openbmb/MiniCPM5-1B` | 1.0B | Apache-2.0 | `transformers`| Candidate | Lightweight planner / parser || `lfm2.5-8b-a1b-gguf` | `unsloth/LFM2.5-8B-A1B-GGUF` | 8.3B | Apache-2.0 | `gguf` | Candidate | GGUF planner for llama.cpp path || `shopstack-parser-lora` | — | — | Apache-2.0 (planned)| `transformers`| Candidate | Future fine-tuned command parser (`well_tuned`) |
### 2e. OCR — Optical Character Recognition
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||---------------------|--------------------------------|--------|--------------|---------------|-----------|------------------------------------|| `nuextract3-4b` | `nuance/NuExtract3-4B` | 4.0B | CC-BY-NC-4.0 | `transformers`| Candidate | Strong receipt extraction (non-commercial) |
### 2f. Segmentation
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||-------------|--------------------------|--------|------------|---------------|-----------|----------------------------------------|| `rmbg-1.4` | `briaai/RMBG-1.4` | 0.3B | Apache-2.0 | `transformers`| Candidate | Background removal for item cards |
### 2g. Embeddings
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||-----------|--------------------|--------|---------|---------------|-----------|------------------------------------|| `bge-m3` | `BAAI/bge-m3` | 0.6B | MIT | `transformers`| Candidate | Multilingual embeddings |
### 2h. Image Generation
| Model ID | HF ID | Params | License | Runtime | Status | Notes ||-----------------------|------------------------------------------|--------|------------------------|-------------|-----------|------------------------------------|| `flux.2-klein-4b` | `black-forest-labs/FLUX.2-klein-4B` | 4.0B | FLUX.2-dev NC | `diffusers` | Candidate | Visual card generation |
---
## 3. Workflow → Model Mapping
Each product workflow requires one or more model capabilities. The table belowshows the mapping, the **default** model that powers it, and **alternatives**for tradeoffs (speed vs. quality, local vs. cloud).
| Product Workflow | Capabilities Required | Default Model (Local) | Alternatives ||-----------------------------|----------------------------------|-------------------------------------|-------------------------------------------------------------------------|| **Today Dashboard** | Planning (text gen) | `llama-3.2-3b` (MLX) | `llama-3.2-3b-gguf` (llama.cpp), `minicpm5-1b` (faster, lighter) || **Shopping List** | Planning, tool-call parsing | `llama-3.2-3b` (MLX) | `lfm2.5-8b-a1b-gguf` (higher quality), `shopstack-parser-lora` (future)|| **Market Lens** | Vision, object detection, OCR, barcode | `minicpm-v-8b` (vision — candidate) | GPT-4o (cloud, best quality), Mock (dev fallback) || **Voice Commands (Ask)** | STT → Planning → Tool-call parse | `local-whisper-tiny` (STT) + `llama-3.2-3b` (planning) | `sense-voice-small` (faster STT), `qwen3-asr-1.7b` (higher quality STT)|| **Add Purchase** | Planning (classification) | `llama-3.2-3b` | `minicpm5-1b` (lighter), Mock (no model needed for form mode) || **Price Intelligence** | Planning (analysis) | `llama-3.2-3b` | — (primarily SQL + heuristic, model optional) || **Inventory View/Search** | Embeddings (semantic search) | `bge-m3` (candidate) | `LocalProvider.embed()` (zero-vector fallback) || **Use Soon / Alerts** | Heuristic (no model) | — | — || **Household Map** | Heuristic (no model) | — | — || **Field Notes** | Planning (summarization) | `llama-3.2-3b` | — || **Trace Export** | Heuristic (no model) | — | — || **Barcode Decoding** | `pyzbar` / `zbarimg` | System `zbar` | — |
### 3a. Detailed Workflow Flow
```Voice Command └─ SHOPSTACK_STT_BACKEND → transcribe audio └─ SHOPSTACK_PLANNER_BACKEND → parse intent, execute action └─ SHOPSTACK_PLANNER_BACKEND (tool-call parsing if enabled)
Market Lens Scan ├─ SHOPSTACK_VISION_BACKEND → detect objects in image ├─ System zbar → decode barcode ├─ SHOPSTACK_OCR_BACKEND → extract text (receipts, labels) └─ SHOPSTACK_PLANNER_BACKEND → classify buy/skip decisions
Shopping List Creation └─ SHOPSTACK_PLANNER_BACKEND → classify items (buy/skip/use_soon) └─ Swiggy price enrichment (external data, no model)
Price Intelligence └─ SHOPSTACK_PLANNER_BACKEND → optional analysis └─ DB query → heuristic comparison (no model required)```
---
## 4. Active Stack — Budget & Status
The **total active model parameter budget** is capped at **32B params**(`MAX_ACTIVE_MODEL_PARAMS_B`).
### Currently Active
| Model | Group | Params | Runtime | Backend Config | Notes ||--------------------------------|------------|--------|-----------|--------------------------|------------------------------------|| `llama-3.2-3b-instruct` (MLX) | Planner | 3.0B | `mlx` | `SHOPSTACK_PLANNER_BACKEND=local` | Default on Apple Silicon || `llama-3.2-3b-gguf` | Planner | 3.0B | `gguf` | (llama.cpp fallback) | 493 ms / 49 tokens via llama.cpp || `local-whisper-tiny` (MLX) | STT | 0.04B | `mlx` | `SHOPSTACK_STT_BACKEND=local_whisper` | On-demand model loading || **Total active** | | **≤ 6.04B** | | | Well within 32B cap |
### Candidate Pipeline
| Priority | Model | Group | Params | Runtime | Why ||----------|--------------------------------|------------|--------|---------------|-----------------------------------|| P0 | `minicpm-v-8b` | Vision | 8.0B | `transformers`| Enables local Market Lens || P0 | `bge-m3` | Embeddings | 0.6B | `transformers`| Semantic search for inventory || P1 | `qwen3-asr-1.7b` | STT | 1.7B | `transformers`| Higher quality local STT || P1 | `sense-voice-small` | STT | 0.2B | `transformers`| Faster multilingual STT || P1 | `nuextract3-4b` | OCR | 4.0B | `transformers`| Receipt scanning (non-commercial) || P2 | `qwen3-tts-0.6b` | TTS | 0.6B | `transformers`| Text-to-speech responses || P2 | `kokoro-82m` | TTS | 0.082B | `custom` | Ultra-lightweight TTS || P2 | `minicpm5-1b` | Planner | 1.0B | `transformers`| Lightweight planner || P3 | `lfm2.5-8b-a1b-gguf` | Planner | 8.3B | `gguf` | Higher-quality planning || P3 | `parakeet-0.6b` | STT | 0.6B | `custom` | Streaming ASR || P3 | `whisper-large-v3-turbo` | STT | 0.8B | `transformers`| Baseline STT benchmark || P3 | `rmbg-1.4` | Segmentation| 0.3B | `transformers`| Item card polish || P3 | `flux.2-klein-4b` | Image Edit | 4.0B | `diffusers` | Visual card generation || P4 | `shopstack-parser-lora` | Planner | ~0.1B | `transformers`| Fine-tuned command parser |
### Budget Projection
```Active (P0 deployed): 6.04B paramsP0 candidates: + 8.6B = 14.6B ← next milestone targetP1 candidates: + 5.9B = 20.5BP2 candidates: + 1.68B = 22.2BP3 candidates: + 5.7B = 27.9BP4 fine-tune: + 0.1B ≈ 28.0B ← still under 32B cap```
---
## 5. Env Configuration Reference
```bash# ── Planner (text gen / planning) ─────────────SHOPSTACK_PLANNER_BACKEND=local # LocalProvider (MLX or llama.cpp)# SHOPSTACK_PLANNER_BACKEND=openai # Cloud fallback (requires API key)
# ── STT (speech-to-text) ─────────────────────# SHOPSTACK_STT_BACKEND=local_whisper # On-device whisper# SHOPSTACK_LOCAL_WHISPER_SIZE=tiny # tiny / base / small / medium / large
# ── Cloud fallback (optional) ────────────────# SHOPSTACK_OPENAI_API_KEY=sk-...
# ── Model paths ──────────────────────────────# SHOPSTACK_LOCAL_MODEL_DIR= # default: shopstack/data/models/# SHOPSTACK_LOCAL_MODEL_REPO=unsloth/Llama-3.2-3B-Instruct-GGUF# SHOPSTACK_LOCAL_MODEL_FILE=Llama-3.2-3B-Instruct-Q4_K_M.gguf# SHOPSTACK_LOCAL_AUTO_DOWNLOAD=false # auto-download GGUF if missing
# ── Off-the-grid (mock mode) ────────────────SHOPSTACK_OFF_THE_GRID=false # false = allow real backends```
---
## 6. Adding a New Model
1. Add a `ModelEntry` to `shopstack/model_registry.py`2. If the model powers a new capability, add a provider class + backend wiring in `shopstack/providers/registry.py`3. If the model replaces an existing backend, update the `SHOPSTACK_*_BACKEND` env default in `shopstack/config.py`4. Update this catalog with the new model's row and workflow mapping5. Verify the parameter budget: `total_active_params() <= 32B`83 unmodified lines8485868788899091929312 unmodified lines10610710810911011111213 unmodified lines12612712812913013113283 unmodified lines## Current Verified by Code InspectionAs of the current code inspection, the following metrics are verified:- **17 Database Tables & 2 Views**: `inventory_lots`, `purchase_events`, `shopping_lists`, `shopping_list_items`, `household_locations`, `movement_events`, `price_observations`, `stores`, `traces`, `app_config`, `market_snapshots`, `market_records`, `market_record_components`, `reconciliation_events`, `preference_signals`, `inventory_events`, `households` (Tables), `price_history`, `agent_traces` (Views).- **12 Tools**: Including `semantic_find_item`.*Note: Tests are continuously added. For the latest test count, run `uv run pytest tests/ --collect-only -q`.***Engineering Mandate:** Do not narrow scope to hackathon/MVP. ShopStack is designed as a long-term, bold, and comprehensive intelligence platform. Follow `motto_v3.md` principles exactly.12 unmodified linesmock_providers.py # Full mock implementations for all 11 (Indian/Hinglish data)registry.py # ProviderRegistry factory wired to Settingspersistence/database.py # SQLite Database (WAL, 17 tables, 2 views, 18 seeded locations, full CRUD)services/ # Business logic services (decision engine, shopping, dashboard, preferences, freshness)tools/registry.py # ToolRegistry — 12 tools executing against Database13 unmodified lines```Gradio Blocks (app.py)→ ToolRegistry (12 tools, validates args, calls Database)→ Database (SQLite WAL, 17 tables, 2 views, 18 seeded locations)→ ProviderRegistry (wired from Settings)→ MockProviders (default — 11 interfaces, all offline)→ Market services (market source registry load + snapshot status helpers in `shopstack.services.market_sources`)83 unmodified lines8485868788899091929312 unmodified lines10610710810911011111213 unmodified lines12612712812913013113283 unmodified lines## Current Verified by Code InspectionAs of the current code inspection, the following metrics are verified:- **25 Database Tables, 2 Views, 2 Triggers, 9 Indexes**: `app_config`, `condition_events`, `find_feedback`, `household_locations`, `household_members`, `household_objects`, `households`, `inventory_events`, `inventory_lots`, `market_record_components`, `market_records`, `market_snapshots`, `movement_events`, `negative_memory`, `object_notes`, `object_sightings`, `person_associations`, `preference_signals`, `price_observations`, `purchase_events`, `reconciliation_events`, `shopping_list_items`, `shopping_lists`, `stores`, `traces` (Tables), `price_history`, `agent_traces` (Views).- **12 Tools**: Including `semantic_find_item`.*Note: For the canonical current-state metrics, run `python3 scripts/repo_truth.py`. The README is updated when new tables/tabs/tools are added; do not hand-maintain these numbers.***Engineering Mandate:** Do not narrow scope to hackathon/MVP. ShopStack is designed as a long-term, bold, and comprehensive intelligence platform. Follow `motto_v3.md` principles exactly.12 unmodified linesmock_providers.py # Full mock implementations for all 11 (Indian/Hinglish data)registry.py # ProviderRegistry factory wired to Settingspersistence/database.py # SQLite Database (WAL, 25 tables, 2 views, 2 triggers, 9 indexes, full CRUD)services/ # Business logic services (decision engine, shopping, dashboard, preferences, freshness)tools/registry.py # ToolRegistry — 12 tools executing against Database13 unmodified lines```Gradio Blocks (app.py)→ ToolRegistry (12 tools, validates args, calls Database)→ Database (SQLite WAL, 25 tables, 2 views, 2 triggers, 9 indexes)→ ProviderRegistry (wired from Settings)→ MockProviders (default — 11 interfaces, all offline)→ Market services (market source registry load + snapshot status helpers in `shopstack.services.market_sources`)
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485# ShopStack Hackathon Submission Smoke Plan
Date: 2026-06-12
This doc tracks the pre-submission checks for the Gradio + Hugging Face Small Hackathon trail.
## ObjectiveShip a household-scoped, traceable, multi-surface app with clean submission evidence and explicit app-polish fixes.
## Mandatory Smoke Checklist (Do Before Submission)
- [ ] Start app - `uv run python app.py` - Confirm Gradio renders all tabs from the home screen - Confirm household switcher and active household are visible
- [ ] Verify Market Lens metadata signaling - Confirm image/audio mode appears in output - Confirm freshness warning is visible for Swiggy / market snapshots - Confirm warnings render safely when inputs are incomplete
- [ ] Dashboard integrity - Open Today dashboard - Confirm `DecisionSet`, use-soon panel, low-stock tiles, and weather block render - Confirm basket optimization panel appears when active list exists - Confirm missing/partial snapshots still show deterministic decision-only basket candidates
- [ ] Household scoping integrity - Seed two households with overlapping activity in a test scenario - Confirm `classify_all(..., user_id=...)` returns only the selected household - Confirm dashboard and list views do not bleed across households
- [ ] Planning and tool safety - Open Ask/Planner flow - Attempt an inventory mutation with planner writes disabled - Confirm write tools require explicit confirmation path
- [ ] Shopping list workflow - Create list from free text - Confirm classifications appear - Confirm share text area and copy + WhatsApp open action work (no placeholder/invalid URL)
- [ ] Reconciliation workflow - Mark partial purchases, skipped items, and substitutions - Confirm trace/log entries persist per household
- [ ] Trace + backup workflow - Create a trace in app UI - Export trace JSONL - Backup DB + import back into a fresh run
- [ ] Market Lens sanity - Verify Swiggy snapshot freshness and market hints render - Confirm compare suggestions are bounded to scoped inventory
## Priority Regression Commands
- `uv run pytest tests/test_decisions.py::TestDecisionClassification::test_classify_all_respects_user_id_scope`- `uv run pytest tests/test_cadence_waste.py::TestPurchaseCadence::test_empty_returns_empty`- `uv run pytest tests/test_dashboard_service.py::test_build_dashboard_state_counts_inventory`- `uv run pytest tests/test_reconciliation_service.py::test_reconciliation_inventory_scopes_to_user_id`- `uv run pytest tests/test_portability.py`- `uv run pytest tests/test_basket_service.py`- `uv run pytest tests/test_market_lens_service.py tests/test_views.py::TestTodayDashboard::test_empty_dashboard_shows_next_actions`
## Hackathon Scoring Alignment (Preliminary)
- ✅ Small-model fit: `SHOPSTACK` remains within existing model-budget contract- ✅ Built on Gradio: existing Gradio app surface kept- ✅ Local-first guardrails: write gating + household scoping fixes- ✅ Submission polish: broken shopping-share link removed- ✅ Documentation: explicit smoke checklist added in repo root
## Optional Bonus Quest Targets
- Off-grid / Local-first: avoid cloud-only dependency in critical paths- Llama.cpp: route heavy inference through llama-compatible runtime where feasible- Open trace: keep trace export path documented and working- Field notes/blog: add a concise postmortem report for what improved this sprint
## Open Items Before Filing Submission
- Record final demo video + social post URL in this checklist- Verify Space metadata and README align with active features- Attach screenshot sequence for Today + Shopping + Reconcile flows100 unmodified lines1011021031041051061071081091101111121131141153 unmodified lines11912012112212312412512612721 unmodified lines14915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119236 unmodified lines22923023123223323423519 unmodified lines255256257258259260261100 unmodified linesAdding a new tab does NOT require editing this file — register itin ``module_registry.TAB_ORDER`` and ``shopstack.ui.tabs.registry``."""with gr.Blocks(title=APP_NAME, css=CSS) as app:mount_sms_webhook(app)mount_global_search(app)mount_privacy_endpoints(app)mount_undo_endpoint(app)initial_locale = load_locale_preference(current_user_id() or "default_household")gr.HTML(header_block(APP_NAME, APP_DESCRIPTION, current_locale=initial_locale),padding=True,)3 unmodified lines# query whether the app is in mock or real mode)build_runtime_status()# ── Tab bar — driven by module_registry.TAB_ORDER via the builder registry ──with gr.Tabs(elem_classes="tabs", elem_id="main-content"):handles = build_all_tabs(blocks=app, app=app, ctx=TabContext())# Extract handles from tabs that expose them for cross-tab wiring.# These are P0 guards: if a builder silently returns None or is21 unmodified linestoday_low = today_handles.today_lowtoday_recent = today_handles.today_recenttoday_changed = today_handles.today_changedp_location = reconcile_handles.p_locationmove_dest = reconcile_handles.move_dest# ── Household settings accordion (workspace admin panel) ──hh = build_household_settings(app)household_dropdown = hh.household_dropdownadd_hh_btn = hh.add_hh_btnhh_add_row = hh.hh_add_row# ── Onboarding wizard (first-run household setup) ──# Hidden by default; auto-shown on first load if the active# household hasn't completed onboarding yet. See# Docs/HANDOFF_ONBOARDING_WIRING_2026-06-13.md.onboarding_wizard = build_onboarding_wizard(app)def _show_onboarding_if_first_run() -> gr.update:from shopstack.services.onboarding import should_show_onboardingreturn gr.update(visible=should_show_onboarding(db))app.load(_show_onboarding_if_first_run,outputs=[onboarding_wizard],)hh_name_input = hh.hh_name_inputhh_create_btn = hh.hh_create_btnhh_cancel_btn = hh.hh_cancel_btn# Refresh dropdown choices on initial loadapp.load(lambda: gr.update(choices=household_choices(), value=current_user_id()),outputs=household_dropdown,)# Wire household dropdown change after all output components are definedhousehold_dropdown.change(switch_household_state,household_dropdown,[household_dropdown, today_stats, today_soon, today_list, today_low, today_recent, today_changed],api_name="switch_household",api_description="Switch active household and refresh dashboard",).then(36 unmodified lineshh_create_btn.click(create_household_state,hh_name_input,[household_dropdown, hh_add_row, today_stats, today_soon, today_list, today_low, today_recent, today_changed],api_name="create_household",api_description="Create a new household, switch to it, and refresh the dashboard",)19 unmodified linesargs = parser.parse_args()app = build_app()app.launch(server_port=args.port, share=args.share, theme=gr.themes.Base(), head=pwa_head_html(), prevent_thread_lock=True)# Post-launch re-mounts: launch() discards the FastAPI app constructed# during build_app() and creates a new one, so any custom routes we# registered in build_app() are lost. Re-mount PWA + health here so100 unmodified lines1011021031041051061071081091101111121131141151161171181191201211221233 unmodified lines12712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017121 unmodified lines19319419519619719819920020120220320420520620720820921021121221321421536 unmodified lines25225325425525625725819 unmodified lines278279280281282283284100 unmodified linesAdding a new tab does NOT require editing this file — register itin ``module_registry.TAB_ORDER`` and ``shopstack.ui.tabs.registry``."""with gr.Blocks(title=APP_NAME) as app:mount_sms_webhook(app)mount_global_search(app)mount_privacy_endpoints(app)mount_undo_endpoint(app)initial_locale = load_locale_preference(current_user_id() or "default_household")# 2026-06-15 (Home screen review): the brand subtitle now# answers the user's actual job instead of the abstract# "platform" copy. The legacy APP_DESCRIPTION is still# passed as a tooltip / fallback via header attributes.gr.HTML(header_block(APP_NAME,"Know what is at home, what to buy next, and what to skip.",current_locale=initial_locale,),padding=True,)3 unmodified lines# query whether the app is in mock or real mode)build_runtime_status()# ── Onboarding wizard (first-run household setup) ──# Rendered above the tab bar so first-time users see setup# immediately, instead of after scrolling past every tab's# content. Hidden by default; auto-shown on first load if the# active household hasn't completed onboarding yet. See# Docs/HANDOFF_ONBOARDING_WIRING_2026-06-13.md.onboarding_wizard = build_onboarding_wizard(app)def _show_onboarding_if_first_run() -> gr.update:from shopstack.services.onboarding import should_show_onboardingreturn gr.update(visible=should_show_onboarding(db))app.load(_show_onboarding_if_first_run,outputs=[onboarding_wizard],)# ── Household settings accordion (workspace admin panel) ──# Rendered above the tab bar — a workspace switcher belongs at# the top of the page, accessible from any tab, not buried# below the last tab's content.hh = build_household_settings(app)household_dropdown = hh.household_dropdownadd_hh_btn = hh.add_hh_btnhh_add_row = hh.hh_add_rowhh_name_input = hh.hh_name_inputhh_create_btn = hh.hh_create_btnhh_cancel_btn = hh.hh_cancel_btn# ── Tab bar — driven by module_registry.TAB_ORDER via the builder registry ──# 2026-06-15: switched to the 6-item user-facing primary nav# (Home / Pantry / Shopping / Recipes / Trips / Memory). The# old 5-group nested layout is still available via# ``build_all_tabs(use_primary_nav=False)`` for back-compat.with gr.Tabs(elem_classes="tabs primary-nav", elem_id="main-content"):handles = build_all_tabs(blocks=app, app=app, ctx=TabContext(),use_primary_nav=True,)# Extract handles from tabs that expose them for cross-tab wiring.# These are P0 guards: if a builder silently returns None or is21 unmodified linestoday_low = today_handles.today_lowtoday_recent = today_handles.today_recenttoday_changed = today_handles.today_changedhome_flow = today_handles.home_flowp_location = reconcile_handles.p_locationmove_dest = reconcile_handles.move_dest# Refresh dropdown choices on initial loadapp.load(lambda: gr.update(choices=household_choices(), value=current_user_id()),outputs=household_dropdown,)# Wire household dropdown change after all output components are defined.# Also refresh the new home_flow panel so the state-aware hero# re-evaluates with the new household's data.household_dropdown.change(switch_household_state,household_dropdown,[household_dropdown, today_stats, today_soon, today_list, today_low, today_recent, today_changed, home_flow],api_name="switch_household",api_description="Switch active household and refresh dashboard",).then(36 unmodified lineshh_create_btn.click(create_household_state,hh_name_input,[household_dropdown, hh_add_row, today_stats, today_soon, today_list, today_low, today_recent, today_changed, home_flow],api_name="create_household",api_description="Create a new household, switch to it, and refresh the dashboard",)19 unmodified linesargs = parser.parse_args()app = build_app()app.launch(server_port=args.port, share=args.share, theme=gr.themes.Base(), head=pwa_head_html(), css=CSS, prevent_thread_lock=True)# Post-launch re-mounts: launch() discards the FastAPI app constructed# during build_app() and creates a new one, so any custom routes we# registered in build_app() are lost. Re-mount PWA + health here so
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252"""Production-accurate tool-calling accuracy benchmark for Qwen3.5-4B-4bit.
Uses the REAL PlannerEngine prompt format: - Verbose tool descriptions from ToolSpec (11 tools) - Full system prompt with rules, safety, inventory context - Chat template formatting (fix #1) - max_tokens=512 (fix #2) - Think-tag stripping in parser (fix #3)
This gives the production-accurate ceiling for Qwen3.5-4B-4bit.
Run standalone: uv run python benchmarks/bench_planner_tool_calling.py"""
# ── Environment (must be set before any shopstack imports) ──────────import osos.environ["SHOPSTACK_OFF_THE_GRID"] = "true"os.environ["SHOPSTACK_LOCAL_AUTO_DOWNLOAD"] = "false"
import reimport sysimport timefrom typing import Any
from mlx_lm import generate, loadfrom mlx_lm.sample_utils import make_sampler
from shopstack.planner.parser import extract_jsonfrom shopstack.planner.prompts import build_planner_prompt, build_system_prompt
MODEL_NAME = "mlx-community/Qwen3.5-4B-4bit"
# ─── Benchmark prompts ──────────────────────────────────────────────
TOOL_PROMPTS: list[tuple[str, str]] = [ ("add_milk", "I bought 2 liters of milk. Record it in my inventory in the fridge."), ("find_onion", "Do I have any onions at home?"), ("consume_rice", "I used 0.5 kg of basmati rice from my pantry."), ("shopping_vegetables", "Create a shopping list for tomatoes, onions, and potatoes. I need 1 kg of each."), ("compare_eggs", "I'm at the store and see eggs for $3.99. Should I buy them?"), ("price_tomato", "I saw tomatoes at $2.49 per kg at Dmart. Record this price."), ("use_soon_check", "What items in my fridge need to be used soon?"), ("buy_suggestions", "What should I buy next time I go shopping?"), ("move_sugar", "I moved the sugar from the pantry to the kitchen counter."), ("multi_step", "I bought 3 kg of apples and 1 kg of carrots. Record both in the fridge, then check if I need to buy onions."),]
# Build a quick lookup for re-runs in the analysis section_PROMPT_MAP: dict[str, str] = dict(TOOL_PROMPTS)
# ─── Parser (matches production extract_json + validation) ──────────
def parse_tool_calls_from_text(text: str) -> list[dict[str, Any]]: """Parse tool calls from raw model output, matching production parser.""" raw = extract_json(text) if raw is None: return [] if isinstance(raw, dict): raw = [raw] if not isinstance(raw, list): return []
validated: list[dict[str, Any]] = [] for item in raw: if not isinstance(item, dict): continue tool = item.get("tool") if not tool or not isinstance(tool, str): continue args = item.get("args", {}) if not isinstance(args, dict): continue validated.append({"tool": tool, "args": args}) return validated
def is_valid_tool_call(calls: list[dict[str, Any]]) -> bool: if not calls: return False for call in calls: if not isinstance(call, dict) or "tool" not in call or not isinstance(call["tool"], str): return False return True
# ═══════════════════════════════════════════════════════════════════════# Main# ═══════════════════════════════════════════════════════════════════════
def main() -> None: t0 = time.perf_counter() print(f"Loading {MODEL_NAME} ...") model, tokenizer = load(MODEL_NAME) print(f"Loaded in {time.perf_counter() - t0:.1f}s\n") sys.stdout.flush()
sampler = make_sampler(temp=0.0)
# Mock database so build_system_prompt() works class MockDB: def get_inventory(self, status: Any = None) -> list[Any]: return [] def __bool__(self) -> bool: return True
mock_db = MockDB() system_prompt = build_system_prompt(mock_db)
print(f"System prompt length: {len(system_prompt)} chars") print(f"Has chat_template: {getattr(tokenizer, 'chat_template', False) is not None}") print() sys.stdout.flush()
# ── Production pipeline benchmark ────────────────────────────── print("=" * 70) print("PRODUCTION-ACCURATE BENCHMARK") print("(verbose ToolSpec descriptions + chat template + 512 tok + think-tag strip)") print("=" * 70) print()
correct = 0 total = len(TOOL_PROMPTS) details: list[tuple[str, str, bool, int, float, str, str]] = [] total_prompt_chars = 0
for pname, question_text in TOOL_PROMPTS: # Step 1: Build the raw prompt the way PlannerEngine does prompt = build_planner_prompt(question_text, mock_db)
# Step 2: Apply chat template (matching LocalProvider.plan()) messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": f"USER REQUEST: {question_text}\n\nJSON tool calls:"}, ] try: formatted_prompt = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) except Exception as exc: print(f" [{pname}] CHAT TEMPLATE FAILED: {exc}") formatted_prompt = prompt # fallback
total_prompt_chars += len(formatted_prompt)
# Step 3: Generate (max_tokens=512 matching the fix) t_gen = time.perf_counter() resp = generate(model, tokenizer, prompt=formatted_prompt, max_tokens=512, sampler=sampler) elapsed = time.perf_counter() - t_gen
# Step 4: Parse with think-tag stripping (matching parser fix) calls = parse_tool_calls_from_text(resp) valid = is_valid_tool_call(calls)
# Determine failure reason fail_reason = "" if not valid: stripped_think = re.sub(r"<think>.*?</think>", "", resp, flags=re.DOTALL) if "[" not in stripped_think: fail_reason = " (no JSON found)" elif resp.strip().endswith("}") or resp.strip().endswith("]"): fail_reason = " (truncated)" else: fail_reason = " (struct invalid)"
if valid: correct += 1 status = "✓" else: status = "✗"
# Show first tool call for debugging call_preview = "" if valid and calls: first = calls[0] call_preview = ( f" → {first['tool']}(" + ", ".join(f"{k}={v}" for k, v in first["args"].items()) + ")" )
details.append((pname, status, valid, len(calls), elapsed, fail_reason, call_preview)) print( f" [{status}] {pname}: {elapsed*1000:.0f}ms" f" | calls={len(calls)} | valid={valid}{fail_reason}{call_preview}" ) sys.stdout.flush()
accuracy = correct / total * 100 print(f"\n Accuracy: {correct}/{total} = {accuracy:.1f}%") print(f" Avg prompt length: {total_prompt_chars // total:,} chars")
# ── Comparison table ─────────────────────────────────────────── print() print("=" * 70) print("COMPARISON WITH EARLIER RESULTS") print("=" * 70) best = "Best so far" if accuracy >= 90 else "Below compact config" verdict = ( "The verbose descriptions do NOT significantly degrade accuracy." if accuracy >= 85 else "The verbose descriptions DO degrade accuracy vs compact format." ) print(f""" Config Accuracy Notes ──────────────────────────────────────────── ──────── ───────────────────── Raw prompt + verbose tools + 64-256 tok 0% Stuck in <think> Raw prompt + verbose tools + 512 tok 10% Conversation repetition Raw prompt + compact tools + 256-512 tok 0% Parser failed on repeats Chat template + compact tools + 256 tok 60% Some truncation Chat template + compact tools + 512 tok 90% Best compact config ──────────────────────────────────────────── ──────── ───────────────────── ★ PRODUCTION: verbose + chat + 512 tok {accuracy:.0f}% {best}
Verdict: {verdict}""")
# ── Raw output analysis (first 3 prompts) ────────────────────── print() print("=" * 70) print("RAW OUTPUT ANALYSIS (first 3 prompts)") print("=" * 70) for pname, _, _, _, _, _, _ in details[:3]: question_text = _PROMPT_MAP.get(pname, pname) messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": f"USER REQUEST: {question_text}\n\nJSON tool calls:"}, ] formatted_prompt = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) resp = generate(model, tokenizer, prompt=formatted_prompt, max_tokens=512, sampler=sampler)
has_think = "think" in resp.lower() has_json = "[" in resp think_end = resp.rfind("</think>") after_think = resp[think_end + 8:] if think_end >= 0 else resp
print(f"\n [{pname}]") print(f" Has <think>: {has_think} | Has JSON: {has_json}") print(f" Response length: {len(resp)} chars") if has_think and "</think>" in resp: think_start = resp.find("<think>") think_close = resp.find("</think>") + 8 print(f" Think content: {resp[think_start:think_close]}") print(f' After think tag: "{after_think.strip()[:200]}"') sys.stdout.flush()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718from __future__ import annotations
import osimport tempfilefrom datetime import date, timedeltafrom pathlib import Pathfrom typing import Any, Generator
import pytest
from shopstack.config import Settingsfrom shopstack.persistence.database import Databasefrom shopstack.providers.registry import ProviderRegistryfrom shopstack.schemas.models import InventoryLot, PriceObservationfrom shopstack.tools.registry import ToolRegistry
SEED_ITEMS = [ ("rice", "Basmati Rice", "grains", 5.0, "kg", "pantry", 450.0), ("wheat_flour", "Aashirvaad Atta", "grains", 10.0, "kg", "pantry", 380.0), ("toor_dal", "Toor Dal", "pulses", 2.0, "kg", "pantry", 180.0), ("moong_dal", "Moong Dal", "pulses", 1.0, "kg", "pantry", 150.0), ("chana_dal", "Chana Dal", "pulses", 1.5, "kg", "pantry", 120.0), ("mustard_oil", "Fortune Mustard Oil", "oils", 1.0, "L", "pantry", 185.0), ("sunflower_oil", "Sunflower Oil", "oils", 1.0, "L", "pantry", 140.0), ("salt", "Tata Salt", "spices", 1.0, "kg", "spice_box", 25.0), ("turmeric", "Turmeric Powder", "spices", 0.2, "kg", "spice_box", 80.0), ("red_chilli", "Red Chilli Powder", "spices", 0.2, "kg", "spice_box", 90.0), ("cumin", "Jeera", "spices", 0.1, "kg", "spice_box", 120.0), ("coriander_powder", "Dhania Powder", "spices", 0.2, "kg", "spice_box", 60.0), ("garam_masala", "MDH Garam Masala", "spices", 0.1, "kg", "spice_box", 150.0), ("milk", "Amul Taaza", "dairy", 2.0, "L", "fridge", 64.0), ("curd", "Amul Curd", "dairy", 0.5, "kg", "fridge", 40.0), ("paneer", "Amul Paneer", "dairy", 0.2, "kg", "fridge", 90.0), ("butter", "Amul Butter", "dairy", 0.1, "kg", "fridge", 56.0), ("onion", "Onion", "vegetables", 2.0, "kg", "fridge_drawer", 40.0), ("tomato", "Tomato", "vegetables", 1.0, "kg", "fridge_drawer", 30.0), ("potato", "Potato", "vegetables", 3.0, "kg", "fridge_drawer", 45.0), ("green_chilli", "Green Chilli", "vegetables", 0.1, "kg", "fridge_drawer", 15.0), ("ginger", "Ginger", "vegetables", 0.2, "kg", "fridge_drawer", 30.0), ("garlic", "Garlic", "vegetables", 0.2, "kg", "fridge_drawer", 40.0), ("capsicum", "Capsicum", "vegetables", 0.5, "kg", "fridge_drawer", 50.0), ("coriander", "Coriander Leaves", "vegetables", 0.1, "kg", "fridge_drawer", 10.0), ("spinach", "Palak", "vegetables", 0.5, "kg", "fridge_drawer", 20.0), ("banana", "Banana", "fruits", 1.0, "dozen", "kitchen", 50.0), ("apple", "Apple", "fruits", 1.0, "kg", "kitchen", 180.0), ("lemon", "Lemon", "fruits", 0.5, "kg", "kitchen", 60.0), ("sugar", "Sugar", "staples", 2.0, "kg", "pantry", 90.0), ("tea", "Tata Tea Gold", "beverages", 0.5, "kg", "pantry", 220.0), ("coffee", "Nescafe Classic", "beverages", 0.2, "kg", "pantry", 200.0), ("biscuit", "Parle-G", "snacks", 1.0, "kg", "pantry", 80.0), ("bread", "Britannia Bread", "bakery", 1.0, "unit", "pantry", 40.0), ("egg", "Eggs", "protein", 1.0, "dozen", "fridge", 80.0), ("chicken", "Chicken Breast", "protein", 1.0, "kg", "freezer", 250.0), ("soap", "Dettol Soap", "hygiene", 3.0, "unit", "bathroom_cabinet", 45.0), ("shampoo", "Head & Shoulders", "hygiene", 1.0, "unit", "bathroom_cabinet", 200.0), ("toothpaste", "Colgate", "hygiene", 1.0, "unit", "bathroom_cabinet", 95.0), ("detergent", "Surf Excel", "cleaning", 2.0, "kg", "cleaning_shelf", 280.0), ("dish_soap", "Vim Liquid", "cleaning", 1.0, "unit", "cleaning_shelf", 110.0), ("floor_cleaner", "Lizol", "cleaning", 1.0, "L", "cleaning_shelf", 150.0), ("mosquito_repellent", "Good Knight", "household", 1.0, "unit", "bedroom", 85.0), ("paratha", "Frozen Paratha", "frozen", 1.0, "unit", "freezer", 120.0), ("peas", "Frozen Peas", "frozen", 0.5, "kg", "freezer", 70.0), ("cornflour", "Cornflour", "thickener", 0.5, "kg", "pantry", 50.0), ("baking_soda", "Baking Soda", "baking", 0.1, "kg", "pantry", 25.0), ("vinegar", "Synthetic Vinegar", "condiment", 1.0, "L", "pantry", 35.0), ("soy_sauce", "Ching's Soy Sauce", "condiment", 0.2, "L", "pantry", 55.0), ("honey", "Dabur Honey", "condiment", 0.5, "kg", "pantry", 200.0),]
SEED_STORES = [ ("store_dmart", "DMart", "Koramangala", "supermarket"), ("store_bigbazaar", "Big Bazaar", "HSR Layout", "supermarket"), ("store_sharma", "Sharma Kirana", "12th Main", "kirana"), ("store_more", "More Supermarket", "Indiranagar", "supermarket"), ("store_local", "Local Vendor", "Roadside", "pushcart"),]
SAMPLE_RECEIPT_TEXT = """Sharma General StoreDate: 08/06/2026Bill No: 1247
ONION 2 KG 64.00TOMATO 1 KG 35.00POTATO 3 KG 75.00GREEN CHILLI 100 G 12.00GINGER 200 GM 28.00CORIANDER LEAVES 1 BUNCH 10.00AMUL TAAZA MILK 2 L 128.00BREAD 1 PCS 42.00EGG 12 PCS 85.00SURF EXCEL 1 KG 145.00VIM LIQUID 1 PCS 110.00TATA SALT 1 KG 25.00TURMERIC POWDER 200 GM 78.00
Total: Rs. 837.00GST: 0.00Cash Paid: 900.00Change: 63.00"""
@pytest.fixture(scope="session")def settings() -> Settings: return Settings( _env_file=None, db_path=":memory:", off_the_grid=True, local_auto_download=False, )
@pytest.fixture(scope="session")def db(settings: Settings) -> Generator[Database, None, None]: with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f: path = f.name database = Database(path) yield database Path(path).unlink(missing_ok=True)
@pytest.fixture(scope="session")def providers(settings: Settings) -> ProviderRegistry: return ProviderRegistry(settings)
@pytest.fixture(scope="session")def tool_registry(db: Database) -> ToolRegistry: return ToolRegistry(db)
@pytest.fixture(scope="session")def bench_db() -> Generator[Database, None, None]: with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f: path = f.name database = Database(path)
today = date.today() for i, (cname, dname, cat, qty, unit, loc, price) in enumerate(SEED_ITEMS): lot = InventoryLot( canonical_name=cname, display_name=dname, category=cat, quantity=qty, unit=unit, storage_location_id=loc, purchase_date=today - timedelta(days=i % 14), price_paid=price, ) database.add_inventory_lot(lot)
stores_map: dict[str, str] = {} for sid, sname, sloc, stype in SEED_STORES: from shopstack.schemas.models import Store store = Store(store_id=sid, name=sname, location=sloc, store_type=stype) database.add_store(store) stores_map[sname] = sid
store_names = list(stores_map.keys()) for i in range(100): item = SEED_ITEMS[i % len(SEED_ITEMS)] cname = item[0] base_price = item[6] store_name = store_names[i % len(store_names)] variation = base_price * (1 + (i % 7 - 3) * 0.05) obs = PriceObservation( canonical_name=cname, quantity=item[3], unit=item[4], price=round(variation, 2), store_name=store_name, store_id=stores_map[store_name], observation_date=today - timedelta(days=i), ) database.record_price(obs)
for i in range(20): item = SEED_ITEMS[i % len(SEED_ITEMS)] from shopstack.schemas.models import PurchaseEvent event = PurchaseEvent( canonical_name=item[0], quantity=item[3], unit=item[4], total_price=item[6], source_type="manual", store_name=store_names[i % len(store_names)], ) database.add_purchase_event(event)
database.set_config_value("field_notes_markdown", "# Field Notes\n\nWeekly grocery planning notes.\n")
from shopstack.schemas.models import ShoppingListItem sl = database.create_shopping_list(name="Weekly Groceries", goal="Restock essentials") for cname, qty, unit, priority in [ ("milk", 2.0, "L", "must_buy"), ("bread", 1.0, "unit", "must_buy"), ("tomato", 1.0, "kg", "optional"), ("onion", 2.0, "kg", "must_buy"), ("egg", 1.0, "dozen", "must_buy"), ]: sli = ShoppingListItem( canonical_name=cname, requested_quantity=qty, unit=unit, priority=priority, reason="Benchmark seed", ) database.add_list_item(sl.list_id, sli)
yield database Path(path).unlink(missing_ok=True)
@pytest.fixture(scope="session")def bench_tools(bench_db: Database) -> ToolRegistry: return ToolRegistry(bench_db)
@pytest.fixture(scope="session")def sample_receipt_text() -> str: return SAMPLE_RECEIPT_TEXT
@pytest.fixture()def fresh_db() -> Generator[Database, None, None]: with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f: path = f.name database = Database(path) yield database Path(path).unlink(missing_ok=True)
# ── Real-model fixtures (skip in CI, requires cached model weights) ──
def _glm_ocr_cache_path() -> str | None: """Return the cached GLM-OCR model path if available, else None.""" import importlib if importlib.util.find_spec("transformers") is None: return None try: from transformers.models.glm_ocr import GlmOcrForConditionalGeneration # noqa: F401 except ImportError: return None
cache_dir = os.path.expanduser("~/.cache/huggingface/hub") model_dir_name = "models--zai-org--GLM-OCR" model_dir = os.path.join(cache_dir, model_dir_name) snapshots_dir = os.path.join(model_dir, "snapshots") if not os.path.isdir(snapshots_dir): return None snapshots = os.listdir(snapshots_dir) if not snapshots: return None snapshot_path = os.path.join(snapshots_dir, snapshots[0]) if os.path.isfile(os.path.join(snapshot_path, "model.safetensors")): return snapshot_path return None
def _create_hindi_receipt_image() -> str: """Generate a bilingual Hindi-English receipt image and return its path.
Uses Devanagari MT font for Hindi-transliterated item names mixed with English (e.g. PYAAZ (Onion), TAMATAR (Tomato)). Tests multilingual OCR. """ from PIL import Image, ImageDraw, ImageFont
lines = [ " SHARMA KIRANA STORE ", " 12th Main, Koramangala", " Date: 15/06/2026", "========================================", " VATRA (ITEM) QTY RUPIYAH", "----------------------------------------", "1. PYAAZ (Onion) 2 KG 40", "2. TAMATAR (Tomato) 1 KG 35", "3. AALOO (Potato) 2 KG 50", "4. DOODH (Milk) 1 L 64", "5. ANDAY (Eggs) 12 PC 85", "6. MAKKHAN (Butter) 500 G 60", "7. CHEENI (Sugar) 1 KG 45", "8. SARSON KA TEL 1 L 185", "9. AATA (Wheat Flour) 1 KG 42", "10. CHAWAL (Rice) 1 KG 75", "----------------------------------------", " KUUL YOG (Total) 681", " AADHAA KAR (GST) 0", "========================================", " DHANYAVAAD! THANK YOU!", ] ground_truth = "\n".join(lines)
padding = 14 font_size = 14 line_height = font_size + 6 width = 420 height = len(lines) * line_height + padding * 2
img = Image.new("RGB", (width, height), (248, 244, 240)) draw = ImageDraw.Draw(img)
try: font = ImageFont.truetype("/System/Library/Fonts/Supplemental/DevanagariMT.ttc", font_size) except Exception: font = ImageFont.load_default()
for i, line in enumerate(lines): y = padding + i * line_height stripped = line.strip() if not stripped: continue lower = stripped.lower() if any(lower.startswith(k) for k in ["kuul", "aadhaa"]): tw = draw.textlength(stripped, font=font) draw.text((width - padding - tw, y), stripped, fill="black", font=font) else: draw.text((padding, y), stripped, fill="black", font=font)
import tempfile fd, path = tempfile.mkstemp(suffix=".png", prefix="glm_ocr_hindi_") os.close(fd) img.save(path)
# Save ground truth alongside the image gt_path = path.replace(".png", "_ground_truth.txt") with open(gt_path, "w", encoding="utf-8") as f: f.write(ground_truth)
return path, gt_path
def _create_receipt_image() -> str: """Generate a test receipt image and return its path.
Creates a thermal-printer style receipt with 13 line items, store name, date, and totals. Used by GLM-OCR benchmarks. """ from PIL import Image, ImageDraw, ImageFont
receipt_text = SAMPLE_RECEIPT_TEXT
lines = receipt_text.split("\n") font_size = 15 line_height = font_size + 7 padding = 16 width = 380 height = len(lines) * line_height + padding * 2
img = Image.new("RGB", (width, height), (248, 244, 240)) draw = ImageDraw.Draw(img)
try: font = ImageFont.truetype("/System/Library/Fonts/Menlo.ttc", font_size) except Exception: font = ImageFont.load_default()
right_align_keys = {"total", "subtotal", "gst", "cgst", "sgst", "cash", "change", "grand", "net"} for i, line in enumerate(lines): y = padding + i * line_height stripped = line.strip() if not stripped: continue lower = stripped.lower() if any(lower.startswith(k) for k in right_align_keys): tw = draw.textlength(stripped, font=font) draw.text((width - padding - tw, y), stripped, fill="black", font=font) else: draw.text((padding, y), stripped, fill="black", font=font)
import tempfile fd, path = tempfile.mkstemp(suffix=".png", prefix="glm_ocr_bench_") os.close(fd) img.save(path) return path
def _mlx_model_cache_path() -> str | None: """Return the cached MLX model path if available, else None.""" cache_dir = os.path.expanduser("~/.cache/huggingface/hub") model_dir_name = "models--mlx-community--Llama-3.2-3B-Instruct-4bit" model_dir = os.path.join(cache_dir, model_dir_name) snapshots_dir = os.path.join(model_dir, "snapshots") if not os.path.isdir(snapshots_dir): return None snapshots = os.listdir(snapshots_dir) if not snapshots: return None # Use the first (and usually only) snapshot snapshot_path = os.path.join(snapshots_dir, snapshots[0]) if os.path.isfile(os.path.join(snapshot_path, "model.safetensors")): return snapshot_path if os.path.isfile(os.path.join(snapshot_path, "model.safetensors.index.json")): return snapshot_path return None
@pytest.fixture(scope="session")def glm_ocr_model() -> Generator[Any, None, None]: """Provide a GlmOCRProvider loaded with GLM-OCR via transformers.
Skips the test if: - transformers with GlmOcrForConditionalGeneration is not installed - The GLM-OCR model is not cached in the HuggingFace hub cache
Yields ``(provider, image_path, warm_elapsed)`` so benchmarks can measure cold-start load time separately from extraction latency. The test receipt image is created in a temp dir and cleaned up on teardown. """ import importlib
if importlib.util.find_spec("transformers") is None: pytest.skip("transformers not installed") if importlib.util.find_spec("PIL") is None: pytest.skip("Pillow not installed")
cache_path = _glm_ocr_cache_path() if cache_path is None: pytest.skip( "GLM-OCR model not cached. Run: " "uv run python -c 'from transformers import AutoModel; " "AutoModel.from_pretrained(\"zai-org/GLM-OCR\", trust_remote_code=True)'" )
from shopstack.providers.ocr_provider import GlmOCRProvider
provider = GlmOCRProvider()
# Warm: load the model into memory once warm_start = __import__("time").perf_counter() provider.load() warm_elapsed = __import__("time").perf_counter() - warm_start
# Create test receipt image image_path = _create_receipt_image()
yield provider, image_path, warm_elapsed
# Teardown: drop references and clean up temp file provider._model = None provider._processor = None try: import os as _os _os.unlink(image_path) except Exception: pass
@pytest.fixture(scope="session")def llama3b_model() -> Generator[Any, None, None]: """Provide a LocalProvider loaded with llama-3.2-3b (MLX).
Skips the test if: - mlx_lm is not installed - The MLX model is not cached in the HuggingFace hub cache
Loading is deferred to the first ``complete()`` call so that inference-only benchmarks can measure cold-start separately. """ import importlib
if importlib.util.find_spec("mlx_lm") is None: pytest.skip("mlx-lm not installed")
cache_path = _mlx_model_cache_path() if cache_path is None: pytest.skip("MLX llama-3.2-3b model not cached (run: uv run python -c 'import mlx_lm; mlx_lm.load(\"mlx-community/Llama-3.2-3B-Instruct-4bit\")')")
from shopstack.providers.local_provider import LocalProvider
provider = LocalProvider( model_dir=os.path.dirname(cache_path), mlx_model=cache_path, allow_download=False, auto_unload=False, # keep loaded across benchmark calls )
# Warm: load the model into memory once warm_start = __import__("time").perf_counter() provider._ensure_model() warm_elapsed = __import__("time").perf_counter() - warm_start
yield provider, warm_elapsed
# Teardown: drop reference so the model can be garbage-collected provider._llm = None provider._tokenizer = None
def _generate_test_audio() -> str: """Generate a short WAV file with a 440Hz sine tone and return its path.
Creates ~1 second of mono 16-bit PCM audio at 16kHz. Used by real STT provider benchmarks. """ import math import struct import tempfile import wave
sample_rate = 16000 duration_s = 1.0 num_samples = int(sample_rate * duration_s)
fd, path = tempfile.mkstemp(suffix=".wav", prefix="stt_bench_") os.close(fd)
with wave.open(path, "w") as wf: wf.setnchannels(1) wf.setsampwidth(2) wf.setframerate(sample_rate) for i in range(num_samples): sample = int(math.sin(2.0 * math.pi * 440.0 * i / sample_rate) * 16000) wf.writeframes(struct.pack("<h", sample)) return path
# ── Real STT provider fixture ──────────────────────────────────
@pytest.fixture(scope="session")def real_stt_model() -> Generator[Any, None, None]: """Provide a real STT provider (tries LocalWhisperProvider first).
Skips the test if no real STT backend is available. Yields ``(provider, audio_path)`` where ``audio_path`` is a generated sine-tone WAV file suitable for transcription benchmarks. """ provider = None
# Try LocalWhisperProvider (mlx-whisper or faster-whisper) try: from shopstack.providers.local_whisper_provider import LocalWhisperProvider p = LocalWhisperProvider() if p.available: provider = p except Exception: pass
# Fallback: SenseVoiceSTTProvider if provider is None: try: from shopstack.providers.stt_provider import SenseVoiceSTTProvider p = SenseVoiceSTTProvider() if p.available: provider = p except Exception: pass
if provider is None: pytest.skip("No real STT provider available (install mlx-whisper or funasr)")
audio_path = _generate_test_audio() yield provider, audio_path
try: os.unlink(audio_path) except Exception: pass
# ── Real TTS provider fixture ──────────────────────────────────
@pytest.fixture(scope="session")def real_tts_model() -> Generator[Any, None, None]: """Provide a real TTS provider (KokoroTTSProvider with gTTS fallback).
Skips the test if no real TTS backend is available. gTTS is tried as a fallback (requires no model weights). Yields ``provider`` for synthesis benchmarks. """ provider = None
try: from shopstack.providers.tts_provider import KokoroTTSProvider p = KokoroTTSProvider() if p.healthcheck(): provider = p except Exception: pass
if provider is None: pytest.skip("No real TTS provider available (install kokoro or gtts)")
yield provider
# ── Real Vision provider fixture ───────────────────────────────
@pytest.fixture(scope="session")def real_vision_model() -> Generator[Any, None, None]: """Provide a real Vision provider (MiniCPM-V via transformers).
Skips the test if transformers/torch are not installed or the model weights are not cached locally. Yields ``(provider, image_path, tmpdir)`` for understanding benchmarks. """ import importlib
if importlib.util.find_spec("transformers") is None: pytest.skip("transformers not installed")
try: from shopstack.providers.vision_provider import MiniCPMVProvider provider = MiniCPMVProvider() if not provider.available: pytest.skip("MiniCPM-V provider not available (missing deps)") except Exception as e: pytest.skip(f"MiniCPM-V provider init failed: {e}")
from PIL import Image from pathlib import Path import tempfile tmp = Path(tempfile.mkdtemp()) img_path = tmp / "vision_bench.png" Image.new("RGB", (400, 300), color="white").save(img_path)
yield provider, str(img_path), tmp
for f in tmp.iterdir(): f.unlink(missing_ok=True) tmp.rmdir()
# ── Real Planner provider fixture ──────────────────────────────
@pytest.fixture(scope="session")def real_planner_model() -> Generator[Any, None, None]: """Provide a real Planner provider (LocalProvider via MLX).
Skips the test if MLX or the cached model weights are not available. Uses the same cache check as the existing ``llama3b_model`` fixture. Yields ``(provider, warm_elapsed)`` for planning benchmarks. """ import importlib
if importlib.util.find_spec("mlx_lm") is None: pytest.skip("mlx-lm not installed")
cache_path = _mlx_model_cache_path() if cache_path is None: pytest.skip("MLX model not cached (run: uv run python -c 'import mlx_lm; mlx_lm.load(\"mlx-community/Llama-3.2-3B-Instruct-4bit\")')")
try: from shopstack.providers.local_provider import LocalProvider provider = LocalProvider( model_dir=os.path.dirname(cache_path), mlx_model=cache_path, allow_download=False, auto_unload=False, ) warm_start = __import__("time").perf_counter() provider._ensure_model() warm_elapsed = __import__("time").perf_counter() - warm_start except Exception as e: pytest.skip(f"LocalProvider init failed: {e}")
yield provider, warm_elapsed
provider._llm = None provider._tokenizer = None
def _tesseract_check() -> bool: """Return True if Tesseract OCR CLI is available and working.""" try: import pytesseract pytesseract.get_tesseract_version() return True except Exception: return False
@pytest.fixture(scope="session")def tesseract_model() -> Generator[Any, None, None]: """Provide a TesseractOCRProvider for real-model benchmarks.
Tesseract is a CLI tool (not a neural model), so there is no model loading step — it's always available if the CLI is installed.
Skips the test if: - pytesseract is not installed - The tesseract CLI binary is not found
Yields ``(provider, image_path)`` where ``image_path`` is a generated thermal-printer receipt image used for extraction benchmarks. The temp image is cleaned up on teardown. """ import importlib
if importlib.util.find_spec("pytesseract") is None: pytest.skip("pytesseract not installed") if not _tesseract_check(): pytest.skip("Tesseract CLI not available (brew install tesseract)")
from shopstack.providers.tesseract_provider import TesseractOCRProvider
provider = TesseractOCRProvider(lang="eng", psm=6)
assert provider.available, "TesseractOCRProvider should report available"
# Create test receipt image (reuse the GLM-OCR image generator) image_path = _create_receipt_image()
yield provider, image_path
# Teardown: clean up temp file try: import os as _os _os.unlink(image_path) except Exception: pass1234[pytest]markers = benchmark: Performance benchmark testsaddopts = -p no:legacypath123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154"""Timing benchmarks for the accessibility test suite.
Measures collection and total execution wall-clock time for``tests/test_accessibility_components.py``. Each measurement runspytest as a subprocess — these are coarse regression detectors,not micro-benchmarks.
Uses manual ``time.perf_counter()`` timing (not pytest-benchmark's``benchmark`` fixture) because the subprocess per run is too expensivefor the multiple rounds pytest-benchmark would need (default min_rounds=5)."""
from __future__ import annotations
import reimport subprocessimport timefrom pathlib import Path
import pytest
pytestmark = pytest.mark.benchmark(group="accessibility_timing")
PROJECT_ROOT = Path(__file__).resolve().parent.parent
# Base pytest args shared by both collection and execution runs._PYTEST_ARGS = [ "tests/test_accessibility_components.py", "-q", "--tb=short", "-p", "no:cacheprovider",]
# ── Helpers ───────────────────────────────────────────────────────────────
def _parse_pytest_summary(stdout: str) -> dict[str, int]: """Parse the summary line from ``pytest -q`` output.
Handles both execution format (
147 passed, 2 warnings in 18.61s
) and ``--collect-only`` format (
147 tests collected in 16.53s ).
Returns ``{"passed": …, "failed": …}``. If no summary line is found, ``failed`` is set to ``-1`` to distinguish from a clean zero-failure run. """ for line in stdout.splitlines(): # Execution format: "147 passed, 2 failed, 5 warnings in 18.61s" m = re.search(r"(\d+)\s+passed", line) if m: passed = int(m.group(1)) failed = 0 fm = re.search(r"(\d+)\s+failed", line) if fm: failed = int(fm.group(1)) return {"passed": passed, "failed": failed} # Collect-only format: "147 tests collected in 16.53s" m = re.search(r"(\d+)\s+tests?\s+collected", line) if m: count = int(m.group(1)) return {"passed": count, "failed": 0} return {"passed": 0, "failed": -1}
# ── Measurement tests ─────────────────────────────────────────────────────
class TestAccessibilityCollectionTime: """Measure pytest collection (import) time for the accessibility tests.
Collection exercises the full ``shopstack.ui`` import chain end-to-end: every screen module, component, renderer, and service module must be imported and registered. A regression here typically means a new circular import, an unexpectedly heavy transitive dependency, or a change in the test discovery pattern. """
def test_collection_time(self) -> None: """Collect-only wall-clock time should be <30s.""" start = time.perf_counter() result = subprocess.run( ["uv", "run", "pytest", *_PYTEST_ARGS, "--collect-only"], capture_output=True, text=True, cwd=str(PROJECT_ROOT), ) elapsed = time.perf_counter() - start
assert result.returncode == 0, ( f"pytest --collect-only failed:\n{result.stderr[:500]}" ) assert elapsed < 30.0, ( f"Collection took {elapsed:.2f}s — expected <30s. " "This may indicate a new circular import or heavy transitive dependency." )
summary = _parse_pytest_summary(result.stdout) assert summary["passed"] >= 140, ( f"Expected ≥140 tests, got {summary['passed']}. " f"Output preview:\n{result.stdout[:500]}" ) assert summary["failed"] not in (-1,), ( f"Could not parse test count from --collect-only output. " f"Full stdout:\n{result.stdout}" )
class TestAccessibilityTotalTime: """Measure total (collection + execution) wall-clock time for all 147+ accessibility tests.
This is the primary regression detector: any change that slows down the full test run (new imports, slower renderers, larger test data) will cause this benchmark to fail. """
def test_total_time(self) -> None: """Full test-suite wall-clock time should be <45s.""" start = time.perf_counter() result = subprocess.run( ["uv", "run", "pytest", *_PYTEST_ARGS], capture_output=True, text=True, cwd=str(PROJECT_ROOT), ) elapsed = time.perf_counter() - start
# Parse summary *before* the assertion so we can report both # timing and pass/fail in a single error message. summary = _parse_pytest_summary(result.stdout)
assert result.returncode == 0, ( f"pytest run failed (exit {result.returncode}):\n" f"{result.stderr[:500]}" ) assert elapsed < 45.0, ( f"Total test time {elapsed:.2f}s exceeds 45s threshold. " "This may indicate a performance regression in the import chain " "or test execution." ) assert summary["passed"] >= 140, ( f"Expected ≥140 passed, got {summary['passed']}. " f"Output preview:\n{result.stdout[:500]}" ) assert summary["failed"] == 0, ( f"Expected 0 failures, got {summary['failed']}. " "All accessibility tests must pass before timing is meaningful." )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111"""Baseline latency + throughput benchmarks for providers, DB, and tools.
Restored 2026-06-14 from ``test_benchmarks_legacy.py.bak`` (motto_v3 §4Local Work Preservation + §7 Supersession Rule). The .bak file heldreal benchmark coverage (provider mock latency, DB bulk insert/query,tool registry throughput) that was not duplicated in the active``test_benchmarks.py``. Rather than delete the .bak as junk, we restoreit under a canonical name so the coverage lives in an importable,discoverable location.
Why these benchmarks matter (motto_v3 §0.6 Risk-Based Verification +§0.10 Observability Is Delivery):
* Provider latency regressions surface as user-visible UI slowdowns (a 5× slowdown in mock STT would make the Ask tab feel broken even though every unit test still passes). * DB bulk-insert is the hottest path for receipt import and seed scripts — a regression here turns a 1s import into a 30s import. * Tool-registry execute is on the critical path of every Gradio button. Throughput regressions compound across the dashboard.
These run under the ``benchmark`` marker (see pyproject.toml) so theydon't slow down the default ``pytest tests/`` run."""import tempfileimport timefrom contextlib import contextmanagerfrom typing import Any
import pytest
pytestmark = pytest.mark.benchmark
class TestProviderBenchmarks: def test_mock_stt_latency(self, providers): samples = ["short utterance", "a " * 50, "a " * 200] for sample in samples: with temp_audio(sample) as path_file: path = path_file start = time.perf_counter() providers.stt.transcribe(path) elapsed = time.perf_counter() - start assert elapsed < 0.5, f"STT too slow: {elapsed:.3f}s"
def test_mock_vision_latency(self, providers): start = time.perf_counter() providers.vision.understand("/dev/null") elapsed = time.perf_counter() - start assert elapsed < 0.5, f"Vision too slow: {elapsed:.3f}s"
def test_mock_object_detection_latency(self, providers): start = time.perf_counter() providers.object_detection.detect("/dev/null") elapsed = time.perf_counter() - start assert elapsed < 0.5, f"Object detection too slow: {elapsed:.3f}s"
def test_mock_planner_latency(self, providers): start = time.perf_counter() providers.planner.plan("what should I cook for dinner") elapsed = time.perf_counter() - start assert elapsed < 0.5, f"Planner too slow: {elapsed:.3f}s"
def test_mock_ocr_latency(self, providers): start = time.perf_counter() providers.ocr.extract("/dev/null") elapsed = time.perf_counter() - start assert elapsed < 0.5, f"OCR too slow: {elapsed:.3f}s"
class TestDatabaseBenchmarks: def test_bulk_insert(self, db): from shopstack.schemas.models import InventoryLot
n = 100 start = time.perf_counter() for i in range(n): db.add_inventory_lot(InventoryLot(canonical_name=f"item-{i}", display_name=f"Item {i}", quantity=1.0, unit="unit")) elapsed = time.perf_counter() - start assert elapsed < 2.0, f"Bulk insert too slow: {elapsed:.3f}s for {n} items"
def test_bulk_query(self, db): n = db.conn.execute("SELECT COUNT(*) FROM inventory_lots").fetchone()[0] start = time.perf_counter() items = db.get_inventory() elapsed = time.perf_counter() - start assert elapsed < 0.5, f"Query too slow: {elapsed:.3f}s for {n} items" assert len(items) == n
class TestToolBenchmarks: def test_add_item_throughput(self, tool_registry): n = 50 start = time.perf_counter() for i in range(n): tool_registry.execute("add_inventory_item", canonical_name=f"bench-item-{i}", quantity=1.0, unit="unit") elapsed = time.perf_counter() - start assert elapsed < 3.0, f"Tool throughput too slow: {elapsed:.3f}s for {n} items"
def test_find_item_latency(self, tool_registry): start = time.perf_counter() tool_registry.execute("find_item", query="bench") elapsed = time.perf_counter() - start assert elapsed < 0.5, f"Search too slow: {elapsed:.3f}s"
@contextmanagerdef temp_audio(content: str) -> Any: with tempfile.NamedTemporaryFile(suffix=".wav", mode="w", delete=False) as f: f.write(content) yield f.name123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161from __future__ import annotations
from datetime import date, timedelta
import pytest
from shopstack.schemas.models import InventoryLot, PriceObservation
pytestmark = pytest.mark.benchmark(group="db")
def test_db_init(benchmark): import tempfile from pathlib import Path
from shopstack.persistence.database import Database
def create_fresh_db(): with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f: path = f.name d = Database(path) Path(path).unlink(missing_ok=True) return d
benchmark(create_fresh_db)
def test_add_inventory_lot(benchmark, fresh_db): lot = InventoryLot( canonical_name="bench_item", display_name="Bench Item", quantity=1.0, unit="unit", )
def add_one(): lot_fresh = InventoryLot( canonical_name="bench_item", display_name="Bench Item", quantity=1.0, unit="unit", ) fresh_db.add_inventory_lot(lot_fresh)
benchmark(add_one)
def test_add_100_inventory_lots(benchmark, fresh_db): def add_100(): for i in range(100): lot = InventoryLot( canonical_name=f"bulk-item-{i}", display_name=f"Bulk Item {i}", quantity=1.0, unit="unit", ) fresh_db.add_inventory_lot(lot)
benchmark(add_100)
def test_get_inventory_full(benchmark, bench_db): result = benchmark(bench_db.get_inventory) assert len(result) >= 50
def test_get_inventory_filtered(benchmark, bench_db): result = benchmark(bench_db.get_inventory, canonical_name="rice") assert len(result) >= 1
def test_update_inventory_lot(benchmark, bench_db): lots = bench_db.get_inventory() lot = lots[0]
def update(): bench_db.update_inventory_lot(lot.lot_id, {"quantity": lot.quantity + 0.1})
benchmark(update)
def test_update_100_lots(benchmark, bench_db): lots = bench_db.get_inventory()[:100]
def update_all(): for lot in lots: bench_db.update_inventory_lot(lot.lot_id, {"quantity": lot.quantity + 0.01})
benchmark(update_all)
def test_record_price_observation(benchmark, bench_db): today = date.today()
def record(): obs = PriceObservation( canonical_name="bench_price_item", quantity=1.0, unit="kg", price=42.0, store_name="Test Store", observation_date=today, ) bench_db.record_price(obs)
benchmark(record)
def test_record_100_price_observations(benchmark, bench_db): today = date.today()
def record_100(): for i in range(100): obs = PriceObservation( canonical_name=f"price-bench-{i % 10}", quantity=1.0, unit="kg", price=50.0 + i, store_name="DMart", observation_date=today, ) bench_db.record_price(obs)
benchmark(record_100)
def test_get_price_history(benchmark, bench_db): result = benchmark(bench_db.get_price_history, "rice") assert len(result) >= 1
def test_get_price_history_heavy_item(benchmark, bench_db): bench_item = SEED_ITEMS[0][0] if (SEED_ITEMS := []) else "rice" most_observed = bench_db.conn.execute( "SELECT canonical_name, COUNT(*) as cnt FROM price_observations GROUP BY canonical_name ORDER BY cnt DESC LIMIT 1" ).fetchone() if most_observed: result = benchmark(bench_db.get_price_history, most_observed["canonical_name"]) assert len(result) >= 1
def test_get_purchase_events(benchmark, bench_db): result = benchmark(bench_db.get_purchase_events, limit=20) assert len(result) >= 1
def test_get_active_shopping_list(benchmark, bench_db): benchmark(bench_db.get_active_shopping_list)
def test_get_locations(benchmark, bench_db): result = benchmark(bench_db.get_locations) assert len(result) >= 10
def test_get_inventory_lot(benchmark, bench_db): lots = bench_db.get_inventory() lot_id = lots[0].lot_id
result = benchmark(bench_db.get_inventory_lot, lot_id) assert result is not None123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100from __future__ import annotations
import json
import pytest
from shopstack.portability import ( export_csv_inventory, export_json, export_trace_bundle, import_json, validate_import_json,)
pytestmark = pytest.mark.benchmark(group="portability")
def test_export_json_full(benchmark, bench_db): result = benchmark(export_json, bench_db) assert len(result["inventory"]) >= 50 assert len(result["price_observations"]) >= 50
def test_export_csv_inventory(benchmark, bench_db): result = benchmark(export_csv_inventory, bench_db) lines = result.strip().split("\n") assert len(lines) >= 51
def test_export_trace_bundle(benchmark, bench_db): result = benchmark(export_trace_bundle, bench_db) assert result["export_type"] == "trace_bundle" assert result["lot_count"] >= 50
def test_import_json_merge(benchmark, bench_db): payload = { "schema_version": "1.0", "inventory": [ {"canonical_name": "merge_test_item", "display_name": "Merge Test", "quantity": 2.0, "unit": "kg"}, {"canonical_name": "another_merge", "display_name": "Another", "quantity": 1.0, "unit": "unit"}, ], "price_observations": [ {"canonical_name": "merge_test_item", "price": 99.0, "quantity": 1.0, "unit": "kg", "store_name": "Test"}, ], }
result = benchmark(import_json, bench_db, payload, import_mode="merge") assert result.items_added + result.items_updated >= 1
def test_import_json_replace(benchmark, fresh_db): from shopstack.schemas.models import InventoryLot
for i in range(10): lot = InventoryLot( canonical_name=f"preexisting-{i}", display_name=f"Item {i}", quantity=1.0, unit="unit", ) fresh_db.add_inventory_lot(lot)
payload = { "schema_version": "1.0", "inventory": [ {"canonical_name": "replace_item", "display_name": "Replace Test", "quantity": 5.0, "unit": "kg"}, ], }
result = benchmark(import_json, fresh_db, payload, import_mode="replace") assert result.items_added >= 1
def test_validate_import_json(benchmark, bench_db): payload = { "schema_version": "1.0", "inventory": [ {"canonical_name": "validate_item", "display_name": "Validate Test", "quantity": 1.0, "unit": "unit"}, {"canonical_name": "another_validate", "display_name": "Another Validate", "quantity": 2.0, "unit": "kg"}, {"canonical_name": "rice", "display_name": "Rice", "quantity": 5.0, "unit": "kg"}, ], "price_observations": [ {"canonical_name": "validate_item", "price": 50.0, "quantity": 1.0, "unit": "unit"}, ], }
result = benchmark(validate_import_json, bench_db, payload) assert result.items_added >= 1 assert "Dry-run" in result.messages[0]
def test_export_json_serialization_size(benchmark, bench_db): def serialize(): data = export_json(bench_db) return json.dumps(data)
result = benchmark(serialize) parsed = json.loads(result) assert "inventory" in parsed1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071from __future__ import annotations
import pytest
from shopstack.decisions import classify_allfrom shopstack.portability import ( export_csv_inventory, export_json, export_trace_bundle, import_json, validate_import_json,)from shopstack.services.dashboard import build_dashboard_statefrom shopstack.services.receipt import parse_receipt_textfrom shopstack.services.search import semantic_searchfrom shopstack.services.shopping import classify_shopping_items
pytestmark = pytest.mark.benchmark(group="services")
def test_build_dashboard_state(benchmark, bench_db, bench_tools): result = benchmark(build_dashboard_state, bench_db, bench_tools.inventory) assert result.decision_set is not None
def test_classify_all(benchmark, bench_db, bench_tools): result = benchmark(classify_all, bench_db, bench_tools.inventory) assert len(result.decisions) >= 10
def test_semantic_search_exact(benchmark, bench_db): result = benchmark(semantic_search, bench_db, "rice") assert len(result) >= 1 assert result[0].match_type == "exact"
def test_semantic_search_prefix(benchmark, bench_db): result = benchmark(semantic_search, bench_db, "ric") assert len(result) >= 1 assert result[0].match_type == "prefix"
def test_semantic_search_miss(benchmark, bench_db): result = benchmark(semantic_search, bench_db, "zzznonexistent") assert len(result) == 0
def test_export_json(benchmark, bench_db): result = benchmark(export_json, bench_db) assert "inventory" in result assert "price_observations" in result
def test_parse_receipt_text(benchmark, sample_receipt_text): result = benchmark(parse_receipt_text, sample_receipt_text) assert result.merchant == "Sharma General Store" assert len(result.lines) >= 10 assert result.total > 0
def test_classify_shopping_items(benchmark, bench_tools): items = [ {"canonical_name": "milk", "requested_quantity": 2.0, "unit": "L"}, {"canonical_name": "bread", "requested_quantity": 1.0, "unit": "unit"}, {"canonical_name": "tomato", "requested_quantity": 1.0, "unit": "kg"}, {"canonical_name": "onion", "requested_quantity": 2.0, "unit": "kg"}, {"canonical_name": "egg", "requested_quantity": 1.0, "unit": "dozen"}, ]
result = benchmark(classify_shopping_items, items, bench_tools.inventory) assert len(result.all_items) >= 3123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}{"text": "add_purchase", "intent": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}, "confidence": 1.0, "confirmation": "confirmed-by-user", "trace_id": "6e9caa1e394c", "timestamp": "2026-06-15 15:01:18.293199", "household_id": "", "source": "real-confirmed"}12345678910111213141516171819{ "raw_text": "Milk 2 L 120", "parsed": { "merchant": "Demo Mart", "purchase_date": "2026-06-06", "total": 120.0, "lines": [ { "canonical_name": "milk", "display_name": "Milk", "quantity": 2.0, "unit": "L", "price": 120.0 } ] }, "user_id": "house_a", "confirmed_at": "2026-06-15T12:13:58.449303"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990card_index,category,name,description,size,delivery_time,tag,availability,discount_percent,price_inr,mrp_inr,discount_amount_inr,computed_discount_percent
1,Fresh Vegetables,Ridge Gourd (Herekaayi),"Light, fibrous & tasty in dals or dry curries",2 Medium,22 MINS,Ad,Available,19,33,41,8,19.51
2,Fresh Vegetables,Cauliflower (Hoo Kosu),"Snow-white florets, perfect for curries & roasts!",1 Medium,22 MINS,Ad,Available,19,29,36,7,19.44
3,Fresh Vegetables,Indian Tomato,"Juicy, tangy & ideal for all Indian curries",500 g,22 MINS,,Available,20,28,35,7,20.0
4,Fresh Vegetables,Onion (Eerulli),"Zero Sprouting, Zero Smut",1 kg,22 MINS,,Available,20,31,39,8,20.51
5,Fresh Vegetables,Bottle Gourd ( Sorekaayi),"Light, hydrating & perfect for soups or halwa",1 Small,22 MINS,Ad,Available,18,26,32,6,18.75
6,Fresh Vegetables,Carrot,"Crunchy, vitamin-packed & perfect raw or cooked",500 g,22 MINS,Ad,Available,19,41,51,10,19.61
7,Fresh Vegetables,Cluster Beans (Gorikayi),"Fiber-packed, fresh, perfect for stir-fries & curries",250 g,22 MINS,,Available,21,18,23,5,21.74
8,Fresh Vegetables,Lady's Finger (Bendekaayi),"Fiber-rich, fresh & great for bhindi fry or curry",250 g x 2,22 MINS,,Available,26,22,30,8,26.67
9,Fresh Vegetables,nectr Ooty Carrot,,4 Pieces,22 MINS,Ad,Available,20,51,64,13,20.31
10,Fresh Vegetables,"Onion, Potato & Desi Tomato",Perfect for Indian home-cooked meals,1 Combo,22 MINS,,Available,20,114,143,29,20.28
11,Fresh Vegetables,English Cucumber - Protected Cultivation,Crisp and fresh cucumbers from hydroponic farming,500 g,22 MINS,,Available,20,32,40,8,20.0
12,Fresh Vegetables,Coccinia (Tondekaayi),"Low-cal, crisp, ideal for stir-fry & sambar",250 g,22 MINS,,Available,21,11,14,3,21.43
13,Fresh Vegetables,French Beans (Bili Hurulikaayi),"Crisp, fiber-rich & great for dry sabzis",250 g,22 MINS,,Available,20,32,40,8,20.0
14,Fresh Vegetables,Hybrid Tomato,"Fresh, firm & great in gravies or sauces",500 g,22 MINS,,Available,17,32,39,7,17.95
15,Fresh Vegetables,Kateri Brinjal (Geeru Gundu Badanekaayi),"Firm, low-seed & tasty in stuffed or fried dishes",250 g,22 MINS,,Available,20,16,20,4,20.0
16,Fresh Vegetables,Sweet Potato (Sihi Genasu),"Iron-rich, sweet & tasty when roasted or boiled",500 g x 2,22 MINS,,Available,22,48,62,14,22.58
17,Fresh Vegetables,English Cucumber (Sowthekaayi),"Crisp, no seeds & perfect in salads or detox drinks",1 Pack,22 MINS,,Available,20,28,35,7,20.0
18,Fresh Vegetables,Drumstick (Nuggekaayi),"Nutrient-rich moringa pods, perfect for sambar & Soups!",2 Pieces x 2,22 MINS,,Available,26,28,38,10,26.32
19,Fresh Vegetables,Haricot Beans (Hurulikayi),"Soft, healthy beans ideal for soups and sautés",250 g,22 MINS,,Available,20,28,35,7,20.0
20,Fresh Vegetables,Ooty Carrot,Sweet mountain-grown carrot with vibrant color!,250 g,22 MINS,,Available,19,29,36,7,19.44
21,Fresh Vegetables,Broad Beans (Huralikaayi),"Nutritious, bold flavor-great in gravies or rice",250 g x 2,22 MINS,,Available,24,50,66,16,24.24
22,Fresh Vegetables,Potato (Aloo Gadde),"Agra’s finest potatoes; great for fries, mash & curries",1 kg,22 MINS,,Available,20,27,34,7,20.59
23,Fresh Vegetables,Totapuri Raw Mango (Mavinahannu),Carbide Free,1 Piece,22 MINS,,Available,18,13,16,3,18.75
24,Fresh Vegetables,White Radish (Moolangi),"Crunchy, Aids digestion, for salads & curries!",2 Pieces,22 MINS,,Available,20,24,30,6,20.0
25,Fresh Vegetables,Bitter Gourd (Haagalakaayi),"Detox veggie, pure & best for fry or juice",1 Pack,22 MINS,,Available,20,34,43,9,20.93
26,Fresh Vegetables,Beetroot,"Rich in iron, earthy sweetness, ideal for salads/sides",500 g,22 MINS,,Available,20,27,34,7,20.59
27,Fresh Vegetables,"Onion, Potato & Hybrid Tomato",Basic essentials for daily cooking,1 Combo,22 MINS,,Available,19,122,151,29,19.21
28,Fresh Vegetables,Coconut (Thenginakayi),"Ideal for festivals, temple offerings, and cooking",1 Medium,22 MINS,,Available,20,44,55,11,20.0
29,Fresh Vegetables,Cowpea Beans (Karamani),"Protein-packed, perfect for stir-fries & curries",250 g,22 MINS,,Available,19,21,26,5,19.23
30,Fresh Vegetables,Sambar Onion (Sambar Eerulli),"Tiny, pure & ideal for authentic sambhar",250 g,22 MINS,,Available,19,25,31,6,19.35
31,Fresh Vegetables,Raw Banana (Baalekaayi),Energy-rich & best for curries or kofta,2 Pieces,22 MINS,,Available,19,33,41,8,19.51
32,Fresh Vegetables,Pointed Gourd (Parwal),"Soft, nutritious & perfect in curry or fry",250 g,22 MINS,,Available,21,30,38,8,21.05
33,Fresh Vegetables,Green Capsicum (Dappa Menasinakaayi),"Crunchy, vitamin-rich bell pepper for any dish!",2 Medium,22 MINS,,Available,5,19,20,1,5.0
34,Fresh Vegetables,Curry Leaves & Coriander Leaves,Aromatic herbs for Indian dishes,1 Combo,22 MINS,,Available,22,21,27,6,22.22
35,Fresh Vegetables,Mint Leaves & Coriander Leaves,Fresh herbs for garnishing,1 Combo,22 MINS,,Available,22,21,27,6,22.22
36,Fresh Vegetables,Hybrid Tomato & Onion,Classic combo for all cuisines,1 Combo,22 MINS,,Available,19,63,78,15,19.23
37,Fresh Vegetables,Curry Leaves & Green Chilli,Perfect base for flavorful dishes,1 Combo,22 MINS,,Available,22,21,27,6,22.22
38,Fresh Vegetables,Garlic & Ginger,Spice blend for flavor and aroma,1 Combo,22 MINS,,Available,17,81,98,17,17.35
39,Fresh Vegetables,Beetroot & Carrot,Bright veggies for salads,1 Combo,22 MINS,,Available,20,68,85,17,20.0
40,Fresh Vegetables,Raw Mango (Mavinakayi),Carbide Free,2 Pieces,22 MINS,,Available,20,19,24,5,20.83
41,Fresh Vegetables,Herbs Mix,Fresh herbs for seasoning,1 Combo,22 MINS,,Available,22,31,40,9,22.5
42,Fresh Vegetables,Snake Gourd (Padavalakaayi),"High-fiber, fresh & great for dry curry or stir-fry",2 Pieces x 2,22 MINS,,Available,24,38,50,12,24.0
43,Fresh Vegetables,Yellow Zucchini,"Bright, juicy & great in salad or stir-fry",1 Piece,22 MINS,,Available,20,38,48,10,20.83
44,Fresh Vegetables,Forest Bitter Gourd (Kaadu Hagalakaayi),"Wild, medicinal & ideal for bitter stir-fries",250 g,22 MINS,,Available,20,34,43,9,20.93
45,Fresh Vegetables,Sambar Veg Combo,"Drumstick, Brinjal, Raw Banana and Pumpkin Fresh veggies combo for Vishu festive cooking",1 Combo,22 MINS,,Available,20,106,133,27,20.3
46,Fresh Vegetables,Snibs Snack Tomatoes(Mixed Colour),"Sweet, vibrant, healthy for kids & snacking",250 g,,,Sold Out,20,92,115,23,20.0
47,Fresh Vegetables,nectr Baby potato (Chemical Free),Cleaner Fresher Sweeter,500 g,,,Sold Out,20,35,44,9,20.45
48,Fresh Vegetables,Pluckk Ozone Washed Hybrid Tomato,Pesticide-Free,500 g,,,Sold Out,20,42,53,11,20.75
49,Fresh Vegetables,Baby Potato (Chikka Aloo Gadde),"Tender, buttery gems for perfect roasting!",500 g x 2,,,Sold Out,23,52,68,16,23.53
50,Fresh Vegetables,Red Bell Pepper (Kempu Dappa Menasinakaayi),"Vitamin-rich & great for salads, grills & pasta",1 Piece,,,Sold Out,20,31,39,8,20.51
51,Fresh Vegetables,Long Purple Brinjal (Udda Badanekaayi),"Soft, tasty & ideal for fries, curries",250 g x 2,,,Sold Out,24,44,58,14,24.14
52,Fresh Vegetables,nectr Coconut (Chemical Free),,1 Piece,,Upgrade,Sold Out,20,59,74,15,20.27
53,Fresh Vegetables,nectr Small Green Zucchini (Chemical Free),"Fresher Taste, Firmer Bite",2 Pieces,,,Sold Out,19,109,136,27,19.85
54,Fresh Vegetables,Broccoli,"Rich in fiber, fresh & perfect for stir-fries",1 Piece,,,Sold Out,20,31,39,8,20.51
55,Fresh Vegetables,nectr Broccoli (Chemical Free),Fresher Crispier Taste,1 Piece,,,Sold Out,19,65,81,16,19.75
56,Fresh Vegetables,nectr Red & Yellow Bell Peppers (Chemical Free),,2 Pieces,,Upgrade,Sold Out,19,81,101,20,19.8
57,Fresh Vegetables,nectr Small Yellow Zucchini (Chemical Free),"Fresher Taste, Firmer Bite",2 Pieces,,,Sold Out,19,109,136,27,19.85
58,Fresh Vegetables,Pluckk Ozone Washed Green Capsicum,Pesticide-Free,250 g,,,Sold Out,19,37,46,9,19.57
59,Fresh Vegetables,Freshcon Cooked Rajma & Black Chickpeas,"Quick, high in protein, perfect for Indian dishes.",1 Combo,,,Sold Out,20,136,170,34,20.0
60,Fresh Vegetables,Pluckk Raw Mango Sliced,"Freshly sliced mango with bold tang, Salt & chilli powder mix sachet included for extra flavor",200 g,,,Sold Out,20,95,119,24,20.17
61,Fresh Vegetables,nectr Bottle Gourd (Chemical Free),,1 Piece,,Upgrade,Sold Out,20,31,39,8,20.51
62,Fresh Vegetables,nectr Raw Banana (Chemical Free),,3 Pieces,,Upgrade,Sold Out,20,55,69,14,20.29
63,Fresh Vegetables,nectr English Cucumber (Chemical Free),,4 Pieces,,Upgrade,Sold Out,20,28,35,7,20.0
64,Fresh Vegetables,nectr Red Cabbage (Chemical Free),,1 Piece,,Upgrade,Sold Out,20,62,78,16,20.51
65,Fresh Vegetables,nectr Green Cucumber (Chemical Free),"Crisper Bite, Fewer Seeds",3 Pieces,,,Sold Out,20,46,58,12,20.69
66,Fresh Vegetables,Cucumber,"Fresh, juicy & best in salads or chutneys",2 Pieces x 2,,,Sold Out,20,32,40,8,20.0
67,Fresh Vegetables,Onion -Value Pack (Eerulli),"Zero Sprouting, Zero Smut",3 kg,,,Sold Out,18,92,113,21,18.58
68,Fresh Vegetables,Round Gourd (Dundagina Sorekaayi),"Mild, easy-to-digest & ideal for dry sabzi",250 g,,,Sold Out,20,39,49,10,20.41
69,Fresh Vegetables,nectr Indian Tomato (Chemical Free),,8 Pieces,,Upgrade,Sold Out,19,53,66,13,19.7
70,Fresh Vegetables,Pluckk Ozone Washed Desi Tomato,Pesticide-Free,500 g,,,Sold Out,20,42,53,11,20.75
71,Fresh Vegetables,nectr Haricot Beans (Chemical Free),"Stringless, Fresher Taste",250 g,,,Sold Out,20,35,44,9,20.45
72,Fresh Vegetables,Freshcon Cooked Chickpeas & Sweetcorn,"Convenient, great for salads or hummus.",1 Combo,,,Sold Out,20,136,170,34,20.0
73,Fresh Vegetables,Yam Portion by Urban Harvest,"Pre-cut, clean & easy for sabzi or roast",250 g,,,Sold Out,20,68,85,17,20.0
74,Fresh Vegetables,nectr Hybrid Tomato (Chemical Free),"Redder Colour, Firmer, Consistent",8 Pieces,,,Sold Out,20,55,69,14,20.29
75,Fresh Vegetables,nectr Capsicum Green (Chemical Free),,2 Pieces,,Upgrade,Sold Out,20,38,48,10,20.83
76,Fresh Vegetables,Potato (Aloo Gadde) Value Pack,"Versatile Vegetable, Cooking Staple.",3 kg,,,Sold Out,20,78,98,20,20.41
77,Fresh Vegetables,nectr Radish,Cleaner Fresher Crisper,2 Pieces,,,Sold Out,19,25,31,6,19.35
78,Fresh Vegetables,Freshcon Cooked Rajma & Sweetcorn,"Quick, high in protein, perfect for Indian dishes.",1 Combo,,,Sold Out,20,136,170,34,20.0
79,Fresh Vegetables,Green Zucchini,"Low-cal, tender & best in grills or pasta",1 Piece,,,Sold Out,20,34,43,9,20.93
80,Fresh Vegetables,nectr Sweet Potato (Chemical Free),Unblemished skin with uniform flesh colour,500 g,,,Sold Out,20,27,34,7,20.59
81,Fresh Vegetables,nectr Onion (Chemical Free),,1 kg,,Upgrade,Sold Out,20,31,39,8,20.51
82,Fresh Vegetables,White Onion (Bili Eerulli),"Sweet, mild onion ideal for salads & salsas!",500 g,,,Sold Out,20,54,68,14,20.59
83,Fresh Vegetables,Yellow Bell Pepper (Haladi Dappa Menasinakaayi),"Sweet, crisp & adds color to stir-fry or salad",1 Piece,,,Sold Out,20,31,39,8,20.51
84,Fresh Vegetables,Red & Yellow Bell Pepper - Protected Cultivation,Fresh bell peppers grown in a safe environment,2 Pieces,,,Sold Out,20,62,78,16,20.51
85,Fresh Vegetables,Colocasia (Arvi),"Iron-rich, soft, tasty in curries",250 g x 2,,,Sold Out,25,36,48,12,25.0
86,Fresh Vegetables,Freshcon Cooked Chickpeas & Black Chickpeas,"Convenient, great for salads or hummus.",1 Combo,,,Sold Out,20,136,170,34,20.0
87,Fresh Vegetables,nectr Ridge Gourd (Chemical Free),"More Tender, Perfectly Grown",1 Piece,,Upgrade,Sold Out,19,21,26,5,19.23
88,Fresh Vegetables,nectr Kateri Brinjal (Chemical Free),,250 g,,Upgrade,Sold Out,20,20,25,5,20.0
89,Fresh Vegetables,Chandramukhi Potato (Aloo Gadde),Creamy texture ideal for mashing & roasting!,500 g,,,Sold Out,20,56,70,14,20.012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337[ { "name": "Ridge Gourd (Herekaayi)", "description": "Light, fibrous & tasty in dals or dry curries", "size": "2 Medium", "discount_percent": 19, "price_inr": 33, "mrp_inr": 41, "availability": "Available", "tag": "Ad", "card_index": 1, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 19.51 }, { "name": "Cauliflower (Hoo Kosu)", "description": "Snow-white florets, perfect for curries & roasts!", "size": "1 Medium", "discount_percent": 19, "price_inr": 29, "mrp_inr": 36, "availability": "Available", "tag": "Ad", "card_index": 2, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 19.44 }, { "name": "Indian Tomato", "description": "Juicy, tangy & ideal for all Indian curries", "size": "500 g", "discount_percent": 20, "price_inr": 28, "mrp_inr": 35, "availability": "Available", "tag": "", "card_index": 3, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 20.0 }, { "name": "Onion (Eerulli)", "description": "Zero Sprouting, Zero Smut", "size": "1 kg", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Available", "tag": "", "card_index": 4, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "Bottle Gourd ( Sorekaayi)", "description": "Light, hydrating & perfect for soups or halwa", "size": "1 Small", "discount_percent": 18, "price_inr": 26, "mrp_inr": 32, "availability": "Available", "tag": "Ad", "card_index": 5, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 18.75 }, { "name": "Carrot", "description": "Crunchy, vitamin-packed & perfect raw or cooked", "size": "500 g", "discount_percent": 19, "price_inr": 41, "mrp_inr": 51, "availability": "Available", "tag": "Ad", "card_index": 6, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 10, "computed_discount_percent": 19.61 }, { "name": "Cluster Beans (Gorikayi)", "description": "Fiber-packed, fresh, perfect for stir-fries & curries", "size": "250 g", "discount_percent": 21, "price_inr": 18, "mrp_inr": 23, "availability": "Available", "tag": "", "card_index": 7, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 5, "computed_discount_percent": 21.74 }, { "name": "Lady's Finger (Bendekaayi)", "description": "Fiber-rich, fresh & great for bhindi fry or curry", "size": "250 g x 2", "discount_percent": 26, "price_inr": 22, "mrp_inr": 30, "availability": "Available", "tag": "", "card_index": 8, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 26.67 }, { "name": "nectr Ooty Carrot", "description": "", "size": "4 Pieces", "discount_percent": 20, "price_inr": 51, "mrp_inr": 64, "availability": "Available", "tag": "Ad", "card_index": 9, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 13, "computed_discount_percent": 20.31 }, { "name": "Onion, Potato & Desi Tomato", "description": "Perfect for Indian home-cooked meals", "size": "1 Combo", "discount_percent": 20, "price_inr": 114, "mrp_inr": 143, "availability": "Available", "tag": "", "card_index": 10, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 29, "computed_discount_percent": 20.28 }, { "name": "English Cucumber - Protected Cultivation", "description": "Crisp and fresh cucumbers from hydroponic farming", "size": "500 g", "discount_percent": 20, "price_inr": 32, "mrp_inr": 40, "availability": "Available", "tag": "", "card_index": 11, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 20.0 }, { "name": "Coccinia (Tondekaayi)", "description": "Low-cal, crisp, ideal for stir-fry & sambar", "size": "250 g", "discount_percent": 21, "price_inr": 11, "mrp_inr": 14, "availability": "Available", "tag": "", "card_index": 12, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 3, "computed_discount_percent": 21.43 }, { "name": "French Beans (Bili Hurulikaayi)", "description": "Crisp, fiber-rich & great for dry sabzis", "size": "250 g", "discount_percent": 20, "price_inr": 32, "mrp_inr": 40, "availability": "Available", "tag": "", "card_index": 13, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 20.0 }, { "name": "Hybrid Tomato", "description": "Fresh, firm & great in gravies or sauces", "size": "500 g", "discount_percent": 17, "price_inr": 32, "mrp_inr": 39, "availability": "Available", "tag": "", "card_index": 14, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 17.95 }, { "name": "Kateri Brinjal (Geeru Gundu Badanekaayi)", "description": "Firm, low-seed & tasty in stuffed or fried dishes", "size": "250 g", "discount_percent": 20, "price_inr": 16, "mrp_inr": 20, "availability": "Available", "tag": "", "card_index": 15, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 4, "computed_discount_percent": 20.0 }, { "name": "Sweet Potato (Sihi Genasu)", "description": "Iron-rich, sweet & tasty when roasted or boiled", "size": "500 g x 2", "discount_percent": 22, "price_inr": 48, "mrp_inr": 62, "availability": "Available", "tag": "", "card_index": 16, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 14, "computed_discount_percent": 22.58 }, { "name": "English Cucumber (Sowthekaayi)", "description": "Crisp, no seeds & perfect in salads or detox drinks", "size": "1 Pack", "discount_percent": 20, "price_inr": 28, "mrp_inr": 35, "availability": "Available", "tag": "", "card_index": 17, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 20.0 }, { "name": "Drumstick (Nuggekaayi)", "description": "Nutrient-rich moringa pods, perfect for sambar & Soups!", "size": "2 Pieces x 2", "discount_percent": 26, "price_inr": 28, "mrp_inr": 38, "availability": "Available", "tag": "", "card_index": 18, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 10, "computed_discount_percent": 26.32 }, { "name": "Haricot Beans (Hurulikayi)", "description": "Soft, healthy beans ideal for soups and sautés", "size": "250 g", "discount_percent": 20, "price_inr": 28, "mrp_inr": 35, "availability": "Available", "tag": "", "card_index": 19, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 20.0 }, { "name": "Ooty Carrot", "description": "Sweet mountain-grown carrot with vibrant color!", "size": "250 g", "discount_percent": 19, "price_inr": 29, "mrp_inr": 36, "availability": "Available", "tag": "", "card_index": 20, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 19.44 }, { "name": "Broad Beans (Huralikaayi)", "description": "Nutritious, bold flavor-great in gravies or rice", "size": "250 g x 2", "discount_percent": 24, "price_inr": 50, "mrp_inr": 66, "availability": "Available", "tag": "", "card_index": 21, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 16, "computed_discount_percent": 24.24 }, { "name": "Potato (Aloo Gadde)", "description": "Agra’s finest potatoes; great for fries, mash & curries", "size": "1 kg", "discount_percent": 20, "price_inr": 27, "mrp_inr": 34, "availability": "Available", "tag": "", "card_index": 22, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 20.59 }, { "name": "Totapuri Raw Mango (Mavinahannu)", "description": "Carbide Free", "size": "1 Piece", "discount_percent": 18, "price_inr": 13, "mrp_inr": 16, "availability": "Available", "tag": "", "card_index": 23, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 3, "computed_discount_percent": 18.75 }, { "name": "White Radish (Moolangi)", "description": "Crunchy, Aids digestion, for salads & curries!", "size": "2 Pieces", "discount_percent": 20, "price_inr": 24, "mrp_inr": 30, "availability": "Available", "tag": "", "card_index": 24, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 20.0 }, { "name": "Bitter Gourd (Haagalakaayi)", "description": "Detox veggie, pure & best for fry or juice", "size": "1 Pack", "discount_percent": 20, "price_inr": 34, "mrp_inr": 43, "availability": "Available", "tag": "", "card_index": 25, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 9, "computed_discount_percent": 20.93 }, { "name": "Beetroot", "description": "Rich in iron, earthy sweetness, ideal for salads/sides", "size": "500 g", "discount_percent": 20, "price_inr": 27, "mrp_inr": 34, "availability": "Available", "tag": "", "card_index": 26, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 7, "computed_discount_percent": 20.59 }, { "name": "Onion, Potato & Hybrid Tomato", "description": "Basic essentials for daily cooking", "size": "1 Combo", "discount_percent": 19, "price_inr": 122, "mrp_inr": 151, "availability": "Available", "tag": "", "card_index": 27, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 29, "computed_discount_percent": 19.21 }, { "name": "Coconut (Thenginakayi)", "description": "Ideal for festivals, temple offerings, and cooking", "size": "1 Medium", "discount_percent": 20, "price_inr": 44, "mrp_inr": 55, "availability": "Available", "tag": "", "card_index": 28, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 11, "computed_discount_percent": 20.0 }, { "name": "Cowpea Beans (Karamani)", "description": "Protein-packed, perfect for stir-fries & curries", "size": "250 g", "discount_percent": 19, "price_inr": 21, "mrp_inr": 26, "availability": "Available", "tag": "", "card_index": 29, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 5, "computed_discount_percent": 19.23 }, { "name": "Sambar Onion (Sambar Eerulli)", "description": "Tiny, pure & ideal for authentic sambhar", "size": "250 g", "discount_percent": 19, "price_inr": 25, "mrp_inr": 31, "availability": "Available", "tag": "", "card_index": 30, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 19.35 }, { "name": "Raw Banana (Baalekaayi)", "description": "Energy-rich & best for curries or kofta", "size": "2 Pieces", "discount_percent": 19, "price_inr": 33, "mrp_inr": 41, "availability": "Available", "tag": "", "card_index": 31, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 19.51 }, { "name": "Pointed Gourd (Parwal)", "description": "Soft, nutritious & perfect in curry or fry", "size": "250 g", "discount_percent": 21, "price_inr": 30, "mrp_inr": 38, "availability": "Available", "tag": "", "card_index": 32, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 8, "computed_discount_percent": 21.05 }, { "name": "Green Capsicum (Dappa Menasinakaayi)", "description": "Crunchy, vitamin-rich bell pepper for any dish!", "size": "2 Medium", "discount_percent": 5, "price_inr": 19, "mrp_inr": 20, "availability": "Available", "tag": "", "card_index": 33, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 1, "computed_discount_percent": 5.0 }, { "name": "Curry Leaves & Coriander Leaves", "description": "Aromatic herbs for Indian dishes", "size": "1 Combo", "discount_percent": 22, "price_inr": 21, "mrp_inr": 27, "availability": "Available", "tag": "", "card_index": 34, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 22.22 }, { "name": "Mint Leaves & Coriander Leaves", "description": "Fresh herbs for garnishing", "size": "1 Combo", "discount_percent": 22, "price_inr": 21, "mrp_inr": 27, "availability": "Available", "tag": "", "card_index": 35, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 22.22 }, { "name": "Hybrid Tomato & Onion", "description": "Classic combo for all cuisines", "size": "1 Combo", "discount_percent": 19, "price_inr": 63, "mrp_inr": 78, "availability": "Available", "tag": "", "card_index": 36, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 15, "computed_discount_percent": 19.23 }, { "name": "Curry Leaves & Green Chilli", "description": "Perfect base for flavorful dishes", "size": "1 Combo", "discount_percent": 22, "price_inr": 21, "mrp_inr": 27, "availability": "Available", "tag": "", "card_index": 37, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 6, "computed_discount_percent": 22.22 }, { "name": "Garlic & Ginger", "description": "Spice blend for flavor and aroma", "size": "1 Combo", "discount_percent": 17, "price_inr": 81, "mrp_inr": 98, "availability": "Available", "tag": "", "card_index": 38, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 17, "computed_discount_percent": 17.35 }, { "name": "Beetroot & Carrot", "description": "Bright veggies for salads", "size": "1 Combo", "discount_percent": 20, "price_inr": 68, "mrp_inr": 85, "availability": "Available", "tag": "", "card_index": 39, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 17, "computed_discount_percent": 20.0 }, { "name": "Raw Mango (Mavinakayi)", "description": "Carbide Free", "size": "2 Pieces", "discount_percent": 20, "price_inr": 19, "mrp_inr": 24, "availability": "Available", "tag": "", "card_index": 40, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 5, "computed_discount_percent": 20.83 }, { "name": "Herbs Mix", "description": "Fresh herbs for seasoning", "size": "1 Combo", "discount_percent": 22, "price_inr": 31, "mrp_inr": 40, "availability": "Available", "tag": "", "card_index": 41, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 9, "computed_discount_percent": 22.5 }, { "name": "Snake Gourd (Padavalakaayi)", "description": "High-fiber, fresh & great for dry curry or stir-fry", "size": "2 Pieces x 2", "discount_percent": 24, "price_inr": 38, "mrp_inr": 50, "availability": "Available", "tag": "", "card_index": 42, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 12, "computed_discount_percent": 24.0 }, { "name": "Yellow Zucchini", "description": "Bright, juicy & great in salad or stir-fry", "size": "1 Piece", "discount_percent": 20, "price_inr": 38, "mrp_inr": 48, "availability": "Available", "tag": "", "card_index": 43, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 10, "computed_discount_percent": 20.83 }, { "name": "Forest Bitter Gourd (Kaadu Hagalakaayi)", "description": "Wild, medicinal & ideal for bitter stir-fries", "size": "250 g", "discount_percent": 20, "price_inr": 34, "mrp_inr": 43, "availability": "Available", "tag": "", "card_index": 44, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 9, "computed_discount_percent": 20.93 }, { "name": "Sambar Veg Combo", "description": "Drumstick, Brinjal, Raw Banana and Pumpkin Fresh veggies combo for Vishu festive cooking", "size": "1 Combo", "discount_percent": 20, "price_inr": 106, "mrp_inr": 133, "availability": "Available", "tag": "", "card_index": 45, "category": "Fresh Vegetables", "delivery_time": "22 MINS", "discount_amount_inr": 27, "computed_discount_percent": 20.3 }, { "name": "Snibs Snack Tomatoes(Mixed Colour)", "description": "Sweet, vibrant, healthy for kids & snacking", "size": "250 g", "discount_percent": 20, "price_inr": 92, "mrp_inr": 115, "availability": "Sold Out", "tag": "", "card_index": 46, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 23, "computed_discount_percent": 20.0 }, { "name": "nectr Baby potato (Chemical Free)", "description": "Cleaner Fresher Sweeter", "size": "500 g", "discount_percent": 20, "price_inr": 35, "mrp_inr": 44, "availability": "Sold Out", "tag": "", "card_index": 47, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 9, "computed_discount_percent": 20.45 }, { "name": "Pluckk Ozone Washed Hybrid Tomato", "description": "Pesticide-Free", "size": "500 g", "discount_percent": 20, "price_inr": 42, "mrp_inr": 53, "availability": "Sold Out", "tag": "", "card_index": 48, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 11, "computed_discount_percent": 20.75 }, { "name": "Baby Potato (Chikka Aloo Gadde)", "description": "Tender, buttery gems for perfect roasting!", "size": "500 g x 2", "discount_percent": 23, "price_inr": 52, "mrp_inr": 68, "availability": "Sold Out", "tag": "", "card_index": 49, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 16, "computed_discount_percent": 23.53 }, { "name": "Red Bell Pepper (Kempu Dappa Menasinakaayi)", "description": "Vitamin-rich & great for salads, grills & pasta", "size": "1 Piece", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Sold Out", "tag": "", "card_index": 50, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "Long Purple Brinjal (Udda Badanekaayi)", "description": "Soft, tasty & ideal for fries, curries", "size": "250 g x 2", "discount_percent": 24, "price_inr": 44, "mrp_inr": 58, "availability": "Sold Out", "tag": "", "card_index": 51, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 14, "computed_discount_percent": 24.14 }, { "name": "nectr Coconut (Chemical Free)", "description": "", "size": "1 Piece", "discount_percent": 20, "price_inr": 59, "mrp_inr": 74, "availability": "Sold Out", "tag": "Upgrade", "card_index": 52, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 15, "computed_discount_percent": 20.27 }, { "name": "nectr Small Green Zucchini (Chemical Free)", "description": "Fresher Taste, Firmer Bite", "size": "2 Pieces", "discount_percent": 19, "price_inr": 109, "mrp_inr": 136, "availability": "Sold Out", "tag": "", "card_index": 53, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 27, "computed_discount_percent": 19.85 }, { "name": "Broccoli", "description": "Rich in fiber, fresh & perfect for stir-fries", "size": "1 Piece", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Sold Out", "tag": "", "card_index": 54, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "nectr Broccoli (Chemical Free)", "description": "Fresher Crispier Taste", "size": "1 Piece", "discount_percent": 19, "price_inr": 65, "mrp_inr": 81, "availability": "Sold Out", "tag": "", "card_index": 55, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 16, "computed_discount_percent": 19.75 }, { "name": "nectr Red & Yellow Bell Peppers (Chemical Free)", "description": "", "size": "2 Pieces", "discount_percent": 19, "price_inr": 81, "mrp_inr": 101, "availability": "Sold Out", "tag": "Upgrade", "card_index": 56, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 20, "computed_discount_percent": 19.8 }, { "name": "nectr Small Yellow Zucchini (Chemical Free)", "description": "Fresher Taste, Firmer Bite", "size": "2 Pieces", "discount_percent": 19, "price_inr": 109, "mrp_inr": 136, "availability": "Sold Out", "tag": "", "card_index": 57, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 27, "computed_discount_percent": 19.85 }, { "name": "Pluckk Ozone Washed Green Capsicum", "description": "Pesticide-Free", "size": "250 g", "discount_percent": 19, "price_inr": 37, "mrp_inr": 46, "availability": "Sold Out", "tag": "", "card_index": 58, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 9, "computed_discount_percent": 19.57 }, { "name": "Freshcon Cooked Rajma & Black Chickpeas", "description": "Quick, high in protein, perfect for Indian dishes.", "size": "1 Combo", "discount_percent": 20, "price_inr": 136, "mrp_inr": 170, "availability": "Sold Out", "tag": "", "card_index": 59, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 34, "computed_discount_percent": 20.0 }, { "name": "Pluckk Raw Mango Sliced", "description": "Freshly sliced mango with bold tang, Salt & chilli powder mix sachet included for extra flavor", "size": "200 g", "discount_percent": 20, "price_inr": 95, "mrp_inr": 119, "availability": "Sold Out", "tag": "", "card_index": 60, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 24, "computed_discount_percent": 20.17 }, { "name": "nectr Bottle Gourd (Chemical Free)", "description": "", "size": "1 Piece", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Sold Out", "tag": "Upgrade", "card_index": 61, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "nectr Raw Banana (Chemical Free)", "description": "", "size": "3 Pieces", "discount_percent": 20, "price_inr": 55, "mrp_inr": 69, "availability": "Sold Out", "tag": "Upgrade", "card_index": 62, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 14, "computed_discount_percent": 20.29 }, { "name": "nectr English Cucumber (Chemical Free)", "description": "", "size": "4 Pieces", "discount_percent": 20, "price_inr": 28, "mrp_inr": 35, "availability": "Sold Out", "tag": "Upgrade", "card_index": 63, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 7, "computed_discount_percent": 20.0 }, { "name": "nectr Red Cabbage (Chemical Free)", "description": "", "size": "1 Piece", "discount_percent": 20, "price_inr": 62, "mrp_inr": 78, "availability": "Sold Out", "tag": "Upgrade", "card_index": 64, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 16, "computed_discount_percent": 20.51 }, { "name": "nectr Green Cucumber (Chemical Free)", "description": "Crisper Bite, Fewer Seeds", "size": "3 Pieces", "discount_percent": 20, "price_inr": 46, "mrp_inr": 58, "availability": "Sold Out", "tag": "", "card_index": 65, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 12, "computed_discount_percent": 20.69 }, { "name": "Cucumber", "description": "Fresh, juicy & best in salads or chutneys", "size": "2 Pieces x 2", "discount_percent": 20, "price_inr": 32, "mrp_inr": 40, "availability": "Sold Out", "tag": "", "card_index": 66, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.0 }, { "name": "Onion -Value Pack (Eerulli)", "description": "Zero Sprouting, Zero Smut", "size": "3 kg", "discount_percent": 18, "price_inr": 92, "mrp_inr": 113, "availability": "Sold Out", "tag": "", "card_index": 67, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 21, "computed_discount_percent": 18.58 }, { "name": "Round Gourd (Dundagina Sorekaayi)", "description": "Mild, easy-to-digest & ideal for dry sabzi", "size": "250 g", "discount_percent": 20, "price_inr": 39, "mrp_inr": 49, "availability": "Sold Out", "tag": "", "card_index": 68, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 10, "computed_discount_percent": 20.41 }, { "name": "nectr Indian Tomato (Chemical Free)", "description": "", "size": "8 Pieces", "discount_percent": 19, "price_inr": 53, "mrp_inr": 66, "availability": "Sold Out", "tag": "Upgrade", "card_index": 69, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 13, "computed_discount_percent": 19.7 }, { "name": "Pluckk Ozone Washed Desi Tomato", "description": "Pesticide-Free", "size": "500 g", "discount_percent": 20, "price_inr": 42, "mrp_inr": 53, "availability": "Sold Out", "tag": "", "card_index": 70, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 11, "computed_discount_percent": 20.75 }, { "name": "nectr Haricot Beans (Chemical Free)", "description": "Stringless, Fresher Taste", "size": "250 g", "discount_percent": 20, "price_inr": 35, "mrp_inr": 44, "availability": "Sold Out", "tag": "", "card_index": 71, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 9, "computed_discount_percent": 20.45 }, { "name": "Freshcon Cooked Chickpeas & Sweetcorn", "description": "Convenient, great for salads or hummus.", "size": "1 Combo", "discount_percent": 20, "price_inr": 136, "mrp_inr": 170, "availability": "Sold Out", "tag": "", "card_index": 72, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 34, "computed_discount_percent": 20.0 }, { "name": "Yam Portion by Urban Harvest", "description": "Pre-cut, clean & easy for sabzi or roast", "size": "250 g", "discount_percent": 20, "price_inr": 68, "mrp_inr": 85, "availability": "Sold Out", "tag": "", "card_index": 73, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 17, "computed_discount_percent": 20.0 }, { "name": "nectr Hybrid Tomato (Chemical Free)", "description": "Redder Colour, Firmer, Consistent", "size": "8 Pieces", "discount_percent": 20, "price_inr": 55, "mrp_inr": 69, "availability": "Sold Out", "tag": "", "card_index": 74, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 14, "computed_discount_percent": 20.29 }, { "name": "nectr Capsicum Green (Chemical Free)", "description": "", "size": "2 Pieces", "discount_percent": 20, "price_inr": 38, "mrp_inr": 48, "availability": "Sold Out", "tag": "Upgrade", "card_index": 75, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 10, "computed_discount_percent": 20.83 }, { "name": "Potato (Aloo Gadde) Value Pack", "description": "Versatile Vegetable, Cooking Staple.", "size": "3 kg", "discount_percent": 20, "price_inr": 78, "mrp_inr": 98, "availability": "Sold Out", "tag": "", "card_index": 76, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 20, "computed_discount_percent": 20.41 }, { "name": "nectr Radish", "description": "Cleaner Fresher Crisper", "size": "2 Pieces", "discount_percent": 19, "price_inr": 25, "mrp_inr": 31, "availability": "Sold Out", "tag": "", "card_index": 77, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 6, "computed_discount_percent": 19.35 }, { "name": "Freshcon Cooked Rajma & Sweetcorn", "description": "Quick, high in protein, perfect for Indian dishes.", "size": "1 Combo", "discount_percent": 20, "price_inr": 136, "mrp_inr": 170, "availability": "Sold Out", "tag": "", "card_index": 78, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 34, "computed_discount_percent": 20.0 }, { "name": "Green Zucchini", "description": "Low-cal, tender & best in grills or pasta", "size": "1 Piece", "discount_percent": 20, "price_inr": 34, "mrp_inr": 43, "availability": "Sold Out", "tag": "", "card_index": 79, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 9, "computed_discount_percent": 20.93 }, { "name": "nectr Sweet Potato (Chemical Free)", "description": "Unblemished skin with uniform flesh colour", "size": "500 g", "discount_percent": 20, "price_inr": 27, "mrp_inr": 34, "availability": "Sold Out", "tag": "", "card_index": 80, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 7, "computed_discount_percent": 20.59 }, { "name": "nectr Onion (Chemical Free)", "description": "", "size": "1 kg", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Sold Out", "tag": "Upgrade", "card_index": 81, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "White Onion (Bili Eerulli)", "description": "Sweet, mild onion ideal for salads & salsas!", "size": "500 g", "discount_percent": 20, "price_inr": 54, "mrp_inr": 68, "availability": "Sold Out", "tag": "", "card_index": 82, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 14, "computed_discount_percent": 20.59 }, { "name": "Yellow Bell Pepper (Haladi Dappa Menasinakaayi)", "description": "Sweet, crisp & adds color to stir-fry or salad", "size": "1 Piece", "discount_percent": 20, "price_inr": 31, "mrp_inr": 39, "availability": "Sold Out", "tag": "", "card_index": 83, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 8, "computed_discount_percent": 20.51 }, { "name": "Red & Yellow Bell Pepper - Protected Cultivation", "description": "Fresh bell peppers grown in a safe environment", "size": "2 Pieces", "discount_percent": 20, "price_inr": 62, "mrp_inr": 78, "availability": "Sold Out", "tag": "", "card_index": 84, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 16, "computed_discount_percent": 20.51 }, { "name": "Colocasia (Arvi)", "description": "Iron-rich, soft, tasty in curries", "size": "250 g x 2", "discount_percent": 25, "price_inr": 36, "mrp_inr": 48, "availability": "Sold Out", "tag": "", "card_index": 85, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 12, "computed_discount_percent": 25.0 }, { "name": "Freshcon Cooked Chickpeas & Black Chickpeas", "description": "Convenient, great for salads or hummus.", "size": "1 Combo", "discount_percent": 20, "price_inr": 136, "mrp_inr": 170, "availability": "Sold Out", "tag": "", "card_index": 86, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 34, "computed_discount_percent": 20.0 }, { "name": "nectr Ridge Gourd (Chemical Free)", "description": "More Tender, Perfectly Grown", "size": "1 Piece", "discount_percent": 19, "price_inr": 21, "mrp_inr": 26, "availability": "Sold Out", "tag": "Upgrade", "card_index": 87, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 5, "computed_discount_percent": 19.23 }, { "name": "nectr Kateri Brinjal (Chemical Free)", "description": "", "size": "250 g", "discount_percent": 20, "price_inr": 20, "mrp_inr": 25, "availability": "Sold Out", "tag": "Upgrade", "card_index": 88, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 5, "computed_discount_percent": 20.0 }, { "name": "Chandramukhi Potato (Aloo Gadde)", "description": "Creamy texture ideal for mashing & roasting!", "size": "500 g", "discount_percent": 20, "price_inr": 56, "mrp_inr": 70, "availability": "Sold Out", "tag": "", "card_index": 89, "category": "Fresh Vegetables", "delivery_time": "", "discount_amount_inr": 14, "computed_discount_percent": 20.0 }]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185# Swiggy Instamart Fresh Vegetables extraction
Source: active browser page context and current screenshot.
## Summary- Total cards extracted: 89- Available cards: 45- Sold out cards: 44- Upgrade-tagged sold-out cards: 11- Ad-tagged available cards: 5- Cheapest item: Coccinia (Tondekaayi) (250 g) - ₹11, 21% OFF- Most expensive item: Freshcon Cooked Rajma & Black Chickpeas (1 Combo) - ₹136, 20% OFF- Highest discount: Lady's Finger (Bendekaayi) (250 g x 2) - ₹22, 26% OFF- Lowest discount: Green Capsicum (Dappa Menasinakaayi) (2 Medium) - ₹19, 5% OFF- Average price: ₹47.91- Median price: ₹35- Average discount: 20.01%
## Availability- Available: 45- Sold Out: 44
## Tags- Ad: 5- None: 73- Upgrade: 11
## Top 10 by price- Freshcon Cooked Rajma & Black Chickpeas (1 Combo) - ₹136, 20% OFF- Freshcon Cooked Chickpeas & Sweetcorn (1 Combo) - ₹136, 20% OFF- Freshcon Cooked Rajma & Sweetcorn (1 Combo) - ₹136, 20% OFF- Freshcon Cooked Chickpeas & Black Chickpeas (1 Combo) - ₹136, 20% OFF- Onion, Potato & Hybrid Tomato (1 Combo) - ₹122, 19% OFF- Onion, Potato & Desi Tomato (1 Combo) - ₹114, 20% OFF- nectr Small Green Zucchini (Chemical Free) (2 Pieces) - ₹109, 19% OFF- nectr Small Yellow Zucchini (Chemical Free) (2 Pieces) - ₹109, 19% OFF- Sambar Veg Combo (1 Combo) - ₹106, 20% OFF- Pluckk Raw Mango Sliced (200 g) - ₹95, 20% OFF
## Top 10 by discount percent- Drumstick (Nuggekaayi) (2 Pieces x 2) - ₹28, 26% OFF, discount amount ₹10- Lady's Finger (Bendekaayi) (250 g x 2) - ₹22, 26% OFF, discount amount ₹8- Colocasia (Arvi) (250 g x 2) - ₹36, 25% OFF, discount amount ₹12- Broad Beans (Huralikaayi) (250 g x 2) - ₹50, 24% OFF, discount amount ₹16- Long Purple Brinjal (Udda Badanekaayi) (250 g x 2) - ₹44, 24% OFF, discount amount ₹14- Snake Gourd (Padavalakaayi) (2 Pieces x 2) - ₹38, 24% OFF, discount amount ₹12- Baby Potato (Chikka Aloo Gadde) (500 g x 2) - ₹52, 23% OFF, discount amount ₹16- Sweet Potato (Sihi Genasu) (500 g x 2) - ₹48, 22% OFF, discount amount ₹14- Herbs Mix (1 Combo) - ₹31, 22% OFF, discount amount ₹9- Curry Leaves & Coriander Leaves (1 Combo) - ₹21, 22% OFF, discount amount ₹6
## Master field inventory
| Field | Meaning | Type ||---|---|---|| card_index | Sequential card number in extracted order | integer || category | Page category | string || name | Product card title exactly as captured from page text | string || description | Short product description, blank where not shown | string || size | Pack size / quantity shown on card | string || delivery_time | Delivery ETA where shown | string || tag | Visible label such as Ad or Upgrade | string || availability | Available or Sold Out | enum || discount_percent | Displayed discount percent | integer || price_inr | Displayed selling price | integer || mrp_inr | Displayed struck-through/original price | integer || discount_amount_inr | MRP minus selling price | integer || computed_discount_percent | Computed discount from MRP and price | float |
## Size distribution
| Size | Count ||---|---:|| 250 g | 16 || 1 Combo | 14 || 500 g | 11 || 1 Piece | 11 || 2 Pieces | 9 || 250 g x 2 | 4 || 1 kg | 3 || 2 Pieces x 2 | 3 || 2 Medium | 2 || 1 Medium | 2 || 4 Pieces | 2 || 500 g x 2 | 2 || 1 Pack | 2 || 3 Pieces | 2 || 3 kg | 2 || 8 Pieces | 2 || 1 Small | 1 || 200 g | 1 |
## Exact structured extraction
| # | Name | Size | Availability | Discount | Price | MRP ||---:|---|---|---|---:|---:|---:|| 1 | Ridge Gourd (Herekaayi) | 2 Medium | Available | 19% | ₹33 | ₹41 || 2 | Cauliflower (Hoo Kosu) | 1 Medium | Available | 19% | ₹29 | ₹36 || 3 | Indian Tomato | 500 g | Available | 20% | ₹28 | ₹35 || 4 | Onion (Eerulli) | 1 kg | Available | 20% | ₹31 | ₹39 || 5 | Bottle Gourd ( Sorekaayi) | 1 Small | Available | 18% | ₹26 | ₹32 || 6 | Carrot | 500 g | Available | 19% | ₹41 | ₹51 || 7 | Cluster Beans (Gorikayi) | 250 g | Available | 21% | ₹18 | ₹23 || 8 | Lady's Finger (Bendekaayi) | 250 g x 2 | Available | 26% | ₹22 | ₹30 || 9 | nectr Ooty Carrot | 4 Pieces | Available | 20% | ₹51 | ₹64 || 10 | Onion, Potato & Desi Tomato | 1 Combo | Available | 20% | ₹114 | ₹143 || 11 | English Cucumber - Protected Cultivation | 500 g | Available | 20% | ₹32 | ₹40 || 12 | Coccinia (Tondekaayi) | 250 g | Available | 21% | ₹11 | ₹14 || 13 | French Beans (Bili Hurulikaayi) | 250 g | Available | 20% | ₹32 | ₹40 || 14 | Hybrid Tomato | 500 g | Available | 17% | ₹32 | ₹39 || 15 | Kateri Brinjal (Geeru Gundu Badanekaayi) | 250 g | Available | 20% | ₹16 | ₹20 || 16 | Sweet Potato (Sihi Genasu) | 500 g x 2 | Available | 22% | ₹48 | ₹62 || 17 | English Cucumber (Sowthekaayi) | 1 Pack | Available | 20% | ₹28 | ₹35 || 18 | Drumstick (Nuggekaayi) | 2 Pieces x 2 | Available | 26% | ₹28 | ₹38 || 19 | Haricot Beans (Hurulikayi) | 250 g | Available | 20% | ₹28 | ₹35 || 20 | Ooty Carrot | 250 g | Available | 19% | ₹29 | ₹36 || 21 | Broad Beans (Huralikaayi) | 250 g x 2 | Available | 24% | ₹50 | ₹66 || 22 | Potato (Aloo Gadde) | 1 kg | Available | 20% | ₹27 | ₹34 || 23 | Totapuri Raw Mango (Mavinahannu) | 1 Piece | Available | 18% | ₹13 | ₹16 || 24 | White Radish (Moolangi) | 2 Pieces | Available | 20% | ₹24 | ₹30 || 25 | Bitter Gourd (Haagalakaayi) | 1 Pack | Available | 20% | ₹34 | ₹43 || 26 | Beetroot | 500 g | Available | 20% | ₹27 | ₹34 || 27 | Onion, Potato & Hybrid Tomato | 1 Combo | Available | 19% | ₹122 | ₹151 || 28 | Coconut (Thenginakayi) | 1 Medium | Available | 20% | ₹44 | ₹55 || 29 | Cowpea Beans (Karamani) | 250 g | Available | 19% | ₹21 | ₹26 || 30 | Sambar Onion (Sambar Eerulli) | 250 g | Available | 19% | ₹25 | ₹31 || 31 | Raw Banana (Baalekaayi) | 2 Pieces | Available | 19% | ₹33 | ₹41 || 32 | Pointed Gourd (Parwal) | 250 g | Available | 21% | ₹30 | ₹38 || 33 | Green Capsicum (Dappa Menasinakaayi) | 2 Medium | Available | 5% | ₹19 | ₹20 || 34 | Curry Leaves & Coriander Leaves | 1 Combo | Available | 22% | ₹21 | ₹27 || 35 | Mint Leaves & Coriander Leaves | 1 Combo | Available | 22% | ₹21 | ₹27 || 36 | Hybrid Tomato & Onion | 1 Combo | Available | 19% | ₹63 | ₹78 || 37 | Curry Leaves & Green Chilli | 1 Combo | Available | 22% | ₹21 | ₹27 || 38 | Garlic & Ginger | 1 Combo | Available | 17% | ₹81 | ₹98 || 39 | Beetroot & Carrot | 1 Combo | Available | 20% | ₹68 | ₹85 || 40 | Raw Mango (Mavinakayi) | 2 Pieces | Available | 20% | ₹19 | ₹24 || 41 | Herbs Mix | 1 Combo | Available | 22% | ₹31 | ₹40 || 42 | Snake Gourd (Padavalakaayi) | 2 Pieces x 2 | Available | 24% | ₹38 | ₹50 || 43 | Yellow Zucchini | 1 Piece | Available | 20% | ₹38 | ₹48 || 44 | Forest Bitter Gourd (Kaadu Hagalakaayi) | 250 g | Available | 20% | ₹34 | ₹43 || 45 | Sambar Veg Combo | 1 Combo | Available | 20% | ₹106 | ₹133 || 46 | Snibs Snack Tomatoes(Mixed Colour) | 250 g | Sold Out | 20% | ₹92 | ₹115 || 47 | nectr Baby potato (Chemical Free) | 500 g | Sold Out | 20% | ₹35 | ₹44 || 48 | Pluckk Ozone Washed Hybrid Tomato | 500 g | Sold Out | 20% | ₹42 | ₹53 || 49 | Baby Potato (Chikka Aloo Gadde) | 500 g x 2 | Sold Out | 23% | ₹52 | ₹68 || 50 | Red Bell Pepper (Kempu Dappa Menasinakaayi) | 1 Piece | Sold Out | 20% | ₹31 | ₹39 || 51 | Long Purple Brinjal (Udda Badanekaayi) | 250 g x 2 | Sold Out | 24% | ₹44 | ₹58 || 52 | nectr Coconut (Chemical Free) | 1 Piece | Sold Out | 20% | ₹59 | ₹74 || 53 | nectr Small Green Zucchini (Chemical Free) | 2 Pieces | Sold Out | 19% | ₹109 | ₹136 || 54 | Broccoli | 1 Piece | Sold Out | 20% | ₹31 | ₹39 || 55 | nectr Broccoli (Chemical Free) | 1 Piece | Sold Out | 19% | ₹65 | ₹81 || 56 | nectr Red & Yellow Bell Peppers (Chemical Free) | 2 Pieces | Sold Out | 19% | ₹81 | ₹101 || 57 | nectr Small Yellow Zucchini (Chemical Free) | 2 Pieces | Sold Out | 19% | ₹109 | ₹136 || 58 | Pluckk Ozone Washed Green Capsicum | 250 g | Sold Out | 19% | ₹37 | ₹46 || 59 | Freshcon Cooked Rajma & Black Chickpeas | 1 Combo | Sold Out | 20% | ₹136 | ₹170 || 60 | Pluckk Raw Mango Sliced | 200 g | Sold Out | 20% | ₹95 | ₹119 || 61 | nectr Bottle Gourd (Chemical Free) | 1 Piece | Sold Out | 20% | ₹31 | ₹39 || 62 | nectr Raw Banana (Chemical Free) | 3 Pieces | Sold Out | 20% | ₹55 | ₹69 || 63 | nectr English Cucumber (Chemical Free) | 4 Pieces | Sold Out | 20% | ₹28 | ₹35 || 64 | nectr Red Cabbage (Chemical Free) | 1 Piece | Sold Out | 20% | ₹62 | ₹78 || 65 | nectr Green Cucumber (Chemical Free) | 3 Pieces | Sold Out | 20% | ₹46 | ₹58 || 66 | Cucumber | 2 Pieces x 2 | Sold Out | 20% | ₹32 | ₹40 || 67 | Onion -Value Pack (Eerulli) | 3 kg | Sold Out | 18% | ₹92 | ₹113 || 68 | Round Gourd (Dundagina Sorekaayi) | 250 g | Sold Out | 20% | ₹39 | ₹49 || 69 | nectr Indian Tomato (Chemical Free) | 8 Pieces | Sold Out | 19% | ₹53 | ₹66 || 70 | Pluckk Ozone Washed Desi Tomato | 500 g | Sold Out | 20% | ₹42 | ₹53 || 71 | nectr Haricot Beans (Chemical Free) | 250 g | Sold Out | 20% | ₹35 | ₹44 || 72 | Freshcon Cooked Chickpeas & Sweetcorn | 1 Combo | Sold Out | 20% | ₹136 | ₹170 || 73 | Yam Portion by Urban Harvest | 250 g | Sold Out | 20% | ₹68 | ₹85 || 74 | nectr Hybrid Tomato (Chemical Free) | 8 Pieces | Sold Out | 20% | ₹55 | ₹69 || 75 | nectr Capsicum Green (Chemical Free) | 2 Pieces | Sold Out | 20% | ₹38 | ₹48 || 76 | Potato (Aloo Gadde) Value Pack | 3 kg | Sold Out | 20% | ₹78 | ₹98 || 77 | nectr Radish | 2 Pieces | Sold Out | 19% | ₹25 | ₹31 || 78 | Freshcon Cooked Rajma & Sweetcorn | 1 Combo | Sold Out | 20% | ₹136 | ₹170 || 79 | Green Zucchini | 1 Piece | Sold Out | 20% | ₹34 | ₹43 || 80 | nectr Sweet Potato (Chemical Free) | 500 g | Sold Out | 20% | ₹27 | ₹34 || 81 | nectr Onion (Chemical Free) | 1 kg | Sold Out | 20% | ₹31 | ₹39 || 82 | White Onion (Bili Eerulli) | 500 g | Sold Out | 20% | ₹54 | ₹68 || 83 | Yellow Bell Pepper (Haladi Dappa Menasinakaayi) | 1 Piece | Sold Out | 20% | ₹31 | ₹39 || 84 | Red & Yellow Bell Pepper - Protected Cultivation | 2 Pieces | Sold Out | 20% | ₹62 | ₹78 || 85 | Colocasia (Arvi) | 250 g x 2 | Sold Out | 25% | ₹36 | ₹48 || 86 | Freshcon Cooked Chickpeas & Black Chickpeas | 1 Combo | Sold Out | 20% | ₹136 | ₹170 || 87 | nectr Ridge Gourd (Chemical Free) | 1 Piece | Sold Out | 19% | ₹21 | ₹26 || 88 | nectr Kateri Brinjal (Chemical Free) | 250 g | Sold Out | 20% | ₹20 | ₹25 || 89 | Chandramukhi Potato (Aloo Gadde) | 500 g | Sold Out | 20% | ₹56 | ₹70 |1234567891011121314151617181920212223242526272829303132# Fly.io configuration — https://fly.io/docs/reference/configuration/# # First-time setup:# flyctl launch --dockerfile ./Dockerfile# flyctl volumes create shopstack_data --region <your-region> --size 1# flyctl deploy
app = "shopstack"
[build] dockerfile = "Dockerfile"
[env] SHOPSTACK_OFF_THE_GRID = "true" # Optional: uncomment for cloud-backed planning # SHOPSTACK_PLANNER_BACKEND = "huggingface"
[http_service] internal_port = 7860 force_https = true auto_stop_machines = false auto_start_machines = true min_machines_running = 1
[[mounts]] source = "shopstack_data" destination = "/app/data"
[[vm]] memory = "512mb" cpu_kind = "shared" cpus = 1123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166# Extracted freebuff session transcript
This document contains all user messages extracted from the available Copilot transcript file.
## Extracted user messages
---
**Timestamp:** 2026-06-06T18:19:33.475Z
- git add -A, commit with detailed msg and push
---
**Timestamp:** 2026-06-06T18:24:36.807Z
- [Terminal 6a38ac30-41d7-4a43-bb92-a6b88fe18d34 notification: command completed with exit code 1. The terminal has been cleaned up.]- Terminal output:- ➜ shopstack git:(main) ✗ git status --short && echo '---' && git diff --stat- M AGENTS.md- M shopstack/decisions.py- M shopstack/services/__init__.py- M shopstack/services/shopping.py- M shopstack/ui/screens/dashboard.py- M shopstack/ui/screens/other.py- M shopstack/ui/screens/shopping.py- M tests/test_local_provider.py- ?? .coverage- ?? .python-version- ?? shopstack/data/- ?? shopstack/services/dashboard.py- ?? shopstack/ui/screens/price.py- ?? tests/test_dashboard_service.py- ---- AGENTS.md | 7 ++-- shopstack/decisions.py | 4 +-- shopstack/services/__init__.py | 3 +- shopstack/services/shopping.py | 123 ++++++++++++++++++++++++++++++++++++++- shopstack/ui/screens/dashboard.py | 36 +++--------- shopstack/ui/screens/other.py | 3 +-- shopstack/ui/screens/shopping.py | 2 +- tests/test_local_provider.py | 9 ++-- 8 files changed, 153 insertions(+), 34 deletions(-)- ➜ shopstack git:(main) ✗ git status --short && echo '---' && ls -la .coverage .python-version 2>/dev/null && echo '---' && find shopstack/data -maxdepth 2 -type f | sed 's#^#FILE: #g' | head -50- M AGENTS.md- M shopstack/decisions.py- M shopstack/services/__init__.py- M shopstack/services/shopping.py- M shopstack/ui/screens/dashboard.py- M shopstack/ui/screens/other.py- M shopstack/ui/screens/shopping.py- M tests/test_local_provider.py- ?? .coverage- ?? .python-version- ?? shopstack/data/- ?? shopstack/services/dashboard.py- ?? shopstack/ui/screens/price.py- ?? tests/test_dashboard_service.py- ---- -rw-r--r-- 1 pranay 69632 Jun 6 23:47 .coverage- -rw-r--r-- 1 pranay 5 Jun 6 23:41 .python-version- ---- ➜ shopstack git:(main) ✗ git diff --name-status -- shopstack/services/dashboard.py tests/test_dashboard_service.py shopstack/ui/screens/price.py && echo '---' && git diff --stat- ---- AGENTS.md | 7 ++-- shopstack/decisions.py | 4 +-- shopstack/services/__init__.py | 3 +- shopstack/services/shopping.py | 123 ++++++++++++++++++++++++++++++++++++++- shopstack/ui/screens/dashboard.py | 36 +++--------- shopstack/ui/screens/other.py | 3 +-- shopstack/ui/screens/shopping.py | 2 +- tests/test_local_provider.py | 9 ++-- 8 files changed, 153 insertions(+), 34 deletions(-)- ➜ shopstack git:(main) ✗ git branch --show-current && git remote -v- main- origin https://github.com/pranaysuyash/shopstack.git (fetch)- origin https://github.com/pranaysuyash/shopstack.git (push)- ➜ shopstack git:(main) ✗ cd /Users/pranay/Projects/shopstack && git add -A && git commit -m "Add dashboard service, improve shopping UI flow, and update provider/tests- - - Add new shopstack/services/dashboard.py to centralize Today dashboard state assembly and service-level logic.- - Update shopstack/services/shopping.py to extend shopping list decision and data handling flows.- - Refresh shopstack/ui/screens/dashboard.py to wire dashboard service output and maintain UI render behavior.- - Adjust shopstack/ui/screens/other.py and shopstack/ui/screens/shopping.py for consistency with updated service flows.- - Update shopstack/decisions.py and shopstack/services/__init__.py to export new dashboard service wiring.- - Revise tests/test_local_provider.py for related provider behavior and add tests/test_dashboard_service.py for dashboard service logic.- - Stage incidental local environment files and coverage artifacts (.python-version, .coverage) along with new shopstack/data content as part of the working tree." && git push origin main- README synced: tests=371 passed in 13.23s, benchmarks=9 passed in 0.04s- [main 9b94483] Add dashboard service, improve shopping UI flow, and update provider/tests- 15 files changed, 402 insertions(+), 35 deletions(-)- create mode 100644 .coverage- create mode 100644 .python-version- create mode 100644 shopstack/data/models/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf- create mode 100644 shopstack/services/dashboard.py- create mode 100644 shopstack/ui/screens/price.py- create mode 100644 tests/test_dashboard_service.py- Enumerating objects: 39, done.- Counting objects: 100% (39/39), done.- Delta compression using up to 14 threads- Compressing objects: 100% (22/22), done.- Writing objects: 100% (25/25), 1.84 GiB | 21.32 MiB/s, done.- Total 25 (delta 14), reused 1 (delta 0), pack-reused 0 (from 0)- remote: Resolving deltas: 100% (14/14), completed with 12 local objects.- remote: error: Trace: 3a4fefd2ede8b6ac0afcfe7bb438c98f3e26507a25db453766610f49a09167b5- remote: error: See https://gh.io/lfs for more information.- remote: error: File shopstack/data/models/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf is 1925.83 MB; this exceeds GitHub's file size limit of 100.00 MB- remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.- To https://github.com/pranaysuyash/shopstack.git- ! [remote rejected] main -> main (pre-receive hook declined)- error: failed to push some refs to 'https://github.com/pranaysuyash/shopstack.git'- ---- **Timestamp:** 2026-06-06T18:25:48.879Z- not remove you idiot, add in gitignore those are model files we need for the project- ---- **Timestamp:** 2026-06-06T18:26:18.734Z- so git rm cached you do- ---- **Timestamp:** 2026-06-06T18:26:26.187Z- [Terminal 4dcc2458-96bb-442e-a38b-c52127bf0850 notification: command completed with exit code 1. The terminal has been cleaned up.]- Terminal output:- ➜ shopstack git:(main) ✗ git log -1 --oneline --decorate && echo '---' && git status --short- dfed3c4 (HEAD -> main, origin/main) feat: module registry, shared product constants, and service boundary extraction- ---- M AGENTS.md- M shopstack/decisions.py- M shopstack/services/__init__.py- M shopstack/services/shopping.py- M shopstack/ui/screens/dashboard.py- M shopstack/ui/screens/other.py- M shopstack/ui/screens/shopping.py- M tests/test_local_provider.py- ?? .coverage- ?? .python-version- ?? shopstack/data/- ?? shopstack/services/dashboard.py- ?? shopstack/ui/screens/price.py- ?? tests/test_dashboard_service.py- ➜ shopstack git:(main) ✗ cd /Users/pranay/Projects/shopstack && git add -A && git commit -m "Add dashboard service, improve shopping UI flow, and update provider/tests" -m "- Add new shopstack/services/dashboard.py to centralize dashboard state assembly.- - Update shopstack/services/shopping.py to extend shopping list decision and data handling flows.- - Refresh shopstack/ui/screens/dashboard.py to wire dashboard service output.- - Adjust shopstack/ui/screens/other.py and shopstack/ui/screens/shopping.py for consistency.- - Update shopstack/decisions.py and shopstack/services/__init__.py to export dashboard service wiring.- - Revise tests/test_local_provider.py and add tests/test_dashboard_service.py."- && git push origin main- README synced: tests=376 passed in 9.47s, benchmarks=9 passed in 0.03s- [main dd072ad] Add dashboard service, improve shopping UI flow, and update provider/tests- 4 files changed, 49 insertions(+), 18 deletions(-)- Enumerating objects: 50, done.- Counting objects: 100% (50/50), done.- Delta compression using up to 14 threads- Compressing objects: 100% (31/31), done.- Writing objects: 100% (34/34), 1.84 GiB | 20.42 MiB/s, done.- Total 34 (delta 21), reused 1 (delta 0), pack-reused 0 (from 0)- remote: Resolving deltas: 100% (21/21), completed with 14 local objects.- remote: error: Trace: 497176475a885e3f896f5c38638b99c29f6a742c9c0597611f74ef04fe92e0bd- remote: error: See https://gh.io/lfs for more information.- remote: error: File shopstack/data/models/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf is 1925.83 MB; this exceeds GitHub's file size limit of 100.00 MB- remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.- To https://github.com/pranaysuyash/shopstack.git- ! [remote rejected] main -> main (pre-receive hook declined)- error: failed to push some refs to 'https://github.com/pranaysuyash/shopstack.git'- ---- **Timestamp:** 2026-06-06T18:28:23.249Z- did you delete any model files?- ---- **Timestamp:** 2026-06-06T18:28:39.928Z- [Terminal 908ee070-bc56-487d-95bf-f4c5d7322586 notification: command completed with exit code 1. The terminal has been cleaned up.]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150# ShopStack Improvement Opportunities
> Date: 2026-06-13 > Scope: app-wide opportunities across product, UI, UX, infra, reliability, data, docs, and operating model. > Method: `motto_v3` pass over instruction stack, generated context, current code, recent worklogs, live app health, and test collection. > Evidence tiers: T1 = static inspection, T2 = targeted command/test, T4 = browser/runtime observation.
## Baseline Evidence
- T2: `/Users/pranay/Projects/agent-start --skip-index` regenerated `Docs/context/agent-start/*` and confirmed `motto_v3.md` is canonical.- T2: `uv run pytest tests/ --collect-only -q` collected 2490 tests in 35.84s with 2 import warnings.- T4: `curl http://127.0.0.1:7860/` returned 200.- T4: Playwright browser visit to `http://127.0.0.1:7860/` stayed on Gradio `Loading...` and logged `SyntaxError: Unexpected token ';'`.- T1: Current tree already has unrelated modified files: `scripts/demo_walkthrough.py`, `scripts/seed_walkthrough.py`, `shopstack/ui/screens/inventory.py`, `shopstack/ui/state/household.py`; final status also shows changes in `shopstack/ui/screens/consumption.py` and `shopstack/ui/screens/household_map.py`.
## P0 / P1: Must Fix First
1. **Browser hydration can fail while HTTP returns 200.** Evidence: Playwright saw only `Loading...`; console logged `SyntaxError: Unexpected token ';'`. Candidate seam: `app.py` registers `app.load(None, js=autocomplete_injector_js())` and `app.load(None, js=url_state_sync_js())`, while `shopstack/ui/components/js_helpers.py` says app-load JS should return a no-arg function expression but both helpers return bare `setTimeout(...)` statements. Fix path: wrap these helpers as `() => { ... }`, add a browser smoke test that asserts no console errors and that the Today tab text appears, then retest with Playwright.2. **The test suite lacks browser-hydration proof.** Evidence: 2490 tests collect, but the live browser still fails to hydrate. Existing tests assert JS strings contain fragments, not that Gradio can evaluate them. Fix path: add a Playwright smoke in CI/dev tooling that opens the app, fails on console errors, waits for `main-content`, and captures a screenshot.3. **Consumer UI still leaks engineering labels in action buttons and API descriptions.** Evidence: `Save Trace`, `Save Market Lens trace output`, `Save home scan trace output`, `canonical` table column, `Lot ID`, `Scene Type`, and `redacted JSONL` still appear across Market, Today, Pantry, and Memory seams. Some are hidden/internal, but several are visible. Fix path: create a UI-copy lint/check over visible `gr.*(label=...)`, `gr.Button(...)`, and table headers; keep API descriptions technical if needed, but hide them from consumer docs/routes unless developer mode.4. **Household permissioning is still architectural debt.** Evidence: Phase 9 handoff calls out that "any code can read/write any household"; current app has household switch state, SMS registry, community opt-in, and trace/user_id work, but no real auth or permission boundary. Fix path: define a `HouseholdContext`/membership service, thread it through DB write paths, and test cross-household denial cases before adding network sync or family sharing.5. **Silent exception swallowing hides product failures.** Evidence: many UI/service handlers catch broad `Exception` and return empty lists or terse HTML; examples include Today restock table returning `[]` on dashboard failure and Today intelligence returning raw unavailable text. Fix path: replace broad silent fallbacks with typed results, visible user-safe errors, trace/log entries, and operator diagnostics.6. **No undo model for mutation-heavy home workflows.** Evidence: confirmations exist for several destructive actions now, but consumption, batch use, receipt import, restore, move, and reconciliation still do not share a common undo/reversal event model. Fix path: add immutable inventory event ledger semantics plus "recent changes" reversal where safe; expose "Undo last change" for use/move/add flows.7. **PWA/custom shell remains fragile and needs live route smoke tests.** Evidence: prior handoff says Gradio 6 path interception made the custom shell unreachable at points, and the current project already had a PWA test lag around `/manifest.json` vs `/static/manifest.json`. Fix path: route-level smoke tests for `/manifest.json`, `/sw.js`, icons, service worker registration, and install metadata in the browser.8. **Docs are useful but internally contradictory and drift-prone.** Evidence: `Docs/issue_review_2026-06-13.md` banner says all P0/P1/P2 are closed while the body still contains old open findings; `Docs/FEATURES_STATUS.md` is dated 2026-06-07 and has later correction sections. Fix path: add a canonical current-state index with statuses generated from code/tests where possible; archive superseded status tables.
## Product And Feature Opportunities
9. **First-run onboarding UI should gate empty app state.** Service exists, but the product should show a household setup path when onboarding is incomplete.10. **Unify "Today intelligence", restock predictions, trip advisor, cook tonight, and Ask into one action queue.** Today risks becoming a stack of widgets instead of one household command center.11. **Make "Cook tonight" actionable from every use-soon item.** Each use-first row should offer "Cook with this", "Add missing ingredients", and "Mark used after cooking".12. **Add a real "I am at the store" mode.** Large touch targets, camera-first scan, list checklist, price compare, substitute, and receipt capture should live in one low-friction trip flow.13. **Turn receipt scan into a complete after-shopping flow.** Scan receipt, match to list, confirm substitutions, update pantry, save price observations, and show "what changed".14. **Add household member roles and attribution.** Track who added/used/moved items, allow child/guest modes, and separate "can view" from "can mutate".15. **Federated community price sync.** The local community pool is a foundation; opt-in anonymized sync is the network-value layer.16. **Trace-tuned parser loop.** Convert confirmed user actions and corrected parser previews into training/eval examples before trace TTL deletes useful data.17. **Improve SMS/WhatsApp quick-add UX.** Surface inbox setup, phone registration, last message, dispatch status, and retry in the app instead of leaving it mostly service-backed.18. **Voice memo UI.** Service exists; add a visible "hands busy" recording surface with session transcript, parsed commands, corrections, and undo.19. **Barcode nutrition enrichment.** Wire barcode/product identity to nutrition facts and household dietary goals.20. **Allergy and dietary guardrails.** Recipes, shopping suggestions, substitutions, and receipt imports should warn against household constraints.21. **Waste prevention by package-size recommendation.** Use historical waste to recommend smaller/larger pack sizes at buy time.22. **Budget mode.** Weekly/monthly budget, basket cost forecast, price-drop wait suggestions, and savings history.23. **Pantry freshness confidence.** Show whether a quantity is scanned, manually entered, inferred, stale, or low-confidence.24. **Storage-aware recommendations.** Buying advice should consider freezer/fridge/pantry capacity and suitable storage.25. **Recurring household routines.** Milk every 3 days, vegetables twice weekly, medicine reminders, cleaning supplies cadence.26. **Expiry label capture.** Camera OCR for expiry/manufacture dates with manual correction.27. **Photo-based shelf diff.** Before/after shelf scans should identify changes, not just produce a one-off scan result.28. **Smart shopping poster/share view.** Make the generated poster/checklist useful on phone screens, not only as an export artifact.29. **Global search/command palette.** Search items, recipes, stores, actions, and activity records from one box.30. **Saved filters and pinned views.** Families should pin "Fridge", "This week", "Kids snacks", "Medicine drawer", "Dinner under 30 min".31. **Offline-first conflict resolution.** Local file sync and future federation need clear "both devices changed this list" handling.32. **Import from common grocery exports.** Support retailer receipts, CSVs, and screenshots from Swiggy/Blinkit/Zepto/DMart.33. **Better demo/walkthrough data management.** Seed realistic household stories with reset, not generic demo blobs.34. **Launch/demo recording pack.** The walkthrough script should produce deterministic screenshots/video for submission and social.
## UI / UX Opportunities
35. **Fix app-load JS contract and add browser console tests.** This is the current blocker for live UI confidence.36. **Replace raw "Loading..." failure with a branded recovery shell.** If Gradio hydration fails, show a useful fallback with refresh, diagnostics, and local log hint.37. **Consumer-copy pass over all buttons/labels.** Replace "Trace", "canonical", "Lot ID", "Scene Type", "registry", and "JSONL" where visible.38. **Make Today less explanatory.** Phrases like "Trip advisor call below" and "rolled up into one ranked list" explain implementation, not user value.39. **Hide canonical columns.** Today restock rows should not expose a `canonical` column; use hidden state or map selected display names safely.40. **Improve empty states to suggest next action.** "No data yet" should become "Add your first 5 pantry staples" or "Scan a receipt".41. **Show last-updated timestamps.** Market data, weather, community medians, inventory scans, and Today intelligence need freshness markers.42. **Use consistent section naming.** "Use Soon", "Use First", "Quick use", "Mark used", "Consume" should collapse into one consumer vocabulary.43. **Add inline help/tooltips for advanced fields.** Lot IDs, batch syntax, scene type, backup restore, community opt-in, and SMS setup need compact help.44. **Make slow operations visibly cancellable/retriable.** Scans, OCR, planner, poster generation, imports, and model calls need retry and timeout UX.45. **Disable action buttons until prerequisites exist.** Confirm/skip/save buttons after scans should be disabled or explain why nothing can happen yet.46. **Preview destructive changes before confirm.** Show exactly what will be moved, consumed, restored, or added.47. **Add undo toast where reversal is safe.** Confirm dialogs prevent some accidents; undo handles "oops" after an intentional click.48. **Improve mobile layout with real viewport QA.** Test 390px/430px mobile, 768px tablet, 1024px tablet landscape, and 1440px desktop.49. **Add one-handed store mode.** Sticky bottom action bar, checklist progress, scan button, and large list rows.50. **Strengthen accessibility beyond static checks.** Keyboard-only walkthrough, screen-reader smoke, aria-live assertions in browser, and focus return after dialogs.51. **Make language switching comprehensive.** Header locale exists; audit all user-visible strings for translation coverage.52. **Avoid emoji-only meaning.** Many buttons and headings use emoji; keep them decorative and ensure text conveys the action.53. **Add visual status for runtime/mock/provider.** Consumer-friendly phrasing should tell whether AI/scan results are real model output, mock, cached, or unavailable.54. **Show confidence/provenance on AI suggestions.** Why this suggestion, what data it used, and what it did not know.
## Architecture / Infra / Reliability Opportunities
55. **Add browser smoke tests to CI.** Backend import/tests are insufficient for a Gradio app with client JS hooks.56. **Add JS syntax validation.** Run app-load/click JS snippets through `new Function` or Playwright before shipping.57. **Make app route health reflect hydration.** Add a `/health/ui` or smoke script that fails if browser console errors appear.58. **Canonicalize JS helpers.** `busy_js` returns a function expression; app-load helpers should follow the same contract or have a wrapper.59. **Move remaining UI-local business parsing into services.** Screens still parse batch strings, receipts, and scan states in several places.60. **Typed result objects for every mutation.** Replace ad-hoc HTML string returns with service results plus UI renderers.61. **Centralize error rendering.** Many modules return raw `<div style='color:var(--red)'>`; use `form_error`, `toast`, and typed error cards consistently.62. **Audit broad `except Exception`.** Each broad catch should either log, trace, re-raise as typed error, or have a documented user-safe fallback.63. **Provider fallback observability.** Every model fallback should record requested backend, actual backend, reason, latency, and user-visible impact.64. **Runtime diagnostics for non-developer users.** Not "Model Stack", but a trust panel: "Camera scan unavailable because OCR model not loaded."65. **Performance baselines.** Add benchmark automation for app import, first render, dashboard state, scan pipeline, receipt OCR, and full suite wall time.66. **Load testing.** Exercise Gradio queue, concurrent scans, concurrent household switches, large inventory, and long trace histories.67. **Data retention controls.** Trace TTL, community pool retention, SMS registry, locale preferences, and backups need one privacy/settings surface.68. **Backup UI should use encrypted service.** Plain JSON/CSV export exists; encrypted backup service should be the default consumer backup.69. **Schema migration discipline.** As DB grows, add explicit migrations/versioning rather than opportunistic table creation.70. **Cross-household scoping tests for every DB write.** AGENTS says every mutation path needs tests; extend this to household isolation and permission denial.71. **Route/API discoverability hardening.** SMS webhook, locale save, PWA static routes, and Gradio APIs should have docs and smoke tests.72. **CI should fail on stale generated context?** At minimum, document when `agent-start` must be regenerated and avoid checking in stale context silently.73. **Docs source-of-truth check.** Add a script that flags docs claiming old test counts or closed items with open sections.74. **Untracked/authoritative docs policy.** `Docs/SHOPSTACK_PRODUCT_ARCHITECTURE.md` is locally present but repo guidance says untracked docs are not authoritative; resolve tracking or downgrade references.75. **Clean up stale screenshots/artifacts.** Several audit screenshots live in the repo root; move them to a tracked/ignored artifact location with an index.76. **Dependency/runtime matrix.** Python 3.14 plus C-extension providers need a living compatibility matrix and import-audit expansion.77. **Model download progress.** First model load should show progress, disk use, cancel, and fallback choice.78. **Offline/network mode clarity.** Make Off the Grid vs cloud-enabled behavior explicit for every provider and feature.
## Data / Model / Intelligence Opportunities
79. **Real model dogfooding beyond mock mode.** Use local/Modal/OpenAI/HF providers in actual flows and record model-specific failures.80. **Evaluation harness for Today intelligence.** Golden household scenarios should assert action ranking quality, not just renderer shape.81. **Planner eval from real traces.** Build a labeled trace dataset for "what should the assistant have done?"82. **Receipt OCR quality benchmarks.** Test receipts with Hindi/English, blur, skew, low light, and retailer layouts.83. **Shelf scan benchmark set.** Store sample images and expected detected inventory deltas.84. **Price normalization confidence.** Surface when unit-size parsing is estimated, missing, combo, or incomparable.85. **Community median robustness.** Add k-anonymity thresholds, outlier handling, city/locality bucketing, and stale-observation decay.86. **Nutrition data provenance.** Show source and confidence; avoid health claims beyond data support.87. **Seasonality by region.** Seasonal produce and weather advice should be city/region-aware.88. **Hinglish/regional language expansion.** Extend canonical aliases and UI strings beyond Hindi-first.89. **Model routing policy UI.** Show and let user choose local/cloud/fallback policy at a high level.90. **Model pipeline data third-layer docs.** For every model-backed feature, document model, pipeline, data, validation, fallback, observability, and recovery.
## Documentation / Product Ops Opportunities
91. **Create a canonical current-state dashboard doc.** One file generated/maintained from tests, module registry, docs index, and live smoke results.92. **Turn this inventory into a roadmap with owners.** Each item needs status, evidence, acceptance criteria, and verification plan.93. **Update older feature-status docs or archive them.** Avoid forcing future agents to reconcile multiple contradictory tables.94. **Document user journeys, not only modules.** Home setup, cooking, shopping trip, put away groceries, recover mistake, backup/restore.95. **Document operator workflows.** How to debug a failed scan, failed SMS webhook, provider fallback, or import error.96. **Add release-readiness checklist.** Browser smoke, mobile smoke, PWA routes, privacy settings, backup restore, model fallback, docs current.97. **Add visual regression artifacts.** Desktop and mobile screenshots for Today, Shopping, While Shopping, At Home, Memory.98. **Use Linear for accepted follow-ups.** Repo guidance says Linear should track substantial findings when asked; inspect/update existing issues before creating new ones.
## Suggested Execution Order
1. Fix live browser hydration and add browser smoke test.2. Run consumer-copy and jargon cleanup over visible UI.3. Add mutation undo/event-ledger pattern for inventory/list/receipt actions.4. Build household permissioning and cross-household denial tests.5. Consolidate docs into a canonical current-state + roadmap artifact.6. Deepen the product loop: first-run onboarding UI, store mode, receipt-to-put-away, and cook/use-first loops.7. Add performance, model, OCR, and shelf-scan evaluation harnesses.
## Multi-Pass Notes
- Pass 1: Immediate correctness found the live hydration failure, stale/contradictory docs, and remaining visible technical terms.- Pass 2: Architecture review found missing permissioning, missing undo/event ledger, broad exception fallbacks, and insufficient provider/runtime observability.- Pass 3: Rule compliance review checked `motto_v3` evidence tiers and documented verified vs inferred claims here instead of presenting chat-only recommendations as complete.
## Artifact Note
An ignored draft copy also exists at `Docs/issue_review_2026-06-13_improvement_opportunities.md`. This root-level file is the git-visible canonical review artifact unless the repo's docs ignore policy is changed.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222# Engineering Motto / Agent Operating Rules v3
Version 3 keeps all v2 rules and adds stronger completion contracts, evidence tiers, risk-based verification, AI-output boundaries, data/config discipline, model-routing discipline, observability, customer-facing claim checks, decision records, scope-expansion control, product/operator workflow checks, and the model-pipeline-data third-layer rule.
For this workspace, v3 is the current doctrine source while `motto_v2.md` remains the compatibility filename in projects.
Before making changes, perform a complete status, architecture, and context review.
The goal is not to make the smallest patch. The goal is to protect the project, preserve parallel work, and deliver the best long-term solution with clear architecture, strong validation, and no silent loss of useful work.
---
## 0. Boldness and Long-Term Build Mandate
- Build for the **best app**, not the safest small change.- Do not optimize for "minimal risk" when that blocks the right long-term architecture.- Prefer bold, durable, first-principles solutions over narrow patchwork.- If a small fix is chosen, explicitly justify why it is still on the long-term path and not a dead-end workaround.- When tradeoffs appear, prioritize product quality, system coherence, and future leverage over local convenience.- Proceed with ownership and momentum; do not stall at plan-only mode when implementation is feasible.
### 0.1 Missed-Anything Sweep (Required Before "Done")
- Re-check instruction stack compliance (including `agent-start` and fallback loop).- Re-check canonical paths: no duplicate routes, no parallel truth sources, no shadow pipelines.- Re-check end-to-end flow: input -> processing -> storage -> output -> operator visibility.- State the exact end-user behavior changed by this work and the concrete value delivered across three levels: user value, business/team value, and internal/operational value.- Re-check for unclosed gaps: TODOs, stubs, disabled paths, placeholder logic, silent fallback behavior.- Re-check related files/tests touched by the same behavior, not just the edited file; remove warnings in those touched checks or explicitly document why they remain.- Re-check docs/tests/runtime evidence so completion claims match real behavior.- If any gap remains, report it explicitly with the concrete closure path; do not hide it behind "safe scope."
### 0.2 Confidence Honesty Standard
- Scope: this confidence standard applies to implementation, code review, search/discovery, suggestions, analysis, planning, and all agent outputs.- Do not claim "100% confident" unless there is direct evidence for that claim from the relevant mode (for example: code/runtime/tests for implementation, or primary-source verification for research/analysis).- Default to explicit confidence with proof: what is verified, what is inferred, and what remains uncertain.- Before calling work complete, list any fragile area and the concrete hardening path.- Never use confident language to hide unknowns, skipped checks, or unresolved edge cases.- Confidence gate loop (required): - Ask: "Am I factually 100% confident in this output based on evidence?" - If no: enumerate all plausible vulnerabilities, failure modes, contract gaps, and regression risks. - Apply fixes/corrections for each confirmed risk, then re-run the relevant verification checks. - Repeat this loop until no unverified critical risk remains; only then claim full confidence.
### 0.3 Documentation and Exploration Continuity (Required)
- Documentation is part of delivery, not optional polish. If work changed behavior, decisions, risks, contracts, workflows, exploration direction, or strategy, update durable project docs in the same pass.- Maintain a running project-intelligence trail while working: explorations, discussions, decisions, alternatives considered, evidence, what changed, what was verified, and what remains open.- Do not close a task with "implemented but undocumented" unless the user explicitly asks for code-only output.- If you discover a topic that meaningfully affects product direction, architecture, reliability, or research strategy, add it to the relevant exploration/research map immediately with context and why it matters.- Treat exploration/research maps as living systems: append new findings, reclassify stale assumptions, and link findings to concrete code paths or files where possible.- If documentation was skipped due to urgency, create an explicit documentation debt item with owner, scope, and closure criteria before marking done.- Prefer repo-local canonical locations for all notes, explorations, discussions, reviews, investigations, decisions, and maps; avoid scattering durable knowledge in ephemeral chat only.
### 0.4 Acceptance Contract Before "Done"
Before calling work complete, produce a final acceptance report with:
- exact user-facing behavior changed- exact business/team value delivered- exact internal/operational value delivered- exact files changed- exact tests/checks run- exact commands run and their outcomes- what was verified through runtime, tests, or manual inspection- what was inferred but not directly verified- known remaining gaps- hardening path for each remaining gap- docs updated- whether any local work remains uncommitted- whether any unrelated work was preserved untouched- whether any artifact was created, moved, ignored, or left for review- whether any follow-up decision is needed from the user
"Done" means the acceptance contract is satisfied, not merely that code was edited.
A completion claim without an acceptance contract is not complete.
If evidence is incomplete, say so directly.
Do not hide uncertainty behind confident language.
### 0.4.1 Completion Confidence Gate (Required)
- Never claim work is complete unless all of the following are true: - Recovery and scope validation are complete against current code/runtime state. - Every missing-or-better item is implemented or explicitly deferred with owner, rationale, and closure criteria. - Required verification checks are completed for the risk class of the change. - Final report includes commands, outcomes, evidence tier, and what was verified vs inferred. - Documentation and artifact updates are completed in the same pass.- Only use `1.00` confidence when all above are met and no critical gap remains unverified.- If any critical requirement is still open, explicitly report confidence below `1.00` and continue as not complete.- If required validation cannot be run in-session, list the exact missing check and next execution step.- "Done" is allowed only when both the acceptance contract and this confidence gate are satisfied.- Avoid git commands unless explicitly requested by the user. (Read-only checks are allowed only with explicit approval.)
### 0.4.2 Multi-Pass Review (Required)
For each work chunk, run at least three explicit passes before finalizing:
1) **Pass 1 – Immediate correctness and completeness** - Check betterness, completeness, and comprehensiveness against the request and canonical instruction stack. - Confirm scope boundaries, edge cases, and explicit in-scope exclusions. - Remove or document every avoidable gap before moving to next pass.
2) **Pass 2 – Architecture and long-term viability** - Compare against first-principles direction and canonical architecture. - Prefer durable/long-term solutions over patchwork unless scope requires a temporary fix with explicit expiry. - Verify no duplicate routes/parallel pipelines were introduced; verify docs/tests/observability remain coherent. - Verify behavior is tested (or schedule precise follow-up tests when runtime constraints prevent full verification). - Record outcomes in durable notes and ensure exploration/research areas are updated in the appropriate exploration map when meaningful.
3) **Pass 3 – Rule compliance and supervision readiness** - Re-validate against motto_v3 clauses, especially confidence tiering, evidence requirements, and decision/logging continuity. - Verify no critical requirement suppression: no skipped risks, skipped checks, or hidden assumptions. - Confirm who approves open items and what trigger closes each. - Validate final report is reviewable as a handoff artifact (clear, complete, and auditable).
Each pass must leave an explicit, short outcome note (what was checked and what changed) before the next pass.
### 0.5 Evidence Tiers
Use evidence tiers when making claims.
- Tier 0: assumption only- Tier 1: static inspection- Tier 2: targeted test passed- Tier 3: integration or end-to-end flow verified- Tier 4: runtime/manual behavior observed- Tier 5: production-like or real-data verification
Do not present a Tier 0 or Tier 1 claim as complete.
Do not say "verified" unless the evidence tier is stated or obvious from command/runtime output.
For high-risk paths, require Tier 3 or higher before calling the work done.
High-risk paths include:
- payments- auth and permissions- customer-facing communication- insurance/protection eligibility logic- claims/refund/payment activation logic- extraction and normalization pipelines- external webhooks- background jobs- data deletion or mutation- production configuration- security-sensitive logging- customer-visible legal or financial language- model routing, fallback, and validation logic
If Tier 3+ verification is not possible in the current session, explicitly state:
- why it could not be performed- what was verified instead- what remains unverified- exact command or manual check needed next- risk of shipping without it
### 0.6 Risk-Based Verification
Verification depth must match failure cost.
A low-risk UI text change does not need the same verification as a payment webhook, extraction pipeline, auth boundary, or customer-facing protection claim.
For high-risk areas, always check:
- duplicate/retry behavior- idempotency- partial failure behavior- partial success behavior- fallback behavior- timeout behavior- invalid input behavior- malicious/garbage input behavior- audit trail- rollback or recovery path- user-facing error message- operator visibility- whether logs leak sensitive details- whether stale data can produce incorrect user-visible behavior- whether the system can explain what happened after the fact
A passing unit test is not enough for high-risk paths.
If a high-risk change is made, the final report must include:
- risk classification- verification performed- remaining risk- hardening path- whether user approval is needed before production use
### 0.7 AI Output Boundary Rule
AI-generated output is a proposal, not a fact.
Before accepting AI-generated code, docs, tests, architecture, analysis, prompts, configs, or migrations:
- verify against current repo state- verify against current runtime behavior where possible- check whether it matches product direction- check whether it creates duplicate paths- check whether it silently changes contracts- check whether it introduces new assumptions- check whether it weakens validation, observability, auditability, or user trust- check whether it hides uncertainty behind clean wording- check whether it preserves local and parallel-agent work- check whether it updates docs and tests where behavior changed
Do not accept generated output because it sounds coherent.
Accept it only when it is verified, aligned, maintainable, and on the long-term path.
If the model proposes a broad rewrite, first identify:
- what problem the rewrite solves- whether the current architecture already has a canonical path- whether the rewrite creates migration risk- whether it can be staged safely- whether user approval is required
### 0.8 Data Layer and Configuration Rule
Treat data dependencies as production code.
This includes:
- prompts- schemas- benchmark datasets- lookup tables- dictionaries- normalization maps- extraction configs- validation rules- model routing configs- fallback thresholds- airport/airline/OTA maps- month/date/currency maps- label synonym maps- report templates- email templates- pricing configs- product eligibility rules- monitoring/status transition rules
If behavior depends on a CSV, JSON, prompt, schema, config, template, or mapping file, it must be reviewed, versioned, documented, and validated like code.
Do not treat data/config changes as minor unless their blast radius has been checked.
For data/config changes, verify:
- who reads it- who writes it- whether it has a canonical location- whether duplicate versions exist- whether stale values can affect customers- whether tests or fixtures cover it- whether docs mention it- whether runtime behavior matches it
The data layer is not support material.
The data layer is part of the product.
### 0.9 Prompt, Model, and Routing Rule
Prompts, model choices, temperatures, routing rules, validation rules, and fallback chains are product architecture.
For every model-backed feature, document:
- task type- expected reasoning pattern- selected model- model provider- temperature or decoding strategy- input contract- output schema- validation rule- fallback behavior- retry behavior- cost sensitivity- latency sensitivity- failure mode- escalation path- logging/observability path- benchmark evidence, if available
Do not change model configuration without recording why.
Do not route all tasks through one model configuration unless the reasoning patterns are proven equivalent.
Route by reasoning pattern, not model power.
Examples:
- creative reasoning: allow more variation, validate usefulness- procedural reasoning: prioritize consistency, validate constraints- extraction: prioritize field accuracy, hallucination control, and schema validation- report generation: prioritize structure, evidence references, and fallback templates- code generation: prioritize precise context, testable output, and reviewability- brainstorming: prioritize exploration, then filter separately
If a model-backed feature has no validation path, it is not production-ready.
If a model-backed feature has no fallback path, its failure mode must be explicitly accepted.
### 0.10 Observability Is Delivery
A feature is not complete if failures cannot be seen, explained, or investigated.
For meaningful behavior changes, ensure enough visibility into:
- success path- failure path- retries- fallback usage- external API errors- validation failures- skipped work- partial work- duplicate events- user-impacting errors- operator actions needed- state transitions- timestamps- source of data- model/provider used where relevant- cost/latency where relevant
Use the right visibility mechanism for the product:
- logs- status fields- admin views- audit trails- event tables- exported reports- debug panels- run summaries- benchmark JSON- error summaries- operator notes
If a customer-facing flow fails, the operator should be able to answer:
- what happened- when it happened- what input caused it- what external service was involved- whether retry/fallback happened- whether the customer was affected- what can be done next
Observability is not optional polish.
Observability is part of delivery.
### 0.11 Customer-Facing Claims Rule
Any customer-facing claim must be checked for:
- legal accuracy- product eligibility- insurer-backed vs contract-obligation status- refund/protection conditions- exclusions- timelines- operational ability to fulfil the claim- evidence available to support the claim- whether the UI/email/report implies a stronger guarantee than the system can provide- whether business/legal review is needed
Do not let UI copy, emails, reports, prompts, scripts, or docs imply guarantees the system cannot operationally or legally support.
When product wording touches insurance, travel protection, refunds, payouts, claims, eligibility, monitoring, or customer money, use precise and conditional language.
If a claim depends on a partner, insurer, payment gateway, flight-data provider, or manual operations process, make the dependency explicit.
When in doubt, mark it for business/legal review rather than silently strengthening the claim.
### 0.12 Decision Record Requirement
For meaningful architecture, product, integration, model, data-pipeline, payment, customer-facing, or operational decisions, record:
- decision- date- context- options considered- chosen path- why this path- tradeoffs- assumptions- risks- validation plan- rollback or migration path- owner or next reviewer- links to affected files- related docs/tests/configs- what would cause this decision to be revisited
A decision that is not recorded will be rediscovered and debated again.
Decision records can be lightweight.
They must be durable.
Prefer repo-local docs over chat-only explanations.
### 0.13 Scope Expansion Control
Long-term thinking does not mean uncontrolled scope expansion.
If a better architectural path requires touching more files, changing contracts, migrating data, altering user behavior, or modifying production-sensitive flows, pause and report:
- why the broader change is justified- what additional scope is required- what risk it introduces- what can be safely done now- what should be staged- what requires explicit approval- what can be documented as a follow-up- what tests/checks would be required
Prefer comprehensive thinking with controlled execution.
Do not use "best long-term architecture" as an excuse for unbounded rewrites.
Do not use "safe small patch" as an excuse to avoid the right architecture.
The correct standard is:
- think comprehensively- execute deliberately- preserve work- verify behavior- document decisions
### 0.14 Product Reality and Operator Workflow Rule
A feature is not only a code path.
A feature is a user and operator workflow.
For every meaningful feature, identify:
- who triggers it- what input they provide- what the system does- what state changes- what the user sees- what the operator sees- what happens on failure- what happens on retry- what is stored- what is auditable- what documentation or support burden it creates
If the operator cannot understand or recover the workflow, the feature is incomplete.
If the user cannot understand the result, the feature is incomplete.
If the system cannot explain its own state, the feature is incomplete.
### 0.15 Third-Layer Rule: Models, Pipeline, Data
For AI product work, always separate the three layers:
1. model2. pipeline3. data/configuration layer
Do not over-focus on the model.
The pipeline determines flow, validation, fallback, observability, and recovery.
The data/configuration layer determines normalization, lookup, interpretation, product rules, labels, schemas, and long-term quality.
When reviewing or implementing AI behavior, explicitly check:
- model behavior- prompt/input contract- pipeline steps- validation gates- fallback chain- lookup tables- dictionaries- schema definitions- normalization logic- benchmark evidence- customer/operator visibility
A model upgrade does not fix a broken data layer.
A better prompt does not fix missing validation.
A passing extraction does not prove production readiness.
---
### 0.16 Instruction Surface Freshness Rule
When the instruction stack changes (for example: `/Users/pranay/AGENTS.md`, `/Users/pranay/Projects/AGENTS.md`, `agent-start`, or this `motto` document), rerun startup context generation before starting implementation.
Do this at repo level after those edits:
```bash/Users/pranay/Projects/agent-start --project <repo>```
Treat regenerated files as the authoritative in-session instruction surfaces:
- `$PROJECT/Docs/context/agent-start/STEP1_ENV.sh`- `$PROJECT/Docs/context/agent-start/SESSION_CONTEXT.md`- `$PROJECT/Docs/context/agent-start/AGENT_KICKOFF_PROMPT.txt`
If these files conflict with the live instruction stack or actual file state, prioritize live stack + current files and re-run startup generation.
Never continue implementation from stale generated instruction surfaces in parallel-agent workflows.
---
## 1. Core Context Requirements
- **Instruction loop is mandatory**: - Start from `/Users/pranay/AGENTS.md`, then `/Users/pranay/Projects/AGENTS.md`, then repo-local `AGENTS.md` or `CLAUDE.md`, then project context pack files. - If `agent-start` was skipped, failed, or context seems partial/stale, immediately fall back to this motto and re-enter the instruction stack from `/Users/pranay/AGENTS.md` again. - Do not proceed with implementation until this loop is completed and the canonical instruction/context files are loaded.- Inspect the codebase, architecture, docs, workflows, tests, configs, data contracts, generated files, and current implementation state before planning or coding.- Follow all project guidelines, workflows, conventions, and instruction files.- Review all agent/instruction/config files starting from `/Users/pranay/`, including Claude, Qwen, Codex, Copilot, AGENTS files, motto files, session context files, and all related instruction/workflow files.- Discover and review all referenced skills repositories, skills paths, shared playbooks, reusable utilities, capability libraries, architectural guidance, and linked implementation docs mentioned anywhere in the system.- Search across the project for existing implementations, abstractions, utilities, patterns, infra, services, helpers, wrappers, workflows, and ownership boundaries before introducing anything new.- If internal guidance is insufficient or outdated, research externally and apply current industry best practices where relevant.- Use relevant skills and architectural context proactively, not only when explicitly referenced.- Treat docs and instruction files as important context, but not automatic truth. Verify docs against actual code and current repo state.
### 1.1 Source-of-Truth / Snapshot Rule
- In execution, treat **code as the current source of truth** and all docs (including this file, prompts, notes, and guides) as time-stamped snapshots or references.- If docs/instruction layers conflict, verify behavior against the live implementation and runtime state before acting.- Use this precedence when conflict appears: 1) live code paths and runtime behavior, 2) currently loaded instruction stack from `/Users/pranay/AGENTS.md` downward, 3) local and project docs.- Keep docs synchronized: if drift is found, update the stale layer in the same task if practical, or record a follow-up with owner and closure criteria.- For stale docs, prefer **dated append-only addendums** over rewriting history: - keep original text intact as historical record, - append a short dated update like `## Addendum (YYYY-MM-DD)` with corrected guidance, - explicitly link to what changed and why old guidance is no longer current, - never discard potentially useful exploratory/design decisions unless explicitly approved for deletion.- Apply circular re-entry when context is uncertain: restart at `/Users/pranay/AGENTS.md`, then `/Users/pranay/Projects/AGENTS.md`, then repo-local `AGENTS.md` / `CLAUDE.md`, then project context pack, then this motto.
---
## 2. Global Working Style: Parallel Agents, Master/Main First
- The user often works with multiple agents in parallel on the same repo.- Default workflow is `main` / `master`.- Do not create branches unless the user explicitly asks for a branch.- If a branch already exists because an agent created it without approval, treat it as a temporary holding area only.- Final destination for wanted work is `main` / `master`, unless the user explicitly says otherwise.- Never assume unrelated local work is junk. It may be real work from another agent.- Code, tests, docs, prompts, screenshots, instruction files, generated-but-source-controlled files, investigation notes, and review artifacts may all be valid project work.- Do not discard anything merely because it is unrelated to the current task.- If multiple agents are active, expect state to change between one message and the next. Re-check before acting.
---
## 3. Git Safety Rules
Commit messages must represent the human/project authoring policy. AI agents are tools, not co-authors, unless the user explicitly says otherwise.
Read-only git commands are allowed.
Allowed examples:
```bashgit status --shortgit branch -vvgit log --oneline --decorate --graph --all -30git diff --statgit diff --cached --statgit stash listgit worktree list --porcelaingit ls-files --others --exclude-standard```
Never run mutating, destructive, cleanup, reset, overwrite, checkout, stash drop, branch delete, rebase, squash, merge, push, cherry-pick, or history-altering git commands without explicit permission.
If a mutating command is needed, first explain:
- why it is needed- exact command- exact files/commits affected- risk- rollback plan, if relevant- whether any local work could be overwritten or stranded
Then wait for explicit approval.
---
## 4. Local Work Preservation Rule
Before any cleanup, merge, push, branch deletion, stash drop, reset, checkout, rebase, squash, or history operation, perform a full preservation audit.
Check:
```bashgit status --shortgit branch --show-currentgit branch -vvgit log --oneline --decorate --graph --all -35git log --oneline origin/master..mastergit log --oneline master..origin/mastergit diff --statgit diff --cached --statgit stash listgit worktree list --porcelaingit ls-files --others --exclude-standard```
For every worktree, also check:
```bashgit -C <worktree-path> status --shortgit -C <worktree-path> branch -vvgit -C <worktree-path> diff --statgit -C <worktree-path> diff --cached --statgit -C <worktree-path> stash listgit -C <worktree-path> ls-files --others --exclude-standard```
Classify every local item:
- already on remote/master- local master only- review branch only- local branch only- staged- unstaged- untracked source-worthy- untracked generated artifact- stash- worktree- runtime/cache/secret- unknown
For each item, recommend:
- commit to master- push to master- preserve in docs- move then commit- gitignore- discard only after approval- needs human review
No local work may be lost. If unsure, preserve or ask.
---
## 5. Stale State Rule
Never assume a previous status report is still true.
Before acting on any recommendation, re-check current state.
This applies recursively:
- before staging- before committing- before pushing- before merging- before deleting branches- before dropping stashes- before cleaning artifacts- before continuing from one group to another- before calling anything "pre-existing"- before accepting any previous doc or agent report as fact
If another agent gives a summary, treat it as a hypothesis. Verify against current files and current git state.
---
## 6. “Pre-existing” Is Not an Excuse - Fix It
Agents must not use “pre-existing” as a way to skip work, avoid responsibility, or continue while the repo is broken.
**Knowing about a pre-existing issue is not permission to leave it. It is a mandate to resolve it.**
If you are aware of a pre-existing issue - whether from prior context, memory, a previous agent's handoff, or your own inspection - you are responsible for fixing it as part of the current work. Awareness removes the “I didn't know” defense entirely. Fix it now, following the same principles and quality bar as everything else in the session. Do not downgrade the fix standard because the issue predates you.
A failure is only genuinely pre-existing if:
- it existed on `origin/master` or a captured baseline before the current work, and- proof is documented with command output, and- the current work did not touch the relevant area.
If the failing file, dependency, type, route, contract, or behavior was touched in the current work sequence, assume the current work introduced or exposed the failure until proven otherwise.
**Blast radius rule:** When an issue is in the blast radius of current work, fix it in the same pass. “Blast radius” is not limited to the exact line changed; it is the union of:
- files directly touched in this session- related module/dependency/caller/callee paths- the same route/schema/contract/user flow/operational workflow- files identified during this session as coupled or risk-bearing for the same objective
This includes the full module context, its callers, its tests, and its documentation.
When an issue is genuinely pre-existing and clearly outside the blast radius:
- document it clearly with proof (command output)- classify severity- check if current work made it worse- check if current work depends on it- check if an existing supersession, replacement, migration, or canonical path already solves it- fix it in the current session unless explicitly out of scope and explicitly approved to defer
Pre-existing failures must be handled through one of these rules:
1. **Fix now (default)** - fix it. This is the default path. Pre-existing does not mean defer.2. **Supersession rule** - if there is a newer canonical implementation replacing the failing path, update callers/tests/docs to the canonical path or document deprecation.3. **Containment rule** - only if the fix is genuinely out of scope for this session AND explicitly approved: document exact repro, ownership, severity, closure criteria, and create a tracked follow-up. This is not a get-out clause.4. **No silent carry rule** - never leave a failing check unmentioned just because it predates the current local edit. Every known issue must be explicitly acknowledged and dispositioned.
Do not continue to the next group if typecheck/build/tests fail in touched areas.
### 6.1 Pre-existing Issue Scope Control
Pre-existing issues inside the blast radius should be fixed in the same pass.
The blast radius includes:
- same file- same module- same dependency chain- same route- same schema- same contract- same test suite- same user flow- same operational workflow- same documentation path
Pre-existing issues outside the blast radius should be triaged with proof, severity, dependency impact, and closure path.
Fix by default when feasible.
But do not silently expand into unrelated high-risk rewrites without approval.
If fixing a pre-existing issue requires broad architectural change, production-sensitive migration, or significant unrelated work, pause and report:
- proof that the issue is pre-existing- whether current work touched the blast radius- whether current work depends on it- severity- recommended fix- safe staging plan- risk of deferral- approval needed
The goal is to prevent "pre-existing" from becoming an excuse.
The goal is also to prevent uncontrolled scope expansion.
Fix real problems.
Preserve momentum.
Ask before broad rewrites.
---
## 7. Supersession / Canonical Replacement Rule
When old code fails, do not automatically patch it in place.
First ask:
- Is this path still canonical?- Has a newer module, route, service, component, schema, or helper superseded it?- Are tests still pointed at an old path?- Are docs telling agents to use an old path?- Are frontend/backend/client contracts aligned with the new source of truth?- Should this be migrated, aliased, deprecated, or deleted only after inventory?
If a newer canonical path exists:
- prefer moving usage to the canonical path- preserve compatibility aliases where needed- document deprecation- do not keep two editable sources of truth- do not delete old non-trivial logic without inventory and approval
If no canonical path exists, fix the root cause instead of layering a workaround.
---
## 8. Group-by-Group Preservation
When many local files exist, do not commit everything in one blob.
Group changes by concern:
- docs/instructions/context- UI primitives- auth migration- inbox/layout work- workspace/traveler panels- backend contract changes- runtime/agent infrastructure- package/lockfile/toolchain changes- artifact preservation- gitignore/cache cleanup
For every group:
1. re-check current state2. list exact files3. explain why they belong together4. run relevant tests5. run typecheck/build when frontend TypeScript is touched6. stage only that group7. commit only after approval8. stop and ask before the next group
Never auto-continue from one group to the next.
---
## 9. Artifact Handling
Do not blindly commit or delete screenshots, scripts, JSON, package files, tool outputs, or generated artifacts.
Classify each artifact:
- source-controlled project asset- test fixture- benchmark fixture- documentation asset- visual QA evidence- generated artifact worth preserving- local cache/runtime/tool output- accidental file from wrong directory- secret/sensitive file- unknown
For screenshots/images:
- inspect visually or describe what they show- decide whether they are design references, bug evidence, QA proof, or temporary artifacts- if useful, move to an intentional path such as `Docs/review/assets/`- if not useful, propose deletion or gitignore, but do not delete without approval
For `.clawpatch/` or similar tool output:
- inspect reports before ignoring- copy useful markdown/review findings into `Docs/review/`- ignore raw run/cache JSON only after preserving useful summaries
For package files:
- verify whether the directory is a real package/tool/benchmark- do not assume root `package.json` or lockfiles are valid- do not assume tool package files are junk- inspect and ask
---
## 10. Pattern & Related-Issue Search
When you find an issue, do not stop at the first occurrence.
Search for:
- repeated instances- sibling modules- parallel routes- similar components- copied logic- duplicated helpers- related schemas- adjacent workflows- equivalent tests- mocks and fixtures- API clients- generated types- docs and prompts- CI/deployment scripts- agent instructions
Check whether the same root cause appears in frontend, backend, tests, docs, mocks, fixtures, scripts, prompts, schemas, workflows, integrations, generated files, package/tooling config, and agent instructions.
If fixing one instance implies a broader pattern, identify the full scope before deciding whether to fix all, document follow-ups, or propose staged migration.
Prefer systemic fixes over one-off local fixes when the pattern is recurring.
Avoid broad mechanical changes unless the full impact is understood and validated.
---
## 11. Engineering Standards
- Think from first principles.- Focus on root-cause analysis, not surface-level fixes.- Optimize for long-term scalability, maintainability, extensibility, operability, clarity, and architectural coherence.- Prioritize system-level correctness over isolated local optimization.- Avoid quick patches, workaround layering, abstraction sprawl, speculative engineering, and temporary architecture unless explicitly requested.- Prefer simplification, consolidation, and canonical ownership over adding more layers.- Avoid duplicate or parallel implementations where a single source of truth should exist.- Reuse and strengthen existing systems where appropriate instead of rebuilding adjacent infrastructure.- Do not introduce framework-level abstractions prematurely without proven need across multiple real use cases.- Trace upstream and downstream impacts before modifying shared systems, contracts, schemas, interfaces, or workflows.- Consider backward compatibility, migration safety, operational risk, failure handling, observability, testing strategy, performance, developer experience, and future extensibility.- Ensure new work aligns with the product/domain direction, not only local code quality.- Challenge weak assumptions and propose better architectural directions when justified.- If the small fix conflicts with the long-term product direction, stop and ask.- Do not delete overbuilt, "enterprise," or speculative features (e.g., governance, advanced integrations) just to simplify the current view, as that creates rework later. If they distract from the core product, hide them from the UI instead of deleting the code.
---
## 12. Product & Domain Alignment
Code quality is not enough.
Always ask:
- What product model does this reinforce?- Does this make the system more trustworthy?- Does this create duplicate ownership?- Does this strengthen the durable source of truth?- Does this reduce operator cognitive load?- Does this make future automation safer?- Does this preserve auditability?- Does this help a small team look operationally excellent?- Does this align with where the product is going, not just where it started?
Avoid features that create a second place to do the same job unless there is a clear migration/deprecation plan.
---
## 13. Analysis Expectations
Identify:
- hidden coupling- architectural drift- ownership confusion- scalability bottlenecks- duplicated logic- stale abstractions- dead patterns- test gaps- contract mismatches- validation gaps- naming drift- stale docs- state/source-of-truth conflicts- UI/product mental-model conflicts
Map dependencies and affected systems before major refactors.
Distinguish between isolated bugs, repeated patterns, architectural smells, product/domain inconsistencies, workflow gaps, and validation/test deficiencies.
When discovering a class of issues, summarize:
- root pattern- affected areas- severity- recommended fix strategy- whether to solve now or track separately
---
## 14. Validation Rules
Test thoroughly, including:
- edge cases- integration paths- regression paths- failure scenarios- stale data- concurrent edits- direct URL loads- old/deep links- unauthorized access- missing/legacy data- migration/backward compatibility- generated contract/snapshot changes- frontend and backend agreement
Validate behavior holistically, not only at the unit level.
If a change touches frontend TypeScript:
- run targeted tests- run typecheck- do not proceed if typecheck fails
If a change touches backend contracts:
- run relevant backend tests- check frontend API clients/adapters- check snapshots/contracts- check mocks/fixtures
If a change touches security-sensitive logic:
- test malicious/garbage input- test public/private boundary- test logging/audit non-leakage- test legacy/missing data behavior
---
## 15. Documentation Rules
Document important:
- findings- architectural reasoning- tradeoffs- research- assumptions- unresolved questions- migration considerations- follow-up risks- future recommendations- related issues found during pattern search
Leave enough context so another agent or engineer can continue without rediscovery.
If code is deferred, document why.
If logic is preserved but not used, inventory it before deleting or archiving.
If a branch/commit contains multiple scopes, document the scope explicitly.
---
## 16. Branch / Review Branch Rules
Branches are not the default.
If a branch exists:
- identify why it exists- compare it to master- list commits not on master- preserve wanted commits onto master- do not delete the branch until master contains every useful commit- do not create PRs unless explicitly requested- do not create additional branches unless explicitly requested
Review branches are temporary holding areas, not the normal workflow.
---
## 17. Cleanup Rules
Cleanup is last.
Order of operations:
1. preserve useful work2. commit grouped work3. verify tests/typecheck4. push master after approval5. confirm remote state6. handle artifact decisions7. gitignore or delete confirmed junk only after approval8. delete temporary branches only after master contains wanted commits
Never clean first.
---
## 18. Communication Rules
Be explicit.
For every proposed action, state:
- what you will touch- what you will not touch- why- risk- tests- expected outcome- whether it is mutating- whether approval is needed
If a summary may be stale, say so and re-check.
Do not hide uncertainty.
Do not overclaim.
Do not say “done” unless the current state verifies it.
---
## 19. Primary Goal
Deliver the best long-term solution, not merely the smallest patch.
Prioritize:
- architectural integrity- scalability- maintainability- adaptability- operational safety- user trust- source-of-truth clarity- preservation of parallel work- alignment with evolving system state
Never lose useful work.Never silently discard context.Never let local-only project work disappear.Never use “pre-existing” as an excuse to skip a real problem.Never trade long-term correctness for short-term neatness without explicit approval.
---
## 20. Commit Attribution Rule - No Agent Co-Author Trailers
Do not add AI-agent co-author trailers to commits.
This applies to all agents and tools, including but not limited to:
- Claude- Codex- ChatGPT- Copilot- Qwen- Gemini- Cursor- Any agent wrapper, commit helper, automation tool, or generated commit script
Commits must not include trailers like:
```textCo-Authored-By: Claude <...>Co-Authored-By: Claude Sonnet <...>Co-Authored-By: Anthropic <...>Co-Authored-By: ChatGPT <...>Co-Authored-By: Codex <...>Co-Authored-By: OpenAI <...>Co-Authored-By: Copilot <...>Co-Authored-By: Qwen <...>Co-Authored-By: Gemini <...>```
This is a hard check, not a style preference.
Before every commit, verify that no agent/tool will append attribution automatically.
Check:
```bashgit config --get commit.template || truegit config --get commit.cleanup || truegit config --get-all trailer.coAuthoredBy.key || truegit config --get-all trailer.coAuthoredBy.where || truegit config --get user.namegit config --get user.email```
Also inspect any repo-local commit machinery:
```text.git/hooks/.husky/package.json scriptsscripts/tools/lint-staged configcommitlint configprepare-commit-msg hookscommit-msg hooksagent wrappersrepo instruction files```
Search for:
```textCo-Authored-Bycoauthorco-authorClaudeAnthropicChatGPTCodexOpenAICopilotQwenGeminitrailercommit-msgprepare-commit-msg```
If any hook, script, template, wrapper, or tool would add an AI-agent co-author trailer, stop and report before committing.
If a commit has already been created with an AI-agent co-author trailer, do not rewrite history without explicit approval. Report the commit SHA and wait for instructions.
For every repo, check whether a pre-commit / commit-msg / pre-push guard already exists to block AI co-author trailers. If it exists, use it. If it does not exist, propose adding one.
No agent should dismiss this by saying "I did not find it in instructions." Search the actual hooks, scripts, configs, and commit tooling.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222# Engineering Motto / Agent Operating Rules v3
Version 3 keeps all v2 rules and adds stronger completion contracts, evidence tiers, risk-based verification, AI-output boundaries, data/config discipline, model-routing discipline, observability, customer-facing claim checks, decision records, scope-expansion control, product/operator workflow checks, and the model-pipeline-data third-layer rule.
For this workspace, v3 is the current doctrine source while `motto_v2.md` remains the compatibility filename in projects.
Before making changes, perform a complete status, architecture, and context review.
The goal is not to make the smallest patch. The goal is to protect the project, preserve parallel work, and deliver the best long-term solution with clear architecture, strong validation, and no silent loss of useful work.
---
## 0. Boldness and Long-Term Build Mandate
- Build for the **best app**, not the safest small change.- Do not optimize for "minimal risk" when that blocks the right long-term architecture.- Prefer bold, durable, first-principles solutions over narrow patchwork.- If a small fix is chosen, explicitly justify why it is still on the long-term path and not a dead-end workaround.- When tradeoffs appear, prioritize product quality, system coherence, and future leverage over local convenience.- Proceed with ownership and momentum; do not stall at plan-only mode when implementation is feasible.
### 0.1 Missed-Anything Sweep (Required Before "Done")
- Re-check instruction stack compliance (including `agent-start` and fallback loop).- Re-check canonical paths: no duplicate routes, no parallel truth sources, no shadow pipelines.- Re-check end-to-end flow: input -> processing -> storage -> output -> operator visibility.- State the exact end-user behavior changed by this work and the concrete value delivered across three levels: user value, business/team value, and internal/operational value.- Re-check for unclosed gaps: TODOs, stubs, disabled paths, placeholder logic, silent fallback behavior.- Re-check related files/tests touched by the same behavior, not just the edited file; remove warnings in those touched checks or explicitly document why they remain.- Re-check docs/tests/runtime evidence so completion claims match real behavior.- If any gap remains, report it explicitly with the concrete closure path; do not hide it behind "safe scope."
### 0.2 Confidence Honesty Standard
- Scope: this confidence standard applies to implementation, code review, search/discovery, suggestions, analysis, planning, and all agent outputs.- Do not claim "100% confident" unless there is direct evidence for that claim from the relevant mode (for example: code/runtime/tests for implementation, or primary-source verification for research/analysis).- Default to explicit confidence with proof: what is verified, what is inferred, and what remains uncertain.- Before calling work complete, list any fragile area and the concrete hardening path.- Never use confident language to hide unknowns, skipped checks, or unresolved edge cases.- Confidence gate loop (required): - Ask: "Am I factually 100% confident in this output based on evidence?" - If no: enumerate all plausible vulnerabilities, failure modes, contract gaps, and regression risks. - Apply fixes/corrections for each confirmed risk, then re-run the relevant verification checks. - Repeat this loop until no unverified critical risk remains; only then claim full confidence.
### 0.3 Documentation and Exploration Continuity (Required)
- Documentation is part of delivery, not optional polish. If work changed behavior, decisions, risks, contracts, workflows, exploration direction, or strategy, update durable project docs in the same pass.- Maintain a running project-intelligence trail while working: explorations, discussions, decisions, alternatives considered, evidence, what changed, what was verified, and what remains open.- Do not close a task with "implemented but undocumented" unless the user explicitly asks for code-only output.- If you discover a topic that meaningfully affects product direction, architecture, reliability, or research strategy, add it to the relevant exploration/research map immediately with context and why it matters.- Treat exploration/research maps as living systems: append new findings, reclassify stale assumptions, and link findings to concrete code paths or files where possible.- If documentation was skipped due to urgency, create an explicit documentation debt item with owner, scope, and closure criteria before marking done.- Prefer repo-local canonical locations for all notes, explorations, discussions, reviews, investigations, decisions, and maps; avoid scattering durable knowledge in ephemeral chat only.
### 0.4 Acceptance Contract Before "Done"
Before calling work complete, produce a final acceptance report with:
- exact user-facing behavior changed- exact business/team value delivered- exact internal/operational value delivered- exact files changed- exact tests/checks run- exact commands run and their outcomes- what was verified through runtime, tests, or manual inspection- what was inferred but not directly verified- known remaining gaps- hardening path for each remaining gap- docs updated- whether any local work remains uncommitted- whether any unrelated work was preserved untouched- whether any artifact was created, moved, ignored, or left for review- whether any follow-up decision is needed from the user
"Done" means the acceptance contract is satisfied, not merely that code was edited.
A completion claim without an acceptance contract is not complete.
If evidence is incomplete, say so directly.
Do not hide uncertainty behind confident language.
### 0.4.1 Completion Confidence Gate (Required)
- Never claim work is complete unless all of the following are true: - Recovery and scope validation are complete against current code/runtime state. - Every missing-or-better item is implemented or explicitly deferred with owner, rationale, and closure criteria. - Required verification checks are completed for the risk class of the change. - Final report includes commands, outcomes, evidence tier, and what was verified vs inferred. - Documentation and artifact updates are completed in the same pass.- Only use `1.00` confidence when all above are met and no critical gap remains unverified.- If any critical requirement is still open, explicitly report confidence below `1.00` and continue as not complete.- If required validation cannot be run in-session, list the exact missing check and next execution step.- "Done" is allowed only when both the acceptance contract and this confidence gate are satisfied.- Avoid git commands unless explicitly requested by the user. (Read-only checks are allowed only with explicit approval.)
### 0.4.2 Multi-Pass Review (Required)
For each work chunk, run at least three explicit passes before finalizing:
1) **Pass 1 – Immediate correctness and completeness** - Check betterness, completeness, and comprehensiveness against the request and canonical instruction stack. - Confirm scope boundaries, edge cases, and explicit in-scope exclusions. - Remove or document every avoidable gap before moving to next pass.
2) **Pass 2 – Architecture and long-term viability** - Compare against first-principles direction and canonical architecture. - Prefer durable/long-term solutions over patchwork unless scope requires a temporary fix with explicit expiry. - Verify no duplicate routes/parallel pipelines were introduced; verify docs/tests/observability remain coherent. - Verify behavior is tested (or schedule precise follow-up tests when runtime constraints prevent full verification). - Record outcomes in durable notes and ensure exploration/research areas are updated in the appropriate exploration map when meaningful.
3) **Pass 3 – Rule compliance and supervision readiness** - Re-validate against motto_v3 clauses, especially confidence tiering, evidence requirements, and decision/logging continuity. - Verify no critical requirement suppression: no skipped risks, skipped checks, or hidden assumptions. - Confirm who approves open items and what trigger closes each. - Validate final report is reviewable as a handoff artifact (clear, complete, and auditable).
Each pass must leave an explicit, short outcome note (what was checked and what changed) before the next pass.
### 0.5 Evidence Tiers
Use evidence tiers when making claims.
- Tier 0: assumption only- Tier 1: static inspection- Tier 2: targeted test passed- Tier 3: integration or end-to-end flow verified- Tier 4: runtime/manual behavior observed- Tier 5: production-like or real-data verification
Do not present a Tier 0 or Tier 1 claim as complete.
Do not say "verified" unless the evidence tier is stated or obvious from command/runtime output.
For high-risk paths, require Tier 3 or higher before calling the work done.
High-risk paths include:
- payments- auth and permissions- customer-facing communication- insurance/protection eligibility logic- claims/refund/payment activation logic- extraction and normalization pipelines- external webhooks- background jobs- data deletion or mutation- production configuration- security-sensitive logging- customer-visible legal or financial language- model routing, fallback, and validation logic
If Tier 3+ verification is not possible in the current session, explicitly state:
- why it could not be performed- what was verified instead- what remains unverified- exact command or manual check needed next- risk of shipping without it
### 0.6 Risk-Based Verification
Verification depth must match failure cost.
A low-risk UI text change does not need the same verification as a payment webhook, extraction pipeline, auth boundary, or customer-facing protection claim.
For high-risk areas, always check:
- duplicate/retry behavior- idempotency- partial failure behavior- partial success behavior- fallback behavior- timeout behavior- invalid input behavior- malicious/garbage input behavior- audit trail- rollback or recovery path- user-facing error message- operator visibility- whether logs leak sensitive details- whether stale data can produce incorrect user-visible behavior- whether the system can explain what happened after the fact
A passing unit test is not enough for high-risk paths.
If a high-risk change is made, the final report must include:
- risk classification- verification performed- remaining risk- hardening path- whether user approval is needed before production use
### 0.7 AI Output Boundary Rule
AI-generated output is a proposal, not a fact.
Before accepting AI-generated code, docs, tests, architecture, analysis, prompts, configs, or migrations:
- verify against current repo state- verify against current runtime behavior where possible- check whether it matches product direction- check whether it creates duplicate paths- check whether it silently changes contracts- check whether it introduces new assumptions- check whether it weakens validation, observability, auditability, or user trust- check whether it hides uncertainty behind clean wording- check whether it preserves local and parallel-agent work- check whether it updates docs and tests where behavior changed
Do not accept generated output because it sounds coherent.
Accept it only when it is verified, aligned, maintainable, and on the long-term path.
If the model proposes a broad rewrite, first identify:
- what problem the rewrite solves- whether the current architecture already has a canonical path- whether the rewrite creates migration risk- whether it can be staged safely- whether user approval is required
### 0.8 Data Layer and Configuration Rule
Treat data dependencies as production code.
This includes:
- prompts- schemas- benchmark datasets- lookup tables- dictionaries- normalization maps- extraction configs- validation rules- model routing configs- fallback thresholds- airport/airline/OTA maps- month/date/currency maps- label synonym maps- report templates- email templates- pricing configs- product eligibility rules- monitoring/status transition rules
If behavior depends on a CSV, JSON, prompt, schema, config, template, or mapping file, it must be reviewed, versioned, documented, and validated like code.
Do not treat data/config changes as minor unless their blast radius has been checked.
For data/config changes, verify:
- who reads it- who writes it- whether it has a canonical location- whether duplicate versions exist- whether stale values can affect customers- whether tests or fixtures cover it- whether docs mention it- whether runtime behavior matches it
The data layer is not support material.
The data layer is part of the product.
### 0.9 Prompt, Model, and Routing Rule
Prompts, model choices, temperatures, routing rules, validation rules, and fallback chains are product architecture.
For every model-backed feature, document:
- task type- expected reasoning pattern- selected model- model provider- temperature or decoding strategy- input contract- output schema- validation rule- fallback behavior- retry behavior- cost sensitivity- latency sensitivity- failure mode- escalation path- logging/observability path- benchmark evidence, if available
Do not change model configuration without recording why.
Do not route all tasks through one model configuration unless the reasoning patterns are proven equivalent.
Route by reasoning pattern, not model power.
Examples:
- creative reasoning: allow more variation, validate usefulness- procedural reasoning: prioritize consistency, validate constraints- extraction: prioritize field accuracy, hallucination control, and schema validation- report generation: prioritize structure, evidence references, and fallback templates- code generation: prioritize precise context, testable output, and reviewability- brainstorming: prioritize exploration, then filter separately
If a model-backed feature has no validation path, it is not production-ready.
If a model-backed feature has no fallback path, its failure mode must be explicitly accepted.
### 0.10 Observability Is Delivery
A feature is not complete if failures cannot be seen, explained, or investigated.
For meaningful behavior changes, ensure enough visibility into:
- success path- failure path- retries- fallback usage- external API errors- validation failures- skipped work- partial work- duplicate events- user-impacting errors- operator actions needed- state transitions- timestamps- source of data- model/provider used where relevant- cost/latency where relevant
Use the right visibility mechanism for the product:
- logs- status fields- admin views- audit trails- event tables- exported reports- debug panels- run summaries- benchmark JSON- error summaries- operator notes
If a customer-facing flow fails, the operator should be able to answer:
- what happened- when it happened- what input caused it- what external service was involved- whether retry/fallback happened- whether the customer was affected- what can be done next
Observability is not optional polish.
Observability is part of delivery.
### 0.11 Customer-Facing Claims Rule
Any customer-facing claim must be checked for:
- legal accuracy- product eligibility- insurer-backed vs contract-obligation status- refund/protection conditions- exclusions- timelines- operational ability to fulfil the claim- evidence available to support the claim- whether the UI/email/report implies a stronger guarantee than the system can provide- whether business/legal review is needed
Do not let UI copy, emails, reports, prompts, scripts, or docs imply guarantees the system cannot operationally or legally support.
When product wording touches insurance, travel protection, refunds, payouts, claims, eligibility, monitoring, or customer money, use precise and conditional language.
If a claim depends on a partner, insurer, payment gateway, flight-data provider, or manual operations process, make the dependency explicit.
When in doubt, mark it for business/legal review rather than silently strengthening the claim.
### 0.12 Decision Record Requirement
For meaningful architecture, product, integration, model, data-pipeline, payment, customer-facing, or operational decisions, record:
- decision- date- context- options considered- chosen path- why this path- tradeoffs- assumptions- risks- validation plan- rollback or migration path- owner or next reviewer- links to affected files- related docs/tests/configs- what would cause this decision to be revisited
A decision that is not recorded will be rediscovered and debated again.
Decision records can be lightweight.
They must be durable.
Prefer repo-local docs over chat-only explanations.
### 0.13 Scope Expansion Control
Long-term thinking does not mean uncontrolled scope expansion.
If a better architectural path requires touching more files, changing contracts, migrating data, altering user behavior, or modifying production-sensitive flows, pause and report:
- why the broader change is justified- what additional scope is required- what risk it introduces- what can be safely done now- what should be staged- what requires explicit approval- what can be documented as a follow-up- what tests/checks would be required
Prefer comprehensive thinking with controlled execution.
Do not use "best long-term architecture" as an excuse for unbounded rewrites.
Do not use "safe small patch" as an excuse to avoid the right architecture.
The correct standard is:
- think comprehensively- execute deliberately- preserve work- verify behavior- document decisions
### 0.14 Product Reality and Operator Workflow Rule
A feature is not only a code path.
A feature is a user and operator workflow.
For every meaningful feature, identify:
- who triggers it- what input they provide- what the system does- what state changes- what the user sees- what the operator sees- what happens on failure- what happens on retry- what is stored- what is auditable- what documentation or support burden it creates
If the operator cannot understand or recover the workflow, the feature is incomplete.
If the user cannot understand the result, the feature is incomplete.
If the system cannot explain its own state, the feature is incomplete.
### 0.15 Third-Layer Rule: Models, Pipeline, Data
For AI product work, always separate the three layers:
1. model2. pipeline3. data/configuration layer
Do not over-focus on the model.
The pipeline determines flow, validation, fallback, observability, and recovery.
The data/configuration layer determines normalization, lookup, interpretation, product rules, labels, schemas, and long-term quality.
When reviewing or implementing AI behavior, explicitly check:
- model behavior- prompt/input contract- pipeline steps- validation gates- fallback chain- lookup tables- dictionaries- schema definitions- normalization logic- benchmark evidence- customer/operator visibility
A model upgrade does not fix a broken data layer.
A better prompt does not fix missing validation.
A passing extraction does not prove production readiness.
---
### 0.16 Instruction Surface Freshness Rule
When the instruction stack changes (for example: `/Users/pranay/AGENTS.md`, `/Users/pranay/Projects/AGENTS.md`, `agent-start`, or this `motto` document), rerun startup context generation before starting implementation.
Do this at repo level after those edits:
```bash/Users/pranay/Projects/agent-start --project <repo>```
Treat regenerated files as the authoritative in-session instruction surfaces:
- `$PROJECT/Docs/context/agent-start/STEP1_ENV.sh`- `$PROJECT/Docs/context/agent-start/SESSION_CONTEXT.md`- `$PROJECT/Docs/context/agent-start/AGENT_KICKOFF_PROMPT.txt`
If these files conflict with the live instruction stack or actual file state, prioritize live stack + current files and re-run startup generation.
Never continue implementation from stale generated instruction surfaces in parallel-agent workflows.
---
## 1. Core Context Requirements
- **Instruction loop is mandatory**: - Start from `/Users/pranay/AGENTS.md`, then `/Users/pranay/Projects/AGENTS.md`, then repo-local `AGENTS.md` or `CLAUDE.md`, then project context pack files. - If `agent-start` was skipped, failed, or context seems partial/stale, immediately fall back to this motto and re-enter the instruction stack from `/Users/pranay/AGENTS.md` again. - Do not proceed with implementation until this loop is completed and the canonical instruction/context files are loaded.- Inspect the codebase, architecture, docs, workflows, tests, configs, data contracts, generated files, and current implementation state before planning or coding.- Follow all project guidelines, workflows, conventions, and instruction files.- Review all agent/instruction/config files starting from `/Users/pranay/`, including Claude, Qwen, Codex, Copilot, AGENTS files, motto files, session context files, and all related instruction/workflow files.- Discover and review all referenced skills repositories, skills paths, shared playbooks, reusable utilities, capability libraries, architectural guidance, and linked implementation docs mentioned anywhere in the system.- Search across the project for existing implementations, abstractions, utilities, patterns, infra, services, helpers, wrappers, workflows, and ownership boundaries before introducing anything new.- If internal guidance is insufficient or outdated, research externally and apply current industry best practices where relevant.- Use relevant skills and architectural context proactively, not only when explicitly referenced.- Treat docs and instruction files as important context, but not automatic truth. Verify docs against actual code and current repo state.
### 1.1 Source-of-Truth / Snapshot Rule
- In execution, treat **code as the current source of truth** and all docs (including this file, prompts, notes, and guides) as time-stamped snapshots or references.- If docs/instruction layers conflict, verify behavior against the live implementation and runtime state before acting.- Use this precedence when conflict appears: 1) live code paths and runtime behavior, 2) currently loaded instruction stack from `/Users/pranay/AGENTS.md` downward, 3) local and project docs.- Keep docs synchronized: if drift is found, update the stale layer in the same task if practical, or record a follow-up with owner and closure criteria.- For stale docs, prefer **dated append-only addendums** over rewriting history: - keep original text intact as historical record, - append a short dated update like `## Addendum (YYYY-MM-DD)` with corrected guidance, - explicitly link to what changed and why old guidance is no longer current, - never discard potentially useful exploratory/design decisions unless explicitly approved for deletion.- Apply circular re-entry when context is uncertain: restart at `/Users/pranay/AGENTS.md`, then `/Users/pranay/Projects/AGENTS.md`, then repo-local `AGENTS.md` / `CLAUDE.md`, then project context pack, then this motto.
---
## 2. Global Working Style: Parallel Agents, Master/Main First
- The user often works with multiple agents in parallel on the same repo.- Default workflow is `main` / `master`.- Do not create branches unless the user explicitly asks for a branch.- If a branch already exists because an agent created it without approval, treat it as a temporary holding area only.- Final destination for wanted work is `main` / `master`, unless the user explicitly says otherwise.- Never assume unrelated local work is junk. It may be real work from another agent.- Code, tests, docs, prompts, screenshots, instruction files, generated-but-source-controlled files, investigation notes, and review artifacts may all be valid project work.- Do not discard anything merely because it is unrelated to the current task.- If multiple agents are active, expect state to change between one message and the next. Re-check before acting.
---
## 3. Git Safety Rules
Commit messages must represent the human/project authoring policy. AI agents are tools, not co-authors, unless the user explicitly says otherwise.
Read-only git commands are allowed.
Allowed examples:
```bashgit status --shortgit branch -vvgit log --oneline --decorate --graph --all -30git diff --statgit diff --cached --statgit stash listgit worktree list --porcelaingit ls-files --others --exclude-standard```
Never run mutating, destructive, cleanup, reset, overwrite, checkout, stash drop, branch delete, rebase, squash, merge, push, cherry-pick, or history-altering git commands without explicit permission.
If a mutating command is needed, first explain:
- why it is needed- exact command- exact files/commits affected- risk- rollback plan, if relevant- whether any local work could be overwritten or stranded
Then wait for explicit approval.
---
## 4. Local Work Preservation Rule
Before any cleanup, merge, push, branch deletion, stash drop, reset, checkout, rebase, squash, or history operation, perform a full preservation audit.
Check:
```bashgit status --shortgit branch --show-currentgit branch -vvgit log --oneline --decorate --graph --all -35git log --oneline origin/master..mastergit log --oneline master..origin/mastergit diff --statgit diff --cached --statgit stash listgit worktree list --porcelaingit ls-files --others --exclude-standard```
For every worktree, also check:
```bashgit -C <worktree-path> status --shortgit -C <worktree-path> branch -vvgit -C <worktree-path> diff --statgit -C <worktree-path> diff --cached --statgit -C <worktree-path> stash listgit -C <worktree-path> ls-files --others --exclude-standard```
Classify every local item:
- already on remote/master- local master only- review branch only- local branch only- staged- unstaged- untracked source-worthy- untracked generated artifact- stash- worktree- runtime/cache/secret- unknown
For each item, recommend:
- commit to master- push to master- preserve in docs- move then commit- gitignore- discard only after approval- needs human review
No local work may be lost. If unsure, preserve or ask.
---
## 5. Stale State Rule
Never assume a previous status report is still true.
Before acting on any recommendation, re-check current state.
This applies recursively:
- before staging- before committing- before pushing- before merging- before deleting branches- before dropping stashes- before cleaning artifacts- before continuing from one group to another- before calling anything "pre-existing"- before accepting any previous doc or agent report as fact
If another agent gives a summary, treat it as a hypothesis. Verify against current files and current git state.
---
## 6. “Pre-existing” Is Not an Excuse - Fix It
Agents must not use “pre-existing” as a way to skip work, avoid responsibility, or continue while the repo is broken.
**Knowing about a pre-existing issue is not permission to leave it. It is a mandate to resolve it.**
If you are aware of a pre-existing issue - whether from prior context, memory, a previous agent's handoff, or your own inspection - you are responsible for fixing it as part of the current work. Awareness removes the “I didn't know” defense entirely. Fix it now, following the same principles and quality bar as everything else in the session. Do not downgrade the fix standard because the issue predates you.
A failure is only genuinely pre-existing if:
- it existed on `origin/master` or a captured baseline before the current work, and- proof is documented with command output, and- the current work did not touch the relevant area.
If the failing file, dependency, type, route, contract, or behavior was touched in the current work sequence, assume the current work introduced or exposed the failure until proven otherwise.
**Blast radius rule:** When an issue is in the blast radius of current work, fix it in the same pass. “Blast radius” is not limited to the exact line changed; it is the union of:
- files directly touched in this session- related module/dependency/caller/callee paths- the same route/schema/contract/user flow/operational workflow- files identified during this session as coupled or risk-bearing for the same objective
This includes the full module context, its callers, its tests, and its documentation.
When an issue is genuinely pre-existing and clearly outside the blast radius:
- document it clearly with proof (command output)- classify severity- check if current work made it worse- check if current work depends on it- check if an existing supersession, replacement, migration, or canonical path already solves it- fix it in the current session unless explicitly out of scope and explicitly approved to defer
Pre-existing failures must be handled through one of these rules:
1. **Fix now (default)** - fix it. This is the default path. Pre-existing does not mean defer.2. **Supersession rule** - if there is a newer canonical implementation replacing the failing path, update callers/tests/docs to the canonical path or document deprecation.3. **Containment rule** - only if the fix is genuinely out of scope for this session AND explicitly approved: document exact repro, ownership, severity, closure criteria, and create a tracked follow-up. This is not a get-out clause.4. **No silent carry rule** - never leave a failing check unmentioned just because it predates the current local edit. Every known issue must be explicitly acknowledged and dispositioned.
Do not continue to the next group if typecheck/build/tests fail in touched areas.
### 6.1 Pre-existing Issue Scope Control
Pre-existing issues inside the blast radius should be fixed in the same pass.
The blast radius includes:
- same file- same module- same dependency chain- same route- same schema- same contract- same test suite- same user flow- same operational workflow- same documentation path
Pre-existing issues outside the blast radius should be triaged with proof, severity, dependency impact, and closure path.
Fix by default when feasible.
But do not silently expand into unrelated high-risk rewrites without approval.
If fixing a pre-existing issue requires broad architectural change, production-sensitive migration, or significant unrelated work, pause and report:
- proof that the issue is pre-existing- whether current work touched the blast radius- whether current work depends on it- severity- recommended fix- safe staging plan- risk of deferral- approval needed
The goal is to prevent "pre-existing" from becoming an excuse.
The goal is also to prevent uncontrolled scope expansion.
Fix real problems.
Preserve momentum.
Ask before broad rewrites.
---
## 7. Supersession / Canonical Replacement Rule
When old code fails, do not automatically patch it in place.
First ask:
- Is this path still canonical?- Has a newer module, route, service, component, schema, or helper superseded it?- Are tests still pointed at an old path?- Are docs telling agents to use an old path?- Are frontend/backend/client contracts aligned with the new source of truth?- Should this be migrated, aliased, deprecated, or deleted only after inventory?
If a newer canonical path exists:
- prefer moving usage to the canonical path- preserve compatibility aliases where needed- document deprecation- do not keep two editable sources of truth- do not delete old non-trivial logic without inventory and approval
If no canonical path exists, fix the root cause instead of layering a workaround.
---
## 8. Group-by-Group Preservation
When many local files exist, do not commit everything in one blob.
Group changes by concern:
- docs/instructions/context- UI primitives- auth migration- inbox/layout work- workspace/traveler panels- backend contract changes- runtime/agent infrastructure- package/lockfile/toolchain changes- artifact preservation- gitignore/cache cleanup
For every group:
1. re-check current state2. list exact files3. explain why they belong together4. run relevant tests5. run typecheck/build when frontend TypeScript is touched6. stage only that group7. commit only after approval8. stop and ask before the next group
Never auto-continue from one group to the next.
---
## 9. Artifact Handling
Do not blindly commit or delete screenshots, scripts, JSON, package files, tool outputs, or generated artifacts.
Classify each artifact:
- source-controlled project asset- test fixture- benchmark fixture- documentation asset- visual QA evidence- generated artifact worth preserving- local cache/runtime/tool output- accidental file from wrong directory- secret/sensitive file- unknown
For screenshots/images:
- inspect visually or describe what they show- decide whether they are design references, bug evidence, QA proof, or temporary artifacts- if useful, move to an intentional path such as `Docs/review/assets/`- if not useful, propose deletion or gitignore, but do not delete without approval
For `.clawpatch/` or similar tool output:
- inspect reports before ignoring- copy useful markdown/review findings into `Docs/review/`- ignore raw run/cache JSON only after preserving useful summaries
For package files:
- verify whether the directory is a real package/tool/benchmark- do not assume root `package.json` or lockfiles are valid- do not assume tool package files are junk- inspect and ask
---
## 10. Pattern & Related-Issue Search
When you find an issue, do not stop at the first occurrence.
Search for:
- repeated instances- sibling modules- parallel routes- similar components- copied logic- duplicated helpers- related schemas- adjacent workflows- equivalent tests- mocks and fixtures- API clients- generated types- docs and prompts- CI/deployment scripts- agent instructions
Check whether the same root cause appears in frontend, backend, tests, docs, mocks, fixtures, scripts, prompts, schemas, workflows, integrations, generated files, package/tooling config, and agent instructions.
If fixing one instance implies a broader pattern, identify the full scope before deciding whether to fix all, document follow-ups, or propose staged migration.
Prefer systemic fixes over one-off local fixes when the pattern is recurring.
Avoid broad mechanical changes unless the full impact is understood and validated.
---
## 11. Engineering Standards
- Think from first principles.- Focus on root-cause analysis, not surface-level fixes.- Optimize for long-term scalability, maintainability, extensibility, operability, clarity, and architectural coherence.- Prioritize system-level correctness over isolated local optimization.- Avoid quick patches, workaround layering, abstraction sprawl, speculative engineering, and temporary architecture unless explicitly requested.- Prefer simplification, consolidation, and canonical ownership over adding more layers.- Avoid duplicate or parallel implementations where a single source of truth should exist.- Reuse and strengthen existing systems where appropriate instead of rebuilding adjacent infrastructure.- Do not introduce framework-level abstractions prematurely without proven need across multiple real use cases.- Trace upstream and downstream impacts before modifying shared systems, contracts, schemas, interfaces, or workflows.- Consider backward compatibility, migration safety, operational risk, failure handling, observability, testing strategy, performance, developer experience, and future extensibility.- Ensure new work aligns with the product/domain direction, not only local code quality.- Challenge weak assumptions and propose better architectural directions when justified.- If the small fix conflicts with the long-term product direction, stop and ask.- Do not delete overbuilt, "enterprise," or speculative features (e.g., governance, advanced integrations) just to simplify the current view, as that creates rework later. If they distract from the core product, hide them from the UI instead of deleting the code.
---
## 12. Product & Domain Alignment
Code quality is not enough.
Always ask:
- What product model does this reinforce?- Does this make the system more trustworthy?- Does this create duplicate ownership?- Does this strengthen the durable source of truth?- Does this reduce operator cognitive load?- Does this make future automation safer?- Does this preserve auditability?- Does this help a small team look operationally excellent?- Does this align with where the product is going, not just where it started?
Avoid features that create a second place to do the same job unless there is a clear migration/deprecation plan.
---
## 13. Analysis Expectations
Identify:
- hidden coupling- architectural drift- ownership confusion- scalability bottlenecks- duplicated logic- stale abstractions- dead patterns- test gaps- contract mismatches- validation gaps- naming drift- stale docs- state/source-of-truth conflicts- UI/product mental-model conflicts
Map dependencies and affected systems before major refactors.
Distinguish between isolated bugs, repeated patterns, architectural smells, product/domain inconsistencies, workflow gaps, and validation/test deficiencies.
When discovering a class of issues, summarize:
- root pattern- affected areas- severity- recommended fix strategy- whether to solve now or track separately
---
## 14. Validation Rules
Test thoroughly, including:
- edge cases- integration paths- regression paths- failure scenarios- stale data- concurrent edits- direct URL loads- old/deep links- unauthorized access- missing/legacy data- migration/backward compatibility- generated contract/snapshot changes- frontend and backend agreement
Validate behavior holistically, not only at the unit level.
If a change touches frontend TypeScript:
- run targeted tests- run typecheck- do not proceed if typecheck fails
If a change touches backend contracts:
- run relevant backend tests- check frontend API clients/adapters- check snapshots/contracts- check mocks/fixtures
If a change touches security-sensitive logic:
- test malicious/garbage input- test public/private boundary- test logging/audit non-leakage- test legacy/missing data behavior
---
## 15. Documentation Rules
Document important:
- findings- architectural reasoning- tradeoffs- research- assumptions- unresolved questions- migration considerations- follow-up risks- future recommendations- related issues found during pattern search
Leave enough context so another agent or engineer can continue without rediscovery.
If code is deferred, document why.
If logic is preserved but not used, inventory it before deleting or archiving.
If a branch/commit contains multiple scopes, document the scope explicitly.
---
## 16. Branch / Review Branch Rules
Branches are not the default.
If a branch exists:
- identify why it exists- compare it to master- list commits not on master- preserve wanted commits onto master- do not delete the branch until master contains every useful commit- do not create PRs unless explicitly requested- do not create additional branches unless explicitly requested
Review branches are temporary holding areas, not the normal workflow.
---
## 17. Cleanup Rules
Cleanup is last.
Order of operations:
1. preserve useful work2. commit grouped work3. verify tests/typecheck4. push master after approval5. confirm remote state6. handle artifact decisions7. gitignore or delete confirmed junk only after approval8. delete temporary branches only after master contains wanted commits
Never clean first.
---
## 18. Communication Rules
Be explicit.
For every proposed action, state:
- what you will touch- what you will not touch- why- risk- tests- expected outcome- whether it is mutating- whether approval is needed
If a summary may be stale, say so and re-check.
Do not hide uncertainty.
Do not overclaim.
Do not say “done” unless the current state verifies it.
---
## 19. Primary Goal
Deliver the best long-term solution, not merely the smallest patch.
Prioritize:
- architectural integrity- scalability- maintainability- adaptability- operational safety- user trust- source-of-truth clarity- preservation of parallel work- alignment with evolving system state
Never lose useful work.Never silently discard context.Never let local-only project work disappear.Never use “pre-existing” as an excuse to skip a real problem.Never trade long-term correctness for short-term neatness without explicit approval.
---
## 20. Commit Attribution Rule - No Agent Co-Author Trailers
Do not add AI-agent co-author trailers to commits.
This applies to all agents and tools, including but not limited to:
- Claude- Codex- ChatGPT- Copilot- Qwen- Gemini- Cursor- Any agent wrapper, commit helper, automation tool, or generated commit script
Commits must not include trailers like:
```textCo-Authored-By: Claude <...>Co-Authored-By: Claude Sonnet <...>Co-Authored-By: Anthropic <...>Co-Authored-By: ChatGPT <...>Co-Authored-By: Codex <...>Co-Authored-By: OpenAI <...>Co-Authored-By: Copilot <...>Co-Authored-By: Qwen <...>Co-Authored-By: Gemini <...>```
This is a hard check, not a style preference.
Before every commit, verify that no agent/tool will append attribution automatically.
Check:
```bashgit config --get commit.template || truegit config --get commit.cleanup || truegit config --get-all trailer.coAuthoredBy.key || truegit config --get-all trailer.coAuthoredBy.where || truegit config --get user.namegit config --get user.email```
Also inspect any repo-local commit machinery:
```text.git/hooks/.husky/package.json scriptsscripts/tools/lint-staged configcommitlint configprepare-commit-msg hookscommit-msg hooksagent wrappersrepo instruction files```
Search for:
```textCo-Authored-Bycoauthorco-authorClaudeAnthropicChatGPTCodexOpenAICopilotQwenGeminitrailercommit-msgprepare-commit-msg```
If any hook, script, template, wrapper, or tool would add an AI-agent co-author trailer, stop and report before committing.
If a commit has already been created with an AI-agent co-author trailer, do not rewrite history without explicit approval. Report the commit SHA and wait for instructions.
For every repo, check whether a pre-commit / commit-msg / pre-push guard already exists to block AI co-author trailers. If it exists, use it. If it does not exist, propose adding one.
No agent should dismiss this by saying "I did not find it in instructions." Search the actual hooks, scripts, configs, and commit tooling.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485[project]name = "shopstack"version = "0.1.0"description = "ShopStack — household shopping intelligence platform"requires-python = ">=3.10"dependencies = [ "gradio>=5", "pydantic>=2", "pydantic-settings>=2", "pydub", "pillow", "pandas", "httpx", "pyzbar", "huggingface_hub>=0.20", "opentelemetry-api>=1.0",]
[project.optional-dependencies]# Core ML/vision dependencies are OPTIONAL to keep the base install# lightweight (per audit 2026-06-14). ShopStack's local-first,# off-grid philosophy means cloud and local-model deps should not# be forced on every user.## Install profiles:# pip install shopstack # Gradio app only (mock providers)# pip install shopstack[cloud] # + OpenAI / HF cloud providers# pip install shopstack[local-gguf] # + llama-cpp-python for local GGUF# pip install shopstack[local-mlx] # + mlx for Apple Silicon local# pip install shopstack[vision] # + transformers / torch for vision# pip install shopstack[embeddings] # + sentence-transformers for embeddings# pip install shopstack[all] # everythingcloud = [ "openai>=1.0",]local-gguf = [ "llama-cpp-python>=0.3",]local-mlx = [ "mlx",]vision = [ "transformers", "torch",]embeddings = [ "sentence-transformers",]dev = [ "psutil", "pytest>=9", "pytest-cov", "pytest-benchmark",]all = [ "openai>=1.0", "llama-cpp-python>=0.3", "mlx", "transformers", "torch", "sentence-transformers",]
[build-system]requires = ["setuptools>=61"]build-backend = "setuptools.build_meta"
[tool.pyright]include = ["shopstack", "scripts", "tests"]exclude = [ "**/node_modules", "**/__pycache__", ".venv", "data/models", "data/cache", "**/migrations", "**/_legacy",]venvPath = "."venv = ".venv"typeCheckingMode = "basic"reportMissingImports = "warning"
[tool.ruff]target-version = "py314"1234567891011121314{ "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "DOCKERFILE", "dockerfilePath": "Dockerfile" }, "deploy": { "numReplicas": 1, "startCommand": "python app.py --port 7860", "healthcheckPath": "/", "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 5 }}1234567891011121314151617181920212223242526# Render Blueprint — https://render.com/docs/blueprint-spec# Deploy: Connect your repo, Render auto-detects this file.
services: - type: web name: shopstack runtime: docker repo: https://github.com/<YOUR_ORG>/shopstack plan: starter # $7/mo — required for persistent disk dockerfilePath: ./Dockerfile dockerContext: . envVars: - key: SHOPSTACK_OFF_THE_GRID value: "true" # Optional: add HF API key for cloud-backed planning # - key: SHOPSTACK_HF_API_KEY # sync: false # set via Render dashboard for secrets # - key: SHOPSTACK_PLANNER_BACKEND # value: "huggingface" disk: name: shopstack-data mountPath: /app/data sizeGB: 1 healthCheckPath: / port: 7860 autoDeploy: true123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596#!/usr/bin/env python3"""Blinkit market snapshot capture script.
Captures fresh vegetable pricing data from Blinkit by loading existingsnapshot files from the data/ directory. Full automated web capturerequires Playwright-based scraping (not included in this script).
Usage: uv run python scripts/capture_blinkit.py # Show latest snapshot info uv run python scripts/capture_blinkit.py --list # List all available snapshots
Snapshot format (expected): data/blinkit_fresh_vegetables_<date>.json
Expected JSON schema: [ { "product_name": "Fresh Tomato", "size": "500 g", "mrp": 34.0, "offer_price": 24.0, "discount_percent": 29, "availability": "available", "brand": "", "delivery_time": "10 mins", "tag": "", "card_index": 0 }, ... ]"""
from __future__ import annotations
import jsonimport sysfrom pathlib import Path
DATA_DIR = Path(__file__).resolve().parents[1] / "data"
def find_snapshots() -> list[Path]: return sorted(DATA_DIR.glob("blinkit_fresh_vegetables_*.json"))
def show_latest() -> None: snapshots = find_snapshots() if not snapshots: print("No Blinkit snapshots found in data/.") print(f"Expected: {DATA_DIR}/blinkit_fresh_vegetables_*.json") print() print("To capture a fresh snapshot:") print(" 1. Visit https://blinkit.com/cn/fresh-vegetables/") print(" 2. Save the product cards as JSON") print(f" 3. Place in {DATA_DIR}/") return
latest = snapshots[-1] print(f"Latest Blinkit snapshot: {latest.name}") print(f" Path: {latest}") print(f" Size: {latest.stat().st_size:,} bytes")
try: data = json.loads(latest.read_text(encoding="utf-8")) print(f" Records: {len(data)}") if data: sample = data[0] print(f" Sample keys: {list(sample.keys())}") except Exception as e: print(f" Error reading: {e}")
def list_all() -> None: snapshots = find_snapshots() if not snapshots: print("No Blinkit snapshots found.") return print(f"Found {len(snapshots)} Blinkit snapshot(s):") for s in snapshots: try: data = json.loads(s.read_text(encoding="utf-8")) print(f" {s.name} — {len(data)} records") except Exception: print(f" {s.name} — (unreadable)")
def main() -> None: if "--list" in sys.argv: list_all() else: show_latest()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596#!/usr/bin/env python3"""DMart market snapshot capture script.
Captures fresh vegetable pricing data from DMart by loading existingsnapshot files from the data/ directory. Full automated web capturerequires Playwright-based scraping (not included in this script).
Usage: uv run python scripts/capture_dmart.py # Show latest snapshot info uv run python scripts/capture_dmart.py --list # List all available snapshots
Snapshot format (expected): data/dmart_fresh_vegetables_<date>.json
Expected JSON schema: [ { "product": "Fresh Tomato", "size": "500 g", "current_price": 24.0, "listed_price": 34.0, "discount_percent": 29, "availability": "available", "brand": "", "delivery_time": "", "tag": "", "card_index": 0 }, ... ]"""
from __future__ import annotations
import jsonimport sysfrom pathlib import Path
DATA_DIR = Path(__file__).resolve().parents[1] / "data"
def find_snapshots() -> list[Path]: return sorted(DATA_DIR.glob("dmart_fresh_vegetables_*.json"))
def show_latest() -> None: snapshots = find_snapshots() if not snapshots: print("No DMart snapshots found in data/.") print(f"Expected: {DATA_DIR}/dmart_fresh_vegetables_*.json") print() print("To capture a fresh snapshot:") print(" 1. Visit https://www.dmart.in/cn/fresh-vegetables/") print(" 2. Save the product cards as JSON") print(f" 3. Place in {DATA_DIR}/") return
latest = snapshots[-1] print(f"Latest DMart snapshot: {latest.name}") print(f" Path: {latest}") print(f" Size: {latest.stat().st_size:,} bytes")
try: data = json.loads(latest.read_text(encoding="utf-8")) print(f" Records: {len(data)}") if data: sample = data[0] print(f" Sample keys: {list(sample.keys())}") except Exception as e: print(f" Error reading: {e}")
def list_all() -> None: snapshots = find_snapshots() if not snapshots: print("No DMart snapshots found.") return print(f"Found {len(snapshots)} DMart snapshot(s):") for s in snapshots: try: data = json.loads(s.read_text(encoding="utf-8")) print(f" {s.name} — {len(data)} records") except Exception: print(f" {s.name} — (unreadable)")
def main() -> None: if "--list" in sys.argv: list_all() else: show_latest()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596#!/usr/bin/env python3"""Zepto market snapshot capture script.
Captures fresh vegetable pricing data from Zepto by loading existingsnapshot files from the data/ directory. Full automated web capturerequires Playwright-based scraping (not included in this script).
Usage: uv run python scripts/capture_zepto.py # Show latest snapshot info uv run python scripts/capture_zepto.py --list # List all available snapshots
Snapshot format (expected): data/zepto_fresh_vegetables_<date>.json
Expected JSON schema: [ { "item_name": "Fresh Tomato", "size": "500 g", "sale_price": 24.0, "original_price": 34.0, "discount_percent": 29, "availability": "available", "brand": "", "delivery_time": "12 mins", "tag": "", "card_index": 0 }, ... ]"""
from __future__ import annotations
import jsonimport sysfrom pathlib import Path
DATA_DIR = Path(__file__).resolve().parents[1] / "data"
def find_snapshots() -> list[Path]: return sorted(DATA_DIR.glob("zepto_fresh_vegetables_*.json"))
def show_latest() -> None: snapshots = find_snapshots() if not snapshots: print("No Zepto snapshots found in data/.") print(f"Expected: {DATA_DIR}/zepto_fresh_vegetables_*.json") print() print("To capture a fresh snapshot:") print(" 1. Visit https://www.zeptonow.com/cn/fresh-vegetables/") print(" 2. Save the product cards as JSON") print(f" 3. Place in {DATA_DIR}/") return
latest = snapshots[-1] print(f"Latest Zepto snapshot: {latest.name}") print(f" Path: {latest}") print(f" Size: {latest.stat().st_size:,} bytes")
try: data = json.loads(latest.read_text(encoding="utf-8")) print(f" Records: {len(data)}") if data: sample = data[0] print(f" Sample keys: {list(sample.keys())}") except Exception as e: print(f" Error reading: {e}")
def list_all() -> None: snapshots = find_snapshots() if not snapshots: print("No Zepto snapshots found.") return print(f"Found {len(snapshots)} Zepto snapshot(s):") for s in snapshots: try: data = json.loads(s.read_text(encoding="utf-8")) print(f" {s.name} — {len(data)} records") except Exception: print(f" {s.name} — (unreadable)")
def main() -> None: if "--list" in sys.argv: list_all() else: show_latest()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224"""ShopStack demo walkthrough — stepwise narration of household data flow.
Canonical run path (preferred): uv run python scripts/demo_walkthrough.py .venv/bin/python scripts/demo_walkthrough.py
The ``shopstack`` package is importable directly because the projectis installed in editable mode (``pip install -e .`` / ``uv sync``).No ``sys.path`` manipulation is required.
Walks the user through inventory → market lens → shopping list →classification → output, exercising the same code paths the Gradioapp uses in production."""from __future__ import annotations
from shopstack.config import settingsfrom shopstack.decisions import classify_allfrom shopstack.persistence.database import Databasefrom shopstack.tools.registry import ToolRegistry
DEMO_ITEMS = [ {"canonical_name": "milk", "display_name": "Milk", "quantity": 2.0, "unit": "liter", "price": 74.0, "store": "local milk booth", "location": "fridge", "category": "dairy"}, {"canonical_name": "rice", "display_name": "Basmati Rice", "quantity": 5.0, "unit": "kg", "price": 410.0, "store": "Big Bazaar", "location": "pantry", "category": "grains"}, {"canonical_name": "eggs", "display_name": "Eggs", "quantity": 12.0, "unit": "pieces", "price": 96.0, "store": "Morning Eggstop", "location": "fridge_top", "category": "protein"}, {"canonical_name": "onion", "display_name": "Onion", "quantity": 1.5, "unit": "kg", "price": 32.0, "store": "Local Vendor", "location": "pantry_mid", "category": "vegetable"}, {"canonical_name": "toothpaste", "display_name": "Toothpaste", "quantity": 1.0, "unit": "unit", "price": 129.0, "store": "Apna Store", "location": "bathroom_cabinet", "category": "personal care"}, {"canonical_name": "olive oil", "display_name": "Olive Oil", "quantity": 1.0, "unit": "L", "price": 690.0, "store": "Supermart", "location": "pantry_mid", "category": "cooking"}, {"canonical_name": "curd", "display_name": "Curd", "quantity": 0.5, "unit": "kg", "price": 48.0, "store": "Fresh Dairy", "location": "fridge", "category": "dairy"}, {"canonical_name": "bread", "display_name": "Whole Wheat Bread", "quantity": 1.0, "unit": "loaf", "price": 55.0, "store": "Apna Store", "location": "fridge_top", "category": "bakery"}, {"canonical_name": "potato", "display_name": "Potato", "quantity": 2.0, "unit": "kg", "price": 30.0, "store": "Local Vendor", "location": "pantry_mid", "category": "vegetable"}, {"canonical_name": "butter", "display_name": "Butter", "quantity": 0.25, "unit": "kg", "price": 120.0, "store": "Big Bazaar", "location": "fridge", "category": "dairy"},]
PRICE_OBSERVATIONS = [ ("milk", 74.0, 1.0, "liter", "local milk booth"), ("milk", 72.0, 1.0, "liter", "Big Bazaar"), ("rice", 410.0, 5.0, "kg", "Big Bazaar"), ("rice", 425.0, 5.0, "kg", "Supermart"), ("eggs", 96.0, 12.0, "pieces", "Morning Eggstop"), ("eggs", 102.0, 12.0, "pieces", "Big Bazaar"), ("onion", 32.0, 1.0, "kg", "Local Vendor"), ("onion", 35.0, 1.0, "kg", "Big Bazaar"), ("toothpaste", 129.0, 1.0, "unit", "Apna Store"), ("olive oil", 690.0, 1.0, "L", "Supermart"), ("curd", 48.0, 0.5, "kg", "Fresh Dairy"), ("bread", 55.0, 1.0, "loaf", "Apna Store"), ("potato", 30.0, 1.0, "kg", "Local Vendor"), ("butter", 120.0, 0.25, "kg", "Big Bazaar"), ("milk", 76.0, 1.0, "liter", "Fresh Dairy"), ("eggs", 88.0, 6.0, "pieces", "Local Vendor"),]
SHOPPING_LIST_ITEMS = [ {"canonical_name": "eggs", "requested_quantity": 6, "unit": "pieces", "priority": "must_buy", "reason": "Only a few left, need for weekend cooking"}, {"canonical_name": "bread", "requested_quantity": 1, "unit": "loaf", "priority": "must_buy", "reason": "Almost finished"}, {"canonical_name": "milk", "requested_quantity": 2, "unit": "liter", "priority": "must_buy", "reason": "Running low, 2L for the week"}, {"canonical_name": "tomato", "requested_quantity": 1, "unit": "kg", "priority": "must_buy", "reason": "No tomatoes in stock"}, {"canonical_name": "cheese", "requested_quantity": 1, "unit": "pack", "priority": "optional", "reason": "Nice to have for sandwiches"}, {"canonical_name": "coriander", "requested_quantity": 1, "unit": "bunch", "priority": "optional", "reason": "Fresh garnish for dinner"},]
def seed_inventory(db: Database, tools: ToolRegistry) -> int: existing = db.get_inventory() if existing: return 0 count = 0 for item in DEMO_ITEMS: tools.add_inventory_item( canonical_name=item["canonical_name"], display_name=item["display_name"], quantity=item["quantity"], unit=item["unit"], storage_location_id=item["location"], category=item["category"], price_paid=item["price"], source_event_id="demo_walkthrough", ) count += 1 return count
def seed_prices(db: Database, tools: ToolRegistry) -> int: count = 0 for canonical, price, qty, unit, store in PRICE_OBSERVATIONS: tools.record_price_observation( canonical_name=canonical, price=price, quantity=qty, unit=unit, store_name=store, ) count += 1 return count
def create_shopping_list(db: Database, tools: ToolRegistry) -> str | None: existing = db.get_active_shopping_list() if existing: return existing.list_id result = tools.create_or_update_shopping_list( goal="Weekly grocery restock", items=SHOPPING_LIST_ITEMS, ) return result["list"]["list_id"]
def show_classification(db: Database, tools: ToolRegistry) -> None: decision_set = classify_all(db, tools)
buy = len(decision_set.buy) skip = len(decision_set.skip) optional = len(decision_set.optional) use_soon = len(decision_set.use_soon)
print(f" Total items evaluated: {len(decision_set.decisions)}") print(f" {'Buy':12s}{buy}") print(f" {'Skip':12s}{skip}") print(f" {'Optional':12s}{optional}") print(f" {'Use Soon':12s}{use_soon}")
relevant = [d for d in decision_set.decisions if d.shopping_list_status == "on_list"] if relevant: print() for d in relevant: icon = {"buy": "✓", "skip": "–", "optional": "?"}.get(d.action, " ") print(f" [{icon}] {d.display_name:25s} → {d.action:10s} {d.reason[:65]}")
def show_inventory_summary(db: Database) -> None: all_inv = db.get_inventory() active = [lot for lot in all_inv if lot.status == "active"] total_qty = sum(lot.quantity for lot in active) categories = sorted({lot.category for lot in active if lot.category}) locations = sorted({lot.storage_location_id for lot in active if lot.storage_location_id}) print(f" Active lots: {len(active)}") print(f" Total units: {total_qty:.1f}") print(f" Categories: {', '.join(categories) if categories else 'none'}") print(f" Locations: {', '.join(locations) if locations else 'none'}")
price_count = db.conn.execute("SELECT COUNT(*) FROM price_observations").fetchone()[0] print(f" Price obs: {price_count}")
def show_shopping_list_summary(db: Database) -> None: active = db.get_active_shopping_list() if not active: print(" No active shopping list.") return pending = [i for i in active.items if i.status == "pending"] must_buy = [i for i in pending if i.priority == "must_buy"] optional = [i for i in pending if i.priority == "optional"] print(f" Goal: {active.goal or '(none)'}") print(f" Items: {len(active.items)} total, {len(pending)} pending") print(f" Must-buy: {len(must_buy)} | Optional: {len(optional)}")
for item in pending: qty_s = f"{item.requested_quantity} {item.unit}" if item.requested_quantity and item.unit else "" pri = {"must_buy": "!", "optional": "?"}.get(item.priority, " ") print(f" [{pri}] {item.canonical_name:25s} {qty_s:15s} {item.reason[:40]}")
def main() -> None: db = Database(settings.db_path) tools = ToolRegistry(db)
section_gap = " " + "─" * 56
print() print(" ╔══════════════════════════════════════════════════════╗") print(" ║ ShopStack — Demo Walkthrough ║") print(" ╚══════════════════════════════════════════════════════╝") print()
print(" Step 1 │ Seed demo inventory") print(section_gap) inv_count = seed_inventory(db, tools) if inv_count: print(f" Added {inv_count} items (milk, rice, eggs, onion, ...)") else: print(" Inventory already populated — reusing existing data") print()
print(" Step 2 │ Seed price observations") print(section_gap) price_count = seed_prices(db, tools) print(f" Recorded {price_count} price observations across stores") print()
print(" Step 3 │ Create shopping list") print(section_gap) list_id = create_shopping_list(db, tools) active = db.get_active_shopping_list() item_count = len(active.items) if active and active.items else 0 print(f" Active shopping list ({list_id[:8]}...) with {item_count} items") if active and active.items: for item in active.items: pri = "⚡" if item.priority == "must_buy" else "·" qty_s = f"{item.requested_quantity} {item.unit}" if item.requested_quantity and item.unit else "" print(f" {pri} {item.canonical_name:22s} {qty_s:12s}") print()
print(" Step 4 │ Classify list against inventory") print(section_gap) show_classification(db, tools) print()
print(" Step 5 │ Summary") print(section_gap) show_inventory_summary(db) print() show_shopping_list_summary(db) print() print(" " + "─" * 56) print(" Demo walkthrough complete.") print(f" Database: {db.db_path}") print()
db.close()
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#!/usr/bin/env python3"""Pre-download BiRefNet segmentation model weights to HuggingFace cache.
Run once to avoid the 10-30s download on the first Shelf Scan call:
uv run python scripts/download_birefnet.py
After this, ``BiRefNetSegmentationProvider``'s first ``segment()`` callwill find weights already cached and load in <2s."""
import loggingimport sys
logging.basicConfig(level=logging.INFO, format="%(message)s")logger = logging.getLogger("download_birefnet")
def main() -> None: model_name = "ZhengPeng7/BiRefNet" logger.info("Downloading BiRefNet model weights from %s ...", model_name) logger.info("This may take 10-30s depending on bandwidth (~200MB).")
try: from huggingface_hub import snapshot_download, hf_hub_download
# Download all model repo files path = snapshot_download(model_name) logger.info("Model weights cached at: %s", path)
# Also explicitly cache the custom-code files birefnet_py = hf_hub_download(model_name, "birefnet.py") config_py = hf_hub_download(model_name, "BiRefNet_config.py") logger.info("Custom code cached: %s", birefnet_py) logger.info("Custom code cached: %s", config_py)
logger.info("") logger.info("✅ BiRefNet model weights pre-downloaded successfully.") logger.info("The first segment() call will now load from cache in <2s.") except ImportError: logger.error( "Missing huggingface_hub. Install with: uv pip install huggingface_hub" ) sys.exit(1) except Exception as e: logger.error("Download failed: %s", e) sys.exit(1)
if __name__ == "__main__": main()1234567891011121314151617181920212223242526import argparsefrom pathlib import Path
from shopstack.config import settingsfrom shopstack.market.sources.swiggy import load_snapshotfrom shopstack.persistence.database import Database
def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--data-dir", type=str, help="Path to data dir") args = parser.parse_args()
db = Database(settings.db_path) data_dir = Path(args.data_dir) if args.data_dir else None snapshot = load_snapshot(data_dir=data_dir)
db.save_market_snapshot(snapshot)
print("Imported Swiggy snapshot into ShopStack database.") print(f"Snapshot ID: {snapshot.snapshot_id}") print(f"Imported records: {len(snapshot.normalized_records)}")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148#!/usr/bin/env python3"""Generate canonical repo truth numbers from the live codebase.
Outputs:- DB table count- DB view count- DB trigger count- DB index count- Module count from module_registry- Tab count from TAB_ORDER- Service module count- Test count from pytest collection
Usage: python3 scripts/repo_truth.py python3 scripts/repo_truth.py --format json
This script exists per motto_v3 §0.3 (documentation continuity) andthe 2026-06-14 audit recommendation. Run it to keep README.md anddocs/ in sync with the actual code state."""from __future__ import annotations
import jsonimport reimport subprocessimport sysfrom pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def count_db_tables() -> int: """Count CREATE TABLE IF NOT EXISTS statements in database.py.""" db_file = REPO_ROOT / "shopstack" / "persistence" / "database.py" content = db_file.read_text(encoding="utf-8") return len(re.findall(r"CREATE TABLE\s+IF NOT EXISTS\s+\w+", content))
def count_db_views() -> int: """Count CREATE VIEW statements in database.py.""" db_file = REPO_ROOT / "shopstack" / "persistence" / "database.py" content = db_file.read_text(encoding="utf-8") return len(re.findall(r"CREATE VIEW\s+IF NOT EXISTS\s+\w+", content))
def count_db_triggers() -> int: """Count CREATE TRIGGER statements in database.py.""" db_file = REPO_ROOT / "shopstack" / "persistence" / "database.py" content = db_file.read_text(encoding="utf-8") return len(re.findall(r"CREATE TRIGGER\s+IF NOT EXISTS\s+\w+", content))
def count_db_indexes() -> int: """Count CREATE INDEX statements in database.py.""" db_file = REPO_ROOT / "shopstack" / "persistence" / "database.py" content = db_file.read_text(encoding="utf-8") return len(re.findall(r"CREATE INDEX\s+IF NOT EXISTS\s+\w+", content))
def list_table_names() -> list[str]: """List all DB table names.""" db_file = REPO_ROOT / "shopstack" / "persistence" / "database.py" content = db_file.read_text(encoding="utf-8") return sorted(re.findall(r"CREATE TABLE\s+IF NOT EXISTS\s+(\w+)", content))
def count_modules() -> int: """Count registered modules in module_registry.""" try: from shopstack.module_registry import get_all return len(get_all()) except Exception: return -1
def count_tabs() -> int: """Count tabs in TAB_ORDER.""" try: from shopstack.module_registry import TAB_ORDER return len(TAB_ORDER) except Exception: return -1
def count_test_files() -> int: """Count test files in tests/.""" tests_dir = REPO_ROOT / "tests" return sum(1 for p in tests_dir.glob("test_*.py") if p.is_file())
def collect_pytest_output() -> dict[str, int | str]: """Run pytest --collect-only and parse the summary line.""" try: result = subprocess.run( ["python3", "-m", "pytest", "--collect-only", "-q"], cwd=REPO_ROOT, capture_output=True, text=True, timeout=120, ) output = result.stdout + result.stderr # Look for "N tests collected" or similar m = re.search(r"(\d+)\s+tests?\s+collected", output) if m: return {"tests_collected": int(m.group(1))} except Exception as e: return {"error": str(e)} return {}
def main() -> int: tables = list_table_names() truth = { "database": { "tables": count_db_tables(), "views": count_db_views(), "triggers": count_db_triggers(), "indexes": count_db_indexes(), "table_names": tables, }, "modules": { "registered": count_modules(), "tabs": count_tabs(), }, "tests": { "files": count_test_files(), **collect_pytest_output(), }, }
if "--format" in sys.argv and "json" in sys.argv: print(json.dumps(truth, indent=2)) else: print(f"DB tables: {truth['database']['tables']}") print(f"DB views: {truth['database']['views']}") print(f"DB triggers: {truth['database']['triggers']}") print(f"DB indexes: {truth['database']['indexes']}") print(f"Modules: {truth['modules']['registered']}") print(f"Tabs: {truth['modules']['tabs']}") print(f"Test files: {truth['tests']['files']}") if "tests_collected" in truth["tests"]: print(f"Tests collected: {truth['tests']['tests_collected']}") return 0
if __name__ == "__main__": sys.exit(main())123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462#!/usr/bin/env python3"""Seed ShopStack with realistic Indian household demo data.
Canonical run path (preferred): uv run python scripts/seed_demo.py [--db PATH] .venv/bin/python scripts/seed_demo.py [--db PATH]
The ``shopstack`` package is importable directly because the projectis installed in editable mode (``pip install -e .`` / ``uv sync``).No ``sys.path`` manipulation is required; doing so would maskbroken installs and hide the canonical dependency declaration in``setup.py``.
Seeds: - 30+ inventory items across all locations (fridge, pantry, spice box, etc.) - 5 stores (Reliance Fresh, DMart, local kirana, etc.) - 20+ price observations across stores for price intelligence - Active shopping list with mixed priorities - 10+ purchase events - 5+ agent traces (market lens, shopping list, ask) - Low-stock and expiring-soon items for dashboard alerts"""
from __future__ import annotations
import argparseimport osfrom datetime import date, datetime, timedelta
from shopstack.config import settingsfrom shopstack.persistence.database import Databasefrom shopstack.schemas.models import ( InventoryLot, PriceObservation, PurchaseEvent, ShoppingListItem, Store,)from shopstack.traces.export import create_trace
def seed_stores(db: Database) -> int: stores = [ Store(store_id="reliance_fresh", name="Reliance Fresh", location="Koramangala", store_type="supermarket"), Store(store_id="dmart", name="DMart", location="HSR Layout", store_type="supermarket"), Store(store_id="kirana_1", name="Sharma Kirana", location="5th Block", store_type="kirana"), Store(store_id="big_basket", name="BigBasket", location="Online", store_type="online"), Store(store_id="local_vendor", name="Green Vegetable Cart", location="Street Corner", store_type="vendor"), ] for s in stores: existing = db.conn.execute("SELECT 1 FROM stores WHERE store_id = ?", (s.store_id,)).fetchone() if not existing: db.add_store(s) return len(stores)
def seed_inventory(db: Database) -> int: today = date.today() yesterday = today - timedelta(days=1) last_week = today - timedelta(days=7) two_weeks_ago = today - timedelta(days=14)
items = [ # --- Fridge --- {"canonical_name": "milk", "display_name": "Amul Taaza Milk", "quantity": 1.5, "unit": "L", "location": "fridge", "category": "dairy", "price": 64.0, "store": "kirana_1", "purchase_date": yesterday, "expiry": today + timedelta(days=3)}, {"canonical_name": "curd", "display_name": "Nestle Curd", "quantity": 0.4, "unit": "kg", "location": "fridge", "category": "dairy", "price": 45.0, "store": "reliance_fresh", "purchase_date": yesterday, "expiry": today + timedelta(days=2)}, {"canonical_name": "eggs", "display_name": "Country Eggs", "quantity": 8.0, "unit": "pieces", "location": "fridge_top", "category": "protein", "price": 84.0, "store": "kirana_1", "purchase_date": last_week}, {"canonical_name": "cheese", "display_name": "Amul Cheese Slices", "quantity": 1.0, "unit": "pack", "location": "fridge", "category": "dairy", "price": 135.0, "store": "dmart", "purchase_date": last_week, "expiry": today + timedelta(days=30)}, {"canonical_name": "butter", "display_name": "Amul Butter", "quantity": 0.5, "unit": "kg", "location": "fridge", "category": "dairy", "price": 235.0, "store": "reliance_fresh", "purchase_date": last_week}, {"canonical_name": "coriander", "display_name": "Fresh Coriander", "quantity": 1.0, "unit": "bunch", "location": "fridge_drawer", "category": "vegetable", "price": 10.0, "store": "local_vendor", "purchase_date": yesterday, "expiry": today + timedelta(days=2)}, {"canonical_name": "ginger", "display_name": "Ginger", "quantity": 0.2, "unit": "kg", "location": "fridge_drawer", "category": "vegetable", "price": 12.0, "store": "local_vendor", "purchase_date": last_week}, {"canonical_name": "green_chili", "display_name": "Green Chilies", "quantity": 0.1, "unit": "kg", "location": "fridge_drawer", "category": "vegetable", "price": 8.0, "store": "local_vendor", "purchase_date": yesterday}, {"canonical_name": "bread", "display_name": "Britannia Brown Bread", "quantity": 1.0, "unit": "loaf", "location": "fridge_top", "category": "bakery", "price": 55.0, "store": "kirana_1", "purchase_date": yesterday, "expiry": today + timedelta(days=4)},
# --- Pantry --- {"canonical_name": "rice", "display_name": "India Gate Basmati", "quantity": 8.0, "unit": "kg", "location": "pantry_mid", "category": "grains", "price": 680.0, "store": "dmart", "purchase_date": two_weeks_ago}, {"canonical_name": "wheat_flour", "display_name": "Aashirvaad Atta", "quantity": 4.5, "unit": "kg", "location": "pantry_mid", "category": "grains", "price": 295.0, "store": "reliance_fresh", "purchase_date": last_week}, {"canonical_name": "toor_dal", "display_name": "Tata Toor Dal", "quantity": 0.8, "unit": "kg", "location": "pantry_top", "category": "pulses", "price": 165.0, "store": "dmart", "purchase_date": two_weeks_ago}, {"canonical_name": "moong_dal", "display_name": "Organic Moong Dal", "quantity": 0.5, "unit": "kg", "location": "pantry_top", "category": "pulses", "price": 120.0, "store": "big_basket", "purchase_date": two_weeks_ago}, {"canonical_name": "onion", "display_name": "Onion", "quantity": 2.0, "unit": "kg", "location": "pantry_mid", "category": "vegetable", "price": 40.0, "store": "local_vendor", "purchase_date": last_week}, {"canonical_name": "potato", "display_name": "Potato", "quantity": 1.5, "unit": "kg", "location": "pantry_mid", "category": "vegetable", "price": 30.0, "store": "local_vendor", "purchase_date": last_week}, {"canonical_name": "garlic", "display_name": "Garlic", "quantity": 0.3, "unit": "kg", "location": "pantry", "category": "vegetable", "price": 35.0, "store": "local_vendor", "purchase_date": two_weeks_ago}, {"canonical_name": "cooking_oil", "display_name": "Fortune Sunflower Oil", "quantity": 0.8, "unit": "L", "location": "pantry_mid", "category": "cooking", "price": 165.0, "store": "dmart", "purchase_date": two_weeks_ago}, {"canonical_name": "salt", "display_name": "Tata Salt", "quantity": 0.9, "unit": "kg", "location": "pantry_top", "category": "staples", "price": 28.0, "store": "kirana_1", "purchase_date": two_weeks_ago}, {"canonical_name": "sugar", "display_name": "Madhur Sugar", "quantity": 1.8, "unit": "kg", "location": "pantry_top", "category": "staples", "price": 90.0, "store": "kirana_1", "purchase_date": two_weeks_ago}, {"canonical_name": "tea_leaves", "display_name": "Tata Premium Tea", "quantity": 0.2, "unit": "kg", "location": "pantry_top", "category": "beverage", "price": 160.0, "store": "reliance_fresh", "purchase_date": two_weeks_ago}, {"canonical_name": "biscuits", "display_name": "Parle-G Biscuits", "quantity": 2.0, "unit": "pack", "location": "pantry", "category": "snacks", "price": 20.0, "store": "kirana_1", "purchase_date": last_week},
# --- Spice Box --- {"canonical_name": "turmeric_powder", "display_name": "Turmeric Powder", "quantity": 0.1, "unit": "kg", "location": "spice_box", "category": "spice", "price": 18.0, "store": "kirana_1", "purchase_date": two_weeks_ago}, {"canonical_name": "chili_powder", "display_name": "Red Chili Powder", "quantity": 0.1, "unit": "kg", "location": "spice_box", "category": "spice", "price": 22.0, "store": "kirana_1", "purchase_date": two_weeks_ago}, {"canonical_name": "garam_masala", "display_name": "MDH Garam Masala", "quantity": 0.05, "unit": "kg", "location": "spice_box", "category": "spice", "price": 55.0, "store": "reliance_fresh", "purchase_date": two_weeks_ago}, {"canonical_name": "mustard_seeds", "display_name": "Mustard Seeds", "quantity": 0.05, "unit": "kg", "location": "spice_box", "category": "spice", "price": 15.0, "store": "kirana_1", "purchase_date": two_weeks_ago}, {"canonical_name": "cumin_seeds", "display_name": "Cumin Seeds (Jeera)", "quantity": 0.05, "unit": "kg", "location": "spice_box", "category": "spice", "price": 20.0, "store": "kirana_1", "purchase_date": two_weeks_ago},
# --- Bathroom --- {"canonical_name": "toothpaste", "display_name": "Colgate Strong Teeth", "quantity": 1.0, "unit": "tube", "location": "bathroom_cabinet", "category": "personal_care", "price": 99.0, "store": "dmart", "purchase_date": two_weeks_ago}, {"canonical_name": "soap", "display_name": "Dove Cream Bar", "quantity": 3.0, "unit": "bar", "location": "bathroom_cabinet", "category": "personal_care", "price": 42.0, "store": "dmart", "purchase_date": two_weeks_ago}, {"canonical_name": "shampoo", "display_name": "Head & Shoulders", "quantity": 0.34, "unit": "L", "location": "bathroom_cabinet", "category": "personal_care", "price": 185.0, "store": "reliance_fresh", "purchase_date": two_weeks_ago},
# --- Low stock / expiring for dashboard alerts --- {"canonical_name": "tomato", "display_name": "Tomato", "quantity": 0.3, "unit": "kg", "location": "fridge_drawer", "category": "vegetable", "price": 18.0, "store": "local_vendor", "purchase_date": last_week, "expiry": today + timedelta(days=1)}, {"canonical_name": "lemon", "display_name": "Lemon", "quantity": 2.0, "unit": "pieces", "location": "fridge_drawer", "category": "vegetable", "price": 6.0, "store": "local_vendor", "purchase_date": yesterday, "expiry": today + timedelta(days=5)}, ]
existing = db.get_inventory() if existing: return 0
added = 0 for item in items: lot = InventoryLot( canonical_name=item["canonical_name"], display_name=item["display_name"], quantity=item["quantity"], unit=item["unit"], storage_location_id=item["location"], purchase_date=item.get("purchase_date", today), estimated_use_by_date=item.get("expiry"), price_paid=item.get("price"), category=item.get("category", ""), source_event_id="demo_seed", ) db.add_inventory_lot(lot) added += 1
return added
def seed_prices(db: Database) -> int: today = date.today() last_week = today - timedelta(days=7) two_weeks = today - timedelta(days=14) three_weeks = today - timedelta(days=21)
prices = [ # Milk - price comparison across stores ("milk", 64.0, 1.0, "L", "kirana_1", "Sharma Kirana", today), ("milk", 68.0, 1.0, "L", "reliance_fresh", "Reliance Fresh", today), ("milk", 62.0, 1.0, "L", "dmart", "DMart", last_week), ("milk", 66.0, 1.0, "L", "big_basket", "BigBasket", last_week), ("milk", 60.0, 1.0, "L", "kirana_1", "Sharma Kirana", two_weeks), ("milk", 63.0, 1.0, "L", "dmart", "DMart", three_weeks),
# Rice - showing price trend ("rice", 680.0, 5.0, "kg", "dmart", "DMart", today), ("rice", 720.0, 5.0, "kg", "reliance_fresh", "Reliance Fresh", last_week), ("rice", 695.0, 5.0, "kg", "big_basket", "BigBasket", last_week), ("rice", 710.0, 5.0, "kg", "dmart", "DMart", two_weeks), ("rice", 730.0, 5.0, "kg", "reliance_fresh", "Reliance Fresh", three_weeks),
# Onion - volatile pricing ("onion", 40.0, 1.0, "kg", "local_vendor", "Green Vegetable Cart", today), ("onion", 35.0, 1.0, "kg", "dmart", "DMart", today), ("onion", 38.0, 1.0, "kg", "reliance_fresh", "Reliance Fresh", last_week), ("onion", 28.0, 1.0, "kg", "local_vendor", "Green Vegetable Cart", two_weeks), ("onion", 22.0, 1.0, "kg", "dmart", "DMart", three_weeks),
# Other items ("eggs", 84.0, 12.0, "pieces", "kirana_1", "Sharma Kirana", today), ("eggs", 90.0, 12.0, "pieces", "reliance_fresh", "Reliance Fresh", last_week), ("wheat_flour", 295.0, 5.0, "kg", "reliance_fresh", "Reliance Fresh", today), ("wheat_flour", 280.0, 5.0, "kg", "dmart", "DMart", last_week), ("cooking_oil", 165.0, 1.0, "L", "dmart", "DMart", today), ("cooking_oil", 175.0, 1.0, "L", "kirana_1", "Sharma Kirana", last_week), ("toor_dal", 165.0, 1.0, "kg", "dmart", "DMart", today), ("toor_dal", 180.0, 1.0, "kg", "big_basket", "BigBasket", last_week), ("tomato", 18.0, 1.0, "kg", "local_vendor", "Green Vegetable Cart", today), ("tomato", 22.0, 1.0, "kg", "reliance_fresh", "Reliance Fresh", last_week), ("potato", 30.0, 1.0, "kg", "local_vendor", "Green Vegetable Cart", today), ("potato", 28.0, 1.0, "kg", "dmart", "DMart", last_week), ]
added = 0 for canonical, price, qty, unit, store_id, store_name, obs_date in prices: obs = PriceObservation( canonical_name=canonical, price=price, quantity=qty, unit=unit, store_id=store_id, store_name=store_name, observation_date=obs_date, notes="demo_seed", ) db.record_price(obs) added += 1
return added
def seed_shopping_list(db: Database) -> int: existing = db.get_active_shopping_list() if existing: return 0
sl = db.create_shopping_list(name="Weekly Grocery Run", goal="Stock up for the week")
items = [ ("milk", 2.0, "L", "must_buy", "Only 1.5L left, family uses 0.5L/day"), ("coriander", 2.0, "bunch", "must_buy", "Need fresh for weekend cooking"), ("tomato", 1.0, "kg", "must_buy", "Almost out, 0.3kg left"), ("bread", 1.0, "loaf", "optional", "Current loaf expires in 4 days"), ("toor_dal", 1.0, "kg", "must_buy", "Running low on dal"), ("biscuits", 3.0, "pack", "optional", "Kids want Parle-G"), ("toothpaste", 1.0, "tube", "must_buy", "Colgate almost empty"), ]
for canonical, qty, unit, priority, reason in items: item = ShoppingListItem( canonical_name=canonical, requested_quantity=qty, unit=unit, priority=priority, reason=reason, ) db.add_list_item(sl.list_id, item)
return len(items)
def seed_purchase_events(db: Database) -> int: today = datetime.now() events = [ ("milk", 1.0, "L", 64.0, "kirana_1", "Sharma Kirana", today - timedelta(days=1)), ("rice", 5.0, "kg", 680.0, "dmart", "DMart", today - timedelta(days=7)), ("eggs", 12.0, "pieces", 84.0, "kirana_1", "Sharma Kirana", today - timedelta(days=7)), ("onion", 2.0, "kg", 40.0, "local_vendor", "Green Vegetable Cart", today - timedelta(days=7)), ("wheat_flour", 5.0, "kg", 295.0, "reliance_fresh", "Reliance Fresh", today - timedelta(days=7)), ("cooking_oil", 1.0, "L", 165.0, "dmart", "DMart", today - timedelta(days=14)), ("toor_dal", 1.0, "kg", 165.0, "dmart", "DMart", today - timedelta(days=14)), ("toothpaste", 1.0, "tube", 99.0, "dmart", "DMart", today - timedelta(days=14)), ("butter", 0.5, "kg", 235.0, "reliance_fresh", "Reliance Fresh", today - timedelta(days=7)), ("bread", 1.0, "loaf", 55.0, "kirana_1", "Sharma Kirana", today - timedelta(days=1)), ]
added = 0 for canonical, qty, unit, price, store_id, store_name, ts in events: event = PurchaseEvent( canonical_name=canonical, quantity=qty, unit=unit, total_price=price, currency="INR", source_type="manual", store_name=store_name, confirmed=True, timestamp=ts, ) db.add_purchase_event(event) added += 1
return added
def seed_traces(db: Database) -> int: traces_data = [ { "input_type": "vision", "user_goal": "market_lens", "perception": {"items_detected": ["milk", "bread", "eggs"], "image": True, "audio": False}, "decision": {"decision_count": 3, "items": ["milk:buy", "bread:optional", "eggs:skip"]}, "tool_calls": [ {"tool_name": "compare_visible_item_to_inventory", "args": {"canonical_name": "milk", "quantity": 1.0, "unit": "unit"}}, {"tool_name": "compare_visible_item_to_inventory", "args": {"canonical_name": "bread", "quantity": 1.0, "unit": "unit"}}, {"tool_name": "compare_visible_item_to_inventory", "args": {"canonical_name": "eggs", "quantity": 1.0, "unit": "unit"}}, ], "response": "<div>Market Lens: 1 buy, 1 optional, 1 skip</div>", "confirmation": "confirmed-buy", }, { "input_type": "text", "user_goal": "Plan shopping for the week", "perception": {"goal": "Weekly grocery run", "item_count": 7}, "decision": {"must_buy": 5, "optional": 2, "skip": 0}, "tool_calls": [{"tool_name": "create_or_update_shopping_list", "args": { "items": [ {"canonical_name": "milk", "requested_quantity": 2, "unit": "L", "priority": "must_buy"}, {"canonical_name": "toothpaste", "requested_quantity": 1, "unit": "tube", "priority": "must_buy"}, ], "goal": "Weekly grocery run", }}], "response": "<div>Created shopping list with 7 items</div>", "confirmation": "auto-summarized", }, { "input_type": "text", "user_goal": "ask_shopstack", "perception": {"query": "Do we have milk?"}, "decision": {"response_type": "ask_shopstack", "found": True}, "tool_calls": [{"tool_name": "find_item", "args": {"query": "milk"}}], "response": "<div>Found Amul Taaza Milk (1.5L) in Fridge</div>", "confirmation": "responded", }, { "input_type": "form", "user_goal": "add_purchase", "perception": {"item": "rice", "quantity": 8, "store": "DMart"}, "decision": {"action": "add_inventory_item", "lot_id": "demo_lot"}, "tool_calls": [{"tool_name": "add_inventory_item", "args": {"canonical_name": "rice", "quantity": 8, "unit": "kg"}}], "response": "<div>Added India Gate Basmati (8kg)</div>", "confirmation": "confirmed-by-user", }, { "input_type": "form", "user_goal": "complete_shopping_list", "perception": {"goal": "Weekly Grocery Run", "item_count": 7, "added_count": 5}, "decision": {"action": "mark_list_complete"}, "tool_calls": [], "response": "<div>Completed list with 5 items added to inventory</div>", "confirmation": "auto-confirmed", }, ]
added = 0 for t in traces_data: create_trace( db, input_type=t["input_type"], user_goal=t["user_goal"], redacted_user_request=t["user_goal"], perception=t["perception"], inventory_context={}, decision=t["decision"], proposed_tool_calls=t["tool_calls"], final_response=t["response"], human_confirmation=t["confirmation"], ) added += 1
return added
def seed_field_notes(db: Database) -> None: notes = """## Kitchen Notes
- Milk delivery: Sharma Kirana delivers by 7 AM, best to order previous night- Tomato prices spike on weekends, buy from local vendor on weekdays- DMart has best prices for staples (rice, dal, oil) but fresh produce is better at the cart
## Price Watch
- Onion prices trending up: ₹22 → ₹40 in 3 weeks- Rice prices softening: ₹730 → ₹680 in 3 weeks- Milk stable at ₹60-68 across stores
## Recipes This Week
- Dal chawal (need toor dal + rice)- Tomato onion sabzi (need more tomatoes)- Egg curry (eggs expiring soon, use by Thursday)""" db.set_config_value("field_notes_markdown", notes)
def main(): parser = argparse.ArgumentParser(description="Seed ShopStack demo data") parser.add_argument("--db", default=None, help="Database path (default: settings.db_path)") parser.add_argument("--reset", action="store_true", help="Clear existing data before seeding") args = parser.parse_args()
db_path = args.db or settings.db_path if args.reset: for suffix in ("", "-shm", "-wal"): f = db_path + suffix if os.path.exists(f): os.remove(f) print(f"Cleared existing database: {db_path}")
db = Database(db_path)
print("Seeding ShopStack demo data...") stores = seed_stores(db) print(f" Stores: {stores}")
inv = seed_inventory(db) print(f" Inventory: {inv} items")
prices = seed_prices(db) print(f" Price observations: {prices}")
sl = seed_shopping_list(db) print(f" Shopping list items: {sl}")
purchases = seed_purchase_events(db) print(f" Purchase events: {purchases}")
traces = seed_traces(db) print(f" Agent traces: {traces}")
seed_field_notes(db) print(" Field notes: configured")
db.close() print(f"\nDone! Database: {db_path}") print("Run: uv run python app.py")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123import osimport sysfrom datetime import datetime, timedelta
# Ensure shopstack is in python pathsys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from shopstack.persistence.database import Databasefrom shopstack.schemas.models import ( InventoryLot, ShoppingListItem, Trace, ToolCall, HouseholdLocation,)
def seed(): print("Seeding ShopStack Database for Demo Walkthrough...") db = Database() # 1. Typical Indian Household Locations # _seed_locations already adds basics, but we can add specifics locs = [ HouseholdLocation(location_id="rice_drum", name="Rice Drum", parent_location_id="kitchen", location_type="cabinet"), HouseholdLocation(location_id="atta_bin", name="Atta Bin", parent_location_id="kitchen", location_type="cabinet"), HouseholdLocation(location_id="onion_basket", name="Onion Basket", parent_location_id="kitchen", location_type="shelf"), ] for loc in locs: try: db.conn.execute( "INSERT INTO household_locations (location_id, name, parent_location_id, location_type) VALUES (?, ?, ?, ?)", (loc.location_id, loc.name, loc.parent_location_id, loc.location_type), ) except Exception: pass # ignore duplicates if run twice db.conn.commit() print("✅ Locations seeded.")
# 2. Previous purchase history & waste calculation now = datetime.now() # Milk - wasted lot_milk = InventoryLot( canonical_name="milk_full_cream", display_name="Full Cream Milk", category="Dairy", quantity=2, unit="L", status="discarded", storage_location_id="fridge_door", purchase_date=(now - timedelta(days=10)).date() ) db.add_inventory_lot(lot_milk) db.conn.execute("INSERT INTO movement_events (movement_id, lot_id, to_location_id, timestamp) VALUES (?, ?, ?, ?)", ("mov_1", lot_milk.lot_id, "trash", now.isoformat())) # Spinach - wasted lot_spinach = InventoryLot( canonical_name="spinach", display_name="Palak (Spinach)", category="Vegetables", quantity=500, unit="g", status="discarded", storage_location_id="fridge_drawer", purchase_date=(now - timedelta(days=5)).date() ) db.add_inventory_lot(lot_spinach) db.conn.execute("INSERT INTO movement_events (movement_id, lot_id, to_location_id, timestamp) VALUES (?, ?, ?, ?)", ("mov_2", lot_spinach.lot_id, "trash", now.isoformat())) # Rice - consumed lot_rice = InventoryLot( canonical_name="basmati_rice", display_name="Basmati Rice", category="Grains", quantity=5, unit="kg", status="used", storage_location_id="rice_drum", purchase_date=(now - timedelta(days=30)).date() ) db.add_inventory_lot(lot_rice) db.conn.execute("INSERT INTO movement_events (movement_id, lot_id, to_location_id, timestamp) VALUES (?, ?, ?, ?)", ("mov_3", lot_rice.lot_id, "consumed", now.isoformat())) db.conn.commit() print("✅ Purchase history & waste patterns seeded.")
# 3. Active Shopping List showing off Decision Engine Confidence Levels sl = db.create_shopping_list(name="Weekend Grocery", goal="Prep for next week") items = [ ShoppingListItem(canonical_name="milk_full_cream", requested_quantity=2, unit="L", priority="must_buy", reason="Staple, running out.", status="pending"), ShoppingListItem(canonical_name="spinach", requested_quantity=500, unit="g", priority="avoid_buying", reason="Wasted often in recent history. Suggest substituting.", status="pending"), ShoppingListItem(canonical_name="basmati_rice", requested_quantity=5, unit="kg", priority="optional", reason="Prices are high this week, wait if possible.", status="pending"), ShoppingListItem(canonical_name="maggi_noodles", requested_quantity=4, unit="pack", priority="must_buy", reason="User preference learned.", status="pending"), ShoppingListItem(canonical_name="onions", requested_quantity=2, unit="kg", priority="must_buy", reason="Staple ingredient.", status="pending"), ] for item in items: db.add_list_item(sl.list_id, item)
print("✅ Active shopping list seeded.")
# 4. Traces for the Trace Viewer t = Trace( input_type="voice", user_goal="Add milk to list", redacted_user_request="Hey, we are out of milk.", perception={"intent": "add_to_list", "entities": ["milk_full_cream"]}, inventory_context={"milk_full_cream": {"in_stock": 0, "wasted_often": True}}, decision={"action": "add_with_warning", "confidence": 0.85}, proposed_tool_calls=[ ToolCall(tool_name="add_to_shopping_list", args={"items": ["milk_full_cream"]}, success=True) ], final_response="Added Full Cream Milk to your shopping list. Note: You've discarded this twice recently." ) db.save_trace(t)
db.close() print("✅ Seed complete! Run 'uv run python app.py' to explore the demo state.")
if __name__ == '__main__': seed()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264#!/usr/bin/env python3"""verification-loop: 6-phase verification pipeline for ShopStack.
Usage: python scripts/verify.py # Run all phases python scripts/verify.py --quick # Skip security scan + diff review python scripts/verify.py --phase build # Run a single phase
Exit code: 0 if all passed, 1 if any failures."""
from __future__ import annotations
import argparseimport subprocessimport sysimport timefrom pathlib import Path
REPO = Path(__file__).resolve().parent.parent
VENV_PYTEST = str(REPO / ".venv" / "bin" / "pytest")VENV_RUFF = str(REPO / ".venv" / "bin" / "ruff")VENV_PYRIGHT = str(REPO / ".venv" / "bin" / "pyright")
def run(cmd: list[str], timeout: int = 180, cwd: str | None = None) -> subprocess.CompletedProcess: return subprocess.run( cmd, capture_output=True, text=True, timeout=timeout, cwd=cwd or str(REPO), )
def phase_build() -> tuple[bool, str]: print(" Phase 1/6: Build check ...", end=" ") result = run([sys.executable, "-c", "import shopstack; print('OK')"]) if result.returncode == 0: print("PASS") return True, result.stdout.strip() print("FAIL") return False, result.stderr
def phase_types() -> tuple[bool, str]: print(" Phase 2/6: Type check ...", end=" ") # Try mypy first, then pyright, fall back to import check try: result = run(["mypy", "shopstack/", "--ignore-missing-imports", "--no-error-summary"], timeout=30) if result.returncode == 0: print("PASS (mypy)") return True, "" print(f"FAIL (mypy: {result.returncode})") return False, result.stdout[-500:] if len(result.stdout) > 500 else result.stdout except FileNotFoundError: pass try: pyright_bin = VENV_PYRIGHT if Path(VENV_PYRIGHT).exists() else "pyright" result = run([pyright_bin, "shopstack/"], timeout=300) if result.returncode == 0: print("PASS (pyright)") return True, "" print(f"FAIL (pyright: {result.returncode})") return False, result.stdout[-500:] if len(result.stdout) > 500 else result.stdout except FileNotFoundError: pass # Fallback: import check result = run([sys.executable, "-c", "import shopstack; print('imported')"]) if "imported" in result.stdout: print("PASS (import check — no static checker installed)") return True, result.stdout.strip() print("SKIP") return True, ""
def phase_lint() -> tuple[bool, str]: print(" Phase 3/6: Lint check ...", end=" ") try: ruff_bin = VENV_RUFF if Path(VENV_RUFF).exists() else "ruff" result = run([ruff_bin, "check", "shopstack/", "tests/", "scripts/"], timeout=30) if result.returncode == 0: print("PASS") return True, "" print(f"FAIL ({result.returncode} error(s))") return False, result.stdout or result.stderr except FileNotFoundError: print("SKIP (ruff not installed)") return True, ""
def phase_tests() -> tuple[bool, str]: print(" Phase 4/6: Test suite ...", end=" ") pytest_bin = VENV_PYTEST if Path(VENV_PYTEST).exists() else "pytest" result = run([pytest_bin, "tests/", "-q", "--tb=short", "--no-header"], timeout=600) summary_line = [line for line in result.stdout.split("\n") if line.strip() and ("passed" in line.lower() or "failed" in line.lower())] summary = summary_line[-1] if summary_line else result.stdout.strip()[-200:] if result.returncode == 0: prefix = result.stdout.strip().split("\n")[-1] if result.stdout.strip() else "" print(f"PASS ({prefix})" if prefix else "PASS") return True, summary print("FAIL") return False, result.stdout[-500:] if len(result.stdout) > 500 else result.stdout
def phase_security() -> tuple[bool, str]: print(" Phase 5/6: Security scan ...", end=" ") issues: list[str] = [] shopstack_src = REPO / "shopstack"
def _is_false_positive(line: str) -> bool: """Filter out lines that match a secret pattern but aren't real secrets.""" # Comments and docstrings stripped = line.strip() if stripped.startswith("#") or stripped.startswith('"""') or stripped.startswith("'''"): return True # Function/class definitions if "def " in line or "class " in line or "lambda" in line: return True # Parameter / attribute / type annotations if "=" in line and not any( tok in line for tok in ["sk-", "sk_proj", "sk_svc", "ghp_", "gho_", "ghu_", "ghs_", "ghr_", "AKIA", "BEGIN", "PRIVATE"] ): # "=" without a secret-format token is likely a config field assignment return True return False
# Patterns that look like real secrets (long random tokens with known prefixes) # We require several characters after the prefix so that identifiers like # "ask-output" or "task-id" don't trigger false positives. Real OpenAI keys # are 48+ chars after "sk-", GitHub tokens are 36+ chars after "ghp_", etc. secret_prefix_patterns = [ "sk-[A-Za-z0-9_-]{20,}", # OpenAI "skproj_[A-Za-z0-9]{8,}", "sk_svc_[A-Za-z0-9]{8,}", "ghp_[A-Za-z0-9]{20,}", "gho_[A-Za-z0-9]{20,}", "ghu_[A-Za-z0-9]{20,}", "ghs_[A-Za-z0-9]{20,}", "ghr_[A-Za-z0-9]{20,}", "AKIA[0-9A-Z]{12,}", "xoxb-[A-Za-z0-9-]{20,}", "xoxp-[A-Za-z0-9-]{20,}", ] for pattern in secret_prefix_patterns: result = run(["rg", "-n", pattern, "-g", "*.py", str(shopstack_src)], timeout=15) if result.returncode == 0 and result.stdout.strip(): for line in result.stdout.strip().split("\n"): if not _is_false_positive(line): issues.append(line)
# PEM private keys result = run(["rg", "-n", "-----BEGIN", str(REPO)], timeout=10) if result.returncode == 0 and result.stdout.strip(): for line in result.stdout.strip().split("\n")[:5]: issues.append(f"PEM key: {line[:150]}")
# Generic api_key = 'sk-...' style hardcoded secrets. Tests use these as # intentional fixtures, so exclude the tests/ directory and the verify # script itself (which documents this pattern). Use a literal string # match to avoid false-positive matches inside comments. result = run( ["rg", "-n", "-g", "!tests/", "-g", "!scripts/verify.py", r"api_key\s*=\s*['\"]sk-", str(REPO)], timeout=10, ) if result.returncode == 0 and result.stdout.strip(): for line in result.stdout.strip().split("\n")[:5]: if line.strip().startswith("#"): continue issues.append(f"Hardcoded secret: {line[:150]}")
if not issues: print("PASS") return True, "" print(f"WARN ({len(issues)} issue(s))") return True, "\n".join(issues[:10])
def phase_diff() -> tuple[bool, str]: print(" Phase 6/6: Diff review ...", end=" ") result = run(["git", "diff", "--stat"]) if result.returncode == 0 and result.stdout.strip(): lines = result.stdout.strip().split("\n") print(f"{len(lines)} file(s) changed") return True, result.stdout.strip() print("No changes") return True, ""
def run_all(quick: bool = False) -> int: phases = [ ("Build", phase_build), ("Types", phase_types), ("Lint", phase_lint), ("Tests", phase_tests), ] if not quick: phases += [ ("Security", phase_security), ("Diff", phase_diff), ]
results: list[tuple[str, bool, str]] = [] all_pass = True t0 = time.monotonic()
for name, fn in phases: passed, detail = fn() results.append((name, passed, detail)) if not passed: all_pass = False
elapsed = time.monotonic() - t0
print() print("=" * 50) print(" VERIFICATION REPORT") print("=" * 50) for name, passed, detail in results: status = "PASS" if passed else "FAIL" print(f" {name:15s} [{status}]") if not passed and detail: for line in detail.strip().split("\n")[:5]: print(f" {line}") print("-" * 50) print(f" Overall: {'READY' if all_pass else 'HAS ISSUES'}") print(f" Time: {elapsed:.1f}s") print("=" * 50) return 0 if all_pass else 1
def main() -> int: parser = argparse.ArgumentParser(description="ShopStack verification pipeline") parser.add_argument("--quick", action="store_true", help="Skip security scan + diff review") parser.add_argument("--phase", choices=["build", "types", "lint", "tests", "security", "diff"], help="Run a single phase") args = parser.parse_args()
if args.phase: phase_map = { "build": ("Build", phase_build), "types": ("Types", phase_types), "lint": ("Lint", phase_lint), "tests": ("Tests", phase_tests), "security": ("Security", phase_security), "diff": ("Diff", phase_diff), } name, fn = phase_map[args.phase] print(f"Running phase: {name}") passed, detail = fn() print(f" {name}: {'PASS' if passed else 'FAIL'}")
if not passed and detail: print(" Details:") for line in detail.strip().split("\n")[:10]: print(f" {line}") return 0 if passed else 1
return run_all(quick=args.quick)
if __name__ == "__main__": sys.exit(main()).commandcode/settings.local.jsonAdded+1
.commandcode/taste/taste.mdAdded+4
.dockerignoreAdded+35
.gitattributes+8
.github/workflows/ci.ymlAdded+91
.github/workflows/doc-health.ymlAdded+57
.github/workflows/quality-gates.ymlAdded+143
.github/workflows/wcag.ymlAdded+72
.gitignoreAdded+49
.pre-commit-config.yaml+12
.tmp-workspace-click.pngAdded

Large File Pointer Details
- SHA256: 810d84df6b9d5a31feb17a8f3b955ecb21e2967c15e98b301b892bd397af545b
- Pointer size: 131 Bytes
- Size of remote file: 296 kB
Docs/README.mdAdded+13
MODEL_CATALOG.mdAdded+225
README.md+4-4
SUBMISSION_SMOKE.mdAdded+85
app.py+55-32
benchmarks/__init__.pyAdded
benchmarks/bench_planner_tool_calling.pyAdded+252
benchmarks/conftest.pyAdded+718
benchmarks/pytest.iniAdded+4
benchmarks/test_accessibility_timing.pyAdded+154
benchmarks/test_baseline_benchmarks.pyAdded+111
benchmarks/test_benchmarks.pyAdded
benchmarks/test_db_operations.pyAdded+161
benchmarks/test_portability.pyAdded+100
benchmarks/test_services.pyAdded+71
benchmarks/trends/.gitkeepAdded
data/parser_training_real.jsonlAdded+111
data/receipts/20260615T121358_Demo_Mart.jsonAdded+19
data/swiggy_fresh_vegetables_cards_6jun26.csvAdded+90
data/swiggy_fresh_vegetables_cards_6jun26.jsonAdded+1337
data/swiggy_fresh_vegetables_extraction_summary__6jun26.mdAdded+185
fly.tomlAdded+32
freebuff_transcript_extracted.mdAdded+166
issue_review_2026-06-13_improvement_opportunities.mdAdded+150
motto_v2.mdAdded+1222
motto_v3.mdAdded+1222
pyproject.tomlAdded+85
railway.jsonAdded+14
render.yamlAdded+26
scripts/capture_blinkit.pyAdded+96
scripts/capture_dmart.pyAdded+96
scripts/capture_zepto.pyAdded+96
scripts/demo_walkthrough.pyAdded+224
scripts/download_birefnet.pyAdded+51
scripts/import_swiggy_snapshot.pyAdded+26
scripts/repo_truth.pyAdded+148
scripts/seed_demo.pyAdded+462
scripts/seed_walkthrough.pyAdded+123
scripts/verify.pyAdded+264