maniator / maniator/verticopolis

[Tech debt]: [P3] serialization.ts and Simulation.ts sit exactly at the 500-line guard ceiling

Open
#543 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

> Imported from the engineering backlog (_bmad-output/implementation-artifacts/backlog.md, story engine-file-size-margin).
> Priority P3 (do-first order) | Severity: low | Status: idea | Epic: code health | Type: design-decision | Recorded: 2026-07-21

Problem / motivation

Acceptance Auditor margin note from the scenery review (v1.72.0). The founding-seed save field (RNG.initialSeed) landed with src/engine/sim/serialization.ts and src/engine/Simulation.ts at exactly 500 lines, the file-size guard's ceiling. The next one-line addition to either forces a split mid-PR, the way this PR had to move SerializedGame out of types.ts into src/engine/serializedGame.ts (type-only re-export keeps the "./types" doorway). Next natural seams: serialization's serializeUnit/serializeTransport pair or the coerce helpers could move beside sim/coerce.ts; Simulation's thin delegation blocks could shed a group. No behavior change involved; do it as a pure move under the golden-master net when either file next needs room.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/engine/sim/serialization.ts and src/engine/Simulation.ts, then read the golden-master tests and the existing src/engine/serializedGame.ts move. Compare the suggested seams around serializeUnit/serializeTransport, the coerce helpers, or Simulation's delegation blocks. Done means a pure move that preserves behavior and leaves both guarded files below the 500-line ceiling.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
game-dev
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.