# Organization Profile Contract

## Goal

Make an AGS organization profile follow GitHub's product model: it is a curated
project-facing page, not an automatically sorted activity dashboard. Internal
work queues and organization administration remain separate surfaces.

## Profile pins

`OrganizationProfilePin` persists an ordered repository list per organization
and audience. It is deliberately independent from stars, push time, and search
rank so an owner controls what a visitor sees.

Supported audiences:

- `public`: returned to all profile visitors.
- `member`: returned only when the authenticated caller is an active member of
  that organization.

Each audience accepts at most six entries, matching GitHub's profile limit.
The same repository may occur once in each audience because the public and
member pages are intentionally separate editorial views.

## API

- `GET /api/ext/v1/orgs/{org}/profile/pins` returns `pinned_repositories`.
  The service, not the browser, applies the member-only access rule.
- `PUT /api/ext/v1/orgs/{org}/profile/pins` replaces both ordered pin lists
  atomically. It requires an active organization owner and accepts only
  repositories owned by that organization.

The input uses repository names, not client-supplied IDs, so the handler can
resolve ownership server-side before writing the relation.

## Non-goals

- This contract does not make all organization memberships public. Public
  member visibility requires a separate per-membership privacy model.
- It does not store README content. The existing Git-compatible convention is
  `.github/profile/README.md`; member-only README support is a follow-up
  contract for `.github-private/profile/README.md`.
