inherited-visibilityrun.md02_define/output/spec.mdToday a person sees either only their own work or, as an administrator, everything. A leader
cannot see their people's customers, service leads or delivery work, so they chase by email. The
reporting line from user-record-and-reporting-line exists to answer exactly this — but nothing
reads it yet (FR-4). This advances Q2-2026 Objective 1 (Establish Product-Market Fit with Vendor
Partners): a vendor partner's leaders must see their whole team's pipeline without leaving the
platform.
Visibility is inherited upward through the reporting hierarchy, and only visibility is.
user-record-and-reporting-line), whose traversal is cycle-guarded and depth-capped, so a
broken or incomplete line yields a short team — visibility fails safe, narrowing and never
widening (BR-12). A viewer outside the hierarchy (external expert, vendor-role or multi-role
document) gets no team at all.isDirectLeadParty, the workspace lever guard, every action's own permission gate) are
untouched. The workspace page becomes viewable for a lead in the viewer's line
(isLeadViewerVisible = direct party or reached through the line); the workspace levers
keep requiring the viewer to be a direct party — a manager can look, not act.service-lead-ownership-and-handoff lands; the SDM's reach follows their hierarchy and, from
team-region-country-filters, the Region/Country filters — no separate SDM regional assignment
is added (D-7).team-region-country-filters.service-lead-ownership-and-handoff.team-region-country-filters.03_build/output/notes.mdleads/lead-scope.ts: withTeamVisibility(base, teamMemberIds) — the pure
widening of an own-scope lead filter to the viewer's line across the csm,
sdm and expert slots. Null base (admin full scope) and an empty team pass
through untouched. Unit-tested, including the expert viewer's $or
flattening and the fail-safe empty-team case.leads/lead-party.ts: reachesLeadThroughLine(lead, teamIds) — the pure
view-side predicate ("someone below me holds a slot on this lead"), plus
refId exported. The customer slot is deliberately not reachable. Tested.leads/index.ts: scopedLeadFilter now widens the own filter with
viewerTeamIds — the viewer's line from the shared hierarchy core
(teamOf, cycle-guarded and depth-capped), empty for anyone outside the
hierarchy and on any hierarchy read failure, so a fault narrows and never
widens (BR-12). New public isLeadViewerVisible = direct party OR reached
through the line — used by the view guard only.apps/web/lib/workspace/lead-guard.ts: canViewLead now calls
isLeadViewerVisible; requireWorkspaceParty (every workspace lever)
stays on isLeadViewerParty — a manager can look at a team member's lead
workspace but every action still requires being a direct party (BR-11,
D-5).findByStatuses per kanban column, and each call now loads
the tenant's org index once (a small indexed find). If that read shows up
in traces, lift the team computation to the page and thread it through —
the pure filter already takes the ids.team-region-country-filters (stated in the spec's out-of-scope).regions-and-countries.