Files
PuGa/docs/roadmap.md
T
dodoxandClaude Sonnet 5 58db08b921 Add multi-base chain modelling, fix price-band-aware demand/supply, tranche-split sell tool
- puga/network.py + tools/network.py: model a multi-base chain (e.g. mine LST at one base,
  ship it, consume it at another). Simulates each base independently, nets a transferred
  material's producer-surplus against consumer-need, charges real freight only on what's
  moved, cm_free for a founding covered by a Core Module Kit. Worked example in plans/chains/.
- puga/saturation.py: real price-band filtering. FIO's order_book NarrowPriceBandLow/High and
  WidePriceBandLow/High match APEX's own displayed Price Band exactly (verified live) - an
  order outside it is a stale artifact, not just uncompetitive. Added in_band() and
  effective_demand(); effective_supply() gained the same hard band filter alongside its
  existing soft vwap-proximity filter (renamed that param mult to free up `band`). Wired into
  tools/scan.py stage 2 in place of the raw, unfiltered demand figure. Was flagged as an
  unimplemented refinement in saturation-design.md since the original design review.
- tools/sell.py: self-contained tranche split (aggressive tranche capped at a volume quantile,
  median normally or 80th pct with --tight when a payment is imminent and stockout risk
  outweighs margin; patient tranche priced under the next competitor tier). Instant-bid
  comparison moved behind --show-bid (off by default).
- Docs and roadmap updated accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 14:32:09 +02:00

4.4 KiB

Roadmap

Legend: [ ] todo, [x] done. Build order matters; each step is usable on its own.

  1. Repo skeleton, git (master), venv, CLAUDE.md, mechanics from PRUNplanner.

  2. puga/fio.py: cached FIO client (TTL per endpoint, keys from .env), plus puga/prunplanner.py for api.prunplanner.org/data/*. Inspect what exchanges/ adds (VWAP?) vs FIO /exchange/all.

  3. (price + book tools done; cxpc trend history not needed, PRUNplanner has vwap7/30) puga/market.py + tools/price.py, tools/book.py: prices across all CX, trends from cxpc, order-book walk for real fill price at quantity N.

  4. puga/econ.py (22 tests pass, expected values from PRUNplanner's suite): efficiency stack, workforce consumption, hab LP, extraction (port the formulas from docs/mechanics.md, with tests against PRUNplanner values).

  5. (v1 done; see saturation-design.md for refinements) tools/scan.py (replaces prun_scan.py): depth-aware ROI. Per recipe report: buildings the market can absorb (output demand + traded volume, input supply), ROI at fill price for N buildings, absorbable profit/day. Filter --min-buildings. Both CX-local and universe. 5b. [ ] tools/arb.py (replaces prun_cxarb.py): inter-CX arbitrage on market.walk at real fill size; capital required, fuel/shipping cost from state, profit per trip within cash. Reason: old script uses top-of-book spread x min(supply,demand); on 2 of 4 top hits it overstated profit 7 to 11x (WAI, SCN).

  6. tools/chain.py: full bill of materials, make-vs-buy per node.

  7. tools/whatif.py: marginal ROI of adding a building to the actual state (uses state/company.yaml, efficiency stack, imports).

  8. tools/planet.py, tools/found.py: rank planets for a resource; founding cost including environment extras. 13b. [x] puga/network.py + tools/network.py: multi-base chain modelling (per-base simulate, net transfers against real freight, cm_free for kits). Worked example: plans/chains/nike_deimos_lst.yaml (Nike LST -> Deimos PP2/BSE). Known gap: reports whole-plan profit per base, not the marginal addition; caller must diff manually.

  9. tools/route.py, tools/haul.py: jump graph, fuel, profit per trip. 9b. [x] (dry-run default, --apply after user yes) tools/plan_push.py: create/update [PuGa] plans in PRUNplanner from YAML (Api-Key auth; see decisions.md for guardrails).

  10. tools/state.py sync (sites, production efficiency, storage, ships, cash, permits): inventory, production, ships into state/.

  11. Docs to fill: docs/apex.md, docs/fio.md, docs/playbook.md (question type -> tool), docs/decisions.md.

  12. tools/buy.py: cash-aware shopping list (construction gap vs empire state's built count, plus N days of net operating stock via simulate(), priced at real fill cost, checked against cash/reserve).

  13. tools/sell.py: ask-post-price + expected-clear-time advisor from 30d traded-volume percentiles, vs hitting the bids now.

  14. tools/portfolio.py: choose the set of 1-building opportunities for one base that maximises total profit given shared whole-building housing (HB1/HB2/...), capex, permits and (for demolish-later) 60-day value decay. Persistence check exists (tools/persistence.py); wire it into the ranking.

Open questions

  • PRUNplanner auth is known (Authorization: Api-Key <key>). FIO REST and FIO API are separate services with separate keys (separate services with separate keys; an earlier "one API" reading was wrong). Keys are in .env. Verified 2026-09-18: FIO_REST_KEY works on rest.fnar.net as Authorization: <key> (own /sites, /storage etc. readable); FIO_API_KEY gives 401 there, host unknown. PRUNplanner key works (plans 0, empires 1, cx prefs 1 on his account). Still unknown: the OpenAPI spec at https://doc.fnar.net/api.json has no securitySchemes. Probe with read-only calls.
  • (resolved) PRUNplanner exchanges/ has vwap_daily/7d/30d and traded volume; merged into puga/market.py. Trend history via cxpc still todo.
  • Extraction: concentration to daily rate formula.
  • (resolved 2026-09-25) Real price-band filtering (NarrowPriceBandLow/High, WidePriceBandLow/High) implemented in puga/saturation.py (in_band, effective_demand, effective_supply band param) and wired into tools/scan.py stage 2. Was flagged as an unimplemented refinement in saturation-design.md since day one; the player noticed a stale out-of-band bid in a live screenshot and asked the right question.