# Origin Coverage Gaps — Detailed Commit Analysis

> This document contains the full commit-by-commit analysis of the 58 commits on
> `origin/main` that diverge from upstream, assessing how each maps to the E2E test
> suite from PR #348, and the reasoning behind priority assignments.
>
> **Exclusions**: Dev sessions/portal (9 commits), infrastructure/deployment (3 commits),
> and chores/docs (5 commits) are excluded per team decision — these are internal to
> the origin team and will not be PR'd upstream.

---

## Methodology

1. All 58 commits since merge base `0b3d168` were extracted with `git log --oneline`
2. Each commit was categorized by functional area
3. Excluded categories were identified and documented
4. For each included commit, the behavioral change was analyzed at the UI level
5. Existing E2E specs were checked for coverage of each behavioral change
6. Missing coverage was documented with specific test scenarios and priority levels

---

## Excluded Commits (17 total)

### Dev Sessions / Portal (9 commits)

| Commit | Subject | Why excluded |
|--------|---------|--------------|
| `420a4fa` | feat(dev-session): implement file-based token auth with real user identity | Internal dev portal feature |
| `e4d9fe9` | feat(dev-session): add token regeneration endpoint and fix 504 timeout | Internal dev portal feature |
| `9bf9970` | feat(extension): manage git branches across session lifecycle | Internal VSCode extension |
| `30c2cab` | fix(extension): reliable process killing on Windows and zombie port cleanup | Internal VSCode extension |
| `be64f6e` | fixed extension server management | Internal VSCode extension |
| `8227241` | feat(dev-portal): add separate Open in Cursor and Open in VSCode buttons | Internal dev portal UI |
| `823ff5d` | Re-added bootstrap skipping for dev sessions | Dev session infrastructure |
| `36052f0` | fix(extension): frontend spawn fails silently on Windows (PID undefined) | Internal VSCode extension |
| `96af872` | chore: WIP save from dev session (flow-check-with-sfdc) | WIP save, not a feature |

### Infrastructure / Deployment (3 commits)

| Commit | Subject | Why excluded |
|--------|---------|--------------|
| `ec67712` | modifications for remote deployment | Deployment config |
| `165b485` | Modified rate limiting logic in WAF | WAF/infra config |
| `7c6d20e` | fix(bootstrap): include NOT NULL and DEFAULT in column reconciliation DDL | DDL generation — backend-only |

### Chores / Docs / WIP (5 commits)

| Commit | Subject | Why excluded |
|--------|---------|--------------|
| `d5e49d0` | updating pr prompt | Prompt config |
| `faa9a03` | bumping build version | Version bump |
| `7f856b4` | docs: move change request to config_change_requests/ | Docs |
| `444a137` | docs: add change request for object-relations dev session | Docs |
| `72b9f3f` | chore: remove transient layout config change request | Cleanup |
| `4eace34` | chore: remove unrelated Salesforce flow XML files from PR scope | Cleanup |
| `2e8c21a` | chore: remove Salesforce Page Layouts.xlsx and add *.xlsx to .gitignore | Cleanup |
| `8869424` | review: revert rejected changes, clean up PR artifacts | Cleanup |
| `7877b49` | chore: WIP save from dev session (opp-layout-adjustment-new) | WIP save |
| `ca6c2a5` | docs: rename config change doc to match session name | Docs |
| `2a15818` | added some basic system prompts | Config |
| `a1bd2ce` | further changes to improve branch limit | Config |
| `11f548c` | adjusted branch limit | Config |

### Generic / Ambiguous (5 commits)

| Commit | Subject | Why excluded |
|--------|---------|--------------|
| `1e39a41` | further bugfixes | Too generic to assess without diff |
| `c367fa8` | dev session changes | Dev session |
| `9027de3` | modified backend | Too generic |
| `35e51ba` | data import changes | Import tooling, not UI |
| `dd400d5` | updates | Too generic |

---

## Included Commits — Full Analysis

### Group A: Page Layouts (13 commits)

Page layouts control how record forms and detail pages are structured. This is the
single largest area of divergence and has **zero E2E coverage** in the upstream suite.

#### `8ee2b06` — feat(layout): multi-layout management, default toggle, and editor enhancements

**What changed at the UI level**:
- Object Manager now shows a "Layouts" tab for each object
- Multiple layouts can be created per object
- One layout can be set as "default" via a toggle
- Layout editor canvas shows sections with fields

**Existing E2E coverage**: None. `object-manager.spec.ts` tests object CRUD but has no
layout-related tests.

**Tests needed**:
- Navigate to Setup → Objects → select object → Layouts tab → verify layout list
- Create new layout → verify it appears in list
- Set layout as default → verify toggle state persists
- Verify only one layout can be default at a time

#### `821347d` — feat(layout): lookup display fields with dot-notation expansions

**What changed**:
- Lookup fields can specify display fields using dot-notation (e.g., `Account.Owner.Name`)
- The UI resolves these references and displays the actual values

**Existing coverage**: None.

**Tests needed**:
- Record detail page with lookup field → verify expanded display field renders
- Verify `Account.Owner.Name` shows the owner's name, not an ID

#### `bceeb44` — fix(layout): list view sync, compact view rendering, and save refresh issues

**What changed**:
- List view columns now sync with `listFields` metadata after save
- Compact view (highlights panel) renders correctly
- Saving a layout no longer requires page refresh to see changes

**Existing coverage**: None.

**Tests needed**:
- Save layout with specific listFields → reload list view → columns match
- Record detail → highlights panel shows compact layout fields
- Save layout editor → changes reflect without manual refresh

#### `aad0194` — fix(layout-editor): populate section.fields from layoutRows for editor canvas

**What changed**: Layout editor canvas now correctly populates fields within sections
from the `layoutRows` data structure.

**Existing coverage**: None.

**Tests needed**: Open layout editor → verify fields appear in correct sections

#### `44abd18` — fix(highlights-panel): pass full field pool so compact layout fields render correctly

**What changed**: Highlights panel (compact layout) now receives the full field pool,
allowing it to render fields that weren't previously available.

**Existing coverage**: None.

**Tests needed**: Record detail → highlights panel → verify all compact layout fields render

#### `dae1673` — layout editor hotfix

**What changed**: Bug fix for layout editor (specific issue unclear from subject alone).

**Existing coverage**: None.

**Tests needed**: Covered by general layout editor tests above.

#### `f8f7d14` — feat(ui-api): add layout save endpoint and Account page layout

**What changed**:
- New backend endpoint for saving layouts
- Account object gets a default page layout

**Existing coverage**: None.

**Tests needed**: Save layout via editor → verify saved state persists across navigation

#### `65cf266` — feat(record-form): layout-driven section rendering for create mode

**What changed**: Record creation form now renders sections based on the page layout
instead of a flat grid of all fields.

**Existing coverage**: `accounts-crud.spec.ts` tests record creation but assumes a flat
form. **This is the most impactful gap** — the test structure doesn't match reality.

**Tests needed**:
- Create record → form shows sections matching layout (e.g., "Account Information",
  "Additional Details")
- Fields within each section match the layout configuration
- Required fields marked correctly within sections

#### `1e46f00` — feat(layout): Opportunity page layout + dev session bootstrap fixes

**What changed**: Opportunity object gets a "New Subscription" page layout.

**Existing coverage**: `opportunities-crud.spec.ts` exists but doesn't test
layout-driven forms.

**Tests needed**: Create Opportunity → form sections match "New Subscription" layout

#### `759e075` — fix: related list rendering, navigation, and duplicate key bugs

**What changed**:
- Related lists on record detail pages render correctly
- Navigation within related lists works
- No React duplicate key warnings

**Existing coverage**: None. No spec tests related lists.

**Tests needed**:
- Record detail → related lists section visible
- Related list items have correct counts
- Click related list item → navigates to correct record
- No console errors (duplicate key)

#### `6f0564f` — fix(campaign): curate related lists and fix apply_campaign_layout script

**What changed**: Campaign object's related lists are curated (specific lists shown/hidden).

**Existing coverage**: None.

**Tests needed**: Campaign record detail → correct related lists shown

---

### Group B: Flows & Record-Triggered Automation (4 commits)

#### `e4a947a` — fix(flows): resolve RecordLookup null handling and typed value extraction

**What changed**:
- `RecordLookup` flow element now returns null (not empty) when no record matches
- `IsNull` check in conditions works correctly for no-match scenarios
- Typed value extraction (string, number, boolean) works in variable assignments

**Existing coverage**: `flows.spec.ts` tests builder UI but not runtime execution.

**Tests needed**:
- Create flow with RecordLookup → run with no matching record → verify null path taken
- Verify typed value extraction in variable assignments

#### `685d33d` — fix(validation+flows): skip validation on unchanged fields and enable record-triggered flow execution

**What changed**:
- Validation rules now skip fields that haven't changed during update
- Record-triggered flows (before-save, after-save) now execute automatically
- `IsChanged` operator works in flow entry conditions

**Existing coverage**: `flows.spec.ts` tests builder only, not execution.

**Tests needed**:
- Create before-save flow → create record → verify flow fired (side effect visible)
- Create flow with IsChanged entry condition → update different field → flow doesn't fire
- Update record with pre-existing invalid data in unchanged field → save succeeds

#### `bdbcace` — review(pr-17): apply modifications to bootstrap backfill and trigger sync

**What changed**: Bootstrap backfill and trigger sync improvements.

**Existing coverage**: Covered by flow execution tests above.

#### `b01898b` — fix(picklist): store value+label in Options for correct display

**What changed**: Picklist field options now store both value and label, fixing display.

**Existing coverage**: CRUD specs test picklist selection but not label correctness.

**Tests needed**: Select picklist → save → reload → verify correct label (not doubled)

---

### Group C: Validation Rules (1 commit)

#### `df69d27` — fix(validation-rules): wire validation rules to _System_ValidationRule with Condition support

**What changed** (fixed 5 separate bugs):
1. Tooling API query now includes validation rules
2. Delete/update parameter case fixed
3. Frontend CRUD routes for validation rules work
4. Response field names corrected
5. PascalCase field mapping aligned

**Existing coverage**: None. No spec tests validation rules.

**Tests needed**:
- Navigate to Setup → Objects → Validation Rules tab
- Create validation rule with condition formula
- Edit existing validation rule
- Delete validation rule
- Create record that violates rule → error message displayed
- Update record changing only valid fields while invalid field unchanged → save succeeds

---

### Group D: Record CRUD & Display Fixes (6 commits)

#### `5f3c6eb` — fix: multipicklist fields display raw JSON instead of formatted values (#13)

**What changed**: Multipicklist fields were rendering as `["AWS","GCP"]` instead of
formatted badges.

**Existing coverage**: CRUD specs don't test field display formatting.

**Tests needed**: View record with multipicklist → verify colored badges, not JSON string

#### `8a13d60` — fix(campaign): fix numeric rendering, picklist UI, and dropdown clipping (#1)

**What changed**:
- Currency/percent fields no longer show 30 trailing decimal zeros
- Picklist dropdowns not clipped by parent overflow:hidden

**Existing coverage**: None.

**Tests needed**:
- Currency field shows `$50,000.00`, not `$50000.000000...`
- Percent field shows `25%`, not `25.000000...`
- Open picklist near container edge → dropdown fully visible

#### `e65af33` — fix(campaign): fix layout, field labels, picklist UI, and numeric rendering

**What changed**: Field labels display the configured label instead of the API name
title-cased as fallback.

**Existing coverage**: None.

**Tests needed**: All visible field labels match configured labels, not API names

#### `d7fe946` — fix: picklist dropdown duplication, decimal zeros, and dropdown clipping

**What changed**: Picklist options no longer show doubled text (e.g., "Awareness · Awareness").

**Existing coverage**: None.

**Tests needed**: Open picklist → each option shows single text

#### `8085728` — fix: remove duplicate trimDecimalString declaration in scanner.go

**What changed**: Build fix (duplicate function removal).

**Existing coverage**: N/A — build fix, no UI impact.

#### `f17863d` — fix: field label bug & data-dictionary-driven Salesforce import

**What changed**: Field labels render correctly from metadata.

**Existing coverage**: None.

**Tests needed**: Covered by field label test above.

---

### Group E: Server-Side Pagination (1 commit)

#### `8883d43` — feat: server-side pagination for record lists (#11)

**What changed**:
- Record lists now use server-side pagination instead of client-side
- Page size selector added (20/50/100)
- Total record count displayed
- Navigation between pages

**Existing coverage**: `accounts-crud.spec.ts` has 1 conditional pagination visibility check.

**Tests needed**:
- Navigate to record list with >20 records → pagination visible
- Change page size to 50 → more rows shown
- Click next page → different records displayed
- Click specific page number → correct page shown
- Total count displayed (e.g., "Showing 1-20 of 150")
- Go to page 3 → click record → go back → still on page 3

---

### Group F: Formula DSL Engine (1 commit)

#### `fee314a` — feat(analytics): Formula DSL engine and Formula Views for computed fields

**What changed**:
- Complete formula DSL: tokenizer, parser, compiler
- DAG dependency resolution for formula fields
- View builder and query routing for computed columns
- FormulaFieldEditor component with syntax highlighting

**Existing coverage**: None. `data-testid="formula-editor"` exists in production code
(one of only 3 production testids!).

**Tests needed**:
- Object Manager → Fields → New → select Formula type → FormulaFieldEditor appears
- Enter formula → syntax highlighting works
- Save formula field → appears in field list
- View record in list → formula column shows computed value
- View record detail → formula field shows computed value

**Note**: `formula-editor` is the only production `data-testid` that could actually be
used by a new test immediately.

---

### Group G: Approvals Fixes (2 commits)

#### `f9924bc` — fix(approvals): skip REST lookups for Tooling API metadata types in getPending (#8)

**What changed**: Pending approvals sidebar no longer makes REST lookup calls for
Tooling API metadata types (e.g., `ProcessDefinition`), which were returning 404 errors.

**Existing coverage**: `approval-queue.spec.ts` tests queue display but not error scenarios.

**Tests needed**:
- Open approval queue → no 404 errors in network panel
- Queue renders correctly when ProcessDefinition references metadata types

#### `ed24df8` — Fixes for approval / permissions

**What changed**: Approval and permission fixes.

**Existing coverage**: Basic approval flow covered.

**Tests needed**: Covered by approval queue test above.

---

### Group H: Auth & Security (2 commits)

#### `8316f9f` — fix(auth): bcrypt-aware password upsert during bootstrap (#3)

**What changed**: Bootstrap process now checks for existing bcrypt password hash before
upserting, preventing password overwrites on server restart.

**Existing coverage**: `auth.spec.ts` tests login but not bootstrap behavior.

**Tests needed**:
- Login → works → restart server → login again with same password → still works
- (This is more of an integration/API test than pure E2E)

#### `454b6ac` — fix(security): restore CSRF, trusted proxies, pprof guard from main

**What changed**: CSRF protection re-enabled on mutating endpoints.

**Existing coverage**: None.

**Tests needed**:
- POST request without CSRF token → 403 response
- (This is more API-level than E2E, but could be verified via Playwright network interception)

---

### Group I: App Launcher Fix (1 commit)

#### `6a59020` — fix(apps): fix duplicate Sales app and missing GET single-app route (#2)

**What changed**:
- App Launcher no longer shows duplicate "Sales" app entries
- GET `/tooling/sobjects/CustomApplication/:id` endpoint works

**Existing coverage**: None. No spec tests app launcher.

**Tests needed**:
- Open App Launcher → verify each app appears exactly once
- Navigate to app detail → page loads without error

---

## Priority Ranking

### Must Have (P0) — 11 scenarios

All from Group A (Page Layouts) + Group B (record-triggered flows) + Group E (pagination basics):
1. Layout editor: create, add/remove fields, set default
2. Record create form respects layout sections
3. List view columns match listFields
4. Record-triggered flow fires on create/update
5. Page size selector and navigation

### Should Have (P1) — 20 scenarios

Groups B-E regression scenarios:
- RecordLookup null handling, IsChanged, validation skip
- Validation rule CRUD + execution
- Multipicklist badges, currency/percent display, field labels
- Pagination: total count, state preservation
- Related lists: counts, navigation
- Compact view / highlights panel

### Nice to Have (P2) — 14 scenarios

Groups F-I + edge cases:
- Formula field creation + display
- Approval queue 404 regression
- Bootstrap password preservation
- CSRF protection
- App Launcher dedup
- Lookup dot-notation expansion
- Complex FilterLogic
- Specific page navigation in pagination
