Commit 8e06bc5
fix(lifecycle): own enrichment provenance in code; fix(mailbox-poller): drop numeric separators (#985)
* fix(mailbox-poller): drop numeric separators so the Apps Script editor can parse Code.gs
The Apps Script editor rejects numeric separator literals (8_000, 4_000,
1_000_000) with 'Unexpected token ILLEGAL' at line 321 and refuses to save.
Plain literals keep the same values.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(lifecycle): own enrichment provenance in code so structured output stops failing
Every production enrich job failed. The Anthropic structured-output grammar
drops array-length, numeric, and enum bounds from the JSON schema, and the
model was asked to echo provenance verbatim. In practice it returned one
draft instead of three, dropped milliseconds from retrieved_at, cited score
identifiers as sources, and fabricated placeholder sources in neutral mode.
Each of those tripped the strict artifact parse or a verifier and the job
went terminal after two attempts.
The wire schema now carries only what the model judges: summary,
confidence, cited signals, company profile, recommended angle, and drafts,
with no grammar-unenforceable bounds. The code derives sources from the
bounded evidence for cited ids, copies score metadata from the input, drops
signals that cite anything outside the evidence, nulls drafts that point at
a dropped source or an unknown angle, pads or truncates drafts to the three
slots, and strips all company claims in neutral mode. The prompt states the
slot count, the allowed angle ids, and which ids are citable.
Verified live against the API: five of five runs succeed across company and
neutral inputs, where zero succeeded before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(lifecycle): survive unusable company pages, keep angles distinct, close evidence sequences
Three findings from vetting enrichment against live sites:
- One oversized, missing, or slow company page aborted evidence for the
whole company, and the enrich job then failed after retries. The fetcher
now skips such a page and keeps the rest; only the caller's abort and
SSRF violations (now CompanyFetchSecurityError) propagate.
- Nothing stopped the model from selecting the same angle in two slots,
which would send the same email twice. The normalizer keeps the first
use of an angle and nulls repeats so those slots fall back to default
copy; the prompt asks for distinct angles.
- The default day-8 copy says it is the last automated follow-up but the
evidence variants did not. renderEvidenceCampaignTemplate takes a
finalStep option and the dispatcher sets it for step 3.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent e643849 commit 8e06bc5
9 files changed
Lines changed: 618 additions & 204 deletions
File tree
- apps/lifecycle/src
- campaign
- enrichment
- tools/google-mailbox-poller
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
251 | 285 | | |
252 | 286 | | |
253 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
197 | 199 | | |
198 | | - | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
201 | 209 | | |
0 commit comments