# L0/L1 Verification Remediation Execution Plan

Generated: 2026-05-05T06:09:35.508Z

## Posting Reconciliation

- Deep-verification marker comments posted/audited: 497/497
- Issues with exactly one marker comment: see deep_marker_audit.json; current audit reports 497/497.
- Verified-label candidate issues applied: 95/95
- Transient GitHub write failures: 8; all later reconciled successfully.

## Grouped Backlog

| Order | Group | Importance | Effort | Fail | Partial | Blocked | Total |
| --- | --- | --- | --- | ---: | ---: | ---: | ---: |
| 1 | API parity / Salesforce v63 response shape | High | Low | 72 | 15 | 1 | 88 |
| 2 | Metadata/setup/layout/formula basics | High | Low to Medium | 25 | 22 | 1 | 48 |
| 3 | CRM L1 object-pack gaps | High | Medium | 26 | 18 | 0 | 44 |
| 4 | Security and permission correctness | High | Medium to High | 19 | 4 | 1 | 24 |
| 5 | Flow/automation/approval runtime | High | High | 46 | 22 | 6 | 74 |
| 6 | Reports/dashboards/analytics | Medium | Medium | 10 | 8 | 0 | 18 |
| 7 | Integration/HubSpot/outbox | Medium | High | 1 | 2 | 15 | 18 |
| 8 | Architecture/public-core boundary and CI guardrails | High | High | 49 | 39 | 0 | 88 |

## Execution Order

### 1. API parity / Salesforce v63 response shape

- Importance: High
- Effort: Low
- Why in this position: Largest low-hanging cluster; many failures share endpoint registration, envelope/schema, pagination, or default-value adapter gaps.
- Deliverable: Contract-test-backed Salesforce v63 response adapters for common endpoints.
- Acceptance: REST/UI API contract tests compare NexusCRM envelopes, status codes, field names, and pagination locators against the local Salesforce-v63 expectations captured in the issue evidence.
- Example issues: #249 (fail) Move verify_query_pagination.sh and verify_search_strict.sh under tests/contract/rest_api/; #259 (fail) [Salesforce Compat] Folder Shares request/response schema diverges from Salesforce; #260 (fail) `/services/data/v63.0/event` advertised but not implemented; #262 (fail) [P3][API] GET /parameterizedSearch returns extra Name field even when fields parameter is omitted; #263 (fail) OAuth revoke endpoint invalid-token behavior differs from Salesforce (always returns 200)

### 2. Metadata/setup/layout/formula basics

- Importance: High
- Effort: Low to Medium
- Why in this position: These defects block pack verification and many admin/UI workflows, and fixes are concentrated in shared metadata utilities and setup handlers.
- Deliverable: Fix shared metadata utilities plus the Setup/API paths that block L1 pack workflows.
- Acceptance: Object create, describe, layout, search-layout, formula materialization, plural label, and system-field scans pass the captured probes and focused regression tests.
- Example issues: #166 (fail) [Story] Admin can edit object schema, picklists, and record types in Setup; #167 (fail) [Story] Admin can configure page layouts per Record Type with Required/Read-only overrides + Search Layouts; #244 (fail) "Fix naive PluralLabel computation in registerSystemObjectMetadata"; #246 (fail) Fix naive pluralization in buildObjectMetadata; #247 (fail) Support consonant doubling in pluralization (Quiz → Quizzes)

### 3. CRM L1 object-pack gaps

- Importance: High
- Effort: Medium
- Why in this position: Once metadata basics work, missing pack facts can be closed with a targeted Salesforce CRM completeness pass.
- Deliverable: Pack-level Salesforce CRM completeness pass with verify-pack plus targeted API/UI smokes.
- Acceptance: Missing standard objects, fields, picklists, related lists, quote/campaign/opportunity behaviors, and default records materialize from salesforce-crm-standard without L0 hardcoding.
- Example issues: #158 (fail) [Story] Sales rep can use Account detail actions: New Contact, Merge Opportunities, View Hierarchy; #172 (fail) [Story] Deal manager can create an Order from a Quote and upload Archived Order Forms; #174 (fail) [Story] Sales rep can log Tasks and Events on records and see them in Activity timeline; #548 (fail) Merge Opportunities action missing on Account page (master selection + re-parent child records); #609 (fail) [P1] Lead Date_Status_Changed__c hardcode in platform persistence violates metadata-driven rules

### 4. Security and permission correctness

- Importance: High
- Effort: Medium to High
- Why in this position: Security gaps carry high correctness risk, but several depend on stable metadata and API read paths from earlier groups.
- Deliverable: Permission enforcement tests across CRUD/query/search/hydration, then fixes by shared permission read path.
- Acceptance: RLS/FLS/sharing/protected-record behavior is enforced consistently in CRUD, query, search, related-list hydration, and UI/API actions.
- Example issues: #273 (fail) [P1][Bug] SF-parity: 6 implicit-CRUD child objects (OpportunityLineItem / QuoteLineItem / OrderItem / OpportunityContactRole / CaseComment / PricebookEntry) fail runtime CRUD check — delegate to parent's ObjectPermissions; #449 (fail) arch: Missing metadata lifecycle layer — permission cascade not wired to EventBus (root cause of #527, #524, #526); #495 (fail) persistence: BatchUpsertProfiles should include UserType explicitly (defense-in-depth); #507 (fail) Add singleflight guard to roleHierarchy lazy-refresh to prevent thundering herd; #532 (fail) security-review: Permission system architecture findings — PermissionSet, FieldPermission, Sharing

### 5. Flow/automation/approval runtime

- Importance: High
- Effort: High
- Why in this position: Approval and flow runtime defects are business-critical but should land after metadata, L1 object shape, and permissions stabilize.
- Deliverable: Approval/flow runtime stabilization after metadata and L1 object basics are reliable.
- Acceptance: Approval submit/recall/reassign chains, flow criteria/default/formula handling, and builder/runtime parity pass targeted browser/API/regression tests.
- Example issues: #173 (fail) [Story] Deal manager can manage Contracts with Archived Contract upload and status flows; #210 (fail) [Bug][R6] New Campaign does not auto-create default CampaignMemberStatus record... (L0); #218 (fail) [Bug][R7] Opportunity Amount does not auto-calculate from OpportunityLineItem t... (L0); #221 (fail) [Bug][R4] Weekly Update Subject field is free-text box — should be picklist (In...; #223 (fail) [Bug][R7] [Quote Approval] Submit for Approval fails with 'entryCriteria' valid... (L0)

### 6. Reports/dashboards/analytics

- Importance: Medium
- Effort: Medium
- Why in this position: Important user workflows, but lower blast radius than API/security/pack blockers.
- Deliverable: Report builder/list parity pass plus SOQL aggregate relationship support.
- Acceptance: Report list navigation, builder filters, dashboard scheduling, analytics API compatibility, and aggregate relationship SOQL probes pass.
- Example issues: #270 (fail) [Gate][Frontend] Visible-disabled New Flow/Dashboard/Report buttons + friendly AUTHORING_UNSUPPORTED handler; #390 (fail) [P1] Aggregate SELECT aliases are ignored and multiple aggregate functions are rejected; #405 (fail) chore: dashboard_filtering_test has never compiled — needs rewrite; #438 (fail) Report edit: "Show me" filter is static and non-interactive; #522 (fail) Report List: Missing left-side category navigation panel (Recent, Created by Me, Folders, etc.)

### 7. Integration/HubSpot/outbox

- Importance: Medium
- Effort: High
- Why in this position: Most items are blocked by credentials, external fixtures, or worker lifecycle evidence, so they need a separate environment-backed run.
- Deliverable: Separate environment-backed integration verification run with credentials/fixtures.
- Acceptance: HubSpot private app auth, HMAC, queue/outbox worker lifecycle, redaction, metrics, and association edge cases pass with real fixtures or approved local fakes.
- Example issues: #650 (fail) [hubspot-v3] e2e-case-debt: author tc-*.json cases for G0/G1/G3 obligations + M4/M5 coverage; #566 (partial) outbox: tighten outboxNoSubscriberObjects filter to event-type granularity; #657 (partial) [Outbox] processEventAtomic should call ClaimEvent OUTSIDE WithTransaction (architectural refactor for #1817 Bug B PR #2027); #170 (blocked) [Story] Integration developer can configure reliable two-way HubSpot sync via integration queue; #189 (blocked) [Bug] HubSpot integration runtime: hapikey, bare domain rejection, MobilePhone validator, portal deploy

### 8. Architecture/public-core boundary and CI guardrails

- Importance: High
- Effort: High
- Why in this position: These guardrails prevent recurrence, but landing them after functional fixes avoids freezing current gaps into noisy CI failures.
- Deliverable: CI-enforced boundary scans and contract tests after the high-volume functional fixes land.
- Acceptance: Hardcoded app/tenant literals, duplicate registries, mocked-over regressions, startup debt, and missing contract-test coverage are enforced by CI with actionable failures.
- Example issues: #178 (fail) [Bug] Tenant-specific metadata leaks into PlatformCore/PlatformUX bootstrap; #182 (fail) [Bug] Code-quality umbrella: 21 Bad Smell tech-debt items (god services, duplications, dead code); #192 (fail) [Bug] Schema/Setup tech-debt: hardcoded constants, duplicate utilities, Contract field dups, frozen formulas; #242 (fail) Extract duplicated splitCamelCase to shared utility; #243 (fail) Replace hardcoded "_System_Field" with constants.TableField in schema.go

## First Implementation Slice

1. API parity / Salesforce v63 response shape: add or repair common response adapters first, with contract tests for status codes, envelopes, pagination locators, quick actions, folder share schemas, OAuth revoke behavior, UI API defaults, and advertised routes.
2. Metadata/setup/layout/formula basics: fix shared pluralization/label utilities, formula materialization, Setup object create, DescribeLayouts/Search Layout/ProfileLayout shape, and `_System_Field` constant usage.
3. Re-run `setup verify-pack salesforce-crm-standard`, targeted API probes, and browser smokes; only then move into CRM L1 object-pack completion and permission/runtime repairs.

## Notes

- Group assignment is primary-cause oriented: each non-pass issue appears in exactly one group even when it touches multiple surfaces.
- Integration/HubSpot items remain intentionally late because most require credentials, external fixtures, or worker lifecycle evidence beyond the local public-core proof environment.
- Architecture/CI guardrails stay last in execution order even though importance is high, because they should encode the fixed contracts after the high-volume functional gaps stop failing.