# Post-launch roadmap: reducing DFS and third-party API dependency

Status: proposed future roadmap; no implementation authorized by this document.
Created: 2026-10-30.

## 1. Launch commitment

**Phase 1 will launch with the application working as it currently does.**

This roadmap is not a launch prerequisite. It does not enable new collection,
change providers, remove existing reports, alter refresh/billing behavior, or
authorize paid calls. Implementation requires separate post-launch approval.

The objective is to reduce avoidable third-party requests and increase ownership
of our data and analysis, not to promise a fully independent replacement for a
search engine, backlink index, or market-data provider.

The existing [shared DFS implementation plan](DFS-plan.md) documents a different
scope: caching and reuse of provider observations. Its numbered phases are not
the product launch phases used here.

## 2. Principles

- Preserve existing pages, API contracts, access controls and source disclosures.
- Calculate arithmetic, percentiles and comparisons deterministically in code.
- Use AI for interpretation and recommendations, not invented measurements.
- Distinguish observed, provider-estimated, locally calculated and AI-inferred data.
- Missing data stays missing. No synthetic pre-collection history or false zeroes.
- Keep organic search metrics separate from website engagement and model samples.
- Reuse observations before buying new ones; respect provider storage/licensing terms.
- Prefer existing infrastructure and services over parallel replacement systems.
- Judge savings against total collection, compute, model and maintenance costs.

## 3. Existing foundation

These are starting points, not a claim of complete replacement coverage:

| Foundation | Existing implementation | Limitations |
|---|---|---|
| Native crawling | `app/Libraries/CrawlEngine.php` | Lightweight HTTP/DOM crawler; not equivalent to a browser-rendered audit |
| Native audit persistence | `app/Libraries/OwnCrawlAuditService.php` | Uses existing audit tables; some fields are absent or placeholders |
| First-party measurements | `app/Controllers/PixelController.php` | Views, events and vitals; not a complete session/user analytics system |
| Shared DFS observations | `app/Libraries/DfsDatasetService.php` | Exact-context reuse for selected endpoints, not all DFS consumers |
| Google report caching | `app/Libraries/MeasureGoogleSource.php` | Authorized Google integrations remain external dependencies |
| Saved rank history | `app/Models/KeywordRankingModel.php` | Supports local analysis; new rank observations still need a source |
| Opportunity generation | `app/Libraries/OpportunityGeneratorService.php` | Already combines audit issues and tracked ranking signals |
| Content briefs | `app/Libraries/ContentScoringService.php` | Currently researches through DFS before optional LLM polishing |

## 4. Dependency disposition

| Capability | Future direction | What must remain explicit |
|---|---|---|
| Technical audits | Gradually replace supported DFS checks with validated native checks | Unsupported checks remain unavailable or provider-backed |
| Page inventory and change monitoring | Own crawl/sitemap snapshots and content fingerprints | Discovered URLs are not proof of Google indexation |
| Internal linking | Persist link edges; compute depth and inbound-link counts locally | Crawl coverage limits conclusions; orphan detection needs another URL inventory |
| Engagement and vitals | Aggregate first-party pixel records | Sample size, consent, missing collection and bot filtering |
| Conversions | Aggregate recorded events and currency-separated values | Events are not automatically unique leads or confirmed orders |
| Search Performance | Prefer authorized GSC for actual owned-site search metrics | Reduces DFS use, but retains Google dependency and reporting limits |
| Top Pages | Add separate first-party engagement and GSC views | Do not overwrite DFS organic estimates with pixel views |
| Keyword discovery and content briefs | Generate ideas from owned content, saved queries and AI | Suggested keywords have no measured volume unless externally sourced |
| Topic/intent clustering | Local rules, embeddings and optional AI | Classification is inferred and versioned |
| Opportunity prioritization | Reuse collected facts and deterministic scoring | Recommendations are not guaranteed ranking/revenue outcomes |
| AI visibility analysis | Analyze saved/direct-model samples | Not equivalent to Google AI Mode/AI Overview observations |
| Market keyword volume/CPC | Retain DFS or another suitable provider | AI cannot supply measured market demand |
| Exact live location/device rankings | Retain a SERP provider initially | GSC average position is not exact rank tracking |
| Competitor keywords, top pages and traffic estimates | Retain an SEO-data provider | Competitor crawling cannot reveal actual search traffic |
| Broad backlink coverage | Retain a backlink-index provider | Our discovered links are only a limited subset |
| Google SERP features and AI citations | Retain supported external observation | Generated answers/links are not proof of Google citations |

GA4 may remain optional where customers want established session/user analytics.
GSC and GA4 connections require authorization and are not universally available.
A missing connection must not silently trigger a paid replacement request.

## 5. Sequenced post-launch work

The stages below are proposals, not delivery dates or completed commitments.

### Stage A: establish the cost and dependency baseline

Before removing any dependency:

1. Inventory provider calls by endpoint, module, account/website and trigger.
2. Measure request count, reported cost, cache reuse, failures and freshness.
3. Separate existing cached observations from newly purchased observations.
4. Identify duplicated requests and unused fields before building replacements.
5. Agree endpoint-specific freshness, quality targets and spending controls.

Extend diagnostics only where necessary. Latest-envelope costs are not a lifetime
spend ledger; missing historical cost data must be reported as unknown.

Exit gate: reviewed baseline and approved pilot scope. Do not promise a percentage
cost reduction until representative post-launch usage exists.

### Stage B: derive more value from facts we already have

1. Build reusable website/page/day projections for saved crawl facts, pixel
   measurements, GSC results and ranking observations.
2. Preserve each source's date, device/location context and coverage.
3. Add local trends, change detection and issue-resolution tracking.
4. Expand exact-context cache reuse only for approved provider endpoints.
5. Use existing opportunities/reporting surfaces rather than duplicating them.

No new provider request should be needed to recalculate a report from saved facts.
Aggregations must not claim completeness when inputs are sampled or truncated.

Exit gate: deterministic fixture tests, tenant isolation, reproducible totals,
bounded storage/query cost and unchanged existing report behavior.

### Stage C: pilot native technical audits

1. Define a check-by-check matrix of native support versus DFS output.
2. Harden collection before scaling: safe public URL access, redirect boundaries,
   TLS verification, robots handling, rate limits, timeouts and resource limits.
3. Expand durable evidence: link edges, schema types, relevant response metadata,
   content fingerprints and parser/check versions.
4. Validate metadata, HTTP status, canonical, indexability signals, schema presence,
   duplicate-content candidates and internal-link checks on controlled fixtures.
5. Compare native and provider results on a bounded, approved sample. Reuse saved
   provider observations where suitable; new paid comparisons require approval.
6. Enable native results for a small opt-in cohort, then expand supported checks.

Browser rendering, JavaScript-only pages and laboratory performance measurement
need separate scope and infrastructure. Pixel vitals measure real-user samples,
not equivalent laboratory scores.

Exit gate: agreed per-check accuracy/coverage and crawl reliability targets met;
unsupported checks visible; source-labelled history and rollback verified.

### Stage D: add cached, evidence-grounded AI enrichment

1. Start with topic/intent labels, query clusters and query-to-page suggestions.
2. Add content overlap candidates, internal-link suggestions and content briefs.
3. Ground recommendations in collected page text, saved queries and known facts.
4. Keep optional external keyword research separate from an owned-data brief.
5. Validate structured responses, evidence references and proposed target URLs.
6. Cache by tenant/website, input hash, model, prompt and output-schema versions.

Send only approved public or appropriately redacted inputs to authorized model
providers. Exclude credentials, visitor identifiers and private customer data.
Treat crawled content as untrusted input, never as instructions to tools.

Store generated time, evidence references and inference provenance. Model errors
must be visible; a failed AI call must not fabricate a successful recommendation.
Require human approval before publishing content or deploying website changes.

Exit gate: reviewed evaluation set, acceptable suggestion quality, bounded cost,
privacy controls and reliable invalidation when source content changes.

### Stage E: deepen first-party measurement

1. Improve collector validation, bot filtering and duplicate-event handling.
2. Design consent-aware session identifiers only if session/funnel metrics are needed.
3. Define event semantics and order/transaction reconciliation before revenue claims.
4. Add daily engagement and vitals summaries with sample counts and retention rules.
5. Evaluate privacy implications before geographic enrichment or cross-session tracking.

Do not infer unique visitors, session conversion rates or causal attribution from
the existing view/event records alone. Before/after correlations remain
correlations even when more first-party data becomes available.

Exit gate: privacy review, tested event semantics and accurate fixture-based
metrics, with collection gaps and limitations visible to customers.

### Stage F: retire selected provider paths

Evaluate each endpoint independently after the relevant pilot succeeds:

1. Confirm all consumers, including exports, scheduled jobs and historical views.
2. Confirm replacement evidence, quality, operating costs and support readiness.
3. Roll out behind a per-capability/cohort switch with an explicit source label.
4. Preserve provider-backed history; break incompatible trend/comparison series.
5. Remove obsolete automatic calls only after confirming no dependent consumer.
6. Retain a tested rollback path during an agreed observation window.

Rollback must not silently incur paid calls. Re-enabling provider refresh requires
the same authorization, billing and refresh controls as the existing application.
Cached prior observations may remain readable with their actual age.

## 6. Shared data and compatibility requirements

Use existing services/tables where appropriate; new schema requires its own plan.
Every shared projection should retain:

- Authorized tenant/website and canonical page identity.
- Source, observation time, ingestion time and freshness state.
- Request context, coverage/sample size and calculation version.
- Evidence references and model/prompt versions for inferred outputs.
- Explicit missing, empty, stale and error states.

Do not merge currencies, distinct locations/devices, incompatible source series or
different measurement populations into misleading totals. Keep raw facts separate
from derived summaries and AI annotations. Apply documented retention/deletion
rules to all three.

## 7. Success measures and approval checklist

Track avoided provider requests and actual costs alongside crawler compute,
storage, model spend, operational failures and maintenance effort. Measure output
accuracy, coverage, freshness, latency and source-state correctness.

Before any stage enters implementation:

- [ ] Assign an owner and approve the bounded scope.
- [ ] Record baseline metrics and numerical acceptance thresholds.
- [ ] Approve privacy, licensing, retention and incremental spend implications.
- [ ] Define source transitions, API/UI compatibility and rollback.
- [ ] Add targeted tests and representative runtime validation.
- [ ] Confirm Phase 1 launch work remains unaffected.

## 8. Recommended first approval after launch

Approve Stage A first, then a small Stage B pilot and one native-audit check group.
AI clustering can follow once approved input handling and evaluation are defined.
Do not begin with a homegrown backlink index, Google SERP scraper or competitor
traffic estimator: these have high operating cost and cannot be replaced by AI.

The intended destination is **owned collection and analysis where we can observe
the facts, selective external providers where we cannot**.
