diff --git a/openspec/changes/gol-simulation/.openspec.yaml b/openspec/changes/archive/2026-11-08-gol-simulation/.openspec.yaml similarity index 100% rename from openspec/changes/gol-simulation/.openspec.yaml rename to openspec/changes/archive/2026-11-08-gol-simulation/.openspec.yaml diff --git a/openspec/changes/gol-simulation/design.md b/openspec/changes/archive/2026-11-08-gol-simulation/design.md similarity index 100% rename from openspec/changes/gol-simulation/design.md rename to openspec/changes/archive/2026-11-08-gol-simulation/design.md diff --git a/openspec/changes/gol-simulation/proposal.md b/openspec/changes/archive/2026-11-08-gol-simulation/proposal.md similarity index 100% rename from openspec/changes/gol-simulation/proposal.md rename to openspec/changes/archive/2026-11-08-gol-simulation/proposal.md diff --git a/openspec/changes/gol-simulation/specs/gol-simulation/spec.md b/openspec/changes/archive/2026-11-08-gol-simulation/specs/gol-simulation/spec.md similarity index 100% rename from openspec/changes/gol-simulation/specs/gol-simulation/spec.md rename to openspec/changes/archive/2026-11-08-gol-simulation/specs/gol-simulation/spec.md diff --git a/openspec/changes/gol-simulation/tasks.md b/openspec/changes/archive/2026-11-08-gol-simulation/tasks.md similarity index 100% rename from openspec/changes/gol-simulation/tasks.md rename to openspec/changes/archive/2026-11-08-gol-simulation/tasks.md diff --git a/openspec/specs/gol-simulation/spec.md b/openspec/specs/gol-simulation/spec.md new file mode 100644 index 0000000..8d7b799 --- /dev/null +++ b/openspec/specs/gol-simulation/spec.md @@ -0,0 +1,85 @@ +# gol-simulation Specification + +## Purpose +Defines Conway's Game of Life simulation behavior, including ticking, pause/resume, stepping, speed control, and paused-only cell editing. + +## Requirements + +### Requirement: Simulation applies Conway's rules +The system SHALL advance the grid by one generation per tick using Conway's rules with wall boundaries. + +#### Scenario: Tick advances grid +- **WHEN** a tick occurs +- **THEN** each cell's next state follows Conway's rules based on its eight neighbors + +### Requirement: Simulation starts paused +The system SHALL start with the simulation paused. + +#### Scenario: Initial state +- **WHEN** the application starts +- **THEN** the simulation is paused + +### Requirement: Pause can be toggled +The system SHALL toggle between paused and running when the pause action is triggered. + +#### Scenario: Toggle pause +- **WHEN** the user triggers the pause action +- **THEN** the simulation switches between paused and running + +### Requirement: Single step advances one generation +The system SHALL advance exactly one generation when the step action is triggered while paused. + +#### Scenario: Step while paused +- **WHEN** the simulation is paused and the user triggers step +- **THEN** the grid advances by one generation +- **AND** the simulation remains paused + +### Requirement: Step is ignored while running +The system SHALL ignore the step action while the simulation is running. + +#### Scenario: Step while running +- **WHEN** the simulation is running and the user triggers step +- **THEN** no extra generation is applied + +### Requirement: Speed is adjustable +The system SHALL change the tick interval when speed_up or speed_down is triggered, within supported bounds. + +#### Scenario: Speed up +- **WHEN** the user triggers speed_up +- **THEN** the tick interval decreases (simulation runs faster) + +#### Scenario: Speed down +- **WHEN** the user triggers speed_down +- **THEN** the tick interval increases (simulation runs slower) + +### Requirement: Cell editing only while paused +The system SHALL allow editing cells only while the simulation is paused. + +#### Scenario: Edit while paused +- **WHEN** the simulation is paused and the user clicks a cell +- **THEN** the cell state changes according to the mouse button + +#### Scenario: No edit while running +- **WHEN** the simulation is running and the user clicks a cell +- **THEN** the grid is not modified by the click + +### Requirement: Left click sets cell alive +The system SHALL set the clicked cell to alive when the left mouse button is pressed while paused. + +#### Scenario: Set alive +- **WHEN** the simulation is paused and the user left-clicks a cell +- **THEN** that cell becomes alive + +### Requirement: Right click sets cell dead +The system SHALL set the clicked cell to dead when the right mouse button is pressed while paused. + +#### Scenario: Set dead +- **WHEN** the simulation is paused and the user right-clicks a cell +- **THEN** that cell becomes dead + +### Requirement: Drag paints cells +The system SHALL paint cells while dragging with the left button (alive) or right button (dead) while paused. + +#### Scenario: Drag paint +- **WHEN** the simulation is paused and the user drags with left button held +- **THEN** cells under the cursor become alive