From 25162e2e56b4e4dc03feb16bad841ae92da8f79d Mon Sep 17 00:00:00 2001 From: MytelligentPRV Date: Sat, 27 Jun 2026 11:27:49 -0700 Subject: [PATCH] chore(scrub): generalize signal-revealing WayforthRank name refs in docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #64. Scrubs the trade-secret NAME only where it REVEALS HOW RANKING WORKS (per the signal-revealing-vs-IP-assertion split): • CHANGELOG.md — dropped the enumerated 8 signal fields + generalized the name • infra/migrations 006/045/058 — 'WayforthRank data pipeline/signal data' -> 'Ranking …' • examples/README.md — 'WayforthRank scoring' -> 'Reliability scoring' • scripts/data-fixes/…dedup — dropped 'WayforthRank v2' from the context note KEPT (intentional IP signposting — asserts the trade secret is deliberately private, good posture, NOT a leak): CONTRIBUTING.md, .gitignore, routers/admin/rank.py, and tests/test_pioneer_boost.py (references the gitignored compute_wri_v2 by name in a private-by-default stub-when-absent pattern; exposes no formula). Docs/SQL-comments only — no code, no behavior change. After this, WayforthRank/WRI appears in tracked code ONLY in those 4 intentional locations. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 12 ++++++------ examples/README.md | 2 +- infra/migrations/006_search_outcomes.sql | 2 +- infra/migrations/045_services_active.sql | 2 +- infra/migrations/058_hosted_agents.sql | 4 ++-- .../data-fixes/2026-06-03-dedup-managed-services.sql | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 032192d..539ea8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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 @@ -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) @@ -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 @@ -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 @@ -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` diff --git a/examples/README.md b/examples/README.md index 8a2f7ad..a4ba65b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 diff --git a/infra/migrations/006_search_outcomes.sql b/infra/migrations/006_search_outcomes.sql index f235541..8752dff 100644 --- a/infra/migrations/006_search_outcomes.sql +++ b/infra/migrations/006_search_outcomes.sql @@ -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 ( diff --git a/infra/migrations/045_services_active.sql b/infra/migrations/045_services_active.sql index 05342cf..42d233b 100644 --- a/infra/migrations/045_services_active.sql +++ b/infra/migrations/045_services_active.sql @@ -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; diff --git a/infra/migrations/058_hosted_agents.sql b/infra/migrations/058_hosted_agents.sql index 5c95798..c45ca38 100644 --- a/infra/migrations/058_hosted_agents.sql +++ b/infra/migrations/058_hosted_agents.sql @@ -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(), @@ -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, diff --git a/scripts/data-fixes/2026-06-03-dedup-managed-services.sql b/scripts/data-fixes/2026-06-03-dedup-managed-services.sql index bc75abb..d536f04 100644 --- a/scripts/data-fixes/2026-06-03-dedup-managed-services.sql +++ b/scripts/data-fixes/2026-06-03-dedup-managed-services.sql @@ -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