Superbench 2.0 · Выпуск запроса 2.0
Павильон Prism Freight
Назад ко всем подсказкамВернуться к Superbench 2.0 · Тестовый контракт и критерии оценки. Опубликована одна записанная оценка для этого краткого описания; откройте страницу краткого описания для артефакта и записи сессии для её пределов. Одно сообщение пользователя, один HTML-ответ; без инструментов или корректировок. Не добавляйте руководство оператора версии 1.x.
# 17. Prism Freight Pavilion
Build a polished interactive freight-exhibition pavilion in one self-contained HTML file: six labeled exhibits occupy six floor bays, and an exact solver finds the best legal arrangement or explains the smallest set of removable rules that prevents one.
This is a tool-free, single-response build. Do not browse, execute code, call tools, ask questions, or request plan approval. Reason privately, review your source against the checklist, and return only the complete HTML document. Do not claim you ran browser checks. A reviewer will run them later.
## Required features
### 1. A fully specified pavilion
Show a 2×3 floor plan with bays 1,2,3 left-to-right on the top row and 4,5,6 on the bottom row. Row and column distances use this grid; adjacency means Manhattan distance exactly one, never diagonals. Put exactly one of exhibits A,B,C,D,E,F in each bay; use all six once.
Default weights are A=3, B=2, C=2, D=1, E=1, F=3. Each bay's default capacity is 3. Default preferred bays are A=1, B=3, C=2, D=4, E=5, F=6. Allow editing each weight and capacity to integers 1–4 and each preferred bay to 1–6. Invalid edits must show an error and leave the last accepted configuration unchanged.
These six rules are initially enabled and individually toggleable:
- c1: A is in the top row.
- c2: F is in the bottom row.
- c3: B and C are adjacent.
- c4: D and F are not adjacent.
- c5: E is in the middle column (bay 2 or 5).
- c6: A and F are not adjacent.
Capacity and one-exhibit-per-bay are hard rules. Allow each exhibit to be unpinned or pinned to a bay. Pins are also hard rules; conflicting pins may make a valid configuration infeasible and must not be silently removed.
### 2. Exact solving and explanations
Enumerate the 720 exhibit permutations for the accepted configuration. For legal arrangements minimize the sum, over all exhibits, of weight multiplied by Manhattan distance from its preferred bay. Break ties by the lexicographically smallest six-letter occupancy string in bay order, using A<B<C<D<E<F. Display legal arrangement count, best cost, winning occupancy and total candidate count 720. Never substitute a greedy layout or a canned answer.
If no legal arrangement exists, find a minimum-cardinality subset of currently enabled c1–c6 whose removal permits a hard-rule-valid arrangement. Break subset ties lexicographically by their sorted ID lists. Display that subset and an optimal witness after its removal, using the same cost and occupancy tie-break. Do not actually disable rules until the user explicitly chooses Apply relaxation. If even removal of all enabled soft rules is insufficient, show “Hard constraints infeasible” and no witness. Distinguish this from input validation errors.
### 3. One state shared by all views
Offer manual placement by selecting an exhibit and destination bay, swapping the current occupants. Provide equivalent keyboard controls. Manual moves may produce an invalid layout for inspection; do not silently repair them. Highlight every violated rule, over-capacity bay and unsatisfied pin. Show each exhibit's distance contribution and their total, even for invalid layouts; label legality separately.
Every accepted edit invalidates earlier solver results until recomputed. Solve displays its result without replacing the manual layout; Apply solution explicitly copies the result into it. Applying a relaxation changes only the named rule toggles, invalidates results and lets the user solve again. Reset restores all defaults and the manual occupancy ABCDEF.
Provide a JSON text export containing accepted configuration, manual occupancy, violations, cost contributions and the current solver result or null. Compute all visual and exported values from the same current state. No storage or network is required.
### 4. Visual and interaction craft
Use a top-down illustrated pavilion with distinct exhibit silhouettes, weight tags, bay numbers and visible routing-distance highlights when selecting an exhibit. Keep the board, rule list and explanation readable without relying only on color. At 390px width stack controls below the board. All controls must work with keyboard and visible focus; include short instructions and respect reduced motion and light/dark preference.
## Output constraints
Exactly one index.html document with inline CSS and JavaScript. Return raw HTML only, without Markdown fences or prose. No libraries, remote fonts, imports, network requests, external assets, build step or server. Use native HTML, SVG or Canvas. It must open via file://, have lang="en", and contain no TODOs or simulated solver results. Export means visible selectable JSON text, not an extra delivered file.
## Loop / validation rule
Do not stop drafting until every required feature has a complete implementation and you have checked the following by source-level reasoning. Do not use tools or report unperformed tests. The reviewer will perform these browser checks:
1. Open offline, inspect all six exhibits and defaults, then navigate every operation with keyboard at desktop and mobile sizes. Check reduced motion and light/dark legibility.
2. Solve defaults: the optimum is ACBDEF with cost 0. Its unique zero-cost assignment satisfies all six rules. Candidate count is 720. Apply solution and reconcile every displayed contribution and exported field.
3. In the solved layout swap A and F. Both row rules fail; the UI must enumerate actual violations instead of showing a stale success. Undo the swap manually, then change A's preferred bay and verify the previous solver result disappears until solving again.
4. Reset; pin A to bay 4. No complete solution satisfies c1. Minimum relaxation must be [c1], with a valid witness: capacity and all other rules can hold, for example DBCAEF. Applying relaxation changes c1 only; solving and applying then produces a valid arrangement.
5. Reset; set all capacities to 2. Show Hard constraints infeasible, since A and F each weigh 3. Reset; pin A and B both to bay 1 and verify the same hard-infeasibility classification.
6. Reset; turn all six optional rules off, leave capacities at 3 and pins empty. Exactly 720 arrangements are legal. Restore rules, edit weights and capacities within range, and independently inspect reported optimality by enumerating the small permutation domain if needed.
7. Enter an out-of-range value or a noninteger. Show an input error without changing the accepted configuration. Check solve, manual placement, applying solutions, applying relaxations, reset and export after repeated edits; no stale result may be presented as current.
If any check fails in your source review, fix the implementation and re-run all checks mentally before returning the single artifact. A reviewer finding a failure records it against this attempt; no second model turn is part of this test.