Skip to content

Fix Lusha v2 bulk API response parsing#433

Merged
bokelley merged 2 commits intomainfrom
bokelley/fix-lusha-response-parsing
Dec 31, 2025
Merged

Fix Lusha v2 bulk API response parsing#433
bokelley merged 2 commits intomainfrom
bokelley/fix-lusha-response-parsing

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

  • Fix response parsing to handle Lusha v2 bulk API format where results are indexed by request ID (e.g., {"1": {...}})
  • Map field names correctly from Lusha v2 response format:
    • namecompanyName
    • companySize array [min, max]employeeCount and employeeCountRange
    • revenueRange array [min, max]revenue and formatted revenueRange
    • linkedinlinkedinUrl
    • specialities (British spelling) → specialties
    • fqdn (may include www.) → domain
    • founded as string → foundedYear as number

Test plan

  • TypeScript compiles
  • All existing tests pass
  • Deploy and verify enrichment returns full company data

🤖 Generated with Claude Code

bokelley and others added 2 commits December 31, 2025 18:03
The v2 bulk API requires:
- Each company object must have an `id` string field
- The `requestId` field should not be sent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Lusha v2 bulk API returns company data directly indexed by the
request ID we provided (e.g., {"1": {company data}}), not nested
under data.companies. Also maps field names correctly:
- name (not companyName)
- companySize array [min, max] (not employeeCount)
- revenueRange array [min, max] (not revenue object)
- linkedin (not linkedinUrl)
- specialities (British spelling, not specialties)
- fqdn (may include www. prefix)
- founded as string (not foundedYear as number)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit b10b66b into main Dec 31, 2025
5 of 6 checks passed
bokelley added a commit that referenced this pull request Apr 7, 2026
Add five new storyboards and fix comply() performance for storyboard evaluations.

Storyboard coverage:
- capability_discovery: get_adcp_capabilities validation (#429)
- campaign_governance_denied: hard denial with no escalation (#430)
- campaign_governance_conditions: conditional approval flow (#430)
- campaign_governance_delivery: delivery drift monitoring (#430)
- creative_lifecycle: multi-format sync, list, build, preview (#431)

Comply performance (#433):
- extractScenariosFromStoryboard() extracts comply_scenario values from YAML
- filterToKnownScenarios() validates scenario names against TRACK_SCENARIOS
- Storyboard run endpoint now passes only referenced scenarios to comply(),
  reducing calls from 30+ to 2-5 per storyboard evaluation

Track changes:
- Add campaign_governance track with 5 scenarios
- Add creative_lifecycle to creative track

Closes #429, #430, #431, #433. Partial progress on #432.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Apr 8, 2026
Add five new storyboards and fix comply() performance for storyboard evaluations.

Storyboard coverage:
- capability_discovery: get_adcp_capabilities validation (#429)
- campaign_governance_denied: hard denial with no escalation (#430)
- campaign_governance_conditions: conditional approval flow (#430)
- campaign_governance_delivery: delivery drift monitoring (#430)
- creative_lifecycle: multi-format sync, list, build, preview (#431)

Comply performance (#433):
- extractScenariosFromStoryboard() extracts comply_scenario values from YAML
- filterToKnownScenarios() validates scenario names against TRACK_SCENARIOS
- Storyboard run endpoint now passes only referenced scenarios to comply(),
  reducing calls from 30+ to 2-5 per storyboard evaluation

Track changes:
- Add campaign_governance track with 5 scenarios
- Add creative_lifecycle to creative track

Closes #429, #430, #431, #433. Partial progress on #432.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Apr 8, 2026
* feat: storyboard coverage and comply() scenario filtering

Add five new storyboards and fix comply() performance for storyboard evaluations.

Storyboard coverage:
- capability_discovery: get_adcp_capabilities validation (#429)
- campaign_governance_denied: hard denial with no escalation (#430)
- campaign_governance_conditions: conditional approval flow (#430)
- campaign_governance_delivery: delivery drift monitoring (#430)
- creative_lifecycle: multi-format sync, list, build, preview (#431)

Comply performance (#433):
- extractScenariosFromStoryboard() extracts comply_scenario values from YAML
- filterToKnownScenarios() validates scenario names against TRACK_SCENARIOS
- Storyboard run endpoint now passes only referenced scenarios to comply(),
  reducing calls from 30+ to 2-5 per storyboard evaluation

Track changes:
- Add campaign_governance track with 5 scenarios
- Add creative_lifecycle to creative track

Closes #429, #430, #431, #433. Partial progress on #432.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: add empty changeset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: storyboard-based comply() routing and full protocol coverage

Five new storyboards covering uncovered protocol domains:
- social_platform: accounts, audiences, native creatives, events, financials
- si_session: SI offering discovery, session lifecycle
- brand_rights: identity, rights licensing, creative approval
- property_governance: property list CRUD, delivery validation
- content_standards: standards CRUD, calibration, delivery validation

comply() migration from track-based to storyboard-based routing:
- PLATFORM_STORYBOARDS maps each platform type to recommended storyboards
- comply() accepts storyboards option (priority: scenarios > storyboards > tracks)
- evaluate_agent_quality uses PLATFORM_STORYBOARDS when no explicit tracks
- Heartbeat job uses storyboard routing when agent has a registered platform type
- Compare endpoint now filters to storyboard scenarios

Fixed comply_scenario annotations across all original storyboards:
- Replaced phantom names (account_setup, governance_setup, media_buy_flow)
  with real TestScenario values (full_sales_flow, create_media_buy, etc.)
- Added comply_scenario to all 7 storyboards that had none
- 20/21 storyboards now have test coverage (brand_rights pending #1993)

Validation against training agent filed as issues:
- #1990: capability_discovery creative validation failure
- #1991: creative_ad_server SSE/rate limit errors
- #1992: 15 storyboards skip (agent tool discovery gap)
- #1993: Brand protocol needs @adcp/client scenarios
- #1994: Bulk validation needs backoff

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add compliance to training agent supported_protocols

The capability_discovery scenario fails with "Tools suggest unreported
protocols: compliance (has: [comply_test_controller])" because the
training agent exposes comply_test_controller but doesn't declare
compliance in supported_protocols.

Task retrieval failures (callToolStream over stateless HTTP) tracked
separately in adcontextprotocol/adcp-client#442.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: bump @adcp/client to 4.22.1

Picks up the serve() task store fix (adcp-client#443) and skip counting
fix (adcp-client#441). Local validation shows 20/20 storyboards passing
against the training agent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant