Skip to content

DealJockey MVP: Phase 4A + 4B (Templates & Seller Integration)#75

Open
atc964 wants to merge 11 commits intomainfrom
test/dealjockey-v1-e2e
Open

DealJockey MVP: Phase 4A + 4B (Templates & Seller Integration)#75
atc964 wants to merge 11 commits intomainfrom
test/dealjockey-v1-e2e

Conversation

@atc964
Copy link
Collaborator

@atc964 atc964 commented Mar 23, 2026

Summary

DealJockey MVP — deal portfolio management agent for the buyer system. This combines Phase 4A (core MVP) and Phase 4B (templates & seller integration) into a single release.

Phase 4A — MVP DealJockey

  • Deal library schema v2 (deal_templates, supply_path_templates, supply_chain_nodes, deal_activations tables)
  • CSV deal import parser
  • Manual deal entry
  • Portfolio inspection tools (list, search, summary, inspect)
  • DealJockey L2 agent scaffolding
  • DealJockey event types

Phase 4B — Templates & Seller Integration

  • Deal template and supply path template CRUD tools
  • AnalyzeSupplyPathTool for multi-dimensional supply path scoring
  • InstantiateDealFromTemplateTool for template-based deal booking via seller API
  • Extract deal-booking logic into booking/ modules
  • Seller API endpoints: supply-chain, from-template, performance (implemented in prior PRs)
  • Cleanup: remove unused imports, refactor inline tier discount to PricingCalculator
  • Fix default_price missing from deal template update and schema

Test plan

  • 274 new tests across all DealJockey features
  • 1364 total tests passing
  • Quinn verified all 3 waves
  • 105/105 smoke tests passed

🤖 Generated with Claude Code

atc964 and others added 11 commits March 19, 2026 08:51
Create ad_buyer.booking package consolidating duplicated pricing,
deal ID generation, and quote flow logic from unified_client.py,
request_deal.py, and get_pricing.py into reusable modules.

New modules:
- booking/pricing.py: PricingCalculator with tier + volume discounts
- booking/deal_id.py: generate_deal_id() utility
- booking/quote_flow.py: QuoteFlowClient for deal data construction
- booking/template_flow.py: TemplateFlowClient stub

Refactored consumers to use centralized modules:
- unified_client.py get_pricing/request_deal
- tools/dsp/request_deal.py _create_deal_response
- tools/dsp/get_pricing.py _format_pricing

31 new tests, 1424 existing tests pass (0 regressions).

bead: buyer-te6b.1.6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements deal template and supply path template management for
DealJockey (Strategic Plan Sections 6.3 and 6.4):

- Schema v3: deal_templates and supply_path_templates tables with
  indexes and migration from v2
- DealStore: full CRUD methods for both template types
- ManageDealTemplateTool: create/read/list/update/delete deal templates
  with optional advertiser_id scoping (null = agency-wide)
- ManageSupplyPathTemplateTool: create/read/list/update/delete supply
  path templates with scoring_weights validation (sum must equal 1.0)
- 33 new tests covering all CRUD operations, validation, and edge cases
- Updated schema version tests and dashboard test for v3

bead: buyer-te6b.1.13

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

- unified_client.py: remove unused generate_deal_id import (buyer-d9p)
- discover_inventory.py: replace inline tier discount math with
  PricingCalculator from booking module (buyer-pnf)
- Add tests verifying tiered price calculation in discovery results

bead: buyer-d9p, buyer-pnf

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements weighted scoring of supply paths on 4 dimensions:
transparency (schain completeness), fee (intermediary cost), trust
(seller reputation), and performance (historical delivery metrics).

Supports scoring from raw supply path data or by deal_id lookup,
comparing multiple paths with ranking, and custom weights from a
supply_path_template. Default weights: transparency=0.25, fee=0.35,
trust=0.20, performance=0.20.

22 tests covering scoring, custom weights, deal lookup, missing data
handling, and multi-path ranking.

bead: buyer-te6b.2.7

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements buyer-te6b.2.8: creates deals from stored deal templates
by reading the template, applying optional overrides (pricing, targeting,
flight dates), calling the seller API via internal booking modules,
storing the new deal in the portfolio, and emitting deal.template_created
event. Handles rejections with seller floor price details.

18 tests cover: successful instantiation, rejection handling, template
not found, override application, event emission, portfolio storage,
seller API errors, and CrewAI tool wrapper.

bead: buyer-te6b.2.8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
default_price was not a column in the deal_templates table, not in the
allowed set in update_deal_template(), and not passed through in
save_deal_template(). An LLM caller passing default_price to the update
action would get a silent failure reported as "not found". This adds the
column end-to-end: schema, INSERT, UPDATE allowed set, tool create
pass-through, input schema description, and formatted read output.

bead: buyer-5wx

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