Commit graph

13 commits

Author SHA1 Message Date
Заид Омар Медхат
7ed585d6a9 Show ingredient tier/enchant + price age in haul advisor
All checks were successful
Deploy / deploy (push) Successful in 1m42s
- Opportunities breakdown now shows each ingredient's tier/enchant
  (e.g. T6.4) so enchant mismatches are visible at a glance.
- Travel haul advisor now shows color-coded price-age badges (green
  fresh / yellow aging / red stale) for both buy and sell prices, like
  Opportunities already does.

Note: the enchanted-ingredient pricing itself was already correct in
code (T6_SHOES_PLATE_SET1@4); a deployed DB parsed before that fix must
re-run Game Data -> Re-download to pick it up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 05:33:52 +05:00
Заид Омар Медхат
c4683ff5b0 Backend caching + AODP refetch cooldown
- In-memory TTL cache (server/src/cache.ts) with a get/set/clear surface
  that a Redis backend can replace later for multi-replica setups.
- Cache the expensive opportunities ranking (5 min), item detail/search
  (1 h), and per-item market prices (10 min). All keyed by request; each
  read endpoint takes a refresh/force bypass.
- Invalidate precisely on writes: price upserts, overrides, profile
  activate/update, economy config, and game-data reparse (full clear).
- AODP anti-spam: a price download now skips items priced within a
  configurable cooldown (default 15 min, Settings page) unless "force"
  is checked; the job reports how many fresh items it skipped.
- No client-side caching (per request); the browser still calls the API,
  but repeats are served from the server cache without recompute/AODP.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 05:09:38 +05:00
Заид Омар Медхат
b8207f5b15 Fix enchanted resource IDs in recipes (T4_LEATHER_LEVEL3@3)
Enchanted refined resources are top-level items carrying their own
@enchantmentlevel, and their tradeable/market id is <name>@<n>
(e.g. T4_LEATHER_LEVEL3@3). The parser stored them — and referenced
them in enchanted recipes — as just T4_LEATHER_LEVEL3, so those inputs
never matched AODP price rows and enchanted-item costs were wrong.
Apply canonicalId(name, enchantLevel) to both item ids and craftresource
references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 04:59:30 +05:00
Заид Омар Медхат
742b7c2085 Travel directions, agent resilience, opportunities clarity
- Travel planner shows the compass bearing (N/NE/.../NW) of each hop,
  computed from world-map coordinates (+x East, +y North, calibrated
  against Bridgewatch=south, Lymhurst=east). Zone positions parsed from
  world.bin into new zones.pos_x/pos_y columns.
- Agent: retry ingest POSTs with backoff + longer timeout, graceful
  failure (no more uncaught crash on a transient connect timeout).
- Opportunities: state the city prices apply to in the breakdown, and
  show tier+enchant as one "T4.3" chip with a tooltip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 04:53:28 +05:00
Заид Омар Медхат
f4f5af9fe5 f
Some checks failed
Deploy / deploy (push) Failing after 43s
2026-08-23 04:29:17 +05:00
Заид Омар Медхат
337dac78ba Client/server split, Postgres, auth, Windows agent, Docker deploy
All checks were successful
Deploy / deploy (push) Successful in 3m58s
- Extract world-parse + packet capture into @albion/shared (reused by
  server and a new standalone agent workspace).
- Migrate the data layer from SQLite/better-sqlite3 to shared Postgres
  (async pg with a ?->$n helper; economy engine preloads the item/recipe
  graph so its sync recursion still works).
- API-key auth (ALBION_API_KEY) on all /api routes except health; web UI
  sends it via a fetch wrapper + key-entry gate; server serves the built
  UI with a path-traversal-safe static handler (drops @fastify/static).
- Windows companion agent: pushes world map + captured market orders to
  /api/ingest/*; runs on the gaming PC where the game traffic lives.
- Docker + docker-compose (external proxy + backend networks for Nginx
  Proxy Manager and shared Postgres) and a Forgejo deploy workflow.
- Validated end-to-end against Postgres 16 and a full compose run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 04:10:08 +05:00
Заид Омар Медхат
9c4a2a8ed3 Phase 7: passive game sniffer + README
tshark-based capture (no native modules) of the player's own UDP 5056
traffic decoded with photon-packet-parser; market orders detected by
JSON shape (patch-proof) and stored as firsthand prices; event-code
debug log to identify destiny-board codes; Sniffer page + README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 03:32:22 +05:00
Заид Омар Медхат
4c16fead97 Phase 6: market watcher
Watch rules (sell below/above, buy above) per item+city, background
poll loop with configurable interval, fresh price fetch for watched
items, alert feed with unseen tracking, Market Watch page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 03:28:13 +05:00
Заид Омар Медхат
5706248a6b Phase 5: travel planner
World map imported from the local game files (public DES key + gzip,
read-only), 485 zones / 723 portal connections, BFS router with
safe-only vs all-zones modes and danger counts, haul advisor ranking
items by trip profit per carry weight, Travel page + game-path setting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 03:24:24 +05:00
Заид Омар Медхат
3b20b1e431 Phase 4: character profiles
Destiny-board profiles (mastery/spec/other-specs per crafting category),
premium flag, focus efficiency formula (250/30/30 per level), active
profile feeds tax + per-category focus costs into the ranker; editor UI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 03:11:01 +05:00
Заид Омар Медхат
9aebed4f55 Phase 3: economy engine + opportunity ranker
Pure-math engine (additive return-rate factors, focus efficiency,
station fees from computed item values, recursive buy-vs-craft input
acquisition), patch-editable economy config, ranked opportunities API
and UI with per-recipe cost breakdowns. 11 unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 03:07:40 +05:00
Заид Омар Медхат
7ff3e6ec95 Phase 2: market data layer
AODP price client (chunked, throttled, proxy-aware), snapshot storage
with freshness ages, manual price overrides that outrank API data,
async refresh job with progress, Market Data + Settings pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 02:59:06 +05:00
Заид Омар Медхат
7ba275dd77 Phase 1: scaffold + game data ingestion
npm workspaces (Fastify+TS server, Vite+React web), SQLite schema,
ao-bin-dumps downloader and parser (items, recipes, enchant upgrades,
EN localization), item browser UI and debug API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 02:53:19 +05:00