---
title: Move game path stages into modules with fixed-key random streams
type: task
status: completed
description: >-
  Load the play detail columns the owner profiles need, move each game path stage into its own
  module with identical outputs, and give every stage, dial and player resample its own fixed-key
  random stream; defines the owner kinds and measure registry.
base_uri: user:task/league/build-game-path-engine-stage-modules-and-streams.md
created_at: '2026-11-03T16:34:40.482Z'
entity_id: cc4bae24-e6f6-4327-ae7a-7facdcfd338c
finished_at: '2026-11-03T20:52:13.533Z'
observations:
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: High
public_read: true
relations:
  - subtask_of [[user:task/league/build-game-path-owner-profile-foundation.md]]
started_at: '2026-11-03T16:35:45.889Z'
tags:
  - user:tag/league-xo-football.md
  - user:tag/nfl-betting.md
updated_at: '2026-11-03T20:52:17.570Z'
visibility_analyzed_at: '2026-11-05T23:48:26.878Z'
---

# Move game path stages into modules with fixed-key random streams

A phase of [[user:task/league/build-game-path-owner-profile-foundation.md]], which holds the overview, background, design, assumptions and notes this plan relies on; read its Design and Notes first. Paths are relative to `repository/active/league/` unless they start with a user-base directory.

## Plan

### Preconditions

- [x] **Clear the shared engine files**
  - Purpose: the module and stream steps rewrite `simulate-game-path.mjs` and path numbering, which another lane may be editing.
  - Changes: confirm the `██████████████████████████████` lane has landed or parked its engine edits; attribute the uncommitted changes to `libs-server/simulation/injury-disrupted-player-games.sql` (read by `load-game-path-quarterback-changes.mjs`) to their owner.
  - Verify: `git log 541d0dc29..master` on both engine directories is read and accounted for; `git status --porcelain` on the engine directories and that file is empty or attributed.

### Foundation

- [x] **Load the play detail columns and full participation**
  - File: `libs-server/nfl-game-path-simulation/build-game-path-pool.mjs`, `libs-shared/nfl-game-path-simulation/derive-game-path-plays.mjs`, `libs-server/nfl-game-path-simulation/load-game-path-participation.mjs`, `load-game-path-player-charting.mjs`
  - Purpose: later steps need formation, personnel counts, air yards, yards after catch, yards after contact, time to throw, time to pressure, tacklers, broken tackles and every on-field player's charted role.
  - Changes: add the columns to `GAME_PATH_PLAY_COLUMNS` and the derived record; load linemen and defenders from charted roles; nothing reads them yet. Check the yards-after-contact source mix for 2025 and 2026 and the pending rename; take time to throw from `nfl_plays`.
  - Verify: weeks 6-8 forward at both seeds is byte-identical to master; per-season counts of each loaded field match query A.

- [x] **Stage modules as a pure move**
  - File: new `libs-shared/nfl-game-path-simulation/stages/*.mjs`; `simulate-game-path.mjs`; `game-path-stage-pieces.mjs`
  - Purpose: stages become real modules without changing any output.
  - Changes: move each stage body out of the closure; the runner passes a snap context; each stage reads its single owner from `GAME_PATH_STAGE_OWNERS` (`game-path-simulation-rules.mjs:47-59`).
  - Verify: weeks 6-8 forward and settled at seeds 7 and 11, one forced-event review and one extension are byte-identical to master; all game-path specs pass.

- [x] **Random streams with fixed keys**
  - File: `libs-shared/nfl-game-path-simulation/game-path-seeds.mjs`, the runner and stage modules
  - Purpose: a new stage, dial or player must leave every other draw unchanged.
  - Changes: a setup stream per path; one stream per stage under the final stage names in the Design; one per owner dial; one per player resample, replacing lazy first-use resampling on the shared stream.
  - Verify: specs show an added stage draw, an added dial and an added player each leave the other draws identical, and an extension's paths equal the matching paths of one longer run; replay gate passes at seeds 7 and 11; the new forward baseline is written at both seeds.

- [x] **Owner kinds, measure registry and content schema**
  - File: new `libs-shared/nfl-game-path-profiles/owner-kinds.mjs`, `measure-registry.mjs`, `profile-content-schema.mjs`
  - Purpose: one definition of owners, measures, producing conditions and minimums.
  - Changes: the closed owner-kind set with each kind's key format; each measure declares owner kind, stage, producing conditions, minimum evidence with its reason, and version; the content schema validates identity, tendency, variation and read citations.
  - Verify: a spec rejects an unknown kind, condition or stage, a measure without producing conditions, and a minimum without a reason.
