PR #149 merged: feat(intel): about-to-be-hot divergence detector + permalink page
The product spine for the newsletter
Pattern A of the divergence-detector framing from the 2026-06-02 multi-agent product review: surface topics where shipping velocity (releases, CVEs, package updates) is rising while community discourse hasn't caught up yet. The "MCP-CVEs-while-MCP-is-dead" pattern — the only spark of insight in four agents' worth of output that week.
This PR ships one full vertical slice — schema → action → command → MCP tool → public permalink page → tests. Patterns B (hype without substance), C (cross-community disagreement), and D (sentiment polarisation) are deliberately deferred; the architecture supports them via pattern_type and they're follow-up PRs.
What landed
| Layer | What |
|---|---|
| Schema | `divergence_topics` (curated watchlist) + `divergences` (detected gaps with hash, supporting URLs, confidence band) |
| Action | `DetectDivergences` — pure handler, returns unsaved Divergence or null. Portable Eloquent queries so the sqlite test suite hits the real logic |
| Thresholds | shipping growth ≥ 1.5×, discourse growth ≤ 1.05× (flat-or-falling), absolute shipping ≥ 5 |
| Command | `intel:detect-divergences` — scheduled daily 05:00 UTC, idempotent within day, `--dry-run` and `--topic` flags |
| MCP tool | `find_divergences` — registered on PublicDevTrendsServer, returns recent divergences with permalink URLs |
| Public page | `/intel/divergence/{hash}` — Inertia detail view, semantic-token styled, links readers back into DevTrends |
| Seeder | 17 topics: MCP, Claude Code, Cursor, Aider, Continue, Cline, Anthropic, OpenAI, RAG, agents, vibecoding, Laravel, Livewire, Filament, Inertia, Coolify, selfhost |
Test coverage
23 new Pest tests under `tests/Feature/Intel/`:
- Action (7) — positive detection, shipping flat → miss, discourse rising → miss, absolute-minimum gate, topic-pattern scoping, hash stability, supporting URL collection
- Command (4) — persist by default, dry-run skips persistence, dedup on rerun, --topic narrows scan
- Tool (3) — empty payload, surfaced divergence with permalink, lookback window
- Controller (3) — render, 404, topic-label fallback
Full suite: 235 passed / 27 skipped / 0 failed. Pint clean. Standards followed (Actions / DTO / casts() / createQuietly() / AAA tests).
Deployment
Auto-migrate is fine — both new tables, no destructive changes. After deploy:
```bash php artisan db:seed --class=DivergenceTopicSeeder php artisan intel:detect-divergences --dry-run # sanity check php artisan intel:detect-divergences # populate ```
Then visit any returned permalink to verify the page renders against real prod data.
What's NOT in this PR (separate work)
- Patterns B/C/D
- Source bias `_meta` on tool responses
- MCP App view removal
- Newsletter draft assembler / track-record UI
- The Tier 1 cleanup nits from the morning plan doc (opportunity_finder, get_trends laravel, count(*) cache)
Each of those is its own focused PR rather than bundled here. Plan doc at `docs/plans/2026-06-03-cleanup-and-newsletter-mvp.md` is also included for tomorrow's review.