Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
chore(web): remove completed server rail PDD spike (#597)
Gener7386100efc98
diff --git a/spikes/server-rail-pdd/.gitignore b/spikes/server-rail-pdd/.gitignoredeleted file mode 100644index 6562ea30d..000000000--- a/spikes/server-rail-pdd/.gitignore+++ /dev/null@@ -1,4 +0,0 @@-dist/-node_modules/-playwright-report/-test-results/diff --git a/spikes/server-rail-pdd/RESULTS.md b/spikes/server-rail-pdd/RESULTS.mddeleted file mode 100644index 51042a460..000000000--- a/spikes/server-rail-pdd/RESULTS.md+++ /dev/null@@ -1,96 +0,0 @@-# Server Rail PDD Spike Results--## Decision--**Go for a production migration checkpoint, with native PDD limited to pointer drag and the explicit Move menu retained for touch and keyboard.** The normalized reducer and list-item hitbox contract removed canonical drag-over mutation, every valid drop emitted one optimistic commit, and the tested cancel paths emitted no persistence batch.--This is not approval to land product code yet. Review of the four visual and interaction details remains the next gate. If native long-press touch dragging is a hard product requirement, the result is **No-go for PDD-only touch**: Chromium mobile emulation proves that PDD leaves swipe and tap alone, but it does not prove a reliable native long-press drag gesture. That requirement should keep a dedicated touch sensor or use the explicit Move action.--## Frozen scope--- Baseline: fresh main `61efa2343291875e08b96dd522869d9ccbf48713` (the production rail implementation files are byte-unchanged from the original `b5bc5fa854784ff8d77a7fcdb04b0edcb618629c` spike baseline)-- Branch: `spike/server-rail-pdd-fresh-main`-- Product files changed: none-- Fixture: 18 servers, 2 folders, 460 px desktop rail viewport, 520 px mobile rail viewport-- PDD surface: core element adapter, list-item hitbox, element auto-scroll, and live region only-- Excluded: channel-sidebar DnD, API/schema changes, server navigation, and production styling--## Browser evidence--Desktop Chromium passed these real-input journeys:--- A pointer down, 2 px sub-threshold move, and release incremented navigation once and produced zero drag commits.-- Bottom-quarter pointer drop reordered `a` after `b`; one optimistic commit and one persistence batch were recorded.-- Center pointer drop combined `a` and `b`; the persistence planner emitted one `create-folder` command.-- Drag-over changed only the preview instruction and indicator. Canonical state stayed byte-for-byte equal until drop.-- Leaving a collapsed folder after 200 ms prevented expansion; a continuous 550 ms combine hover expanded it.-- Escape and release outside all targets each restored the drag-start snapshot with zero commit and zero persistence batch.-- Dragging expanded folder `one` temporarily hid its children; cancel restored them.-- A 260 px wheel gesture scrolled natively. Holding a drag at the bottom edge increased `scrollTop` while canonical state stayed fixed.-- A forced persistence rejection rolled back the exact snapshot after one optimistic commit.-- The Move menu produced the same cross-folder reducer result, announced the literal outcome through the PDD live region, and restored focus to the moved server.--Mobile-emulated Chromium passed:--- A touch sequence of eight 18 px vertical moves scrolled the rail from a server row with zero click and zero drag commit.-- A short touch tap invoked the server action exactly once with zero drag commit.-- The explicit Move action moved `a` into folder `two` with one persistence batch.--WebKit was not run because no Playwright WebKit browser is installed locally. Physical iOS and Android remain required only if native long-press drag is reconsidered; the recommended contract does not depend on it.--The fresh-main rerun caught one real POC contract defect: sticky row drop targets retained the last folder instruction after the pointer left the rail, so an outside release could commit instead of cancel. The POC now uses non-sticky row targets. The exact cancel/hover journey then passed five consecutive focused repeats and the complete matrix; auto-scroll and valid drop targeting remained green.--## Reducer and persistence evidence--Eleven Vitest cases cover top-level before/after reorder, folder reorder, same-folder reorder, rail-to-folder, folder-to-rail, folder-to-folder, server combine, the 10-folder limit, duplicate/invalid state rejection, empty-folder deletion, zero-write no-ops, minimal command planning, and accessible labels.--The reducer owns the only canonical transition. PDD drag-over stores one `RailInstruction` preview and applies no state or persistence mutation. The final drop uses the immutable start snapshot, applies one reducer transition, computes the command set, and can restore that exact snapshot after rejection.--The platform's native drag API does not distinguish Escape from another no-target termination. The integration intentionally treats every final drop with no valid innermost instruction as the same zero-write cancel outcome.--## Dependency and bundle surface--The isolated production build contains 81 transformed modules:--- HTML: 0.64 kB raw / 0.39 kB gzip-- CSS: 2.22 kB raw / 0.98 kB gzip-- JavaScript including the fixture: 47.01 kB raw / 13.56 kB gzip--The runtime has no React or tree-wrapper dependency. Candidate exact packages are:--- `@atlaskit/[email protected]`-- `@atlaskit/[email protected]`-- `@atlaskit/[email protected]`-- `@atlaskit/[email protected]`--All four exact versions remained the current registry releases during the fresh-main rerun.--## Verification--- `pnpm typecheck` — pass-- `pnpm test` — 11 passed-- `pnpm test:browser` — 5 passed, 5 expected project skips-- focused hover/cancel stability rerun — 5 passed across five consecutive repeats-- `pnpm build` — pass-- `git diff --check` — pass-- POC implementation/config manifest SHA256 (excluding this report and generated evidence) — `e73d3b1a3a6ae3cadfd79ff9cb7d8673b24de00b748e47d2bbd518d8fc1edb40`-- Product diff relative to fresh main — empty; port 4177 free after teardown--The desktop combine-target and mobile Move-menu screenshots were visually inspected. They prove the interaction states are visible and usable in the fixture, but they are not production-design approval: the combine border strength, insertion-line treatment, 500 ms expansion feedback, and compact mobile Move flow remain the four explicit design-review items.--## Production recommendation--Proceed only after the design checkpoint. Keep the normalized state and persistence planner framework-independent. Use PDD list-item instructions for desktop pointer preview, commit once in the final monitor drop, and keep the existing server-folder API boundaries. Touch and keyboard should use the same reducer through the Move menu. Channel-sidebar dnd-kit remains untouched.--The proposed production file boundary is:--- `src/web/package.json`-- `pnpm-lock.yaml`-- `src/web/src/components/community/shell/server-rail.tsx`-- `src/web/src/components/community/shell/use-rail-order.ts`-- `src/web/src/components/community/shell/use-rail-order.test.ts`-- `src/web/src/components/community/shell/server-rail-actions.ts`-- `src/web/src/components/community/shell/server-rail-actions.test.ts`-- `src/web/src/test/e2e-ui/server-rail-dnd.spec.ts`--No production file should be touched until the insertion line, combine border, 500 ms expansion timing, and touch feedback receive their pending design review.diff --git a/spikes/server-rail-pdd/evidence/.gitkeep b/spikes/server-rail-pdd/evidence/.gitkeepdeleted file mode 100644index 8b1378917..000000000--- a/spikes/server-rail-pdd/evidence/.gitkeep+++ /dev/null@@ -1 +0,0 @@-diff --git a/spikes/server-rail-pdd/evidence/desktop-hover-combine.png b/spikes/server-rail-pdd/evidence/desktop-hover-combine.pngdeleted file mode 100644index 3c738bca1..000000000Binary files a/spikes/server-rail-pdd/evidence/desktop-hover-combine.png and /dev/null differdiff --git a/spikes/server-rail-pdd/evidence/mobile-move-menu.png b/spikes/server-rail-pdd/evidence/mobile-move-menu.pngdeleted file mode 100644index b17333edd..000000000Binary files a/spikes/server-rail-pdd/evidence/mobile-move-menu.png and /dev/null differdiff --git a/spikes/server-rail-pdd/index.html b/spikes/server-rail-pdd/index.htmldeleted file mode 100644index b269dfbcb..000000000--- a/spikes/server-rail-pdd/index.html+++ /dev/null@@ -1,17 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="UTF-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Server rail PDD spike</title>- </head>- <body>- <main>- <h1>Server rail PDD spike</h1>- <p id="instructions">Drag to preview and drop once. Use each item’s Move button for the accessible equivalent.</p>- <div id="app"></div>- <pre id="events" aria-label="Event log"></pre>- </main>- <script type="module" src="/src/main.ts"></script>- </body>-</html>diff --git a/spikes/server-rail-pdd/package.json b/spikes/server-rail-pdd/package.jsondeleted file mode 100644index 9f03d037a..000000000--- a/spikes/server-rail-pdd/package.json+++ /dev/null@@ -1,25 +0,0 @@-{- "name": "@alook/server-rail-pdd-spike",- "private": true,- "type": "module",- "scripts": {- "build": "vite build",- "dev": "vite --host 127.0.0.1 --port 4177 --strictPort",- "test": "vitest run",- "test:browser": "playwright test",- "typecheck": "tsc --noEmit"- },- "dependencies": {- "@atlaskit/pragmatic-drag-and-drop": "3.0.0",- "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "3.1.0",- "@atlaskit/pragmatic-drag-and-drop-hitbox": "2.1.0",- "@atlaskit/pragmatic-drag-and-drop-live-region": "2.0.0"- },- "devDependencies": {- "@playwright/test": "1.62.1",- "@types/node": "25.9.4",- "typescript": "6.0.3",- "vite": "8.2.2",- "vitest": "4.1.10"- }-}diff --git a/spikes/server-rail-pdd/playwright.config.ts b/spikes/server-rail-pdd/playwright.config.tsdeleted file mode 100644index 53d9355c7..000000000--- a/spikes/server-rail-pdd/playwright.config.ts+++ /dev/null@@ -1,19 +0,0 @@-import { defineConfig, devices } from "@playwright/test"--export default defineConfig({- testDir: "./tests",- timeout: 30_000,- use: {- baseURL: "http://127.0.0.1:4177",- trace: "retain-on-failure",- },- projects: [- { name: "desktop-chromium", use: { ...devices["Desktop Chrome"] } },- { name: "mobile-chromium", use: { ...devices["Pixel 7"] } },- ],- webServer: {- command: "pnpm dev",- url: "http://127.0.0.1:4177",- reuseExistingServer: false,- },-})diff --git a/spikes/server-rail-pdd/pnpm-lock.yaml b/spikes/server-rail-pdd/pnpm-lock.yamldeleted file mode 100644index bcaadcced..000000000--- a/spikes/server-rail-pdd/pnpm-lock.yaml+++ /dev/null@@ -1,829 +0,0 @@-lockfileVersion: '9.0'--settings:- autoInstallPeers: true- excludeLinksFromLockfile: false--importers:-- .:- dependencies:- '@atlaskit/pragmatic-drag-and-drop':- specifier: 3.0.0- version: 3.0.0- '@atlaskit/pragmatic-drag-and-drop-auto-scroll':- specifier: 3.1.0- version: 3.1.0- '@atlaskit/pragmatic-drag-and-drop-hitbox':- specifier: 2.1.0- version: 2.1.0- '@atlaskit/pragmatic-drag-and-drop-live-region':- specifier: 2.0.0- version: 2.0.0- devDependencies:- '@playwright/test':- specifier: 1.62.1- version: 1.62.1- '@types/node':- specifier: 25.9.4- version: 25.9.4- typescript:- specifier: 6.0.3- version: 6.0.3- vite:- specifier: 8.2.2- version: 8.2.2(@types/[email protected])- vitest:- specifier: 4.1.10--packages:-- '@atlaskit/[email protected]':- resolution: {integrity: sha512-YfxLci5SA2MwdJKIVpnEZfbiOGWQIQnD1NvUgqFq96v33PGVWQy13k07KxeSkR/M8E6VBiYRoglelyCdRmyyBQ==}-- '@atlaskit/[email protected]':- resolution: {integrity: sha512-88krJVd1OcPHy0EFcJx0CjT1AOTB/1AneVvDWOhU4FH6NYDgTNF69euj8GUE07r0KK3L+9V77MKQhaOtwq2mXA==}-- '@atlaskit/[email protected]':- resolution: {integrity: sha512-GrlZdZQSw4yegSrU8EDcaO6IBDEAYbSMgv3tTTfkbdmOjpEnwXmNGHe7CiA3GR9LgUNiKpERR9tlfa+viXIGvA==}-- '@atlaskit/[email protected]':- resolution: {integrity: sha512-EEKBELv757wrvhMHBAoFcXjfzGZ4Y2FJ2xnSsWovsOKywkN1Q4IWRH52hQpPmJnATLcmO9viVhoXWSXFBLKSLQ==}-- '@babel/[email protected]':- resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}- engines: {node: '>=6.9.0'}-- '@jridgewell/[email protected]':- resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}-- '@oxc-project/[email protected]':- resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==}-- '@playwright/[email protected]':- resolution: {integrity: sha512-DTcUc8qii+cpHvtOwggMtBRMjKZHXYWdw8syRYu2vtzuq4Wxphqq4NfCs5Zt44L6mA8rfDfj+PHnxFc/FeK6mQ==}- engines: {node: '>=20'}- hasBin: true-- '@rolldown/[email protected]':- resolution: {integrity: sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm]- os: [android]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [android]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [darwin]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [x64]- os: [darwin]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [x64]- os: [freebsd]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm]- os: [linux]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [linux]- libc: [glibc]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [linux]- libc: [musl]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [ppc64]- os: [linux]- libc: [glibc]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [s390x]- os: [linux]- libc: [glibc]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [x64]- os: [linux]- libc: [glibc]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [x64]- os: [linux]- libc: [musl]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [openharmony]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [arm64]- os: [win32]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==}- engines: {node: ^20.19.0 || >=22.12.0}- cpu: [x64]- os: [win32]-- '@rolldown/[email protected]':- resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==}-- '@standard-schema/[email protected]':- resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}-- '@types/[email protected]':- resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}-- '@types/[email protected]':- resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}-- '@types/[email protected]':- resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==}-- '@types/[email protected]':- resolution: {integrity: sha512-dszCsrKb5U7ZsVZBWiHFklTloVl0mSEnWH/iZXfZUlI4rzCUnsvGmgqfuVRHL54ugE7/wRuxEIXRa2iMZ+BG6g==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==}- peerDependencies:- msw: ^2.4.9- vite: ^6.0.0 || ^7.0.0 || ^8.0.0- peerDependenciesMeta:- msw:- optional: true- vite:- optional: true-- '@vitest/[email protected]':- resolution: {integrity: sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==}-- resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-PJvH288AWQhKs2v9zyfYdPzlPqf5bXbGMmhmUIY9x4dAUGIWgomO771oBQNwJnMQSnUIXhKu6sgzpBRXTlvb8Q==}-- resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}-- resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==}-- resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}-- resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==}- engines: {node: '>=12.0.0'}-- resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}- engines: {node: '>=12.0.0'}- peerDependencies:- picomatch: ^3 || ^4- peerDependenciesMeta:- picomatch:- optional: true-- resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}- os: [darwin]-- resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}- engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}- os: [darwin]-- resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==}- engines: {node: '>= 12.0.0'}- cpu: [arm64]- os: [android]-- resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==}- engines: {node: '>= 12.0.0'}- cpu: [arm64]- os: [darwin]-- resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==}- engines: {node: '>= 12.0.0'}- cpu: [x64]- os: [darwin]-- resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==}- engines: {node: '>= 12.0.0'}- cpu: [x64]- os: [freebsd]-- resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==}- engines: {node: '>= 12.0.0'}- cpu: [arm]- os: [linux]-- resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==}- engines: {node: '>= 12.0.0'}- cpu: [arm64]- os: [linux]- libc: [glibc]-- resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==}- engines: {node: '>= 12.0.0'}- cpu: [arm64]- os: [linux]- libc: [musl]-- resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==}- engines: {node: '>= 12.0.0'}- cpu: [x64]- os: [linux]- libc: [glibc]-- resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==}- engines: {node: '>= 12.0.0'}- cpu: [x64]- os: [linux]- libc: [musl]-- resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==}- engines: {node: '>= 12.0.0'}- cpu: [arm64]- os: [win32]-- resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==}- engines: {node: '>= 12.0.0'}- cpu: [x64]- os: [win32]-- resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==}- engines: {node: '>= 12.0.0'}-- resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}-- resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==}- engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}- hasBin: true-- resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==}- engines: {node: '>=12.20.0'}-- resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}-- resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}-- resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==}- engines: {node: '>=20'}- hasBin: true-- resolution: {integrity: sha512-0M+L3LAD8/nm554LOla9Ayx0j0tmFZ0FBcoQ7F1VuVHpM/XpiC8RcDzBQB8W5+hA8L22THxELzeF+2WcUzvcLg==}- engines: {node: '>=20'}- hasBin: true-- resolution: {integrity: sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==}- engines: {node: ^10 || ^12 || >=14}-- resolution: {integrity: sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==}-- resolution: {integrity: sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==}- engines: {node: ^20.19.0 || >=22.12.0}- hasBin: true-- resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}-- resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}- engines: {node: '>=0.10.0'}-- resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}-- resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==}-- resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}-- resolution: {integrity: sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}- engines: {node: '>=12.0.0'}-- resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==}- engines: {node: '>=14.0.0'}-- resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==}- engines: {node: '>=14.17'}- hasBin: true-- resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==}-- resolution: {integrity: sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==}- engines: {node: ^20.19.0 || >=22.12.0}- hasBin: true- peerDependencies:- '@types/node': ^20.19.0 || >=22.12.0- '@vitejs/devtools': ^0.4.0 || ^0.5.0- esbuild: ^0.27.0 || ^0.28.0- jiti: '>=1.21.0'- less: ^4.0.0- sass: ^1.70.0- sass-embedded: ^1.70.0- stylus: '>=0.54.8'- sugarss: ^5.0.0- terser: ^5.16.0- tsx: ^4.8.1- yaml: ^2.4.2- peerDependenciesMeta:- '@types/node':- optional: true- '@vitejs/devtools':- optional: true- esbuild:- optional: true- jiti:- optional: true- less:- optional: true- sass:- optional: true- sass-embedded:- optional: true- stylus:- optional: true- sugarss:- optional: true- terser:- optional: true- tsx:- optional: true- yaml:- optional: true-- resolution: {integrity: sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==}- engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}- hasBin: true- peerDependencies:- '@edge-runtime/vm': '*'- '@opentelemetry/api': ^1.9.0- '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0- '@vitest/browser-playwright': 4.1.10- '@vitest/browser-preview': 4.1.10- '@vitest/browser-webdriverio': 4.1.10- '@vitest/coverage-istanbul': 4.1.10- '@vitest/coverage-v8': 4.1.10- '@vitest/ui': 4.1.10- happy-dom: '*'- jsdom: '*'- vite: ^6.0.0 || ^7.0.0 || ^8.0.0- peerDependenciesMeta:- '@edge-runtime/vm':- optional: true- '@opentelemetry/api':- optional: true- '@types/node':- optional: true- '@vitest/browser-playwright':- optional: true- '@vitest/browser-preview':- optional: true- '@vitest/browser-webdriverio':- optional: true- '@vitest/coverage-istanbul':- optional: true- '@vitest/coverage-v8':- optional: true- '@vitest/ui':- optional: true- happy-dom:- optional: true- jsdom:- optional: true-- resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==}- engines: {node: '>=8'}- hasBin: true--snapshots:-- '@atlaskit/[email protected]':- dependencies:- '@atlaskit/pragmatic-drag-and-drop': 3.0.0- '@babel/runtime': 7.29.7-- '@atlaskit/[email protected]':- dependencies:- '@atlaskit/pragmatic-drag-and-drop': 3.0.0- '@babel/runtime': 7.29.7-- '@atlaskit/[email protected]':- dependencies:- '@babel/runtime': 7.29.7-- '@atlaskit/[email protected]':- dependencies:- '@babel/runtime': 7.29.7- bind-event-listener: 3.0.0- raf-schd: 4.0.3-- '@babel/[email protected]': {}-- '@jridgewell/[email protected]': {}-- '@oxc-project/[email protected]': {}-- '@playwright/[email protected]':- dependencies:- playwright: 1.62.1-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]':- optional: true-- '@rolldown/[email protected]': {}-- '@standard-schema/[email protected]': {}-- '@types/[email protected]':- dependencies:- '@types/deep-eql': 4.0.2- assertion-error: 2.0.1-- '@types/[email protected]': {}-- '@types/[email protected]': {}-- '@types/[email protected]':- dependencies:- undici-types: 7.24.6-- '@vitest/[email protected]':- dependencies:- '@standard-schema/spec': 1.1.0- '@types/chai': 5.2.3- '@vitest/spy': 4.1.10- '@vitest/utils': 4.1.10- chai: 6.2.2- tinyrainbow: 3.1.1-- dependencies:- '@vitest/spy': 4.1.10- estree-walker: 3.0.3- magic-string: 0.30.21- optionalDependencies:- vite: 8.2.2(@types/[email protected])-- '@vitest/[email protected]':- dependencies:- tinyrainbow: 3.1.1-- '@vitest/[email protected]':- dependencies:- '@vitest/utils': 4.1.10- pathe: 2.0.3-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 4.1.10- '@vitest/utils': 4.1.10- magic-string: 0.30.21- pathe: 2.0.3-- '@vitest/[email protected]': {}-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 4.1.10- convert-source-map: 2.0.0- tinyrainbow: 3.1.1-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@types/estree': 1.0.9-- [email protected]: {}-- optionalDependencies:- picomatch: 4.0.7-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- optional: true-- dependencies:- detect-libc: 2.1.2- optionalDependencies:- lightningcss-android-arm64: 1.33.0- lightningcss-darwin-arm64: 1.33.0- lightningcss-darwin-x64: 1.33.0- lightningcss-freebsd-x64: 1.33.0- lightningcss-linux-arm-gnueabihf: 1.33.0- lightningcss-linux-arm64-gnu: 1.33.0- lightningcss-linux-arm64-musl: 1.33.0- lightningcss-linux-x64-gnu: 1.33.0- lightningcss-linux-x64-musl: 1.33.0- lightningcss-win32-arm64-msvc: 1.33.0- lightningcss-win32-x64-msvc: 1.33.0-- dependencies:- '@jridgewell/sourcemap-codec': 1.5.5-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- playwright-core: 1.62.1- optionalDependencies:- fsevents: 2.3.2-- dependencies:- nanoid: 3.3.18- picocolors: 1.1.1- source-map-js: 1.2.1-- [email protected]: {}-- dependencies:- '@oxc-project/types': 0.147.0- '@rolldown/pluginutils': 1.0.1- optionalDependencies:- '@rolldown/binding-android-arm-eabi': 1.2.6- '@rolldown/binding-android-arm64': 1.2.6- '@rolldown/binding-darwin-arm64': 1.2.6- '@rolldown/binding-darwin-x64': 1.2.6- '@rolldown/binding-freebsd-x64': 1.2.6- '@rolldown/binding-linux-arm-gnueabihf': 1.2.6- '@rolldown/binding-linux-arm64-gnu': 1.2.6- '@rolldown/binding-linux-arm64-musl': 1.2.6- '@rolldown/binding-linux-ppc64-gnu': 1.2.6- '@rolldown/binding-linux-s390x-gnu': 1.2.6- '@rolldown/binding-linux-x64-gnu': 1.2.6- '@rolldown/binding-linux-x64-musl': 1.2.6- '@rolldown/binding-openharmony-arm64': 1.2.6- '@rolldown/binding-win32-arm64-msvc': 1.2.6- '@rolldown/binding-win32-x64-msvc': 1.2.6-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- dependencies:- fdir: 6.5.0([email protected])- picomatch: 4.0.7-- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-- [email protected](@types/[email protected]):- dependencies:- lightningcss: 1.33.0- picomatch: 4.0.7- postcss: 8.5.26- rolldown: 1.2.6- tinyglobby: 0.2.17- optionalDependencies:- '@types/node': 25.9.4- fsevents: 2.3.3-- dependencies:- '@vitest/expect': 4.1.10- '@vitest/mocker': 4.1.10([email protected](@types/[email protected]))- '@vitest/pretty-format': 4.1.10- '@vitest/runner': 4.1.10- '@vitest/snapshot': 4.1.10- '@vitest/spy': 4.1.10- '@vitest/utils': 4.1.10- es-module-lexer: 2.3.2- expect-type: 1.4.0- magic-string: 0.30.21- obug: 2.1.4- pathe: 2.0.3- picomatch: 4.0.7- std-env: 4.2.0- tinybench: 2.9.0- tinyexec: 1.3.0- tinyglobby: 0.2.17- tinyrainbow: 3.1.1- vite: 8.2.2(@types/[email protected])- why-is-node-running: 2.3.0- optionalDependencies:- '@types/node': 25.9.4- transitivePeerDependencies:- - msw-- dependencies:- siginfo: 2.0.0- stackback: 0.0.2diff --git a/spikes/server-rail-pdd/src/css.d.ts b/spikes/server-rail-pdd/src/css.d.tsdeleted file mode 100644index d7e961ee2..000000000--- a/spikes/server-rail-pdd/src/css.d.ts+++ /dev/null@@ -1 +0,0 @@-declare module "*.css"diff --git a/spikes/server-rail-pdd/src/main.ts b/spikes/server-rail-pdd/src/main.tsdeleted file mode 100644index 639f7e935..000000000--- a/spikes/server-rail-pdd/src/main.ts+++ /dev/null@@ -1,548 +0,0 @@-import { autoScrollForElements } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element"-import {- attachInstruction,- extractInstruction,- type Availability,-} from "@atlaskit/pragmatic-drag-and-drop-hitbox/list-item"-import { announce, cleanup as cleanupLiveRegion } from "@atlaskit/pragmatic-drag-and-drop-live-region"-import {- draggable,- dropTargetForElements,- monitorForElements,-} from "@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter"-import {- accessibleMoveLabel,- cloneState,- commitInstruction,- folderForServer,- planPersistence,- visibleTopLevelServers,- type Entity,- type PersistenceCommand,- type RailInstruction,- type RailState,-} from "./rail-model"-import "./styles.css"--type EventEntry = {- index: number- type: string- instruction?: RailInstruction- commands?: PersistenceCommand[]- detail?: string-}--type SpikeReadout = {- state: RailState- events: EventEntry[]- clickCount: number- commitCount: number- persistenceBatchCount: number- rollbackCount: number- failNext: boolean- preview: RailInstruction | null-}--declare global {- interface Window {- __railSpike: {- read: () => SpikeReadout- reset: () => void- failNextPersistence: () => void- }- }-}--function requiredElement(selector: string): HTMLElement {- const element = document.querySelector<HTMLElement>(selector)- if (!element) throw new Error(`missing element ${selector}`)- return element-}--const app = requiredElement("#app")-const eventOutput = requiredElement("#events")--function makeFixture(): RailState {- return {- serverOrder: Array.from({ length: 18 }, (_, index) => String.fromCharCode(97 + index)),- folderOrder: ["one", "two"],- folders: { one: ["c", "d"], two: ["e", "f"] },- expanded: ["one"],- }-}--let state = makeFixture()-let events: EventEntry[] = []-let clickCount = 0-let commitCount = 0-let persistenceBatchCount = 0-let rollbackCount = 0-let failNext = false-let preview: RailInstruction | null = null-let dragStartSnapshot: RailState | null = null-let dragSource: Entity | null = null-let folderSequence = 0-let interactionCleanups: Array<() => void> = []-let hoverTimer: number | null = null-let hoverFolderId: string | null = null-const transientCollapsed = new Set<string>()-const transientExpanded = new Set<string>()--function entityKey(entity: Entity): string {- return `${entity.kind}-${entity.id}`-}--function sameEntity(left: Entity | null, right: Entity | null): boolean {- return left?.kind === right?.kind && left?.id === right?.id-}--function entityFromData(data: Record<string | symbol, unknown>): Entity | null {- const kind = data.railKind- const id = data.railId- if ((kind !== "server" && kind !== "folder") || typeof id !== "string") return null- return { kind, id }-}--function record(type: string, values: Omit<EventEntry, "index" | "type"> = {}): void {- events.push({ index: events.length + 1, type, ...values })- eventOutput.textContent = JSON.stringify(events, null, 2)-}--function readout(): SpikeReadout {- return {- state: cloneState(state),- events: structuredClone(events),- clickCount,- commitCount,- persistenceBatchCount,- rollbackCount,- failNext,- preview: preview ? structuredClone(preview) : null,- }-}--function clearHoverTimer(): void {- if (hoverTimer !== null) window.clearTimeout(hoverTimer)- hoverTimer = null- hoverFolderId = null-}--function effectiveExpanded(folderId: string): boolean {- if (transientCollapsed.has(folderId)) return false- return state.expanded.includes(folderId) || transientExpanded.has(folderId)-}--function setFolderChildrenVisibility(folderId: string): void {- const element = document.querySelector<HTMLElement>(`[data-folder-children="${folderId}"]`)- if (element) element.hidden = !effectiveExpanded(folderId)- const row = document.querySelector<HTMLElement>(`[data-testid="rail-item-folder-${folderId}"]`)- row?.setAttribute("aria-expanded", String(effectiveExpanded(folderId)))-}--function resetTransientDragState(): void {- clearHoverTimer()- preview = null- dragStartSnapshot = null- dragSource = null- transientCollapsed.clear()- transientExpanded.clear()-}--function focusEntity(entity: Entity): void {- requestAnimationFrame(() => {- document.querySelector<HTMLElement>(`[data-testid="primary-${entityKey(entity)}"]`)?.focus()- })-}--function finishCommit(- before: RailState,- instruction: RailInstruction,- source: "pointer" | "move-menu",-): void {- const committed = commitInstruction(before, instruction)- if (!committed.applied) {- record("invalid-drop", { instruction, detail: committed.reason })- render(instruction.source)- return- }-- const commands = planPersistence(before, committed.state, instruction)- const shouldFail = failNext- failNext = false- state = committed.state- commitCount += 1- persistenceBatchCount += 1- record("optimistic-commit", { instruction, commands, detail: source })- render(instruction.source)-- window.setTimeout(() => {- if (shouldFail) {- state = cloneState(before)- rollbackCount += 1- record("rollback", { instruction, commands })- announce(`${accessibleMoveLabel(before, instruction)} failed and was rolled back`)- render(instruction.source)- return- }- const label = accessibleMoveLabel(before, instruction)- record("persisted", { instruction, commands, detail: label })- announce(label)- focusEntity(instruction.source)- }, 80)-}--function instructionWithFolderId(instruction: RailInstruction, before: RailState): RailInstruction {- if (- instruction.operation !== "combine"- || instruction.source.kind !== "server"- || instruction.target.kind !== "server"- || folderForServer(before, instruction.source.id)- || folderForServer(before, instruction.target.id)- ) {- return instruction- }- folderSequence += 1- return { ...instruction, newFolderId: `temporary-${folderSequence}` }-}--function instructionFromDropTargets(- sourceData: Record<string | symbol, unknown>,- targets: readonly { data: Record<string | symbol, unknown> }[],-): RailInstruction | null {- const source = entityFromData(sourceData)- const targetRecord = targets[0]- if (!source || !targetRecord) return null- const target = entityFromData(targetRecord.data)- const hitbox = extractInstruction(targetRecord.data)- if (!target || !hitbox || hitbox.blocked || sameEntity(source, target)) return null- return { operation: hitbox.operation, source, target }-}--function sameInstruction(left: RailInstruction | null, right: RailInstruction | null): boolean {- return left?.operation === right?.operation- && sameEntity(left?.source ?? null, right?.source ?? null)- && sameEntity(left?.target ?? null, right?.target ?? null)-}--function clearPreviewClasses(): void {- for (const element of document.querySelectorAll<HTMLElement>(".preview-before, .preview-after, .preview-combine")) {- element.classList.remove("preview-before", "preview-after", "preview-combine")- }-}--function updateHoverExpansion(instruction: RailInstruction | null): void {- const folderId = instruction?.operation === "combine" && instruction.target.kind === "folder"- ? instruction.target.id- : null- if (!folderId || effectiveExpanded(folderId)) {- clearHoverTimer()- return- }- if (hoverFolderId === folderId && hoverTimer !== null) return- clearHoverTimer()- hoverFolderId = folderId- hoverTimer = window.setTimeout(() => {- transientExpanded.add(folderId)- setFolderChildrenVisibility(folderId)- record("hover-expand", { detail: folderId })- hoverTimer = null- }, 500)-}--function updatePreview(- sourceData: Record<string | symbol, unknown>,- targets: readonly { data: Record<string | symbol, unknown> }[],-): void {- const next = instructionFromDropTargets(sourceData, targets)- if (sameInstruction(preview, next)) return- preview = next- clearPreviewClasses()- if (next) {- const target = document.querySelector<HTMLElement>(`[data-testid="rail-item-${entityKey(next.target)}"]`)- target?.classList.add(- next.operation === "reorder-before"- ? "preview-before"- : next.operation === "reorder-after"- ? "preview-after"- : "preview-combine",- )- record("preview", { instruction: next })- } else {- record("preview-cleared")- }- updateHoverExpansion(next)-}--function operationAvailability(source: Entity | null, target: Entity): {- "reorder-before": Availability- "reorder-after": Availability- combine: Availability-} {- const canReorder = source?.kind === target.kind- const canCombine = source?.kind === "server" && (target.kind === "folder" || target.kind === "server")- return {- "reorder-before": canReorder ? "available" : "not-available",- "reorder-after": canReorder ? "available" : "not-available",- combine: canCombine ? "available" : "not-available",- }-}--function makeMoveOption(- label: string,- testId: string,- instruction: RailInstruction,- container: HTMLElement,-): void {- const button = document.createElement("button")- button.type = "button"- button.role = "menuitem"- button.dataset.testid = testId- button.textContent = label- button.addEventListener("click", () => {- finishCommit(cloneState(state), instructionWithFolderId(instruction, state), "move-menu")- })- container.append(button)-}--function buildMoveMenu(entity: Entity): HTMLElement {- const menu = document.createElement("div")- menu.className = "move-menu"- menu.role = "menu"- menu.hidden = true- menu.dataset.testid = `move-menu-${entityKey(entity)}`-- if (entity.kind === "folder") {- for (const targetId of state.folderOrder.filter((id) => id !== entity.id)) {- for (const operation of ["reorder-before", "reorder-after"] as const) {- makeMoveOption(- `Move ${operation === "reorder-before" ? "before" : "after"} folder ${targetId}`,- `move-${entityKey(entity)}-${operation}-${targetId}`,- { operation, source: entity, target: { kind: "folder", id: targetId } },- menu,- )- }- }- return menu- }-- for (const targetId of state.serverOrder.filter((id) => id !== entity.id)) {- for (const operation of ["reorder-before", "reorder-after"] as const) {- makeMoveOption(- `Move ${operation === "reorder-before" ? "before" : "after"} server ${targetId}`,- `move-${entityKey(entity)}-${operation}-${targetId}`,- { operation, source: entity, target: { kind: "server", id: targetId } },- menu,- )- }- }- for (const folderId of state.folderOrder) {- makeMoveOption(- `Move into folder ${folderId}`,- `move-${entityKey(entity)}-into-${folderId}`,- { operation: "combine", source: entity, target: { kind: "folder", id: folderId } },- menu,- )- }- for (const targetId of visibleTopLevelServers(state).filter((id) => id !== entity.id)) {- makeMoveOption(- `Combine with server ${targetId}`,- `move-${entityKey(entity)}-combine-${targetId}`,- { operation: "combine", source: entity, target: { kind: "server", id: targetId } },- menu,- )- }- return menu-}--function renderRow(entity: Entity, parentFolderId: string | null): HTMLElement {- const row = document.createElement("div")- row.className = "rail-row"- row.dataset.testid = `rail-item-${entityKey(entity)}`- row.dataset.level = parentFolderId ? "1" : "0"- if (entity.kind === "folder") row.setAttribute("aria-expanded", String(effectiveExpanded(entity.id)))-- const primary = document.createElement("button")- primary.type = "button"- primary.className = "primary-action"- primary.dataset.testid = `primary-${entityKey(entity)}`- primary.textContent = entity.kind === "server" ? `Server ${entity.id}` : `Folder ${entity.id}`- primary.addEventListener("click", () => {- clickCount += 1- record("click", { detail: entityKey(entity) })- if (entity.kind === "folder") {- state.expanded = state.expanded.includes(entity.id)- ? state.expanded.filter((id) => id !== entity.id)- : [...state.expanded, entity.id]- render(entity)- }- })-- const moveTrigger = document.createElement("button")- moveTrigger.type = "button"- moveTrigger.className = "move-trigger"- moveTrigger.dataset.testid = `move-trigger-${entityKey(entity)}`- moveTrigger.setAttribute("aria-haspopup", "menu")- moveTrigger.textContent = "Move…"-- const menu = buildMoveMenu(entity)- moveTrigger.addEventListener("click", () => {- menu.hidden = !menu.hidden- moveTrigger.setAttribute("aria-expanded", String(!menu.hidden))- })-- row.append(primary, moveTrigger, menu)- return row-}--function renderFolder(folderId: string): HTMLElement {- const wrapper = document.createElement("section")- wrapper.className = "folder"- wrapper.append(renderRow({ kind: "folder", id: folderId }, null))- const children = document.createElement("div")- children.className = "folder-children"- children.dataset.folderChildren = folderId- children.hidden = !effectiveExpanded(folderId)- for (const serverId of state.folders[folderId] ?? []) {- children.append(renderRow({ kind: "server", id: serverId }, folderId))- }- wrapper.append(children)- return wrapper-}--function wireInteractions(rail: HTMLElement): void {- for (const cleanup of interactionCleanups.splice(0)) cleanup()-- for (const row of rail.querySelectorAll<HTMLElement>(".rail-row")) {- const kind = row.dataset.testid?.includes("-folder-") ? "folder" : "server"- const id = row.dataset.testid?.split(`-${kind}-`)[1]- const primary = row.querySelector<HTMLElement>(".primary-action")- if (!id || !primary) continue- const entity: Entity = { kind, id }-- interactionCleanups.push(draggable({- element: row,- dragHandle: primary,- getInitialData: () => ({ railKind: entity.kind, railId: entity.id }),- }))-- interactionCleanups.push(dropTargetForElements({- element: row,- canDrop: ({ source }) => !sameEntity(entityFromData(source.data), entity),- getIsSticky: () => false,- getData: ({ input, element, source }) => attachInstruction(- { railKind: entity.kind, railId: entity.id },- {- input,- element,- axis: "vertical",- operations: operationAvailability(entityFromData(source.data), entity),- },- ),- }))- }-- interactionCleanups.push(autoScrollForElements({- element: rail,- getAllowedAxis: () => "vertical",- getConfiguration: () => ({ maxScrollSpeed: "fast" }),- }))-- interactionCleanups.push(monitorForElements({- canMonitor: ({ source }) => entityFromData(source.data) !== null,- onDragStart: ({ source }) => {- dragStartSnapshot = cloneState(state)- dragSource = entityFromData(source.data)- if (dragSource?.kind === "folder" && state.expanded.includes(dragSource.id)) {- transientCollapsed.add(dragSource.id)- setFolderChildrenVisibility(dragSource.id)- }- record("drag-start", { detail: dragSource ? entityKey(dragSource) : "unknown" })- },- onDrag: ({ source, location }) => {- updatePreview(source.data, location.current.dropTargets)- },- onDropTargetChange: ({ source, location }) => {- updatePreview(source.data, location.current.dropTargets)- },- onDrop: ({ source, location }) => {- const before = dragStartSnapshot ? cloneState(dragStartSnapshot) : cloneState(state)- const rawInstruction = instructionFromDropTargets(source.data, location.current.dropTargets)- resetTransientDragState()- clearPreviewClasses()- if (!rawInstruction) {- record("cancel")- render(dragSource ?? undefined)- return- }- finishCommit(before, instructionWithFolderId(rawInstruction, before), "pointer")- },- }))-}--function render(focusAfter?: Entity): void {- const scrollTop = app.querySelector<HTMLElement>("[data-testid='rail-scroll']")?.scrollTop ?? 0- app.replaceChildren()-- const controls = document.createElement("div")- controls.className = "controls"- const resetButton = document.createElement("button")- resetButton.type = "button"- resetButton.dataset.testid = "reset"- resetButton.textContent = "Reset fixture"- resetButton.addEventListener("click", resetFixture)- const failureButton = document.createElement("button")- failureButton.type = "button"- failureButton.dataset.testid = "fail-next"- failureButton.textContent = failNext ? "Next persistence will fail" : "Fail next persistence"- failureButton.addEventListener("click", () => {- failNext = true- record("failure-armed")- render(focusAfter)- })- controls.append(resetButton, failureButton)-- const rail = document.createElement("div")- rail.className = "rail-scroll"- rail.dataset.testid = "rail-scroll"- rail.setAttribute("aria-label", "Server rail")- for (const folderId of state.folderOrder) rail.append(renderFolder(folderId))- for (const serverId of visibleTopLevelServers(state)) {- rail.append(renderRow({ kind: "server", id: serverId }, null))- }-- app.append(controls, rail)- rail.scrollTop = scrollTop- wireInteractions(rail)- if (focusAfter) focusEntity(focusAfter)-}--function resetFixture(): void {- state = makeFixture()- events = []- clickCount = 0- commitCount = 0- persistenceBatchCount = 0- rollbackCount = 0- failNext = false- folderSequence = 0- resetTransientDragState()- eventOutput.textContent = "[]"- render()-}--window.__railSpike = {- read: readout,- reset: resetFixture,- failNextPersistence: () => {- failNext = true- record("failure-armed")- render()- },-}--window.addEventListener("pagehide", () => {- for (const dispose of interactionCleanups) dispose()- cleanupLiveRegion()-}, { once: true })--render()diff --git a/spikes/server-rail-pdd/src/rail-model.test.ts b/spikes/server-rail-pdd/src/rail-model.test.tsdeleted file mode 100644index 29599e89b..000000000--- a/spikes/server-rail-pdd/src/rail-model.test.ts+++ /dev/null@@ -1,210 +0,0 @@-import { describe, expect, it } from "vitest"-import {- MAX_FOLDERS,- accessibleMoveLabel,- cloneState,- commitInstruction,- planPersistence,- stateErrors,- visibleTopLevelServers,- type RailInstruction,- type RailState,-} from "./rail-model"--function fixture(): RailState {- return {- serverOrder: ["a", "b", "c", "d", "e", "f"],- folderOrder: ["one", "two"],- folders: { one: ["c", "d"], two: ["e"] },- expanded: ["one"],- }-}--function apply(instruction: RailInstruction, state = fixture()) {- return commitInstruction(state, instruction)-}--describe("normalized server rail reducer", () => {- it("keeps global membership order while deriving visible top-level servers", () => {- expect(visibleTopLevelServers(fixture())).toEqual(["a", "b", "f"])- expect(stateErrors(fixture())).toEqual([])- })-- it("reorders top-level servers with the full membership sequence", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "reorder-after",- source: { kind: "server", id: "a" },- target: { kind: "server", id: "b" },- }- const result = commitInstruction(before, instruction)- expect(result.applied).toBe(true)- expect(result.state.serverOrder).toEqual(["b", "a", "c", "d", "e", "f"])- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "reorder-servers", serverIds: ["b", "a", "c", "d", "e", "f"] },- ])-- const beforeResult = apply({- operation: "reorder-before",- source: { kind: "server", id: "f" },- target: { kind: "server", id: "a" },- })- expect(beforeResult.state.serverOrder).toEqual(["f", "a", "b", "c", "d", "e"])- })-- it("reorders folders without inventing cross-kind positions", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "reorder-before",- source: { kind: "folder", id: "two" },- target: { kind: "folder", id: "one" },- }- const result = commitInstruction(before, instruction)- expect(result.state.folderOrder).toEqual(["two", "one"])- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "reorder-folders", folderIds: ["two", "one"] },- ])-- expect(apply({- operation: "reorder-before",- source: { kind: "server", id: "a" },- target: { kind: "folder", id: "one" },- })).toMatchObject({ applied: false, reason: "server and folder orders cannot interleave" })- })-- it("reorders within a folder with one folder update", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "reorder-before",- source: { kind: "server", id: "d" },- target: { kind: "server", id: "c" },- }- const result = commitInstruction(before, instruction)- expect(result.state.folders.one).toEqual(["d", "c"])- expect(result.state.serverOrder).toEqual(before.serverOrder)- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "update-folder", folderId: "one", serverIds: ["d", "c"] },- ])- })-- it("moves a top-level server into a folder and expands the destination", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "combine",- source: { kind: "server", id: "a" },- target: { kind: "folder", id: "two" },- }- const result = commitInstruction(before, instruction)- expect(result.state.folders.two).toEqual(["e", "a"])- expect(result.state.expanded).toEqual(["one", "two"])- expect(result.state.serverOrder).toEqual(before.serverOrder)- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "update-folder", folderId: "two", serverIds: ["e", "a"] },- ])- })-- it("moves a server between folders with the two necessary updates", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "reorder-after",- source: { kind: "server", id: "c" },- target: { kind: "server", id: "e" },- }- const result = commitInstruction(before, instruction)- expect(result.state.folders).toEqual({ one: ["d"], two: ["e", "c"] })- expect(result.state.expanded).toEqual(["one", "two"])- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "update-folder", folderId: "one", serverIds: ["d"] },- { type: "update-folder", folderId: "two", serverIds: ["e", "c"] },- ])- })-- it("moves the last folder server to rail and deletes the empty folder", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "reorder-before",- source: { kind: "server", id: "e" },- target: { kind: "server", id: "f" },- }- const result = commitInstruction(before, instruction)- expect(visibleTopLevelServers(result.state)).toEqual(["a", "b", "e", "f"])- expect(result.state.folderOrder).toEqual(["one"])- expect(result.state.serverOrder).toEqual(["a", "b", "c", "d", "e", "f"])- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "update-folder", folderId: "two", serverIds: [] },- ])- })-- it("creates a temporary folder only from two top-level servers", () => {- const before = fixture()- const instruction: RailInstruction = {- operation: "combine",- source: { kind: "server", id: "a" },- target: { kind: "server", id: "b" },- newFolderId: "temp-1",- }- const result = commitInstruction(before, instruction)- expect(result.state.folderOrder).toEqual(["one", "two", "temp-1"])- expect(result.state.folders["temp-1"]).toEqual(["a", "b"])- expect(planPersistence(before, result.state, instruction)).toEqual([- { type: "create-folder", tempFolderId: "temp-1", serverIds: ["a", "b"] },- ])-- expect(apply({- ...instruction,- source: { kind: "server", id: "c" },- })).toMatchObject({- applied: false,- reason: "creating a folder requires two top-level servers",- })- })-- it("blocks new folders at the limit", () => {- const state = fixture()- state.folderOrder = Array.from({ length: MAX_FOLDERS }, (_, index) => `f${index}`)- state.folders = Object.fromEntries(- state.folderOrder.map((folderId, index) => [folderId, [`extra-${index}`]]),- )- state.serverOrder.push(...Object.values(state.folders).flat())- state.expanded = []- const result = commitInstruction(state, {- operation: "combine",- source: { kind: "server", id: "a" },- target: { kind: "server", id: "b" },- newFolderId: "too-many",- })- expect(result).toMatchObject({ applied: false, reason: "folder limit reached" })- })-- it("treats preview, cancel, self drops, and invalid state as zero-write", () => {- const before = fixture()- const snapshot = cloneState(before)- const self = apply({- operation: "reorder-before",- source: { kind: "server", id: "a" },- target: { kind: "server", id: "a" },- })- expect(self.applied).toBe(false)- expect(planPersistence(before, snapshot, {- operation: "reorder-before",- source: { kind: "server", id: "a" },- target: { kind: "server", id: "b" },- })).toEqual([])-- const invalid = fixture()- invalid.folders.two.push("c")- expect(commitInstruction(invalid, {- operation: "combine",- source: { kind: "server", id: "a" },- target: { kind: "folder", id: "one" },- })).toMatchObject({ applied: false, reason: "invalid start state" })- })-- it("produces a literal accessible outcome", () => {- expect(accessibleMoveLabel(fixture(), {- operation: "reorder-after",- source: { kind: "server", id: "c" },- target: { kind: "server", id: "e" },- })).toBe("Server c moved after server e from folder one")- })-})diff --git a/spikes/server-rail-pdd/src/rail-model.ts b/spikes/server-rail-pdd/src/rail-model.tsdeleted file mode 100644index 8a61e9e34..000000000--- a/spikes/server-rail-pdd/src/rail-model.ts+++ /dev/null@@ -1,356 +0,0 @@-export const MAX_FOLDERS = 10--export type Entity =- | { kind: "server"; id: string }- | { kind: "folder"; id: string }--export type Operation = "reorder-before" | "reorder-after" | "combine"--export type RailInstruction = {- operation: Operation- source: Entity- target: Entity- newFolderId?: string-}--export type RailState = {- serverOrder: string[]- folderOrder: string[]- folders: Record<string, string[]>- expanded: string[]-}--export type PersistenceCommand =- | { type: "reorder-servers"; serverIds: string[] }- | { type: "reorder-folders"; folderIds: string[] }- | { type: "update-folder"; folderId: string; serverIds: string[] }- | { type: "create-folder"; tempFolderId: string; serverIds: string[] }--export type CommitResult = {- state: RailState- applied: boolean- reason?: string-}--function unique(values: readonly string[]): string[] {- return [...new Set(values)]-}--export function cloneState(state: RailState): RailState {- return {- serverOrder: [...state.serverOrder],- folderOrder: [...state.folderOrder],- folders: Object.fromEntries(- Object.entries(state.folders).map(([folderId, serverIds]) => [folderId, [...serverIds]]),- ),- expanded: [...state.expanded],- }-}--export function visibleTopLevelServers(state: RailState): string[] {- const claimed = new Set(Object.values(state.folders).flat())- return state.serverOrder.filter((serverId) => !claimed.has(serverId))-}--export function folderForServer(state: RailState, serverId: string): string | null {- for (const folderId of state.folderOrder) {- if (state.folders[folderId]?.includes(serverId)) return folderId- }- return null-}--export function stateErrors(state: RailState): string[] {- const errors: string[] = []- const serverSet = new Set(state.serverOrder)- if (serverSet.size !== state.serverOrder.length) errors.push("serverOrder contains duplicates")- if (new Set(state.folderOrder).size !== state.folderOrder.length) {- errors.push("folderOrder contains duplicates")- }- if (state.folderOrder.length > MAX_FOLDERS) errors.push("folder limit exceeded")-- const memberships = new Set<string>()- for (const folderId of state.folderOrder) {- const items = state.folders[folderId]- if (!items) {- errors.push(`folder ${folderId} is missing`)- continue- }- if (items.length === 0) errors.push(`folder ${folderId} is empty`)- if (new Set(items).size !== items.length) errors.push(`folder ${folderId} contains duplicates`)- for (const serverId of items) {- if (!serverSet.has(serverId)) errors.push(`folder ${folderId} contains unknown server ${serverId}`)- if (memberships.has(serverId)) errors.push(`server ${serverId} belongs to multiple folders`)- memberships.add(serverId)- }- }- for (const folderId of Object.keys(state.folders)) {- if (!state.folderOrder.includes(folderId)) errors.push(`folder ${folderId} is not ordered`)- }- for (const folderId of state.expanded) {- if (!state.folderOrder.includes(folderId)) errors.push(`expanded folder ${folderId} is missing`)- }- return errors-}--function sameArray(left: readonly string[], right: readonly string[]): boolean {- return left.length === right.length && left.every((value, index) => value === right[index])-}--export function sameState(left: RailState, right: RailState): boolean {- if (!sameArray(left.serverOrder, right.serverOrder)) return false- if (!sameArray(left.folderOrder, right.folderOrder)) return false- if (!sameArray(left.expanded, right.expanded)) return false- return left.folderOrder.every((folderId) =>- sameArray(left.folders[folderId] ?? [], right.folders[folderId] ?? []),- )-}--function moveRelative(list: readonly string[], sourceId: string, targetId: string, after: boolean): string[] {- const withoutSource = list.filter((id) => id !== sourceId)- const targetIndex = withoutSource.indexOf(targetId)- if (targetIndex === -1) return [...list]- const next = [...withoutSource]- next.splice(targetIndex + (after ? 1 : 0), 0, sourceId)- return next-}--function removeEmptyFolder(state: RailState, folderId: string): void {- if ((state.folders[folderId]?.length ?? 0) > 0) return- delete state.folders[folderId]- state.folderOrder = state.folderOrder.filter((id) => id !== folderId)- state.expanded = state.expanded.filter((id) => id !== folderId)-}--function removeServerFromFolder(state: RailState, serverId: string): string | null {- const folderId = folderForServer(state, serverId)- if (!folderId) return null- state.folders[folderId] = state.folders[folderId]!.filter((id) => id !== serverId)- removeEmptyFolder(state, folderId)- return folderId-}--function insertServerRelative(- state: RailState,- sourceId: string,- targetId: string,- after: boolean,-): boolean {- const targetFolder = folderForServer(state, targetId)- const sourceFolder = folderForServer(state, sourceId)- if (sourceFolder === targetFolder) {- if (targetFolder) {- state.folders[targetFolder] = moveRelative(- state.folders[targetFolder]!,- sourceId,- targetId,- after,- )- } else {- state.serverOrder = moveRelative(state.serverOrder, sourceId, targetId, after)- }- return true- }-- removeServerFromFolder(state, sourceId)- if (targetFolder) {- const targetItems = state.folders[targetFolder]- if (!targetItems) return false- state.folders[targetFolder] = moveRelative(- [...targetItems, sourceId],- sourceId,- targetId,- after,- )- state.expanded = unique([...state.expanded, targetFolder])- return true- }-- state.serverOrder = moveRelative(state.serverOrder, sourceId, targetId, after)- return true-}--function combineServer(state: RailState, instruction: RailInstruction): CommitResult {- if (instruction.source.kind !== "server") {- return { state, applied: false, reason: "folders cannot combine" }- }- const sourceId = instruction.source.id- const sourceFolder = folderForServer(state, sourceId)-- if (instruction.target.kind === "folder") {- const targetFolderId = instruction.target.id- const targetItems = state.folders[targetFolderId]- if (!targetItems) return { state, applied: false, reason: "target folder is missing" }- if (sourceFolder === targetFolderId) {- return { state, applied: false, reason: "server is already in target folder" }- }- removeServerFromFolder(state, sourceId)- state.folders[targetFolderId] = [...targetItems, sourceId]- state.expanded = unique([...state.expanded, targetFolderId])- return { state, applied: true }- }-- const targetId = instruction.target.id- const targetFolder = folderForServer(state, targetId)- if (targetFolder) {- if (sourceFolder === targetFolder) {- return { state, applied: false, reason: "servers already share a folder" }- }- removeServerFromFolder(state, sourceId)- const targetItems = state.folders[targetFolder]- if (!targetItems) return { state, applied: false, reason: "target folder is missing" }- const targetIndex = targetItems.indexOf(targetId)- state.folders[targetFolder] = [...targetItems]- state.folders[targetFolder]!.splice(targetIndex + 1, 0, sourceId)- state.expanded = unique([...state.expanded, targetFolder])- return { state, applied: true }- }-- if (sourceFolder) {- return {- state,- applied: false,- reason: "creating a folder requires two top-level servers",- }- }- if (state.folderOrder.length >= MAX_FOLDERS) {- return { state, applied: false, reason: "folder limit reached" }- }- const newFolderId = instruction.newFolderId- if (!newFolderId || state.folders[newFolderId]) {- return { state, applied: false, reason: "new folder id is required" }- }- state.folderOrder.push(newFolderId)- state.folders[newFolderId] = [sourceId, targetId]- state.expanded = unique([...state.expanded, newFolderId])- return { state, applied: true }-}--export function commitInstruction(- before: RailState,- instruction: RailInstruction,-): CommitResult {- if (stateErrors(before).length > 0) {- return { state: before, applied: false, reason: "invalid start state" }- }- if (- instruction.source.kind === instruction.target.kind- && instruction.source.id === instruction.target.id- ) {- return { state: before, applied: false, reason: "source equals target" }- }-- const next = cloneState(before)- let result: CommitResult- if (instruction.operation === "combine") {- result = combineServer(next, instruction)- } else if (instruction.source.kind === "folder" || instruction.target.kind === "folder") {- if (instruction.source.kind !== "folder" || instruction.target.kind !== "folder") {- return { state: before, applied: false, reason: "server and folder orders cannot interleave" }- }- if (!next.folderOrder.includes(instruction.source.id)- || !next.folderOrder.includes(instruction.target.id)) {- return { state: before, applied: false, reason: "folder is missing" }- }- next.folderOrder = moveRelative(- next.folderOrder,- instruction.source.id,- instruction.target.id,- instruction.operation === "reorder-after",- )- result = { state: next, applied: true }- } else {- if (!next.serverOrder.includes(instruction.source.id)- || !next.serverOrder.includes(instruction.target.id)) {- return { state: before, applied: false, reason: "server is missing" }- }- const applied = insertServerRelative(- next,- instruction.source.id,- instruction.target.id,- instruction.operation === "reorder-after",- )- result = applied- ? { state: next, applied: true }- : { state: before, applied: false, reason: "target is missing" }- }-- if (!result.applied) return { ...result, state: before }- const errors = stateErrors(result.state)- if (errors.length > 0) {- return { state: before, applied: false, reason: errors.join("; ") }- }- if (sameState(before, result.state)) {- return { state: before, applied: false, reason: "instruction is a no-op" }- }- return result-}--function sameMembers(left: readonly string[], right: readonly string[]): boolean {- if (left.length !== right.length) return false- const set = new Set(left)- return right.every((value) => set.has(value))-}--export function planPersistence(- before: RailState,- after: RailState,- instruction: RailInstruction,-): PersistenceCommand[] {- if (sameState(before, after)) return []- const commands: PersistenceCommand[] = []-- if (!sameArray(before.serverOrder, after.serverOrder)) {- commands.push({ type: "reorder-servers", serverIds: [...after.serverOrder] })- }-- const addedFolders = after.folderOrder.filter((folderId) => !before.folderOrder.includes(folderId))- const removedFolders = before.folderOrder.filter((folderId) => !after.folderOrder.includes(folderId))- if (addedFolders.length === 1 && instruction.operation === "combine") {- const folderId = addedFolders[0]!- commands.push({- type: "create-folder",- tempFolderId: folderId,- serverIds: [...after.folders[folderId]!],- })- }-- for (const folderId of before.folderOrder) {- const beforeItems = before.folders[folderId] ?? []- const afterItems = after.folders[folderId]- if (!afterItems) {- commands.push({ type: "update-folder", folderId, serverIds: [] })- } else if (!sameArray(beforeItems, afterItems)) {- commands.push({ type: "update-folder", folderId, serverIds: [...afterItems] })- }- }-- const sameFolderSet = sameMembers(before.folderOrder, after.folderOrder)- if (sameFolderSet && !sameArray(before.folderOrder, after.folderOrder)) {- commands.push({ type: "reorder-folders", folderIds: [...after.folderOrder] })- }-- return commands-}--export function accessibleMoveLabel(- state: RailState,- instruction: RailInstruction,-): string {- const source = instruction.source.kind === "server"- ? `Server ${instruction.source.id}`- : `Folder ${instruction.source.id}`- if (instruction.operation === "combine") {- const target = instruction.target.kind === "server"- ? `server ${instruction.target.id}`- : `folder ${instruction.target.id}`- return `${source} moved into ${target}`- }- const placement = instruction.operation === "reorder-before" ? "before" : "after"- const target = instruction.target.kind === "server"- ? `server ${instruction.target.id}`- : `folder ${instruction.target.id}`- const sourceFolder = instruction.source.kind === "server"- ? folderForServer(state, instruction.source.id)- : null- return `${source} moved ${placement} ${target}${sourceFolder ? ` from folder ${sourceFolder}` : ""}`-}diff --git a/spikes/server-rail-pdd/src/styles.css b/spikes/server-rail-pdd/src/styles.cssdeleted file mode 100644index 899abe2e8..000000000--- a/spikes/server-rail-pdd/src/styles.css+++ /dev/null@@ -1,182 +0,0 @@-:root {- color: #1c1917;- background: #f6f5f2;- font-family: Inter, ui-sans-serif, system-ui, sans-serif;- font-synthesis: none;- --card: #fff;- --border: #d6d3d1;- --muted: #78716c;- --accent: #2563eb;- --combine: #7c3aed;-}--* {- box-sizing: border-box;-}--body {- margin: 0;- min-width: 320px;-}--main {- width: min(720px, 100%);- margin: 0 auto;- padding: 24px;-}--h1 {- margin: 0 0 8px;- font-size: 24px;-}--#instructions {- color: var(--muted);- margin: 0 0 16px;-}--.controls {- display: flex;- gap: 8px;- margin-bottom: 12px;-}--button {- border: 1px solid var(--border);- border-radius: 8px;- background: var(--card);- color: inherit;- font: inherit;-}--button:focus-visible {- outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);- outline-offset: 2px;-}--.controls button {- padding: 8px 12px;-}--.rail-scroll {- width: min(100%, 360px);- height: 460px;- overflow-y: auto;- overscroll-behavior: contain;- touch-action: pan-y;- scrollbar-width: thin;- border: 1px solid var(--border);- border-radius: 14px;- background: color-mix(in srgb, var(--card) 78%, transparent);- padding: 8px;-}--.folder {- display: contents;-}--.folder-children[hidden] {- display: none;-}--.rail-row {- position: relative;- display: grid;- grid-template-columns: minmax(0, 1fr) auto;- gap: 8px;- min-height: 54px;- margin: 4px 0;- padding: 5px;- border: 2px solid transparent;- border-radius: 12px;- background: var(--card);- touch-action: pan-y;-}--.rail-row[data-level="1"] {- margin-left: 26px;-}--.primary-action,-.move-trigger {- min-height: 40px;- padding: 8px 12px;-}--.primary-action {- cursor: grab;- text-align: left;- font-weight: 650;-}--.primary-action:active {- cursor: grabbing;-}--.preview-before::before,-.preview-after::after {- content: "";- position: absolute;- z-index: 2;- right: 4px;- left: 4px;- height: 3px;- border-radius: 999px;- background: var(--accent);-}--.preview-before::before {- top: -5px;-}--.preview-after::after {- bottom: -5px;-}--.preview-combine {- border-color: var(--combine);- box-shadow: 0 0 0 2px color-mix(in srgb, var(--combine) 18%, transparent);-}--.move-menu {- grid-column: 1 / -1;- display: grid;- gap: 4px;- max-height: 180px;- overflow-y: auto;- scrollbar-width: thin;- border-top: 1px solid var(--border);- padding-top: 6px;-}--.move-menu[hidden] {- display: none;-}--.move-menu button {- padding: 7px 10px;- text-align: left;-}--#events {- min-height: 88px;- max-height: 240px;- overflow: auto;- margin-top: 16px;- border-radius: 12px;- background: #1c1917;- color: #fafaf9;- padding: 12px;- font-size: 12px;-}--@media (max-width: 520px) {- main {- padding: 12px;- }-- .rail-scroll {- width: 100%;- height: 520px;- }-}diff --git a/spikes/server-rail-pdd/tests/rail-pdd.spec.ts b/spikes/server-rail-pdd/tests/rail-pdd.spec.tsdeleted file mode 100644index 6e0c6e6b7..000000000--- a/spikes/server-rail-pdd/tests/rail-pdd.spec.ts+++ /dev/null@@ -1,208 +0,0 @@-import { expect, test, type Page } from "@playwright/test"--type SpikeReadout = {- state: {- serverOrder: string[]- folderOrder: string[]- folders: Record<string, string[]>- expanded: string[]- }- events: Array<{ type: string; detail?: string; commands?: unknown[] }>- clickCount: number- commitCount: number- persistenceBatchCount: number- rollbackCount: number- preview: null | { operation: string; target: { kind: string; id: string } }-}--async function read(page: Page): Promise<SpikeReadout> {- return page.evaluate(() => window.__railSpike.read())-}--async function reset(page: Page): Promise<void> {- await page.getByTestId("reset").click()-}--async function pointerDrag(- page: Page,- sourceTestId: string,- targetTestId: string,- targetYRatio: number,-): Promise<void> {- const sourceBox = await page.getByTestId(sourceTestId).boundingBox()- const targetBox = await page.getByTestId(targetTestId).boundingBox()- expect(sourceBox).not.toBeNull()- expect(targetBox).not.toBeNull()- await page.mouse.move(sourceBox!.x + sourceBox!.width / 2, sourceBox!.y + sourceBox!.height / 2)- await page.mouse.down()- await page.mouse.move(targetBox!.x + targetBox!.width / 2, targetBox!.y + targetBox!.height * targetYRatio, { steps: 12 })- await page.mouse.up()-}--test.beforeEach(async ({ page }) => {- await page.goto("/")-})--test.describe("desktop pointer contract", () => {- test.skip(({ isMobile }) => Boolean(isMobile))-- test("click, reorder, combine, and rollback each settle once", async ({ page }) => {- const clickBox = await page.getByTestId("primary-server-a").boundingBox()- expect(clickBox).not.toBeNull()- await page.mouse.move(clickBox!.x + clickBox!.width / 2, clickBox!.y + clickBox!.height / 2)- await page.mouse.down()- await page.mouse.move(clickBox!.x + clickBox!.width / 2 + 2, clickBox!.y + clickBox!.height / 2 + 2)- await page.mouse.up()- expect((await read(page)).clickCount).toBe(1)- expect((await read(page)).commitCount).toBe(0)-- await pointerDrag(page, "primary-server-a", "rail-item-server-b", 0.95)- await expect.poll(async () => (await read(page)).commitCount).toBe(1)- const reordered = await read(page)- expect(reordered.state.serverOrder.slice(0, 2)).toEqual(["b", "a"])- expect(reordered.persistenceBatchCount).toBe(1)- expect(reordered.events.filter((event) => event.type === "optimistic-commit")).toHaveLength(1)-- await reset(page)- await pointerDrag(page, "primary-server-a", "rail-item-server-b", 0.5)- await expect.poll(async () => (await read(page)).commitCount).toBe(1)- const combined = await read(page)- const createdFolder = combined.state.folderOrder.find((id) => id.startsWith("temporary-"))- expect(createdFolder).toBeTruthy()- expect(combined.state.folders[createdFolder!]).toEqual(["a", "b"])- expect(combined.events.find((event) => event.type === "optimistic-commit")?.commands).toEqual([- { type: "create-folder", tempFolderId: createdFolder, serverIds: ["a", "b"] },- ])-- await reset(page)- await page.getByTestId("fail-next").click()- await page.getByTestId("move-trigger-server-a").click()- await page.getByTestId("move-server-a-reorder-after-b").click()- await expect.poll(async () => (await read(page)).rollbackCount).toBe(1)- const rolledBack = await read(page)- expect(rolledBack.state.serverOrder.slice(0, 2)).toEqual(["a", "b"])- expect(rolledBack.commitCount).toBe(1)- expect(rolledBack.persistenceBatchCount).toBe(1)- })-- test("preview is non-mutating, collapsed folder hover expands, and Escape cancels", async ({ page }) => {- const before = await read(page)- const sourceBox = await page.getByTestId("primary-server-a").boundingBox()- const folderBox = await page.getByTestId("rail-item-folder-two").boundingBox()- expect(sourceBox).not.toBeNull()- expect(folderBox).not.toBeNull()-- await page.mouse.move(sourceBox!.x + sourceBox!.width / 2, sourceBox!.y + sourceBox!.height / 2)- await page.mouse.down()- await page.mouse.move(folderBox!.x + folderBox!.width / 2, folderBox!.y + folderBox!.height / 2, { steps: 12 })- await expect(page.getByTestId("rail-item-folder-two")).toHaveClass(/preview-combine/)- expect((await read(page)).state).toEqual(before.state)- await page.waitForTimeout(200)- await page.mouse.move(8, 8, { steps: 6 })- await page.waitForTimeout(400)- await expect(page.locator('[data-folder-children="two"]')).toBeHidden()- const currentFolderBox = await page.getByTestId("rail-item-folder-two").boundingBox()- expect(currentFolderBox).not.toBeNull()- await page.mouse.move(currentFolderBox!.x + currentFolderBox!.width / 2, currentFolderBox!.y + currentFolderBox!.height / 2, { steps: 8 })- await page.waitForTimeout(550)- await expect(page.locator('[data-folder-children="two"]')).toBeVisible()- await page.screenshot({ path: "evidence/desktop-hover-combine.png", fullPage: true })- await page.keyboard.press("Escape")- await expect.poll(async () => (await read(page)).events.some((event) => event.type === "cancel")).toBe(true)- const after = await read(page)- expect(after.state).toEqual(before.state)- expect(after.commitCount).toBe(0)- expect(after.persistenceBatchCount).toBe(0)-- const nextSourceBox = await page.getByTestId("primary-server-a").boundingBox()- expect(nextSourceBox).not.toBeNull()- await page.mouse.move(nextSourceBox!.x + nextSourceBox!.width / 2, nextSourceBox!.y + nextSourceBox!.height / 2)- await page.mouse.down()- await page.mouse.move(8, 8, { steps: 8 })- await page.mouse.up()- await expect.poll(async () => (await read(page)).events.filter((event) => event.type === "cancel").length).toBe(2)- expect((await read(page)).commitCount).toBe(0)- })-- test("edge drag auto-scrolls while canonical state stays fixed until drop", async ({ page }) => {- const rail = page.getByTestId("rail-scroll")- const railBox = await rail.boundingBox()- const sourceBox = await page.getByTestId("primary-folder-one").boundingBox()- expect(railBox).not.toBeNull()- expect(sourceBox).not.toBeNull()-- await page.mouse.move(railBox!.x + railBox!.width / 2, railBox!.y + railBox!.height / 2)- await page.mouse.wheel(0, 260)- await expect.poll(async () => rail.evaluate((element) => element.scrollTop)).toBeGreaterThan(0)- expect((await read(page)).commitCount).toBe(0)- await rail.evaluate((element) => { element.scrollTop = 0 })-- await page.mouse.move(sourceBox!.x + sourceBox!.width / 2, sourceBox!.y + sourceBox!.height / 2)- await page.mouse.down()- await page.mouse.move(railBox!.x + railBox!.width / 2, railBox!.y + railBox!.height - 3, { steps: 16 })- await expect(page.locator('[data-folder-children="one"]')).toBeHidden()- await expect.poll(async () => rail.evaluate((element) => element.scrollTop), { timeout: 4_000 }).toBeGreaterThan(0)- expect((await read(page)).commitCount).toBe(0)- await page.keyboard.press("Escape")- await expect.poll(async () => (await read(page)).events.some((event) => event.type === "cancel")).toBe(true)- await expect(page.locator('[data-folder-children="one"]')).toBeVisible()- expect((await read(page)).commitCount).toBe(0)- })-- test("Move menu preserves parity, announcement, and focus", async ({ page }) => {- await page.getByTestId("move-trigger-server-c").click()- await page.getByTestId("move-server-c-reorder-after-e").click()- await expect.poll(async () => (await read(page)).commitCount).toBe(1)- const moved = await read(page)- expect(moved.state.folders.one).toEqual(["d"])- expect(moved.state.folders.two).toEqual(["e", "c", "f"])- await expect(page.getByRole("status")).toHaveText("Server c moved after server e from folder one")- await expect(page.getByTestId("primary-server-c")).toBeFocused()- })-})--test.describe("mobile touch separation", () => {- test.skip(({ isMobile }) => !isMobile)-- test("row swipe scrolls, short tap clicks once, and Move is intentional", async ({ page }) => {- const rail = page.getByTestId("rail-scroll")- const row = page.getByTestId("primary-server-g")- const rowBox = await row.boundingBox()- expect(rowBox).not.toBeNull()- const client = await page.context().newCDPSession(page)- const x = rowBox!.x + rowBox!.width / 2- const startY = rowBox!.y + rowBox!.height / 2-- await client.send("Input.dispatchTouchEvent", {- type: "touchStart",- touchPoints: [{ x, y: startY }],- })- for (let index = 1; index <= 8; index += 1) {- await client.send("Input.dispatchTouchEvent", {- type: "touchMove",- touchPoints: [{ x, y: startY - index * 18 }],- })- }- await client.send("Input.dispatchTouchEvent", { type: "touchEnd", touchPoints: [] })- await expect.poll(async () => rail.evaluate((element) => element.scrollTop)).toBeGreaterThan(0)- let current = await read(page)- expect(current.commitCount).toBe(0)- expect(current.clickCount).toBe(0)-- await rail.evaluate((element) => { element.scrollTop = 0 })- const tapBox = await page.getByTestId("primary-server-a").boundingBox()- expect(tapBox).not.toBeNull()- await page.touchscreen.tap(tapBox!.x + tapBox!.width / 2, tapBox!.y + tapBox!.height / 2)- await expect.poll(async () => (await read(page)).clickCount).toBe(1)- current = await read(page)- expect(current.commitCount).toBe(0)-- await page.getByTestId("move-trigger-server-a").click()- await page.screenshot({ path: "evidence/mobile-move-menu.png", fullPage: true })- await page.getByTestId("move-server-a-into-two").click()- await expect.poll(async () => (await read(page)).commitCount).toBe(1)- current = await read(page)- expect(current.state.folders.two).toEqual(["e", "f", "a"])- expect(current.persistenceBatchCount).toBe(1)- })-})diff --git a/spikes/server-rail-pdd/tsconfig.json b/spikes/server-rail-pdd/tsconfig.jsondeleted file mode 100644index ce7eb4a8b..000000000--- a/spikes/server-rail-pdd/tsconfig.json+++ /dev/null@@ -1,13 +0,0 @@-{- "compilerOptions": {- "target": "ES2023",- "useDefineForClassFields": true,- "module": "ESNext",- "moduleResolution": "Bundler",- "strict": true,- "noEmit": true,- "lib": ["ES2023", "DOM", "DOM.Iterable"],- "types": ["vitest/globals", "node"]- },- "include": ["src", "tests", "playwright.config.ts", "vite.config.ts"]-}diff --git a/spikes/server-rail-pdd/vite.config.ts b/spikes/server-rail-pdd/vite.config.tsdeleted file mode 100644index 153005a3b..000000000--- a/spikes/server-rail-pdd/vite.config.ts+++ /dev/null@@ -1,12 +0,0 @@-import { defineConfig } from "vitest/config"--export default defineConfig({- server: {- host: "127.0.0.1",- port: 4177,- strictPort: true,- },- test: {- include: ["src/**/*.test.ts"],- },-})