Skip to content

Copilot/fix backend GitHub actions job#11

Open
ScooterStuff wants to merge 27 commits into
Instalily:mainfrom
ScooterStuff:copilot/fix-backend-github-actions-job
Open

Copilot/fix backend GitHub actions job#11
ScooterStuff wants to merge 27 commits into
Instalily:mainfrom
ScooterStuff:copilot/fix-backend-github-actions-job

Conversation

@ScooterStuff

Copy link
Copy Markdown

No description provided.

ScooterStuff and others added 27 commits June 10, 2026 19:33
…tool

- PhotoUploader: camera/file capture -> lazy-loaded tesseract.js -> tiered
  model-number extractor (pure, unit-tested) -> smart prefill into composer
- order_support tool removed (registry entry only - loop untouched)
- repairs: workspace sync corruption (NUL-padded/truncated saves) fixed by
  splicing tails from git history; see DEVIATIONS
Pluggable appliances:
- backend/app/appliances.toml is now the single source of truth (canonical
  name + keywords per appliance). Adding a new appliance is a TOML edit +
  seed URLs in scraper/seeds.py + re-ingest.
- New backend/app/appliances.py loads it once and exposes ApplianceType
  (Pydantic Literal), ALL_KEYWORDS, and a display helper. tools.py / guard.py
  / prompts.py all read from it; SYSTEM_PROMPT is interpolated at import time.
- Drops stale order_support reference from SYSTEM_PROMPT.

Honesty trace panel ("How I know this"):
- Backend: tools.result_summary() builds a one-line summary per tool result.
  agent.py emits enriched tool_end events (args + summary) plus a final
  'trace' SSE event listing every call and the validator's verdict on each
  PS# mentioned (verified / stripped / unknown).
- Frontend: new TracePanel collapsible under each assistant message.
  Brand-styled, monospace call list, color-coded part-number badges.

Plus: ruff format pass on llm_client / tools / test_llm_client (CI fix);
.gitattributes pins *.sh to LF so backend/entrypoint.sh stays executable
when cloned on Windows.
…find parts

Problem (CI failure on test_spray_arm_natural_language):
"I need the thing that sprays water in the bottom of my dishwasher" was
returning gaskets and rollers instead of spray arms. Root cause:
websearch_to_tsquery is AND-mode, and that query has too many filler words
("I", "need", "the", "thing", "that", ...) - the tsvector match was empty,
so ranking fell through to vector-only, where mock embeddings put the spray
arm at position 4 (the mock LLM only renders top 3).

Fix:
- keyword_search now retries with to_tsquery('english', 'word1 | word2 | ...')
  when the websearch (AND) query yields zero rows.
- A small _FILLER_WORDS frozenset strips verbal-tic words that aren't on
  Postgres' english stopword list ("need", "thing", "looking", "fix", ...).

Result:
- Hybrid search now ranks "Dishwasher Spray Arm" #2 for that query (was Instalily#4).
- 68/70 tests pass (2 pre-existing skips), 93% coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants