Economic Health Dashboard #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-02T23:09:36Z
Task 2 — Economic Health Dashboard
Prereq: read
todo/README.mdfirst for cross-cutting conventions (SSM region, template paths, iframe CSP, Day-3 data thinness).Goal
Build an MCP tool
get_eco_economythat renders an iframe card showing a live economic vitals board for the Eco server.Data sources
All from
/datasets/get?dataset={Name}&dayStart=0&dayEnd={days_elapsed}onhttp://eco.coilysiren.me:3001. Admin endpoint — requiresX-API-Keyheader from SSM/eco-mcp-app/api-admin-token(regionus-east-1).Verified-present stat names (all 14 confirmed in
/datasets/flatliston live server):OfferedLoanOrBond,AcceptedLoanOrBond,RepaidLoanOrBond,DefaultedOnLoanOrBondPayWages,PayRentOrMoveInFeePostedContract,CompletedContract,FailedContractPropertyTransfer,ReputationTransfer,TransferMoneyPayTax,ReceiveGovernmentFundsAlso pull from
GET /info(public):EconomyDesc(string like"524 trades, 0 contracts")TotalCulture(number; this is a /info field, NOT a /datasets stat —/datasets/get?dataset=TotalCulturereturns 500)Compute
days_elapsedfrom/info'sTimeSinceStart(seconds) → days.Card layout (iframe at
/mcp/ui/economy)"Economy is {healthy|stressed|booming} — {N}% default rate, {M}% contracts completed"Classification thresholds (seed values, tune as you watch real data):
booming: trades/day up 20% week-over-week AND default rate < 5%stressed: default rate > 15% OR contract failure rate > 30%healthy: otherwiseImplementation notes
src/eco_mcp_app/templates/(note:templates/, notui/).src/eco_mcp_app/server.py.Out of scope
Acceptance
inv harness.inv smokepasses with the new tool registered.respxmocking the admin endpoints for at least the KPI computation.Migrated from coilyco-flight-deck/eco-mcp-app#14 during the eco repo consolidation (coilysiren/inbox#100).
🔒 Reserved by
ward agent --driver claude— containerengineer-claude-eco-app-12on hostKAI-DESKTOP-TOWERis carrying this issue (reserved 2026-07-05T04:32:29Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
— Claude (she/her), via
ward agentWARD-OUTCOME: done - fixed the tautological week-over-week calc so the
boomingeconomy classification is actually reachable, landed on main.The surprise here was that the feature was already fully built and merged via the big eco-app consolidation commit —
issue-12started life identical tomain, tests green, tool registered, card rendering. So this wasn't a build-from-scratch; it was reading a finished implementation closely enough to find the one real crack.That crack: the WoW trades delta derived the trailing-7-day rate from the cumulative average, which is algebraically that same average — so
trades_wow_pctwas always exactly +0.0%, the card printed a meaningless "+0.0% vs avg", and theboomingbranch was dead code that could never fire. Replaced it with a genuine trailing-7 vs prior-7 in-game-day window summed across the datasets as an activity proxy (Eco only exposes trade count as a scalar, never a series, so a literal trades/day WoW is genuinely uncomputable). Added tests proving booming now triggers, that WoW stays None before two weeks, and that stressed still wins over booming.Fairly confident — 399 tests pass, lint/mypy/precommit clean, and I rendered a synthetic booming card end-to-end to confirm the new label. Honest rough edge: 'total economic activity' is a proxy, not real trade velocity, and the thresholds are still the spec's untuned seed values. Worth a follow-up to watch real Day-14+ data and tune, and maybe to have the replay/telemetry mod emit a proper per-day trades series so the WoW can key off the real thing instead of a proxy.