Bootstrap the Rust simulation workspace and first closed-loop slice #13

Closed
opened 2026-07-09 18:33:55 +00:00 by coilyco-ops · 2 comments
Owner

Implement the first Rust migration slice from #12. This is the first build step after the design/advisor pass, not a Bevy or Unity-cleanup task.

Important implementation constraint from Kai:

  • Keep the code structure very similar to the last C# variant where that does not sacrifice code quality. Use the existing Unity-era classes as semantic/source-structure references, but do not copy engine coupling, stringly-typed state, or brittle test wiring.

Current repo state to respect:

  • main is green.
  • Unity project scaffolding has been removed.
  • Assets are in Git LFS.
  • The repo has the aos baseline and Forgejo CI.
  • tests.csproj / NuGet is reference-only and must stay out of active validation.
  • There is no Rust code yet.

Build the initial pure Rust workspace:

  • Add a root Cargo.toml workspace.
  • Add crates/factory_sim for deterministic simulation state and tick stepping.
  • Add crates/factory_content for typed content IDs, starter items, starter recipe/scenario data.
  • Add crates/factory_cli for a headless runner.
  • Do not add Bevy or rendering dependencies.

First closed-loop slice:

  • Model IronOre -> IronBars.
  • Include typed item/content IDs.
  • Include an inventory/resource container with weight, volume, capacity checks, and reserved-capacity behavior if it fits cleanly in the first slice.
  • Include a tiny GameState with a source node, one hauler/truck-like actor, one factory, craft progress, tick counter, and a minimal topology.
  • Include deterministic tick stepping for collect, deliver, production progress, and output creation.
  • Keep movement/topology minimal. Do not implement full grid pathfinding yet.

C# reference material to read and mirror where sensible:

  • Assets/Scripts/GameContent.cs
  • Assets/Scripts/FactoryGame/FactoryGameContent.cs
  • Assets/Scripts/Components/ResourcesComponent.cs
  • Assets/Scripts/Components/ProductionComponent.cs
  • Assets/Scripts/Components/MiningComponent.cs
  • Assets/Scripts/Components/DispatchComponent.cs
  • Assets/Scripts/Components/DispatchReceiverComponent.cs
  • Assets/Scripts/Components/ResourceRetrieverComponent.cs
  • Assets/Scripts/Components/ResourceInserterComponent.cs
  • Assets/Scripts/WorldObjects/WorldObjectFactory.cs
  • Assets/Scripts/WorldObjects/WorldObjectTruck.cs
  • Assets/Scripts/WorldObject.cs

Acceptance criteria:

  • cargo test --workspace passes.
  • ward exec test passes, with the repo test gate updated only if needed to include the Rust workspace sensibly.
  • At least one deterministic test runs the same scenario twice and asserts identical snapshots/events.
  • At least one test covers resource capacity/transfer behavior.
  • The CLI can run the tiny scenario headlessly, for example cargo run -p factory_cli -- run --scenario iron-bars --ticks 6.
  • CLI output is stable and diffable, preferably JSON lines with one snapshot per tick.
  • Documentation is updated where the repo inventory expects it, especially docs/FEATURES.md if this creates the Rust simulation capability.

Out of scope:

  • Bevy viewer or rendering.
  • NuGet / C# test repair.
  • Full Unity gameplay parity.
  • Full grid pathfinding.
  • Power, batteries, deployment verbs, or broad recipe/content expansion.

Close this issue when the first deterministic Rust logistics/production loop is implemented, tested, and landed on main.

Implement the first Rust migration slice from #12. This is the first build step after the design/advisor pass, not a Bevy or Unity-cleanup task. Important implementation constraint from Kai: * Keep the code structure very similar to the last C# variant where that does not sacrifice code quality. Use the existing Unity-era classes as semantic/source-structure references, but do not copy engine coupling, stringly-typed state, or brittle test wiring. Current repo state to respect: * `main` is green. * Unity project scaffolding has been removed. * Assets are in Git LFS. * The repo has the aos baseline and Forgejo CI. * `tests.csproj` / NuGet is reference-only and must stay out of active validation. * There is no Rust code yet. Build the initial pure Rust workspace: * Add a root `Cargo.toml` workspace. * Add `crates/factory_sim` for deterministic simulation state and tick stepping. * Add `crates/factory_content` for typed content IDs, starter items, starter recipe/scenario data. * Add `crates/factory_cli` for a headless runner. * Do not add Bevy or rendering dependencies. First closed-loop slice: * Model `IronOre -> IronBars`. * Include typed item/content IDs. * Include an inventory/resource container with weight, volume, capacity checks, and reserved-capacity behavior if it fits cleanly in the first slice. * Include a tiny `GameState` with a source node, one hauler/truck-like actor, one factory, craft progress, tick counter, and a minimal topology. * Include deterministic tick stepping for collect, deliver, production progress, and output creation. * Keep movement/topology minimal. Do not implement full grid pathfinding yet. C# reference material to read and mirror where sensible: * `Assets/Scripts/GameContent.cs` * `Assets/Scripts/FactoryGame/FactoryGameContent.cs` * `Assets/Scripts/Components/ResourcesComponent.cs` * `Assets/Scripts/Components/ProductionComponent.cs` * `Assets/Scripts/Components/MiningComponent.cs` * `Assets/Scripts/Components/DispatchComponent.cs` * `Assets/Scripts/Components/DispatchReceiverComponent.cs` * `Assets/Scripts/Components/ResourceRetrieverComponent.cs` * `Assets/Scripts/Components/ResourceInserterComponent.cs` * `Assets/Scripts/WorldObjects/WorldObjectFactory.cs` * `Assets/Scripts/WorldObjects/WorldObjectTruck.cs` * `Assets/Scripts/WorldObject.cs` Acceptance criteria: * `cargo test --workspace` passes. * `ward exec test` passes, with the repo test gate updated only if needed to include the Rust workspace sensibly. * At least one deterministic test runs the same scenario twice and asserts identical snapshots/events. * At least one test covers resource capacity/transfer behavior. * The CLI can run the tiny scenario headlessly, for example `cargo run -p factory_cli -- run --scenario iron-bars --ticks 6`. * CLI output is stable and diffable, preferably JSON lines with one snapshot per tick. * Documentation is updated where the repo inventory expects it, especially `docs/FEATURES.md` if this creates the Rust simulation capability. Out of scope: * Bevy viewer or rendering. * NuGet / C# test repair. * Full Unity gameplay parity. * Full grid pathfinding. * Power, batteries, deployment verbs, or broad recipe/content expansion. Close this issue when the first deterministic Rust logistics/production loop is implemented, tested, and landed on `main`.
Author
Owner

WARD-RESERVATION: held 🔒

reservation details

Holder: container engineer-codex-factory-game-v3-13 on host kais-macbook-pro-2.local.

Reserved by ward agent --harness codex (reserved 2026-07-09T18:34:00Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL). --force overrides.

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).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-gaming/factory-game-v3#13 · branch issue-13 · harness codex · workflow direct-to-main
  • Run: engineer-codex-factory-game-v3-13 · ward v0.493.0 · dispatched 2026-07-09T18:34:00Z
  • Comment thread: 0 included in the pre-flight read, 0 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.493.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> WARD-RESERVATION: held 🔒 <details><summary>reservation details</summary> Holder: container `engineer-codex-factory-game-v3-13` on host `kais-macbook-pro-2.local`. Reserved by `ward agent --harness codex` (reserved 2026-07-09T18:34:00Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL). `--force` overrides. **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). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-gaming/factory-game-v3#13` · branch `issue-13` · harness `codex` · workflow `direct-to-main` - **Run:** `engineer-codex-factory-game-v3-13` · ward `v0.493.0` · dispatched `2026-07-09T18:34:00Z` - **Comment thread:** 0 included in the pre-flight read, 0 stripped (ward's own automated comments). Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.493.0). </details> </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Owner

WARD-OUTCOME: done

details

workflow: direct-to-main; review summary: skipped by ~/.ward/config.yaml default (review gate skipped by ~/.ward/config.yaml default)
felt: mechanical after the toolchain was in place
confidence: high
surprises: the container started without cargo, so I installed rustup locally to finish the compile and CLI checks
follow-ups: none

WARD-OUTCOME: done ✅ <details><summary>details</summary> workflow: direct-to-main; review summary: skipped by ~/.ward/config.yaml default (review gate skipped by ~/.ward/config.yaml default) felt: mechanical after the toolchain was in place confidence: high surprises: the container started without cargo, so I installed rustup locally to finish the compile and CLI checks follow-ups: none </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/factory-game-v3#13
No description provided.