Skip to content

Web interface: a run's progress at a glance, machine paths kept out of the view - #76

Open
alhermann wants to merge 4 commits into
feat/scale-bridgingfrom
feat/webui-run-progress
Open

alhermann wants to merge 4 commits into
feat/scale-bridgingfrom
feat/webui-run-progress

Conversation

@alhermann

Copy link
Copy Markdown
Collaborator

The run view shows at a glance where a run stands, and machine paths stay out of what it shows. Stacked on #75 (material handoff); review that one first.

Progress. Six stages under the run header: Understand, Build, Review, Solve, Check, Report.

  • The rail follows the transcript's rules (webui/outcome.py). It adds no second judgement:
    • a step counts when it runs, not when it is proposed;
    • Claude Code's critic, run through its own Agent or Task tool, counts as Review;
    • Check shows the turn's best solver evidence, with the server's stamp first and the transcript's own reading for older records;
    • Report is reached only by a turn that ended with an answer;
    • a new turn clears the current stage.

Paths.

  • Arguments inside the run's folder are shown relative to it. The absolute prefix says nothing a reader needs and names the machine's layout.
  • Step pictures and fields are still found by the unshortened folder.
  • Windows homes are shown as ~ in all three forms a run prints them: C:\Users\name, C:/Users/name and /c/Users/name (Git Bash). This covers profile names with spaces or non-ASCII letters.
  • The server scrubs these homes as it does Unix homes, and a Windows home under an encoded key is not taken for data.

Home. Two more examples: a flexible flap in channel flow, solved with two codes, and a perforated copper sheet from DFT constants.

webui/static is rebuilt. It will conflict with any other UI change, so rebuild it again right before merging.

Which failures it catches.

  • A Windows user name could reach the browser and downloads.
  • Absolute run paths filled every argument line.
  • In the first version of this change, also caught by Copilot's review on the fork:
    • step pictures disappeared;
    • the rail counted skipped steps;
    • it showed Report as current during a follow-up;
    • it marked Report for stopped turns.

How it was checked.

  • tsc --noEmit is clean, and npm run build succeeds.
  • The rail logic was run on two recorded runs, an FSI coupling and a copper sheet. Check is verified for the copper sheet and not verified for the FSI coupling. There is no Report for the FSI turn that ended in an error.
  • Both pages were opened in a browser. No home path appears.
  • New privacy cases, for spaces, umlauts and Git Bash under an encoded key, fail on the previous code.
  • webui/tests on Windows: every failure also fails on main there. They come from Windows itself:
    • there is no /proc;
    • ? is not allowed in a file name;
    • symlinks need extra rights;
    • open files are locked;
    • HOME is ignored;
    • the Claude Code CLI is not installed.

Not run: webui/tests on Linux.

Seen, not fixed here (also on main). When a tool reply's JSON carries escaped quotes inside a string, the transcript cannot parse it. The verdict note then shows \u2014 and a stray \. The reason is that readable() unescapes the MCP wrapper before the JSON is parsed. It needs its own fix.

- Progress: six stages under the run header (Understand, Build, Review, Solve, Check, Report), each with its step count, the current one marked, the check showing whether openPASO verified the result
- Paths: arguments inside the run folder are shown relative to it; Windows homes (C:\Users\name, C:/Users/name, /c/Users/name) are shown as ~ in the interface and scrubbed on the server like Unix ones
- Home: two more examples, a coupled flap in a channel and a perforated copper sheet from DFT constants
- Rebuilt webui/static
… profile names

Answers to Copilot's review of the run view.
- Step pictures and fields: the path shortening removed the run folder a step's outputs are found by, so they disappeared from the page. The folder is now read from the unshortened reply; only displayed text is shortened.
- Review: Claude Code's critic, run through its own Agent or Task tool, now counts as review, as the transcript already reads it.
- A new turn clears the current stage: after a follow-up, Report no longer showed as 'now' while the model worked.
- A step counts when it runs, not when it is proposed: in plan mode a skipped step left a stage checked.
- Check uses the transcript's verdict for every solver tool (stamp first, its own reading for older records, mesh-independence included) and the turn's best evidence, verified over unverified over failed.
- Report is reached only by a turn that ended with an answer, not by one that failed or was stopped.
- Windows homes: a profile name with spaces or non-ASCII letters is replaced whole (C:/Users/Alice Smith/...), on the server and in the interface; a Git Bash home under an encoded key is no longer taken for data.
Checked: the new privacy cases fail on the previous code; tsc clean; webui/static rebuilt; the rail run on the two recorded runs gives verified for the copper sheet, not verified for the FSI run, and no Report for the turn that ended in an error.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved defects leak Windows profile names, corrupt path arguments containing spaces, and let stale verification, critic messages, or failed turns incorrectly satisfy progress indicators.

7 open issues
1 file not reviewed
  • webui/static/assets/index-B3DXHtFR.css: Generated file
What changed in this PR

This PR adds an at-a-glance progress rail to openPASO’s run view and reduces machine-path exposure in displayed output. It builds on #75’s material handoff with a copper-sheet example.

Changes:

  • Adds six progress stages derived from run events and solver verdicts.
  • Shortens displayed run paths, preserves paths used to locate step outputs, and extends Windows home-path scrubbing.
  • Adds two simulation examples, privacy regression tests, and rebuilt static assets.
File Description
webui/​tests/​test_app.py Adds Windows home-path privacy cases.
webui/​static/​index.html References the rebuilt frontend assets.
webui/​static/​assets/​index-CEh6O6E7.css Removes the previous stylesheet bundle.
webui/​static/​assets/​index-B3DXHtFR.css Adds rebuilt styles for the progress rail.
webui/​privacy.py Extends Windows home redaction and encoded-data guards.
ui/​src/​components/​Transcript.tsx Exposes verdict helpers and preserves step-output lookup paths.
ui/​src/​components/​RunView.tsx Places the progress rail below the run header.
ui/​src/​components/​Progress.tsx Derives and displays the six progress stages.
ui/​src/​components/​Home.tsx Adds coupled-flap and material-handoff examples.
ui/​src/​api.ts Shortens run paths and Windows homes for display.

Review effort: Balanced

Comment thread ui/src/api.ts
return s
// a path inside the run's own folder is shown from that folder: the absolute prefix says
// nothing a reader needs and names the machine's layout
.replace(/(?:[A-Za-z]:)?[^\s'"`=(]*?eval_interactive[\\/]+webui_[0-9a-f]{6,}(?:[\\/]+|(?=[\s'"`),:]|$))/g, '')
Comment on lines +52 to +66
const pending = new Map<string, Ev>() // a step's tool, arguments and agent, from before it ran
const ran = new Set<string>()
const skipped = new Set<string>()
let saidSinceStep = false
const step = (id: string) => {
const p = pending.get(id)
if (!p || ran.has(id) || skipped.has(id)) return
ran.add(id)
const s = stageOf(p)
if (s) { count[s] += 1; current = s }
}
for (const e of events) {
const id = e.call_id || ''
if (e.type === 'turn_start') {
current = null; turnBest = null; saidSinceStep = false
step(id) // counted when it runs, not when it is proposed
} else if (e.type === 'tool_call_rejected') {
skipped.add(id)
} else if (e.type === 'tool_result' || e.type === 'tool_error') {
if ((e.text || '').trim()) saidSinceStep = true
} else if (e.type === 'done') {
// a turn that failed or was stopped has no answer, and neither has one whose last act was a step
const answered = !['failed', 'interrupted', 'unfinished'].includes(String(e.outcome || '')) && saidSinceStep
Comment thread webui/privacy.py
# goes on after it, and up to the first space where nothing follows, so the prose after it stays.
_WIN_NAME = r"[^\s\\/:*?\"<>|'`]+"
_WIN_HOME_RE = re.compile(_BOUNDARY + r"(?:[A-Za-z]:[\\/]+|/[A-Za-z]/)Users[\\/]+"
+ rf"(?:{_WIN_NAME}(?: {_WIN_NAME})*(?=[\\/])|{_WIN_NAME})")
Comment thread webui/privacy.py
Comment on lines +38 to +40
_WIN_NAME = r"[^\s\\/:*?\"<>|'`]+"
_WIN_HOME_RE = re.compile(_BOUNDARY + r"(?:[A-Za-z]:[\\/]+|/[A-Za-z]/)Users[\\/]+"
+ rf"(?:{_WIN_NAME}(?: {_WIN_NAME})*(?=[\\/])|{_WIN_NAME})")
Comment thread webui/privacy.py
Comment on lines +39 to +40
_WIN_HOME_RE = re.compile(_BOUNDARY + r"(?:[A-Za-z]:[\\/]+|/[A-Za-z]/)Users[\\/]+"
+ rf"(?:{_WIN_NAME}(?: {_WIN_NAME})*(?=[\\/])|{_WIN_NAME})")
…where they are discussed

The coupling driver appends each iteration's residual to openpaso_coupling_progress.jsonl beside its participants (never raising); GET /api/sessions/{sid}/coupling reads those files from the run's own folder, and a couple/couple_levels step shows the residual per iteration, polled every 2 s while it runs, one line per driver call, with the target tolerance. Field animations get an adjustable colour range; mp4/webm a step writes play under that step; a message can show a picture or animation from the run's own folder (anything else is not loaded).
…rds, and see the run's stages from the start

Result files (VTU/VTK/VTP/PVD) open in a full-screen 3D view drawn by the browser: the server sends the outer surface once (webui/mesh3d.py, faces oriented outward, cached) and a true cut through the inside on request (/api/mesh3d/cut). Controls: quantity and part, colour range (auto over the whole body and, by default, the whole series; out-of-range colours), colour scale chosen by sign (viridis / blue-white-orange, no rainbow), shape moved by a vector field x1/x10/x100 with the factor always shown, cut across x/y/z, mesh lines, mesh-level or time stepping, value under the pointer, and a saved picture stamped with file, step, quantity, range, factor, cut and the run's check status. 'Ask for a different view' turns plain words into the same settings with one model call that sees only field names and current settings (webui/view_assist.py), validated against the file, shown in the controls and undoable; a request that needs a new calculation is offered to the run's agent as a draft message. The six-stage rail shows from the first moment of a run. Folder listings use forward slashes on Windows too (every listing was refused there).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants