fix(lifecycle): own enrichment provenance in code; fix(mailbox-poller): drop numeric separators - #985
Merged
Merged
Conversation
…r 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
September 3, 2026 15:44
Contributor
…t 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>
Contributor
… 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>
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three commits on one branch, all in service of getting production enrichment to succeed and the resulting sequence to be correct.
1. Apps Script parse fix (
tools/google-mailbox-poller/Code.gs). The editor rejects numeric separators; three literals became plain numbers.2. Code-owned enrichment provenance (
apps/lifecycle/src/enrichment/anthropic.ts). Every productionenrichjob was terminal withenrichment_failed. The Anthropic structured-output grammar drops array-length, numeric, and enum bounds, and the model was asked to echo provenance verbatim; it returned one draft instead of three, dropped milliseconds fromretrieved_at, cited score identifiers as sources, and fabricated sources in neutral mode. The wire schema now carries only what the model judges, with no grammar-unenforceable bounds, andnormalizeArtifactderives sources from the bounded evidence, copies score metadata from the input, drops signals citing anything outside the evidence, nulls drafts pointing at a dropped source or unknown angle, pads or truncates drafts to three slots, and strips company claims in neutral mode.3. Findings from vetting against live sites (fetcher, normalizer, templates, dispatcher).
CompanyFetchSecurityError) propagate.Verification
nx run-many -t lint,test,check -p lifecyclepasses (201 tests across the four affected specs).After merge the lifecycle auto-deploys; the two failed production enrich jobs then get a one-line re-queue.
🤖 Generated with Claude Code