Skip to content

D588: share a scoring report with one named account - #1327

Merged
guillaumelauzier merged 1 commit into
mainfrom
agent/cursor/1215-lab-report-shares
Oct 7, 2026
Merged

guillaumelauzier merged 1 commit into
mainfrom
agent/cursor/1215-lab-report-shares

Conversation

@guillaumelauzier

@guillaumelauzier guillaumelauzier commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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. summary shows the total and tier; dimensions adds 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 from api.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.jsx and frontend/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.
  • Tests for the route and the sheet.

Testing

npm run build then npm 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.toml change. 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.

STATUS
task: #1215   slot: S06   agent: Cursor
branch: agent/cursor/1215-lab-report-shares
state: READY_FOR_REVIEW
files: cloudflare-worker/src/routes/lab_report_shares.ts, cloudflare-worker/sql/migrations/401_lab_report_shares.sql, frontend/src/components/spinout/LabReportShareSheet.jsx, frontend/src/pages/SpinoutLabScoringPage.jsx, documentation/architecture/decisions/D588.md
blockers: none
questions: none
tests: npm run build then npm run test:drift; EXIT=0. Named-account and summary-redaction mutations each failed the new test, then were restored.
pr: https://github.com/AxalNetwork/StudioOS/pull/1327
Open in Web Open in Cursor 

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>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

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, /api/* is a 404, and nothing here can reach production data. Redeployed on every push; deleted when the PR closes.

@guillaumelauzier
guillaumelauzier marked this pull request as ready for review October 7, 2026 00:02
@guillaumelauzier
guillaumelauzier merged commit 7c53b08 into main Oct 7, 2026
21 checks passed
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.

Spin-Out Lab: add share links for Lab reports, with consent and expiry (D588, migration 401; from D350)

2 participants