Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ All notable changes to the Wayforth platform are documented here.
- Wayforth metadata in response headers: `X-Wayforth-Failover`, `X-Wayforth-Original-Service`, `X-Wayforth-Routed-To`, `X-Wayforth-Reason`, `X-Wayforth-WRI`, `X-Wayforth-Cost`, `X-Wayforth-Rail`, `X-Wayforth-Credits-Remaining`
- `?wayforth_wrap=true` opt-in for full `/execute`-style envelope
- Failover on primary degradation: same `SERVICE_ALTERNATIVES` engine as `/execute`; failover reflected in headers and signal row
- Every proxied call writes a `credit_transactions` signal row with all 8 WayforthRank signal fields (`substitution_from`, `substitution_to`, `substitution_reason`, `failure_code`, `output_length_chars`, `model_routing_attempted`, `model_routing_selected`, `task_query_text`)
- Every proxied call writes a `credit_transactions` signal row with substitution, routing, and outcome metadata for analytics
- `X-Wayforth-Agent-ID` header support for agent tagging on proxy calls
- 10 new tests: structural, auth, POST (Serper), GET (OpenWeather), wrap mode, failover unit (4 mock-based async tests verifying headers + signal kwargs)

Expand Down Expand Up @@ -80,7 +80,7 @@ Params, method, response parsing — unchanged.

- SSRF: AssemblyAI, Jina, Firecrawl adapters now validate user-supplied URLs before any HTTP request
- SSRF: Webhook DNS-rebind TOCTOU closed with socket-level IP pinning (post_pinned helper, verified on Python 3.12)
- WayforthRank: All 8 stale MANAGED_TO_CATALOG mappings corrected — health signal routes to canonical rows
- Catalog mappings: All 8 stale MANAGED_TO_CATALOG mappings corrected — health signal routes to canonical rows
- Catalog: Retired services excluded from execute and catalog browse endpoints
- Account deletion: grace period blocks re-authentication; deliberate re-login cancels pending deletion
- Email canonicalization: UNIQUE constraint enforced at DB level (migration 057); all auth lookups normalized
Expand Down Expand Up @@ -124,7 +124,7 @@ Params, method, response parsing — unchanged.

---

## v0.8.6 — WayforthRank integrity — 2026-06-03
## v0.8.6 — Ranking integrity — 2026-06-03

- Fixed slug matcher bug: recalculate now matches `clicked_slug` directly against `services.slug` (was using a name-derived proxy, which hit the wrong duplicate rows)
- Deduped 8 managed service rows with split signal/base history; donor rows soft-retired (`active=false`, reversible)
Expand All @@ -143,7 +143,7 @@ USDC rails are disabled pending proper on-chain settlement; do not re-enable
until the v0.9.0 real-money test sequence.

- Disabled x402 and USDC rails pending proper on-chain settlement implementation (env-gated, default off)
- Stripped shadow execute/search/webhook API from wayforth-rank (now `/health` + `/v1/rank/recalculate` only)
- Stripped shadow execute/search/webhook API from the private rank service (now `/health` + `/v1/rank/recalculate` only)
- Pinned JWT algorithm to {RS256, ES256} from JWKS only; never read `alg` from the token header; pinned issuer
- Closed webhook SSRF DNS-rebind gap (IPv4-mapped-IPv6 unwrap, fail-closed parse, pre-connect re-validation)
- Moved anonymous search counters to Redis; IPv6 /64 keying; fail-closed on Redis loss
Expand All @@ -167,7 +167,7 @@ until the v0.9.0 real-money test sequence.
- DB-level CHECK constraint: `credits_balance >= 0`
- Fixed multi-key credit replenishment vector — users with multiple API keys were eligible for N credit resets per month; now gated to once per calendar month per user regardless of key count

### WayforthRank
### Ranking
- Fixed pioneer `signal_weight` discount — pioneer-routed payment conversions now correctly weighted at 0.75× in both ranking paths (`ranker_client.py` and `search.py`)
- Restored x402 +5 bonus to v1 inline formula in `services/wayforthrank.py` (had silently drifted from `ranker.py`)
- `/admin/rank/recalculate` endpoint fixed (was 500 in production — `wayforth_rank_v2.py` is gitignored and not deployed in API container); formula inlined
Expand Down Expand Up @@ -275,7 +275,7 @@ Signal fields are populated on all three execution paths:

Security hardening release. See PR #12 and PR #13.

### Security fixes (12 total across wayforth + wayforth-rank)
### Security fixes (12 total across the public + private services)

- Pioneer double-award race: atomic `UPDATE … WHERE pioneer_credits_awarded=FALSE RETURNING id`
- Provider boost activation race: atomic `UPDATE … WHERE boost_used=FALSE RETURNING id`
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ python research_agent.py "What are the best vector databases for RAG?"

**What it shows:**
- Natural language service discovery across 2,500+ services
- WayforthRank scoring — best service rises to top automatically
- Reliability scoring — best service rises to top automatically
- WayforthQL structured queries
- Credits-based payment via wayforth_pay()
- The full search → pay attribution loop via query_id
Expand Down
2 changes: 1 addition & 1 deletion infra/migrations/006_search_outcomes.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- WayforthRank data pipeline — search outcomes and analytics
-- Ranking data pipeline — search outcomes and analytics
-- Run in Railway Data tab before deploying

CREATE TABLE IF NOT EXISTS search_outcomes (
Expand Down
2 changes: 1 addition & 1 deletion infra/migrations/045_services_active.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Migration 045 (v0.8.2): soft-delete flag for provider-managed services.
-- DELETE /provider/services/{slug} sets active=FALSE so the service stops
-- surfacing in /search and fallback while its catalog row and WayforthRank
-- surfacing in /search and fallback while its catalog row and ranking
-- signal history are preserved. Defaults TRUE so all existing rows stay live.
ALTER TABLE services
ADD COLUMN IF NOT EXISTS active BOOLEAN NOT NULL DEFAULT TRUE;
Expand Down
4 changes: 2 additions & 2 deletions infra/migrations/058_hosted_agents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CREATE TABLE hosted_agents (
CREATE INDEX idx_hosted_agents_user ON hosted_agents(user_id, created_at DESC);
CREATE INDEX idx_hosted_agents_status ON hosted_agents(status);

-- agent_runs is the primary WayforthRank data path for Cloud.
-- agent_runs is the primary ranking data path for Cloud.
-- Every completed run writes outcome data that feeds the ranking pipeline.
CREATE TABLE agent_runs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
Expand All @@ -63,7 +63,7 @@ CREATE TABLE agent_runs (
-- sum of proxy call charges attributed to this run (from credit_transactions)
credits_total INTEGER DEFAULT 0,
-- credits_compute + credits_proxy
-- WayforthRank signal data (first-class, not bolted-on logging)
-- Ranking signal data (first-class, not bolted-on logging)
services_called JSONB DEFAULT '[]',
-- [{slug, calls, credits_spent, avg_latency_ms}]
failover_events INTEGER DEFAULT 0,
Expand Down
2 changes: 1 addition & 1 deletion scripts/data-fixes/2026-06-03-dedup-managed-services.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Data fix: deduplicate managed services & repair WRI base history
-- Date: 2026-06-03
-- Author: platform / WRI recalibration
-- Context: WayforthRank v2 recalculate was returning 84.0 for several top
-- Context: the rank recalculate was returning 84.0 for several top
-- managed services. Root cause was a "base/clicks split": each of
-- these managed services had TWO rows —
-- * a source='managed'/canonical row that receives the click signal
Expand Down
Loading