Trades ledger misreads aggregated CurrencyTrade rows (same rollup defect as #131) #132
Labels
No labels
burndown-2026-06
headless
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/eco-app#132
Loading…
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?
Sibling of #131, discovered while fixing it.
CurrencyTrade(viaTradeAction) is also anAggregatableAction: the server's StatsAggregator merges rows older than its detail window into per-citizen hourly rollups where Count becomes the merged-event total, Time the max, and non-key columns (Buyer, Seller, ShopOwner, ItemUsed, NumberOfItems, CurrencyAmount unless summed) keep one arbitrary merged record's values.In the cycle-14 snapshot, 79% of CurrencyTrade rows have Count > 1 (max 38) - so most of the ledger's history rows are rollups, and
trades.pycurrently treats each as one trade with trusted buyer/seller/item/price. Consequences to audit:/tradepage, who-sold-what) - old rows attribute merged trades to one representative buyer/seller/item.fair_price/ market history consumers of the same CSV inherit the distortion.SumInAggregateGrouping(summed on merge - valid) vs representative-only.Fix shape mirrors #131: treat Count>1 rows as rollups, exclude them from per-item/per-party attribution (or bucket them as "aggregated older trades"), keep whatever fields are genuinely summed, and label the UI accordingly. Note the gather actions (HarvestOrHunt / ChopTree / DigOrMine) have NO per-row discriminator (their Count is biomass even on detail rows), so
by_gatheredspecies labels on old rows carry the same residual risk - documented here rather than fixed.WARDED_WORKFLOW: done ✅
details
Review: detailed-only attribution for CurrencyTrade hourly rollups; merged event and currency totals remain.
workflow: merge-remote-main; review summary: in-container review gate intentionally skipped (temporary ward default pending brokered QA)
Felt: a narrow shared-boundary correction that carried cleanly through downstream consumers.
Confidence: high — lint, 529 pytest, and MCP smoke passed.
Surprise: frontend install/test could not run because pnpm is unavailable or non-executable in this container.
Follow-up: gather-action species labels retain their documented rollup risk.
WARDED_WORKFLOW: reservation-released
release details
Run finished with
WARDED_WORKFLOW: done ✅.ward container reapreleased containerengineer-codex-eco-app-132(--harness codex): the terminal outcome supersedes the reservation, so a later redispatch no longer needs--override-reservation.— Codex, via
ward agent