Skip to content

chore(scrub): remove WRI formula copies from public code + canary TODO - #64

Merged
WayforthOfficial merged 1 commit into
mainfrom
chore/scrub-public-wri-leak
Jun 27, 2026
Merged

chore(scrub): remove WRI formula copies from public code + canary TODO#64
WayforthOfficial merged 1 commit into
mainfrom
chore/scrub-public-wri-leak

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

Staged for review — the formula scrub (#1) + canary (#2). No merge.

Correction first (important)

My initial headline — "the full v2 formula is public" — was wrong. wayforth_rank_v2.py and ranker.py (the real formulas) are gitignored/private (.gitignore:48-49) — a working-tree file isn't a public file. The crown-jewel v2 algorithm is not exposed.

What WAS public (and is now scrubbed) — the simpler heuristic, copied into 5 tracked files

Your "assume another copy" was right three times over: the simple weight formula (base 50, tier +20/+5, failures +20/+10, x402 +5, payment +min(×2,8)) was in:

  • apps/api/routers/search/catalog.py — a live /search router (the one that mattered most)
  • apps/crawler/health_monitor.py, backfill_v2.py, backfill_v7.py, fix_backfill.py

All now defer to the private rank service (RANK_SERVICE_URL) and return an interim placeholder — no signal weights in any public container. Renamed compute_wri_simple_interim_score, run_wri_recalculaterun_rank_recalculate; scrubbed promoter.py prose. Kept the output-contract names (wri_score, X-Wayforth-WRI headers, *_wri_alert webhooks, boost_wri_bonus) — already public via the gateway API, same distinction as the mcp scrub. Also removed the TODO(canary) unannounced-gap framing.

Acceptance — grep-clean proof

git grep over tracked (public) code for formula/weights/compute_wri* = ZERO (the kept output-contract names excluded). wayforth-ts + x402 repos: clean (code search returned nothing). Full suite green: 593 passed.

NOT in this PR — a scope decision for you (the NAME, not the formula)

WayforthRank/WRI still appears in ~10 docs/migrations/tests, which splits into:

  • Arguably fine / intentionalCONTRIBUTING.md, .gitignore, admin/rank.py assert the formula is private ("the ranking engine is proprietary closed-source", "weights stay out of this public container"). That's good posture, not a leak.
  • Signal-revealing (worth scrubbing)CHANGELOG.md lists the 8 signal fields that feed the ranking; examples/README.md, migrations 006/045/058, a data-fix script name the pipeline.
  • A test_pioneer_boost.py references the gitignored compute_wri_v2 (it stubs it when absent).

Your call on how far to scrub the name (everywhere, or keep the "it's private" assertions and scrub only the signal-revealing ones) — I didn't touch docs/migrations unilaterally.

🤖 Generated with Claude Code

The real leak #46 missed — but NOT what it first looked like. The v2 production
formula (wayforth_rank_v2.py, ranker.py) is GITIGNORED (private); those are not public.
What WAS public: the SIMPLER heuristic formula copied into FIVE tracked files —
catalog.py (a LIVE /search router), plus crawler health_monitor / backfill_v2 /
backfill_v7 / fix_backfill — each exposing the weights (base 50, tier +20/+5,
failures +20/+10, x402 +5, payment +min(*2,8)).

Scrubbed: every public copy now defers to the private rank service (RANK_SERVICE_URL,
recalculated via promoter.run_rank_recalculate) and returns an interim placeholder —
no signal weights in any public container. Renamed compute_wri_simple -> _interim_score
and run_wri_recalculate -> run_rank_recalculate; scrubbed promoter prose. KEPT the
output-contract names (wri_score, X-Wayforth-WRI headers, *_wri_alert webhooks,
boost_wri_bonus) — already public via the gateway API, same call as the mcp scrub.

Also removed the unannounced-gap TODO(canary) framing from deps_live_proof.py.

ACCEPTANCE: git grep over tracked (public) code = ZERO formula/weights/compute_wri
fingerprints. wayforth-ts + x402 repos: clean (code search). Full suite green (593).

NOT in this PR (separate decision): the trade-secret NAME 'WayforthRank'/'WRI' still
appears in ~10 docs/migrations/tests — some intentional boundary-disclosure
(CONTRIBUTING/.gitignore/admin assert 'the formula is private'), some signal-revealing
(CHANGELOG lists the 8 signals). Reported for a scope decision before touching docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to wayforth / wayforth-pr-64 June 27, 2026 18:21 Destroyed
@WayforthOfficial
WayforthOfficial merged commit 0581c8d into main Jun 27, 2026
3 of 4 checks passed
@WayforthOfficial
WayforthOfficial deleted the chore/scrub-public-wri-leak branch June 27, 2026 18:24
WayforthOfficial added a commit that referenced this pull request Jun 27, 2026
…ocs (#65)

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: MytelligentPRV <assulindor@gmail.com>
Co-authored-by: Claude Opus 4.8 (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.

2 participants