Ad Monetization Readiness Report
A full ad-monetization subsystem for the Open Surface of the DOSFI/MeshInfer ecosystem. Ads run only in the UI layer โ dashboard, marketplace, mesh-native apps, and public pages. The DOSFI Closed Core (scheduler, router, privacy engines, inference, coordinator) is completely untouched. Ads never affect routing, cost, latency, node selection, or privacy-tier logic.
Live system state
Advertiser focus โ enterprise & developer only
This is not a traditional consumer ad network. The category enum restricts inventory to advertisers relevant to mesh developers and enterprise node operators. Each category maps to a real vendor class in the AI infrastructure ecosystem.
Placement inventory โ all 9 slots
AdService schema
| ad_id | string (UUID) โ unique ad identifier |
| title | string โ ad display title |
| description | string โ short ad copy / subtitle |
| image_url | string โ ad creative image URL |
| click_url | string โ destination URL on click |
| category | enum: gpu_hardware, ai_model_provider, enterprise_saas, developer_tooling, security_vendor, cloud_connector, monitoring_tool, node_promotion, app_promotion |
| targeting_rules | object: { region, device_type, developer_tier, app_category } โ ad only shows if viewer matches ALL specified fields |
| placement_keys | array: slots where this ad is eligible (empty = all slots) |
| monetization_type | enum: sponsored, cpc, cpm, partner, marketplace_fee |
| cpc_rate | number โ USD per click (cpc model) |
| cpm_rate | number โ USD per 1000 impressions (cpm model) |
| priority | integer โ higher = shown first when multiple ads match |
| expiration | date-time โ expired ads are never served |
| status | enum: active, paused, expired |
| advertiser_email | string โ owner email for billing attribution |
AdPlacement rules
| placement_id | string (UUID) โ unique placement identifier |
| placement_key | enum: 9 slot keys (dashboard_top, dashboard_sidebar, ...) |
| surface | enum: dashboard, marketplace, mesh_app, public_site |
| ad_id | string (optional) โ pinned ad. If set, this slot always shows this ad. If null, any matching ad fills it. |
| category_filter | string (optional) โ only ads with this category are eligible |
| targeting_rules | object โ placement-level targeting overrides (merged with ad-level at serve time) |
| active | boolean โ whether this slot is currently serving |
Targeting engine logic (getAdsForPlacement)
| Step 1 | Fetch active AdPlacement records for the requested placement_key |
| Step 2 | Fetch all active, non-expired AdService records (sorted by priority desc) |
| Step 3 | Filter by placement_keys โ ad must include this placement_key (if ad.placement_keys is set) |
| Step 4 | Filter by category โ ad.category must match placement.category_filter (if set) |
| Step 5 | Targeting match โ ad.targeting_rules checked against caller context (region, device_type, developer_tier, app_category). ALL specified fields must match. |
| Step 6 | Pinned ads prioritized โ if placement.ad_id is set, that ad goes first |
| Step 7 | Return top N by priority |
UI components added
Monetization models
Flat fee for a fixed time period. Ad shown in a specific placement until expiration. Revenue = flat fee (settled offline).
Advertiser pays per click. Revenue = cpc_rate ร clicks. Tracked via AdMetrics click events.
Advertiser pays per 1000 impressions. Revenue = cpm_rate ร impressions / 1000. Tracked via AdMetrics impression events.
Revenue-share with partner. Ad shown in partner integration slot. Terms settled offline per partner agreement.
Node/app owner pays to promote their listing in the marketplace. Featured + sponsored badges. Flat fee per listing per period.
AdMetrics โ impression, click, conversion tracking
| metric_id | string (UUID) โ unique event identifier |
| ad_id | string โ which ad was shown |
| placement_key | enum โ where the ad was shown |
| event_type | enum: impression, click, conversion |
| user_email | string (optional) โ viewer email (null for anonymous public visitors) |
| region | string โ viewer region at event time |
| device_type | enum โ viewer device type |
| developer_tier | enum โ viewer tier at event time |
| monetization_type | enum โ snapshot of ad monetization model for revenue calc |
| revenue_usd | number โ revenue attributed: cpc click = cpc_rate, cpm impression = cpm_rate/1000, sponsored/partner = 0 per event |
| timestamp | date-time โ when the event occurred |
Privacy & safety โ Closed Core isolation
trackAdEvent reads AdService (for revenue calc), writes only: AdMetrics.
Neither function reads or writes: Node, NodePool, Task, RoutingLog, TelemetryEvent, ShardDirectory, VitalLedger, AuditLog, or any inference/routing/coordinator entity. The Closed Core is untouched.
