Commit graph

11 commits

Author SHA1 Message Date
72f607132c Tighten AI insight bullet constraints further — still truncating at 800 tokens
Live-tested again: 800 tokens still wasn't enough for Sonnet's bullet density
(6 dense bullets, cut off mid-sentence again). Capped bullet count to 4-5,
added a hard 35-word single-sentence limit per bullet, told it not to add a
closing summary, and raised the cap to 1200 for genuine headroom.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 19:48:05 +00:00
50ef00c336 Fix AI insight output truncation — bump token cap, enforce bullet brevity
Live-tested on the dev stack: with the more verbose Sonnet model, the old
550-token cap cut the last bullet off mid-sentence. Bumped to 800 and told
the model to keep each bullet to 1-2 sentences so it isn't relying on the
cap alone to stay in bounds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 19:39:26 +00:00
2a7ee1d6b8 Expand AI insight: fix broken competitor query, add continuity, 30-day horizon, holidays
- Fix gather_competitor_data() tier filter: it queried tier IN ('primary','secondary'),
  values that never exist (real values are 'own'/'competitor'/'market'), so the
  cheapest-competitor comparison has always silently returned nothing.
- Feed the previous insight back into the prompt so the model can note what's
  changed/resolved instead of repeating itself.
- Extend forecast horizon from 14 to 30 days; add a per-day revenue table
  alongside the existing occupancy table.
- Annotate the occupancy table with UK (England) bank holidays.
- Add a same-channel market-movement section (B.com vs B.com, rack vs rack)
  diffing rates against the last insight's snapshot, threshold £3.
- Add a parsed headline field + insight history list on the Dashboard,
  collapsed to headline/age and expandable to full content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 18:03:31 +00:00
5fbf155f62 Add weather sync job, API endpoints and settings UI
Fetches daily ERA5 weather from Open-Meteo (no API key).
Configurable location, timezone and sync time via Settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 21:10:03 +00:00
fc15bc5d9a Remove old Resos sync path (resos_bookings table)
Consolidates to single sync path: resos_bookings_sync.py →
resos_bookings_data table. Removes sync_resos_data(), duplicate
load_resos_custom_field_mappings(), resos_api_key and
sync_resos_enabled seed rows, and the dead resos_sync scheduler job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 21:07:47 +00:00
018a73ed95 Remove local asyncio import shadowing module-level import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 20:36:13 +00:00
ba386e316e Fix Resos sync interrupted by health check restart
Yield to event loop after each booking DB commit so FastAPI can
respond to Docker health checks during long syncs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 20:29:50 +00:00
0563ad7fc2 AI insights: UK dates, GBP, remove rate parity section
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 19:57:40 +00:00
3650c92175 Move Resos API key to central Settings service; add sidebar scrollbar styling
Removes the standalone resos_api_key from the forecasting app's own
system_config table. All credential fetches now go through
central_settings.get_resos_credentials() / get_resos_credentials_sync()
which pull from the Settings app (LXC 116) via the internal integration
endpoint — the same pattern already used for NewBook. The Resos API
Config section is removed from the forecasting Settings page; users
manage the key in the central Settings app instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 14:35:35 +00:00
aeb99650bd NewBook credentials from central Settings service
Stack-wide NewBook config lives in the Settings app (LXC 116) and is
fetched live via SETTINGS_URL/SETTINGS_SECRET — same pattern as cashup,
room-planner and maintenance. App-local system_config credentials remain
as a fallback for standalone/dev use. The app's Settings → Newbook page
no longer edits credentials; it points to the central app and keeps
Test Connection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 19:36:41 +00:00
75d2c1fa9d Forecasting app: hybrid port to HNF stack
Python FastAPI ML backend kept intact; auth replaced with central hnf_session cookie verification. Frontend rebuilt on React 18 + TS + Vite with stack design system, Plotly charts retained. Shared Postgres via DATABASE_URL; schema applied on startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 18:49:34 +00:00