<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->

# Role-specific pages (2026-09-13)

HeavyHaul Agent has five page groups. Each has its own dashboard route, its own trip/assignment route, its own page files and its own data loader. Shared UI lives in `src/components/app/`; role pages never import from another role's page folder.

| Page group | Abbr | Dashboard | Trip / assignment view |
|---|---|---|---|
| Freight broker | FB | `src/app/fb-dashboard/` → `/fb-dashboard` · `/fb-new-trip-request` · `/fb-new-trip` | `src/app/fb-trip-workspace/[ref]/` → `/fb-trip-workspace/<trip number>` |
| Carrier dispatch | CD | `src/app/cd-dashboard/` → `/cd-dashboard` · `/cd-new-trip` | `src/app/cd-trip-workspace/[ref]/` |
| Pilot dispatch / pilot company | PD | `src/app/pd-dashboard/` → `/pd-dashboard` · `/pd-new-trip` | `src/app/pd-trip-workspace/[ref]/` |
| Carrier truck driver | CT | `src/app/ct-dashboard/` → `/ct-dashboard` | `src/app/ct-trip-workspace/[ref]/` |
| Pilot car driver | PC | `src/app/pc-dashboard/` → `/pc-dashboard` | `src/app/pc-trip-workspace/[ref]/` |

`/dashboard` and `/trips/<id>` are redirects into the signed-in role's environment (`src/lib/page-context.ts` resolves the context; `src/lib/role-route.ts` guards each route). Cross-role jumps exist only for internal admins (pilot testing bar, `?view=`, `/admin/pilot-preview`).

**Task-wording rule.** "Change Freight Broker Dashboard" (Broker Dashboard) means the freight broker dashboard only; the same for Freight Broker Trip View, Carrier Dispatch Dashboard, Carrier Dispatch Trip View, Pilot Company Dashboard, Pilot Company Trip View, Carrier Driver App, Carrier Driver Trip View, Pilot Driver App, Pilot Driver Assignment View. No change is global unless the task says so. When a shared shell (`src/components/app/trip-workspace/`, `src/components/app/pilot-assignment/`) must behave differently for one role, add a role-specific option and set it from that role's page — do not branch on another role's behalf.

Reference snapshot before this separation: tag `snapshot-2026-09-13-1630-ET` (see `SNAPSHOTS.md`).
