diff --git a/openspec/changes/optimize-brush-hot-path/.openspec.yaml b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/.openspec.yaml similarity index 100% rename from openspec/changes/optimize-brush-hot-path/.openspec.yaml rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/.openspec.yaml diff --git a/openspec/changes/optimize-brush-hot-path/design.md b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/design.md similarity index 100% rename from openspec/changes/optimize-brush-hot-path/design.md rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/design.md diff --git a/openspec/changes/optimize-brush-hot-path/proposal.md b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/proposal.md similarity index 100% rename from openspec/changes/optimize-brush-hot-path/proposal.md rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/proposal.md diff --git a/openspec/changes/optimize-brush-hot-path/specs/brush-painting/spec.md b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/specs/brush-painting/spec.md similarity index 100% rename from openspec/changes/optimize-brush-hot-path/specs/brush-painting/spec.md rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/specs/brush-painting/spec.md diff --git a/openspec/changes/optimize-brush-hot-path/specs/build-verification/spec.md b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/specs/build-verification/spec.md similarity index 100% rename from openspec/changes/optimize-brush-hot-path/specs/build-verification/spec.md rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/specs/build-verification/spec.md diff --git a/openspec/changes/optimize-brush-hot-path/tasks.md b/openspec/changes/archive/2026-10-10-optimize-brush-hot-path/tasks.md similarity index 100% rename from openspec/changes/optimize-brush-hot-path/tasks.md rename to openspec/changes/archive/2026-10-10-optimize-brush-hot-path/tasks.md diff --git a/openspec/changes/reduce-menu-memory/.openspec.yaml b/openspec/changes/archive/2026-10-10-reduce-menu-memory/.openspec.yaml similarity index 100% rename from openspec/changes/reduce-menu-memory/.openspec.yaml rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/.openspec.yaml diff --git a/openspec/changes/reduce-menu-memory/design.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/design.md similarity index 100% rename from openspec/changes/reduce-menu-memory/design.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/design.md diff --git a/openspec/changes/reduce-menu-memory/proposal.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/proposal.md similarity index 100% rename from openspec/changes/reduce-menu-memory/proposal.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/proposal.md diff --git a/openspec/changes/reduce-menu-memory/specs/brush-menu/spec.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/brush-menu/spec.md similarity index 100% rename from openspec/changes/reduce-menu-memory/specs/brush-menu/spec.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/brush-menu/spec.md diff --git a/openspec/changes/reduce-menu-memory/specs/brush-painting/spec.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/brush-painting/spec.md similarity index 100% rename from openspec/changes/reduce-menu-memory/specs/brush-painting/spec.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/brush-painting/spec.md diff --git a/openspec/changes/reduce-menu-memory/specs/update-notification/spec.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/update-notification/spec.md similarity index 100% rename from openspec/changes/reduce-menu-memory/specs/update-notification/spec.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/specs/update-notification/spec.md diff --git a/openspec/changes/reduce-menu-memory/tasks.md b/openspec/changes/archive/2026-10-10-reduce-menu-memory/tasks.md similarity index 100% rename from openspec/changes/reduce-menu-memory/tasks.md rename to openspec/changes/archive/2026-10-10-reduce-menu-memory/tasks.md diff --git a/openspec/changes/support-minecraft-26-3/.openspec.yaml b/openspec/changes/archive/2026-10-10-support-minecraft-26-3/.openspec.yaml similarity index 100% rename from openspec/changes/support-minecraft-26-3/.openspec.yaml rename to openspec/changes/archive/2026-10-10-support-minecraft-26-3/.openspec.yaml diff --git a/openspec/changes/support-minecraft-26-3/design.md b/openspec/changes/archive/2026-10-10-support-minecraft-26-3/design.md similarity index 100% rename from openspec/changes/support-minecraft-26-3/design.md rename to openspec/changes/archive/2026-10-10-support-minecraft-26-3/design.md diff --git a/openspec/changes/support-minecraft-26-3/proposal.md b/openspec/changes/archive/2026-10-10-support-minecraft-26-3/proposal.md similarity index 100% rename from openspec/changes/support-minecraft-26-3/proposal.md rename to openspec/changes/archive/2026-10-10-support-minecraft-26-3/proposal.md diff --git a/openspec/changes/support-minecraft-26-3/specs/platform-compatibility/spec.md b/openspec/changes/archive/2026-10-10-support-minecraft-26-3/specs/platform-compatibility/spec.md similarity index 100% rename from openspec/changes/support-minecraft-26-3/specs/platform-compatibility/spec.md rename to openspec/changes/archive/2026-10-10-support-minecraft-26-3/specs/platform-compatibility/spec.md diff --git a/openspec/changes/support-minecraft-26-3/tasks.md b/openspec/changes/archive/2026-10-10-support-minecraft-26-3/tasks.md similarity index 100% rename from openspec/changes/support-minecraft-26-3/tasks.md rename to openspec/changes/archive/2026-10-10-support-minecraft-26-3/tasks.md diff --git a/openspec/specs/brush-menu/spec.md b/openspec/specs/brush-menu/spec.md index 6354eb33..50a3c2ec 100644 --- a/openspec/specs/brush-menu/spec.md +++ b/openspec/specs/brush-menu/spec.md @@ -32,3 +32,53 @@ Menu titles, item names and lore SHALL be resolved from the translation bundles. #### Scenario: German client - **WHEN** a German client opens the brush menu and a German bundle is installed - **THEN** titles and item texts are German + +### Requirement: Menu inventory is created on first open +The plugin SHALL NOT create a menu inventory for a player who has not opened the menu. + +#### Scenario: Painting without the menu +- **WHEN** a player right-clicks with the brush item and paints, never opening the menu +- **THEN** no menu inventory has been created for that player + +#### Scenario: First open +- **WHEN** the player opens the menu for the first time +- **THEN** exactly one menu inventory is created and rendered + +### Requirement: Rendered menu text is cached +The plugin SHALL NOT render the same translation again for the same locale while neither the +translations nor the shown setting changed. + +#### Scenario: Open twice +- **WHEN** a player opens the menu twice without changing any setting +- **THEN** the second open triggers no translation render + +#### Scenario: Translations reloaded +- **WHEN** the translation bundles are reloaded and the player opens the menu +- **THEN** the text is rendered again + +### Requirement: Updates need a viewer +A settings change SHALL NOT render the menu while the owner is not viewing it, and SHALL write only +the slots whose content changed while the owner is viewing it. + +#### Scenario: Change while closed +- **WHEN** a setting changes and the menu is closed +- **THEN** no render happens until the next open, which shows the new value + +#### Scenario: Change while open +- **WHEN** the player changes the brush size in the open menu +- **THEN** only the slots that show the size are written + +### Requirement: Picker is built once per locale +The brush picker content SHALL be built once per locale, and every viewer SHALL get an inventory of +their own. + +#### Scenario: Two players, same locale +- **WHEN** two players with the same locale open the picker +- **THEN** the content is built once and the two inventories are different instances + +### Requirement: Equal heads are equal +Heads created from the same texture SHALL be equal. + +#### Scenario: Same texture +- **WHEN** two heads are created from the same texture +- **THEN** the two item stacks are equal diff --git a/openspec/specs/brush-painting/spec.md b/openspec/specs/brush-painting/spec.md index 5edb8bbb..8a7a7680 100644 --- a/openspec/specs/brush-painting/spec.md +++ b/openspec/specs/brush-painting/spec.md @@ -43,3 +43,96 @@ which thread computes the stroke. #### Scenario: Deterministic test - **WHEN** a brush runs twice against identical in-memory extents with the same seed - **THEN** both runs change exactly the same positions to the same blocks + +### Requirement: Stroke points are bounded +The Paint Brush SHALL store at most 256 points of an unfinished stroke per player and SHALL refuse +further points with a message while keeping the stored ones. + +#### Scenario: Limit reached +- **WHEN** a player who already stored 256 points clicks again without sneaking +- **THEN** the point is not stored and the player receives the limit message + +#### Scenario: Finish at the limit +- **WHEN** a player at the limit sneaks and clicks +- **THEN** the stroke is painted with the 256 stored points + +### Requirement: Quitting releases brush state +When a player quits, the plugin SHALL remove that player's brush settings and unfinished stroke. + +#### Scenario: Quit mid stroke +- **WHEN** a player with stored stroke points quits +- **THEN** neither the player brush nor the stroke points remain + +### Requirement: Each world position is read at most once per stroke +A brush stroke SHALL read the block at any given position through the extent at most once while it +selects its candidates, regardless of how many filters (air, mask, surface, thickness) inspect it. + +#### Scenario: Sphere with mask and surface filter +- **WHEN** a Spray brush stroke with a mask and the DIRECT surface mode runs against a counting extent +- **THEN** no position is read more than once + +#### Scenario: Overlay with thickness +- **WHEN** an Overlay brush stroke with thickness 3 runs against a counting extent +- **THEN** no position is read more than once + +#### Scenario: Bucket flood fill +- **WHEN** a Bucket brush stroke fills a connected region +- **THEN** each candidate position is read at most once + +### Requirement: Paint brush computes its curve once per stroke +The Paint Brush SHALL derive the relative curve and its sample offsets once per stroke and SHALL +reuse them, translated, for every candidate block. Each position SHALL be placed at most once. + +#### Scenario: Many candidates +- **WHEN** a Paint Brush stroke with several hundred candidate blocks runs +- **THEN** the curve is constructed exactly once + +#### Scenario: Same result as per-block curves +- **WHEN** a Paint Brush stroke runs with a fixed seed +- **THEN** the set of positions on each candidate's curve equals the set the per-block construction produced + +### Requirement: Height results are shared within a stroke +A stroke SHALL scan a given world column for a given height query at most once, and a brush SHALL +compute the self height of a candidate once. + +#### Scenario: Fracture brush +- **WHEN** a Fracture brush stroke runs against a counting extent +- **THEN** no column scan for the same query repeats and the self height of each candidate is computed once + +### Requirement: Random filters run before world reads +A brush whose candidate filter depends only on random numbers and geometry SHALL apply that filter +before any mask, surface or other world-reading filter. The probability that a candidate is +selected SHALL be unchanged; the sequence of random draws consumed MAY differ from earlier versions. + +#### Scenario: Chance filter rejects first +- **WHEN** a Spray brush runs with chance 0 against a counting extent +- **THEN** no mask or surface read happens and no block changes + +#### Scenario: Chance 100 +- **WHEN** a Spray brush runs with chance 100 +- **THEN** every candidate that passes the mask and surface checks is selected + +#### Scenario: Seeded output may differ from earlier versions +- **WHEN** a Spray, Splatter or Gradient stroke runs with the same seed as in an earlier version +- **THEN** the positions MAY differ, while every selected position passes the mask and lies inside the sphere + +### Requirement: Sphere selection is unchanged +Sphere selection SHALL include exactly the positions whose distance to the middle point is +strictly less than `size / 2`, SHALL exclude positions outside the build limits and, unless air is +requested, air positions. + +#### Scenario: Boundary voxel +- **WHEN** a voxel lies exactly `size / 2` from the middle point +- **THEN** it is not selected + +#### Scenario: Equivalence for several sizes +- **WHEN** sphere selection runs for sizes 1 through 21 around a fixed middle point +- **THEN** the selected set equals the set produced by the strict distance definition + +### Requirement: Brush jitter does not use a cryptographic generator +A stroke SHALL take its random numbers from a fast seeded generator created per stroke, and +`StrokeContext` SHALL accept an injected generator so tests can fix the sequence. + +#### Scenario: Injected random +- **WHEN** a test builds a stroke context with a seeded random and runs the same brush twice +- **THEN** both runs select the same positions diff --git a/openspec/specs/build-verification/spec.md b/openspec/specs/build-verification/spec.md index 9e5ac5a8..c221a607 100644 --- a/openspec/specs/build-verification/spec.md +++ b/openspec/specs/build-verification/spec.md @@ -34,3 +34,17 @@ Every Java source file SHALL carry the GPL license header from `HEADER.txt`. #### Scenario: New file without header - **WHEN** a Java file without the header is added - **THEN** `./gradlew build` fails in `spotlessJavaCheck` and `./gradlew spotlessApply` adds the header + +### Requirement: Hot-path behaviour is verified without timing +The build SHALL verify the brush hot-path rules (read counts, curve computed once, sphere +equivalence, random filter order) with unit tests that count calls and compare selections. These +tests SHALL NOT sleep, read the system clock or assert elapsed time, and SHALL use fixed seeds and +a fresh extent per test. + +#### Scenario: Extra world read introduced +- **WHEN** a change makes a stroke read one position twice +- **THEN** `./gradlew test` fails and names the position-count test + +#### Scenario: Timing is never asserted +- **WHEN** the hot-path tests are searched for `Thread.sleep`, `System.nanoTime` and `Instant.now` +- **THEN** none is found diff --git a/openspec/specs/platform-compatibility/spec.md b/openspec/specs/platform-compatibility/spec.md index 9f04e6c8..ea987f56 100644 --- a/openspec/specs/platform-compatibility/spec.md +++ b/openspec/specs/platform-compatibility/spec.md @@ -8,16 +8,22 @@ supports, and how the plugin reacts when it is started in an unsuitable environm ### Requirement: Supported Minecraft versions The plugin SHALL be published for, and SHALL load on, Paper for every Minecraft version in the -supported-versions list. The list SHALL contain 26.1.1, 26.1.2 and 26.2. +supported-versions list. The list SHALL contain 26.1.1, 26.1.2, 26.2 and 26.3. A Minecraft +version SHALL be added to the list once the current FastAsyncWorldEdit release supports it, and +not before. Minecraft versions below 26.1 SHALL NOT be supported. #### Scenario: Release lists supported versions - **WHEN** a release is published to Hangar and Modrinth - **THEN** the release lists exactly the Minecraft versions of the supported-versions list #### Scenario: Plugin loads on a supported version -- **WHEN** the plugin jar is placed on a Paper 26.2 server running Java 25 with FastAsyncWorldEdit 2.16.1 +- **WHEN** the plugin jar is placed on a Paper 26.3 server running Java 25 with FastAsyncWorldEdit 2.16.1 - **THEN** the plugin enables without errors +#### Scenario: Version without FAWE support is not listed +- **WHEN** a Minecraft version has no adapter in the current FastAsyncWorldEdit release +- **THEN** it is not part of the supported-versions list + ### Requirement: Java runtime The plugin SHALL require Java 25 at runtime. diff --git a/openspec/specs/update-notification/spec.md b/openspec/specs/update-notification/spec.md index c1548001..33f27100 100644 --- a/openspec/specs/update-notification/spec.md +++ b/openspec/specs/update-notification/spec.md @@ -34,3 +34,14 @@ A failed or unparsable update check SHALL NOT log a stack trace at WARN or ERROR #### Scenario: Invalid response - **WHEN** Hangar answers with a body that is not a version - **THEN** the plugin logs one debug line and keeps running + +### Requirement: No HTTP client while checks are disabled +The plugin SHALL NOT create an HTTP client when `generic.check-for-updates` is `false`. + +#### Scenario: Disabled +- **WHEN** `generic.check-for-updates` is `false` and the plugin enables +- **THEN** no HTTP client has been created + +#### Scenario: Enabled +- **WHEN** `generic.check-for-updates` is `true` and the first check runs +- **THEN** one HTTP client is created and closed on shutdown