Skip to content

V48: a damaged share link ends on a refusal, never on a crash - #109

Merged
dapiced merged 1 commit into
mainfrom
claude/labml-improvements-ipscw1
Oct 9, 2026
Merged

dapiced merged 1 commit into
mainfrom
claude/labml-improvements-ipscw1

Conversation

@dapiced

@dapiced dapiced commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

The roadmap row for V48 planned a deeper validator for share links. I measured first, and the numbers changed the approach.

Measurement. I captured three real share links from the running app:

Link Task Analyses carried
titanic binary uncertainty, threshold, segments
iris multiclass uncertainty, threshold, k-NN tuning, groups
mpg regression uncertainty, segments

I then deleted, nulled, or retyped every field of each one and rendered the result through the real SharedRunPage:

Damaged links Accepted by the decoder Crashed the page Distinct paths
3 948 3 660 1 020 99

A validator covering 99 paths would become the largest file in the module, and it would drift every time a run learns to carry a new analysis.

Change

  • Render guard. SharedRunPage now wraps the run in a render guard. Any failure while drawing the run shows the refusal page, with its own FR/EN explanation, and nothing from the run. A partial render was rejected on purpose: it would let a half-read figure pass for a real one.
  • Decoder unchanged. The decoder still checks the fields every view reads first, as in V35.
  • Fixtures. The three links are committed under tests/share-links/, with a README.
  • Regression test. The measurement is now SharedRunPage.test.tsx. Each field shape is damaged six ways, and the page must end on either the run or the refusal. The test fails on the code before this change.
  • Download helper. The five copies of the helper are replaced by a single src/lib/download.ts. It revokes the object URL after the click has been handled instead of in the same tick, where some browser engines cancel the download without any error.
  • Docs. V48 is marked delivered in PLAN, the CHANGELOG is regenerated, the version is 1.48.0, and the plan doc is in docs/superpowers/plans/.

Cost. The regression test adds about 25 s to the unit suite: 66 s → 90 s on 4 cores. I chose to cover the whole format instead of a sample.

Test plan

  • lint, format:check, typecheck, build
  • npm test: 889 passed. Before the guard, the new share-page test fails 2 of its 5 cases.
  • Playwright, Chromium only: projects (share link + JSON/CSV/HTML downloads), sql, data, imported, a11y. 20/20 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ELAjHYDyxa5zbbdcke1bMA


Generated by Claude Code

Measured on three real links captured from the app: deleting, nulling or
retyping single fields gave 3660 links the decoder accepted, and 1020 of
them crashed the page on 99 distinct paths. Rather than a 99-path schema
that drifts with every new analysis, SharedRunPage now wraps the run in a
render guard that shows the refusal page with its own explanation.

- tests/share-links: the three real payloads, decoded
- SharedRunPage.test: every field shape damaged six ways must end on the
  run or the refusal (fails before this change)
- src/lib/download: one download helper instead of five copies, revoking
  the object URL after the click is handled
- PLAN/CHANGELOG: V48 delivered, version 1.48.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELAjHYDyxa5zbbdcke1bMA
@dapiced
dapiced marked this pull request as ready for review October 9, 2026 02:12
Copilot AI balanced review requested due to automatic review settings October 9, 2026 02:12
@dapiced
dapiced merged commit 2c7805e into main Oct 9, 2026
5 checks passed

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.

🟢 Approval recommended

The render guard, regression coverage, download refactor, documentation, and generated version files are consistent and show no unresolved defects.

0 open findings

What changed in this PR

Adds graceful refusal handling for malformed share links and centralizes browser downloads.

Changes:

  • Adds a render guard and comprehensive damaged-payload regression coverage.
  • Consolidates download behavior with delayed object-URL cleanup.
  • Adds fixtures, translations, documentation, and V48 version updates.
File Description
tests/​share-links/​titanic.json Binary-run fixture.
tests/​share-links/​iris.json Multiclass-run fixture.
tests/​share-links/​mpg.json Regression-run fixture.
tests/​share-links/​README.md Documents fixtures and regeneration.
src/​locales/​en.json Adds English refusal explanation.
src/​locales/​fr.json Adds French refusal explanation.
src/​lib/​download.ts Introduces shared download helper.
src/​lib/​download.test.ts Tests delayed URL revocation.
src/​features/​ml/​pages/​SharedRunPage.tsx Guards shared-run rendering failures.
src/​features/​ml/​pages/​SharedRunPage.test.tsx Exercises damaged share payloads.
src/​features/​ml/​components/​ImportModelPanel.tsx Uses shared download helper.
src/​features/​ml/​components/​ExportBar.tsx Uses shared download helper.
src/​features/​ml/​components/​BatchScorePanel.tsx Uses shared download helper.
src/​features/​data/​SqlPanel.tsx Uses shared download helper.
src/​features/​data/​components/​DataExportBar.tsx Uses shared download helper.
README.md Updates unit-test count.
PLAN.md Marks V48 delivered.
package.json Bumps version to 1.48.0.
package-lock.json Synchronizes package version.
docs/​superpowers/​plans/​2026-10-09-v48-share-links.md Records V48 design decisions.
CHANGELOG.md Adds the generated V48 entry.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants