Add run-summary metrics to the sim and CLI #21
Labels
No labels
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/factory-game-v3#21
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?
Build the next core simulation step after #20. This is core Rust logic, not Bevy/viewer/deploy work.
Current state on
main:Goal:
Give the kernel deterministic run-level counters and give the CLI a final summary line, so a long headless run is diffable at a glance without parsing every tick.
Implementation guidance:
metricsmodule tofactory_simwith aRunMetricsstruct: per-item mined and crafted totals, dispatches assigned, units collected, units delivered, and idle ticks (ticks that emitted no events).GameStateowns the counters and increments them inside the existing step functions. No parallel bookkeeping in the CLI.GameState.factory_cliemits one final JSON line with a distinguishing key (for example{"summary": ...}) so tick lines and the summary line are mechanically separable.Acceptance criteria:
cargo test --workspacepasses.docs/factory-sim.mddocuments the summary line.Out of scope:
Landed on
maininfe624a9(feat: add run-summary metrics to the sim and cli).What shipped:
factory_sim::metricsmodule withRunMetrics/RunMetricsSnapshot: ticks, per-item mined and crafted totals, dispatches assigned, units collected, units delivered, and idle ticks (ticks emitting no events).GameStateowns the counters and increments them inside the existing step functions - mining, dispatch assignment, collect, deliver, and production (whoseadvancenow returns the produced quantity). No parallel bookkeeping in the CLI.factory_cliemits one final{"summary": ...}JSON line after the tick loop, keeping tick lines and the summary mechanically separable.Verification:
cargo test --workspacepasses - 10 sim tests plus the CLI integration test, including an exact-value summary assertion for a 6-tick iron-bars run and a 12-tick determinism check on metrics.ward exec testandpre-commit run --all-filesboth green.WARD-OUTCOME: done