---
name: step-01-nav-audit
description: Audit navigation seed data for reserved section codes appearing as menu items
next_step: steps/step-02-crud-audit.md
---

# Step 1: Navigation Audit

## YOUR TASK:
Scan all navigation seed data files for sections with reserved codes that should NOT appear as sidebar menu items.

## RESERVED SECTION CODES:
```
RESERVED = ["detail", "create", "edit"]
```
These are internal route targets (/:id, /create, /:id/edit), NOT sidebar menu items.
Any section with one of these codes — or containing "detail" (e.g., "department-detail") — must NOT be a visible menu entry.

---

## EXECUTION SEQUENCE:

### 1. Scan Navigation Seed Data

For each file in {seed_files}:

**1a. Extract all section entries**

Use Grep to find section definitions. Two patterns to check:

Pattern A — SectionData record array:
```csharp
new("detail", "/path/:id", "icon", 4, (...))
```
→ Grep for `new\s*\("([^"]+)"` in SectionData arrays

Pattern B — NavigationSectionSeedEntry objects:
```csharp
Code = "detail",
```
→ Grep for `Code\s*=\s*"([^"]+)"`

**1b. Check each section code against RESERVED list**

For each extracted section code:
- If code == "detail" OR code == "create" OR code == "edit" → **BLOCKING finding**
- If code contains "-detail" (e.g., "department-detail") → **BLOCKING finding**
- Check if `IsActive = false` is set nearby (within 10 lines) — if so, downgrade to WARNING (it's hidden but still seeded, which is acceptable)

### 2. Check Route Patterns

For each section route in seed data:
- Route ending with `/:id` that is NOT the "list" section's detail route → WARNING (may be a separate detail section that should be merged)
- Route containing `/detail/` or `/create/` or `/edit/` as segments → **BLOCKING** (forbidden patterns per SmartStack convention)

### 3. Record Findings

For each issue found, create a finding:

```
{
  id: "NAV-001",       // Sequential per category
  severity: "BLOCKING",
  category: "Navigation",
  file: "EmployeesNavigationSeedData.cs",
  line: 25,
  message: "Reserved section code 'detail' is seeded as a visible menu item",
  fix: "Remove this section entry from the Sections[] array. Detail routes are resolved by DynamicRouter convention (/:id under list section)."
}
```

### Finding IDs:

| ID | Severity | Rule |
|----|----------|------|
| NAV-001 | BLOCKING | Reserved section code (detail/create/edit) seeded as menu item |
| NAV-002 | BLOCKING | Section code contains "-detail" (e.g., department-detail) seeded as menu item |
| NAV-003 | BLOCKING | Route contains forbidden segment (/detail/, /create/, /edit/) |
| NAV-004 | WARNING | Reserved section code with IsActive = false (acceptable but unnecessary) |
| NAV-005 | WARNING | Section code not in kebab-case |
| NAV-006 | WARNING (v3.46) | `ApplicationZone` enum referenced in seed data — must use `IsPersonal`/`IsOpen` flags (cf. seed-checks.sh check **C66**, will become BLOCKING in v3.47) |
| NAV-007 | WARNING (v3.46) | Legacy layouts `AdminLayout`/`BusinessLayout`/`UserLayout`/`HRLayout`/`SalesLayout` referenced — must use `AppLayout` (cf. seed-checks.sh check **C67**, will become BLOCKING in v3.47) |

**Note** : NAV-006 and NAV-007 mirror the bash post-checks **C66**/**C67** in `apex/references/checks/seed-checks.sh`. The bash checks emit `WARNING` (no FAIL) during the v3.46 grace period — apex-verify should align with the same severity.

---

## SUCCESS METRICS:
- All NavigationSeedData files scanned
- Every section code checked against reserved list
- Every route checked for forbidden patterns
- Findings recorded with file:line evidence

## NEXT STEP:
If {scope} is `all` or `crud` → proceed to `./step-02-crud-audit.md`
If {scope} is `nav` → skip to `./step-05-report.md`
