Repository navigation
Workbench: instant checks, opt-in auto-check, job progress, keyboard palette and offline guidance - #16
Merged
Conversation
…d completion signals Runs record when they start and end; a 429 puts the run in a retrying state that resubmits after Retry-After (or a doubling wait) up to five times, and Stop cancels it. Check supersedes a running check of earlier inputs. Auto-check is a pure decision plus a debounced driver: it waits 1.2 s after the last edit, never runs on invalid inputs or during an experiment, respects the service queue and stops a superseded auto-check before submitting the next. Settings and recent durations are saved in this browser.
… not checked The result area shows the lib/preview.ts diagnostics for the inputs in the editor before any run, while a check runs and above results from an earlier version, under 'Preview (not yet checked by Lean)'. A Lean result for exactly these inputs replaces it.
… card into the workbench
…rtcuts and the width selector
The popover focused its first input, which is disabled when notifications are blocked, so focus stayed outside it and the window handler read Escape as Stop. The popover is now an overlay in the store, focuses the first enabled control, closes on Escape from the button or panel and on tabbing out, and the window key handler (moved to state/keys.ts) leaves Escape to any open overlay.
On Experiments it stops the experiment before any check, in the story the story's runs; the announcement and the palette command name the job.
The error, the progress line and the README now all count attempts in all (six: the first and five retries).
A busy service that never took the run, an unreachable service, a rejected request or a stop before the job started now show their error (with the path the service named) in the execution banner, say that nothing was checked, and keep the instant preview below with a Check again button. The progress line keeps only errors of runs still under way.
… by Lean' Only a completed run labels the strip 'Checked by Lean'. After a time-out, failure or stop the strip names that outcome, shows Lean's status only for claims it decided, and keeps the preview for claims left not established because the run ended.
…eck matched A look-up that found no recording (replay, or the service offline) now reads 'No recorded check for these inputs; start the service to check them.'
The card says which results are recorded Lean runs and which are an unchecked browser preview. The header badge drops its Retry wherever the card shows its own Try now, and uses the same label in the story.
… last resort Typing 'stop' no longer lists the story steps and a preset under the Stop command: a letters-in-order match must stay inside one label word that starts with the same letter, and is offered only when nothing matches better.
A failure, a time-out or a rejected input is not something the user stopped: the title now reads ✕ Failed, ✕ Timed out, ✕ Stopped or ✕ Rejected, and the Alerts popover and README say so.
The Experiments view showed the running experiment twice, compact in the action bar and in full in the panel below, each with its own live status region and Stop button; the workspace result area and the first story step did the same for their runs. The compact RunProgress beside the run buttons is now the single status region and Stop control, and the panels use RunDetails, which shows the progress bar, the steps and the busy-retry explanation with no live region and no buttons.
The polite announcement region lived in the workspace view, so 'Stopping the experiment.' after Escape on Experiments, and other announcements made outside the workspace, were never read out. It is now mounted once by App.
A quick experiment started from the workspace that failed before any report (busy service, unreachable service, rejected request) left no trace in the workspace. The run bar now keeps the status of the latest check or experiment that ended without a report, in the same live region that showed it running, with a link to Experiments or Jump to results.
A recorded or cached report of a timed-out or failed run, fetched by a run that itself completed, made the strip read 'Checked by Lean'. The strip now takes the outcome from the report's execution state when it has one.
The auto-check status read 'Up to date.' whenever the latest check of these inputs had completed, including a completed fetch of a recorded or cached report whose own execution timed out or failed. Such a check now counts as not finished, as in the instant-checks strip.
The page can only observe that the service does not answer (it may be starting, or listening elsewhere), not that it is not running.
Typing a single letter matched every command whose label, group or keywords contained it anywhere. One letter now matches only the start of a word; label substrings need two letters and keyword substrings three.
…lette matching in the web README
The run bar holding the Stop button is at the top of the workspace, well above the result area; the panel's caption now says so.
A refused or unreachable submission read 'took 0.0 s' next to Failed. A run that ended without a job id did no work and now shows no duration.
A 400 invalid-request answer to a submission was reported as a plain failure. The run now ends as 'invalid' (Rejected as invalid input, and the tab title reads Rejected), with the service's message and path.
…e the inputs have problems
…job for the current inputs
… are not announced
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.
Stacked on #15 (
feat/web-workspace-productivity); review and merge that one first.Summary
The workbench now responds while you edit instead of only after a Lean job returns. Browser diagnostics appear right away under the label Preview (not yet checked by Lean), and the Lean evidence replaces them when it arrives. An opt-in auto-check submits a check 1.2 s after editing stops, and it works with the service's small queue: it backs off on 429, supersedes its own unfinished check, and never runs on invalid inputs. Running jobs show elapsed time, an estimate and the service budget, and signal when they finish. Keyboard users get Ctrl/Cmd+Enter, Esc, a
?shortcuts dialog and a Ctrl/Cmd+K command palette. When the service is offline, a card showsnpm startwith a copy button and reconnects automatically. A width selector exposes the experimental 3×3 and 2×2 AES-like designs thatvalidateDesignalready accepts.This branch builds on
feat/web-workspace-productivity. After review it also guarantees one status line and one Stop button per running job, Escape that closes popovers before stopping anything and stops the job the view shows, visible errors for runs that end without a report, no Checked by Lean or Up to date for runs that did not finish, and announcements that are read on every view.What is changed
Nothing new is proved: this is a web-workbench change. No Lean or engine code changes. The only service change: a
400 invalid-requestresponse now also setserror.pathto the first validation issue's JSON Pointer (the schema'sJobError.pathalready allowed it, and the message text is unchanged).components/LiveChecks.tsx,components/ResultsPanel.tsx)lib/preview.tsresults for the inputs in the editor, debounced by 150 ms: MDS witness, distinct offsets, S-box collisions, power-map gcd and circuit coefficient equivalence.execution.statefor a recorded or cached report), only the claims Lean decided replace their previews and the strip names how the run ended.lib/autocheck.ts,state/actions.ts)cryptificate.prefs.v1.limits.maxQueued, less this page's own live jobs.POST /api/jobs/:id/stop) before submitting the next one.lib/retry.ts,data/api.ts)ApiErrorcarriesRetry-After.retryingstate and resubmits afterRetry-After, or after 2/4/8/16/32 s when the header is missing (capped at 60 s): six submissions in all, the first and five retries. The error text, the progress line (attempt n of 6) and the README all count submissions this way (BUSY_MAX_ATTEMPTS).400 invalid-requestends as invalid input with the service's message and the JSON Pointer of the first problem, read fromerror.path(or fromerrors[0].pathfor a service without the change above); the pointer prefix the service puts in the message is shown once, beside it. An unreachable service ends as a failure saying so.components/RunProgress.tsx,lib/progress.ts,lib/signals.ts,state/signals.ts)cryptificate.timings.v1; cached results are excluded). An estimate bar appears when there is history.analysisBudgetSeconds, or the profile'stotalSeconds. The Experiments profile buttons show the budget too.◌ Runningduring a run, and✓ Doneor how the run ended (✕ Failed,✕ Timed out,✕ Stopped,✕ Rejected) if it ends while the page is in the background.RunDetails), and says where Stop is. In the workspace the run bar shows the running job's status and Stop beside any input problems, because the inputs can be edited while a job runs. The story's run areas are not live regions, so the ticking step times are not announced.lib/shortcuts.ts,lib/commands.ts,components/Overlays.tsx,App.tsx)?opens the shortcuts dialog. Neither fires while focus is in a text field.App, so they are read on every view.<dialog>s, and the palette follows the ARIA combobox/listbox pattern.components/ServiceCard.tsx)npm start(and a copy button) andnpx cryptificate serve. Its Try now is the only retry control while it is shown.lib/width.ts,components/DesignEditor.tsx)circ(02,01,01)orcirc(02,03), both checked by a test), offsets 0..w−1, and a term-by-term circuit. The change is one undo step."experimental": true. The hints say that the activity bound is not established by this method at widths 2 and 3, and the offset hint names the actual width.apps/web/README.md(a new Checking as you edit section, plus updated accessibility shortcuts) andREADME.md.Screenshots
Taken with Playwright against
vite previewof the production build, with the API mocked in the test script (capabilities, a long-running job, a job that times out with a partial report, a422rejection, the service's real400 invalid-requestbody, an aborted connection, and an unreachable service). Light and dark at 1440 px and 390 px for each review-fix state; the script also counted Stop buttons (one per running job on Experiments, Workspace, Workspace with an input problem, and story step 1, at every size), checked for horizontal overflow (none) and read the announcement after Esc on Experiments (Stopping the experiment.)./design/roundsshown once)The screenshots of the first version are in screens/web-automation/.
Tests run
npm run build && npm testat the worktree root (all workspaces): build passes; schema 14/14 pass; server 42 pass, 0 fail, 5 skipped (the skipped tests need a Lean toolchain); web 37 test files, 520 tests pass.lib/retry.test.ts: Retry-After parsing, backoff, queue room.lib/autocheck.test.ts:lib/progress.test.ts,lib/prefs.test.ts,lib/commands.test.tsandlib/signals.test.ts.lib/shortcuts.test.ts:appShortcutandisTextField.lib/width.test.ts: every width gives a valid design with an MDS preview and an equivalent circuit, plus the experimental flag.state/runs.test.ts, with a mocked API:LiveChecks/ResultsPanel: the preview label, no proof status classes, replacement by the Lean report, and stale ordering;RunProgress: elapsed time, estimate, budget, retry countdown;ServiceCard;views/RunControls.test.tsx: exactly one Stop button and one status line for a running job on Experiments and in the workspace (both counted 2 before the fix), also while the inputs have a problem (0 before); story step 1 has one Stop button and no live region other than the status line; the workspace run bar keeps a job that ended without a report and links to the explanation, but not once a later job reported or the inputs changed; nothing is kept after a completed job.App.test.tsx: one announcement region on every view.RunProgress.test.tsx:RunDetailshas no live region and no buttons and renders nothing once the run ended; no duration for a run the service never accepted.LiveChecks.test.tsx: no Checked by Lean for a timed-out, failed or stopped run, including a completed fetch of a report whose execution timed out.data/api.test.ts: a 400 body exactly asapps/serversends it gives the message, code and path; the path falls back toerrors[0].path; a message without a path is kept.apps/server/test/http.test.ts: the 400 body'serror.pathequals the first issue's path and the message keeps itspath: messageform.state/runs.test.ts: Esc/Stop target per view, a 400invalid-requestends as invalid with its path, an unreachable service ends as a failure, auto-check never reads Up to date for an unmatched look-up or an unfinished recorded run.lib/commands.test.ts: one-letter queries match word starts only; letters in order only within one word and only as a last resort.ServiceCard.test.tsx,Overlays.test.tsx,signals.test.ts: offline heading, Stop label, tab-title marks.◌ Runningduring a check. There is no horizontal scroll at 390 px on the workspace, the experiments view, the story, or the 2×2 workspace.Scope and limits
Generated by Claude Code