Phase 2 part 4: discovery per signal (Claude web search, explee.com)

Each signal's page can search for organizations that show it, by hand or
every 7, 14 or 30 days. Claude with the web_search_20260209 server tool
(pause_turn resumed) works from the signal's "How to spot it" lines and
the profile's targets; a company is kept only if its evidence URL was
among the pages searched. explee.com's company search runs the signal's
description in the target sizes, scored against the hypothesis, keeping
strong matches. Our sites, the inventory, existing prospects, CRM
Accounts and suppressed domains are left out. New companies go to Review
tagged with the signal. Schema 8 adds discovery_runs (counts, searches,
why companies were left out) and the signal's schedule and explee.com
description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 18:27:35 -07:00
co-authored by Claude Opus 5.5
parent b025a97e4a
commit 157902f7e2
15 changed files with 1234 additions and 15 deletions
+58
View File
@@ -26,6 +26,30 @@
{{end}}
{{end}}
{{if $s.ID}}
<section class="card" id="discovery">
<h2>Find companies</h2>
<p>Supermarket searches for organizations that show this signal now and adds them to <a href="/prospects?status=new&amp;signal={{$s.ID}}">Review</a>, tagged with it. Nothing is contacted or sent to your CRM until you accept it.</p>
<div class="grid">
<div>
<h3>Claude, with web search</h3>
<p class="small">Up to {{.MaxSearch}} web searches from “How to spot it”, for up to {{.MaxResults}} companies. Each company comes with the page that shows the signal; any whose page wasn't among the search results is left out. Web searches are billed by Anthropic on top of the tokens.</p>
{{if .Research}}<p class="warn-text small">{{.Research}}</p>
{{else if not $s.SpotLines}}<p class="warn-text small">Fill in “How to spot it” below first.</p>
{{else}}<form method="post" action="/signals/{{$s.ID}}/discover/claude" data-busy="Starting…"><button type="submit" {{if .Running}}disabled{{end}}>Search the web now</button></form>{{end}}
</div>
<div>
<h3>explee.com company search</h3>
<p class="small">Companies that do what you describe below, in your target sizes, scored against the hypothesis; only strong matches are added. The first 10 results of a search are free on explee.com.</p>
{{if not .ExpleeKey}}<p class="small">Save an explee.com API key under <a href="/settings/sources">Settings → Lead sources</a> to use it.</p>
{{else if not $s.ExpleeDefinition}}<p class="small">Describe what the companies do, under “explee.com description” below.</p>
{{else}}<form method="post" action="/signals/{{$s.ID}}/discover/explee" data-busy="Starting…"><button type="submit" class="secondary" {{if .Running}}disabled{{end}}>Search explee.com now</button></form>{{end}}
</div>
</div>
{{template "runs" (dict "ID" $s.ID "Runs" .Runs "Running" .Running)}}
</section>
{{end}}
<form method="post" action="{{if $s.ID}}/signals/{{$s.ID}}{{else}}/signals/new{{end}}" class="card">
<div class="cols">
<label>Name <input name="name" value="{{$s.Name}}" required placeholder="Leaving Microsoft 365"></label>
@@ -39,6 +63,15 @@
<span class="help">Discovery (next) runs these as searches, so write them the way you'd search for the companies.</span></label>
<label>Angle <textarea name="angle" rows="3" placeholder="The pain, and what we promise about it">{{$s.Angle}}</textarea>
<span class="help">What emails, LinkedIn messages and content for this signal should say.</span></label>
<div class="cols">
<label>Search automatically
<select name="discover_every_days">{{range .EveryDays}}<option value="{{.}}" {{if eq . $s.DiscoverEveryDays}}selected{{end}}>{{if eq . 0}}Only when I ask{{else}}Every {{.}} days{{end}}</option>{{end}}</select>
<span class="help">Runs the searches above on a schedule, while the signal isn't retired. Each run costs web searches.</span>
</label>
<label>explee.com description <input name="explee_definition" value="{{$s.ExpleeDefinition}}" placeholder="e.g. law firm, managed IT services, nonprofit">
<span class="help">What the companies do, in a few words, for explee.com's company search.</span>
</label>
</div>
<label>Campaign tag <input name="slug" value="{{$s.Slug}}" placeholder="made from the name">
<span class="help">Used as <code>utm_campaign</code> on links for this signal, so visits and sign-ups are counted against it. Change it before using it, not after.</span></label>
<div class="actions">
@@ -67,3 +100,28 @@
</form>
{{end}}
{{end}}{{end}}
{{define "runs"}}
<div id="runs" {{if .Running}}hx-get="/signals/{{.ID}}/runs" hx-trigger="every 4s" hx-swap="outerHTML"{{end}}>
{{if .Runs}}
<table class="list runs">
<thead><tr><th>Started</th><th>Source</th><th>Result</th></tr></thead>
<tbody>
{{range .Runs}}
<tr>
<td>{{ago .StartedAt}}</td>
<td>{{if eq .Source "claude"}}Claude web search{{else}}explee.com{{end}}</td>
<td>
{{if eq .Status "running"}}<span class="badge scheduled">searching…</span>
{{else if eq .Status "failed"}}<span class="badge failed">failed</span> <span class="small">{{.Error}}</span>
{{else}}<strong>{{.Added}} new</strong>{{if .Existing}}, {{.Existing}} already in Review{{end}}{{if .Skipped}}, {{.Skipped}} left out{{end}} <span class="muted small">of {{.Found}} found</span>{{end}}
{{if .Searches}}<span class="muted small"> · {{.Searches}} {{if eq .Source "claude"}}web searches{{else}}search{{end}}</span>{{end}}
{{if .Notes}}<details class="small"><summary>Why some were left out</summary><ul>{{range .Notes}}<li>{{.}}</li>{{end}}</ul></details>{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}<p class="help">No searches yet.</p>{{end}}
</div>
{{end}}