Skip to content

feat(wedge): PR-WV1-7 — Sponsor ACL wiring + ADR-059 dead-code cleanup#190

Merged
jukka-matti merged 6 commits into
mainfrom
feat/wedge-pr-wv1-7-sponsor-acl-cleanup
May 17, 2026
Merged

feat(wedge): PR-WV1-7 — Sponsor ACL wiring + ADR-059 dead-code cleanup#190
jukka-matti merged 6 commits into
mainfrom
feat/wedge-pr-wv1-7-sponsor-acl-cleanup

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

Close the wedge V1 conformance gap. Wire canAccess('edit-improve') at InvestigationWorkspace photo handlers (the B-class deferral from PR-WV1-5 Task 3) AND delete two zombie features uncovered during the audit: SharePoint publish (already a stub per ADR-059) and the orphaned share-link UI. 43 files, +88/-711 lines, 5 categorized commits.

What changed

Concern A — SharePoint publish deletion (ADR-059 alignment)

usePublishReport.publish() was already a stub that errored with "SharePoint upload removed — use local export". ADR-059 (Web-First Deployment) retired SharePoint. UI dead code remained.

  • Deleted apps/azure/src/hooks/usePublishReport.ts (entire hook)
  • Deleted 7 publish props from ReportViewBase (onPublishToSharePoint, onPublishReplace, publishStatus, publishError, onPublishReset, publishedUrl, plus state-render branches)
  • Stripped Azure ReportView.tsx import + ~20-line ADR-026 comment block + prop passes

Concern B — share-link dead UI deletion

useShareReport was a wrapper that always returned canShare=false. Azure passed a stub callback; PWA passed shareLinkGate="locked". Orphaned.

  • Deleted apps/azure/src/hooks/useShareReport.ts
  • Removed shareLinkGate, onShareReport, canShareViaTeams props from ReportViewBase + Azure + PWA wrappers
  • ShareLinkGate export type retired

Scope correction: useTeamsShare.ts KEPT — actively used for clipboard-share in Editor.tsx + useShareFinding. Only the dead wrapper goes.

Concern C — canAccess('edit-improve') wiring (the B-class fix)

InvestigationWorkspace photo handlers were tier-gated in WV1-5; the gate dropped, leaving them always-on. Wedge spec §4.1: Sponsor read-only. This wires the proper role check.

  • Added canAccess import + userId: string | null + members: ProjectMember[] props to InvestigationWorkspace.tsx
  • Gated onAddPhoto at line 976: userId && canAccess(userId, members, 'edit-improve') && handleAddPhoto
  • Editor.tsx: plumbed userId={currentUser?.email ?? null} + members={wallActiveIPMembers} (both already in scope)
  • Scope correction: deleted onCaptureFromTeams + isTeamsCamera entirely instead of gating — usePhotoComments.ts:115 hardcodes isTeamsCamera: false per ADR-059 Teams SDK removal, so the branch is structurally dead

i18n + tests

  • 9 i18n keys removed across types.ts + 32 locale files (report.action.publishToSharePoint, report.action.shareLink, report.publish.*, etc.)
  • 5 publish/share describe blocks dropped from ReportViewBase.test.tsx
  • 3 new Sponsor-gate tests added to InvestigationWorkspace.mapwall.test.tsx (Lead wired, Sponsor undefined, null userId undefined)

investigations.md resolution

  • Deleted the "PR-WV1-5 Task 3 — B-class canAccess() rewires deferred" entry. The diff is the durable record.

Plan + reviews

Sub-plan: ~/.claude/plans/execute-the-wv1-5-elegant-whale.md

Spec + quality reviewer (Sonnet): APPROVE. No blocking or important issues. Both scope corrections defensible and documented.

Test plan

  • @variscout/ui ReportView: 146/146 pass
  • @variscout/azure-app InvestigationWorkspace: 11/11 pass (with 3 new Sponsor-gate tests)
  • @variscout/azure-app ReportView: 18/18 pass
  • @variscout/core i18n: 70/70 pass
  • pnpm lint — 0 errors
  • pnpm docs:check — 529 docs validated, frontmatter clean
  • Zero residual publishToSharePoint, usePublishReport, useShareReport, shareLinkGate, onShareReport, canShareViaTeams references
  • Pre-existing TSC errors in @variscout/core (ActionItem/OutcomeSpec test fixture drift) unchanged — unrelated to this PR

Wedge V1 progress

Wedge V1 architecture scope: 100% shipped. Remaining items are operational, not architectural.

🤖 Generated with Claude Code

jukka-matti and others added 5 commits May 17, 2026 14:23
usePublishReport was a stub that immediately errored ("SharePoint upload
removed — use local export"). Delete the hook file, drop the 7 publish
props from ReportViewBase, and remove all publish-status JSX branches
(sidebar footer + mobile action bar). Remove the hook usage from
apps/azure ReportView.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
useShareReport wrapped useTeamsShare.isTeams which is always false
(Teams SDK removed per ADR-059), making canShare always false. The
"Share link" button + canShareViaTeams gated Share Report button were
both unreachable UI. Delete useShareReport.ts; drop onShareReport,
shareLinkGate, and canShareViaTeams from ReportViewBase props and all
three callers (azure ReportView, pwa ReportView, ReportViewBase JSX).
Drop the ShareLinkGate export type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… userId/members

Sponsor is read-only (wedge spec §3.1). Photo attach was always-on after
the tier-gate deletion in WV1-5. Close the B-class deferral from
investigations.md.

- Add userId + members props to InvestigationWorkspace (from canAccess)
- Gate onAddPhoto on canAccess(userId, members, 'edit-improve')
- Delete isTeamsCamera + handleCaptureFromTeams props (isTeamsCamera is
  always false per ADR-059 + usePhotoComments.ts:115 + existing test)
- Plumb userId (currentUser?.email) + members (wallActiveIPMembers) from
  Editor.tsx mount; remove unused handleCaptureFromTeams destructure
- Update InvestigationWorkspace.mapwall.test.tsx fixture props

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ests

Remove 9 i18n keys from types.ts + all 32 locale files:
  report.action.shareReport
  report.action.publishToSharePoint
  report.action.publishedToSharePoint
  report.publish.{rendering,uploading,exists,replace,failed,tryAgain}

Delete share/canShareViaTeams describe blocks from ReportViewBase.test.tsx
(those props are gone).

Add 3 canAccess photo-gate tests to InvestigationWorkspace.mapwall.test.tsx
asserting: Lead gets onAddPhoto, Sponsor gets undefined, null userId gets
undefined. FindingsLog mock now captures props; usePanelsStore imported for
investigationViewMode toggle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The PR-WV1-5 Task 3 deferral ("canAccess() rewires deferred") is closed
by this PR. Delete the entry — the diff is the durable record.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Ready Ready Preview, Comment May 17, 2026 0:00am
variscout_website Ready Ready Preview, Comment May 17, 2026 0:00am

… fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant