Alexander Rozhenko
beeace231d
fix #3 : guard breakdown() so a delisted mid-batch card cannot 500 the deck
...
A section can outlive an ad: when a card's listing left the active pool after compose and has no swipe history, it is absent from the engine's by_id map. breakdown() indexed the missing row without a guard, so one such card 500'd GET /api/section (and /api/listing/{id}) - live incident 2026-11-15: section 57 + delisted listing 298. Degrade to no-signal lines instead. Regression test added; before/after verified on a copy of the live DB (section 500 -> 200; forge rebuild 200).
2026-11-15 11:06:51 -04:00
Torres
04463cadcd
P3: personalization core — event log + taste engine + section engine + agent pass + API + frontend
...
- db.py: guarded P3 tables (swipe_events/sections/section_items/taste_profile/
agent_runs), one-time event seeding from swipes, append_event round math
- taste.py: deterministic taste engine (action x round x recency weights,
n/(n+3) shrink, ramp w=min(.85,N/60), percentile norm, agent adjustments
+/-10, points + source-labeled breakdown + tank bands)
- sections.py: compose/read/exhaust/forge — 2 wildcards + <=5 returns
(<=2 nopes, surprising only) + remainder new, <=4/family, >=3 price
bands w/ repair, returns maybe>like>nope, last-two-section exclusion,
ondemand/strict modes
- agentpass.py: mock (deterministic) / live (OpenRouter, one retry) /
fallback; strict payload schema; --print-summary/--dry-run
- api.py: GET /api/section, POST /api/section/forge, GET /api/trends,
POST /api/agent/run, POST /api/prefs; P3 payload fields (points, tank,
slot, round_next, points_breakdown); events stamped with section_id
- frontend: section buffer + progress pill, report screen + forge + mode
toggle, WILDCARD/SECOND LOOK bands, tank gauges (list + dossier), dossier
Why-this-rank, real Trends tab, /api/deck fallback for pre-P3 API, sw v2
- selfcheck: 9 new P3 checks (25/25 green)
2026-11-10 23:18:26 -04:00