# Restore Header / Footer Architecture — Rebuild Components Where Needed

**Status:** LOCKED architecture + Phase 2 implementation standard  
**Date clarified:** 2026-07-25  
**Authority:** Brad Camp  

**Walter directive:**

> **Restore the Architecture — Rebuild the Components Where Needed.**  
> Preserve the proven rule: **business identity in the header; Istockhomes trust in the footer.**  
> Do **not** create a competing shell system.  
> Do **not** assume old PHP files are production-ready.

**Implementation gate:** Phase 1 verification must complete first (Brad certified → return to Live). **No header/footer PHP changes until then.** Phase 1 remains the only active feature work.

---

## What “restore” means (and does not mean)

| Restore means | Restore does **not** mean |
|---------------|---------------------------|
| Keep the original Istockhomes principle (`include` header → content → `include` footer) | Blindly reuse ten-year-old files unchanged |
| One maintained business-identity header + one maintained trust footer | Parallel App / App2 / Live / Brand headers that drift independently |
| Current, working, secure, responsive, database-aware, tested components | Decorative “Certified” text or historical navigation kept for nostalgia |
| Safe adapters only where App / App2 / Live need different paths | A new “Business Shell” product |

The architecture is historic. **The implementation must be current.**

---

## Authorized work order

| Step | Work | Status |
|------|------|--------|
| **1** | Phase 1 — Verification journey | **ACTIVE — only feature work now** |
| **2** | Brad certified and can return to Live | Gate |
| **3** | **Audit** existing header/footer implementations across `/App/`, `/App2/`, `/live/` | Phase 2 — not started |
| **4** | Classify each component (KEEP / REPAIR / REPLACE IN PLACE / LEGACY / REMOVE LATER) | Phase 2 |
| **5** | Restore Live to canonical header + trust footer contract | Phase 2 |
| **6** | Audit **only** drifted App2 pages; preserve pages already correct | Phase 2 |

---

## Phase 2 audit checklist (every active header/footer file)

For each file Walter must confirm:

1. When it was last meaningfully updated  
2. Which pages include it  
3. Whether it is responsive on desktop and mobile  
4. Whether it loads the **selected business** correctly  
5. Whether logos and brand colours come from **canonical business data**  
6. Whether navigation links are current  
7. Whether login, logout, and Dashboard links work  
8. Whether it preserves **active business context**  
9. Whether it contains obsolete paths, duplicated markup, or dead code  
10. Whether the footer performs a **real** verification lookup and **`footer.ping`**  
11. Whether the footer clearly shows **failed / unverified / verified** states  
12. Whether it meets current **security** and **accessibility** expectations  

**Do not assume the old files are acceptable.** The include pattern is the foundation—not proof that a given file is production-ready.

---

## Classification (required before editing)

| Class | Meaning | Action |
|-------|---------|--------|
| **KEEP** | Working and current | Preserve |
| **REPAIR** | Correct foundation; broken or outdated parts | Fix in place under BUILD LOCK |
| **REPLACE IN PLACE** | Too old or unsafe to repair cleanly | Rebuild while preserving the **same canonical include role and public interface** |
| **LEGACY** | Still required by an identified caller; not canonical | Document caller; do not expand use |
| **REMOVE LATER** | Unused | Only after dependency evidence + **separate Brad authorization** |

---

## Canonical result

Ultimately:

1. **One maintained business identity component**  
   → active business data → correct logo/branding → business-context navigation → Current Business switcher  

2. **One maintained Istockhomes trust component**  
   → active business validation → authorized operator validation → current certification status → live `footer.ping` → proper Istockhomes branding  

Safe **adapters** only where `/App/`, `/App2/`, or `/live/` require different paths—not independent chrome trees.

**Not:**

- App header + App2 header + Live header + Brand header + another new shell  
- each drifting on its own  

Intended Live page shape (Phase 2):

```php
<?php require_once $businessHeaderInclude; ?>
<!-- Live-specific content -->
<?php require_once $istockhomesFooterInclude; ?>
```

Prefer extending App2 `includes/header.php` / `includes/footer.php` (or thin adapters to those contracts) after the audit—not inventing a fourth system.

---

## Acceptance standard (Phase 2)

Phase 2 is **not** complete merely because pages contain `include 'header.php'` / `include 'footer.php'`.

It is complete only when **KatherineAir Live** (or the selected business) **visibly and functionally** proves:

- [ ] The real KatherineAir logo appears  
- [ ] The logo returns to KatherineAir’s **selected** Dashboard context  
- [ ] Correct business name and branding load from **canonical data**  
- [ ] Page works correctly on **mobile and desktop**  
- [ ] Proper Istockhomes logo appears in the footer  
- [ ] Footer identifies KatherineAir as the active business  
- [ ] Footer confirms the signed-in user (e.g. Brad) is **authorized** to operate it  
- [ ] Footer verifies the business against the **canonical database**  
- [ ] A real **`footer.ping` succeeds**  
- [ ] A copied, disconnected, or invalid page **cannot** falsely display certification  
- [ ] Failure states are clear and do **not** show decorative “Certified” text  
- [ ] Existing **correct** App2 pages remain working  
- [ ] No ten-year-old broken navigation, styling, or security behaviour is carried forward merely for historical consistency  

---

## Out of scope until authorized

- Header/footer PHP before Phase 1 complete  
- Streaming / WebRTC / LiveKit  
- Competing “Business Shell” package  
- Infrastructure folder reorganization  
- Deleting LEGACY/REMOVE LATER files without Brad authorization  

---

## Related

- Directive 001: Header = Identity · Content = Value · Footer = Trust  
- App2 footer pattern: `App2/includes/footer.php`  
- Stub (superseded name): [`ACTIVE_BUSINESS_IDENTITY_AND_TRUST_SHELL.md`](ACTIVE_BUSINESS_IDENTITY_AND_TRUST_SHELL.md)  
