Repository navigation
D588: share a scoring report with one named account - #1327
Merged
Merged
Conversation
A founder mints a link for an existing account, with an audience, expiry and open limit. The token is stored only as a hash and shown once. Unknown, expired, used-up, revoked and wrong-account opens are the same 404. Co-authored-by: Guillaume Lauzier <guillaumelauzier@users.noreply.github.com>
|
Preview: https://studioos-pr-1327.guillaumelauzier.workers.dev (built from c44bd45) The pull request's SPA build on a Worker with no bindings: pages and deep links work, |
guillaumelauzier
marked this pull request as ready for review
October 7, 2026 00:02
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.
Objective
A founder can share the latest official scoring run with one existing account, for a chosen audience, until it expires, runs out of opens, or is revoked.
Closes #1215
Implementation
The owner's answers on #1215 stand: scoring only (1A), a signed-in account the founder names (2B), and profiling stays unshared (3A). Migration 401 stores the link. The raw token is returned once and kept only as a SHA-256 hash.
summaryshows the total and tier;dimensionsadds the six dimension scores. Neither audience receives the raw inputs, notes, or who scored it. A practice run is not shared. The official run is frozen when the link is created. Unknown, expired, used-up, revoked, and wrong-account opens answer the same 404. Creating and listing also narrow by the founder's active company.Files changed
cloudflare-worker/sql/migrations/401_lab_report_shares.sql— the share store.cloudflare-worker/src/services/labReportShare.ts— what each audience may see.cloudflare-worker/src/routes/lab_report_shares.ts— create, list, revoke, and the signed-in open.cloudflare-worker/src/index.ts— mounts/api/lab-report-shares.frontend/src/lib/api/labReportShares.js— the client module, re-exported fromapi.js.frontend/src/components/spinout/LabReportShareSheet.jsx— the sheet that states what the link shows and hides before minting, then shows the link once.frontend/src/pages/SpinoutLabScoringPage.jsx— the Share button.frontend/src/pages/LabReportSharePage.jsxandfrontend/src/App.jsx— the named account's page at/share/lab-report/:token.documentation/architecture/decisions/D588.md— the decision.documentation/architecture/ROUTE_MAP.md— the Lab scoring row names the share.Testing
npm run buildthennpm run test:drift > drift.log 2>&1; echo EXIT=$?→ EXIT=0.Worker tests cover owner-only create, hash-only storage, audience redaction, practice-run refusal, and the same 404 for an unknown, expired, used-up, revoked, or wrong-account token. Dropping the named-account check and returning dimension scores on the summary audience each failed that test, then were restored.
Risks
Ships in the Worker, the frontend build, and D1 migration 401. No new secret and no
wrangler.tomlchange. The open route is signed-in, not public. Rollback is reverting the commit; the table is additive.Dependencies
Part of #1009. Depends on the answers recorded on #1215. Does not block #1216.
Agent
S06 · Cursor
Review requested
A reviewer from another vendor, when one is free.