feat(web): the Cost & Risk view, Day 1 on a Pareto detent ladder (#44) - #67
Merged
Conversation
Day 1's thesis on screen: serve each destination by its own cheapest path, watch the plan fail, then flip to the feasible optimum -- walked along the Pareto frontier. The coarse unit is a distinct Pareto POINT, not a lambda value. The eight default lambdas collapse to four distinct plans on the theater, so walking lambda positions would have made the first four presses of Day 1 change nothing on screen -- the dead-key failure the beat model exists to prevent, sitting in the default sweep at the worst possible moment. Dedup is on the PAIR: a block collapses only if neither the naive plan nor the optimum moved, because the theater has a lambda where the naive plan moves and the optimum does not, and collapsing it would hide the ticket's own punchline. The panel keeps all eight rows with the duplicates marked as duplicates -- the dedup only pays for itself as a sentence if the collapsed rows are still there to be pointed at. The Pareto table is promoted to be this view's timeline and the beat timeline is empty here, because a four-row detent list beside eight lambda rows would be the same beat state in two components that can disagree. The two slots are never both filled. The naive plan's two failures stay two things: an over-capacity lane is a mark on the LANE and an over-stock hub is a mark on the NODE, so the room reads an assignment error rather than merely a too-small pipe. Every supply node renders with its dispatched-against-stock readout, idle healthy ones included -- an overdrawn hub beside a hub with spare stock makes the allocation argument by itself, and on the theater the overdrawn hub's identity changes from BRAVO to ALPHA as lambda rises. A base nothing reaches wears the removed vocabulary (grey, struck) where a base served illegally wears the violation hue: unreachability and infeasibility are different lessons. Beat a switches capacity on and cost/risk off, because the two share the anchor's lower row and the sentence there is "this lane is asked for 90 and holds 60"; the flip switches them back for the frontier's trade-off. Day 1 authors --violation, which the token block had been carrying as a provisional panel tick with no canvas hue behind it, and re-derives that tick from it. Reddish purple rather than red: red against --node-demand is dE 3 under deuteranopia, confusable exactly where it matters, since an overloaded lane is by construction the lane running into a demand node. The degenerate combination is LABELLED, not struck. On the textbook set every cost is 1 and no lane carries risk, so lambda multiplies zero and all eight lambdas return one plan; the headline states "no risk data; frontier is a single point" rather than the view being made unreachable, because view-aware behaviour is the hidden modality the key assignments exist to avoid. Both arrays are prefetched in the same batch as the trace and the ladder, so the dial never awaits a fetch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #44.
Day 1's opening thesis on screen: serve each destination by its own cheapest path, watch the plan fail, then flip to the feasible optimum — walked along the Pareto frontier.
The detents
The coarse unit is a distinct Pareto point, not a λ value. The eight default λs collapse to four distinct plans on the theater (blocks
0,1,2,5/10/25/50,100), so walking λ positions would have made the first four presses of Day 1 change nothing on screen — the dead-key failure the beat model exists to prevent, sitting in the default sweep at the worst possible moment.Dedup is on the pair. A block collapses only if neither the naive plan nor the optimum moved. Deduping on the optimum alone would be the same bug one step later: the theater has a λ where the naive plan moves and the optimum does not, and collapsing it would hide the ticket's own punchline — that the naive plan fails at every λ and gets worse.
The panel keeps all eight rows with the duplicates marked as duplicates.
paretoRowsis one pure function called by both the spine and the table, so the block the panel marks and the beat the keyboard reaches cannot disagree.The panel
The Pareto table is promoted to be this view's timeline and the beat timeline is empty here — a four-row detent list beside eight λ rows would be the same beat state in two components that can disagree. The two slots swap: they are never both filled.
views.jscarries the standing note not to "fix" the empty list.Two structurally different violations
An over-capacity lane is a mark on the lane; an over-stock hub is a mark on the node. Two shapes, not two shades of one, so the room reads an assignment error rather than merely a too-small pipe. Every supply node renders with its dispatched-against-stock readout, idle healthy ones included — on the theater the overdrawn hub's identity changes from
HUB-BRAVOtoHUB-ALPHAas λ rises, which kills the "you just picked bad weights" objection on screen.A base nothing reaches wears the
removedvocabulary (grey, struck) where a base served illegally wears the violation hue: unreachability and infeasibility are different lessons. No shipped dataset exercisesfound: false, so that branch is the guard reporting idle.Beat a switches capacity on and cost/risk off — the two share the anchor's lower row, and the sentence there is "this lane is asked for 90 and holds 60". The flip switches them back for the frontier's trade-off.
The violation hue
Day 1 authors
--violation, which the token block had been carrying as a provisional panel tick with no canvas hue behind it, and re-derives that tick from it. Reddish purple rather than red: red against--node-demandis ΔE 3 under deuteranopia — confusable exactly where it matters, since an overloaded lane is by construction the lane running into a demand node.The degenerate combination
Labelled, not struck. On the textbook set every cost is 1 and no lane carries risk, so λ multiplies zero and all eight λs return one plan. The headline states no risk data; frontier is a single point rather than the view being made unreachable — view-aware behaviour is the hidden modality the key assignments exist to avoid.
Verification
tests/test_web_assets.py(the repo verifies the frontend from Python or not at all)./sweep+/naivepayloads on all three datasets: 4 detents on the theater, the 1080 → 1250 delta at λ0, the hub identity flip, and the degenerate note on textbook and greedy_trap./code-reviewaxes run and addressed. Notably it caught a real bug: a Pareto row click drove whatever spine was active, so clicking a λ row in Flow & Cut silently jumped the augmentation ladder — a pointer reaching a state no key can. Row clicks now go throughjumpToUnitand are gated on the view owning the table.