Find a Member: public lookup at /lookup (Marty 2026-11-14)

One box: member ID or wallet address -> member ID, wallet (short, full on
hover + Copy), level and tier, join date, sponsor ID (clickable), direct
referral count, Polygonscan link, public dashboard link. Chain facts only,
never names or emails. RM Circle only; nothing from any other site.

- chain.lookupPublic: served from the indexed state (zero RPC); only a
  position or wallet the index has not seen yet falls back to one eth_call
  (memberId(address) 0x39106821, verified live: 0x7c7D...d3c2 -> 7230)
- /api/public/lookup: own 12/min per-IP limiter, 3-minute answer cache
  (negative answers too), global budget of 60 RPC fallbacks per minute
- page lookup.html + lookup.js (no inline script), ?q= deep links, /find alias
- "Find a Member" in every site footer; chat.js?v=20261114a
- chatbot: canned answer in chat.js + FACT line and Site pages entry in the
  AI system prompt
- tests: qa/lookup-unit.mjs (25), qa/lookup-e2e.mjs (51, desktop + phone,
  CSP, no-email, rate limit) against qa/harness-server.js LOOKUP_SEED

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 12:53:19 -06:00
parent 2549f116aa
commit 0254f933be
40 changed files with 478 additions and 45 deletions
+11
View File
@@ -38,5 +38,16 @@ chain.getOrgRouting = async function () { return null; };
chain.getOrgShare = async function () { return null; };
chain.nextOpenPosition = function () { return 21; };
// LOOKUP_SEED=<file.json>: seed the in-memory index for the /lookup suite, and keep the
// lookup offline (a miss reports not-found instead of reaching a real Polygon RPC).
if (process.env.LOOKUP_SEED) {
chain.__test.setState(JSON.parse(require('fs').readFileSync(process.env.LOOKUP_SEED, 'utf8')));
const realLookup = chain.lookupPublic;
chain.lookupPublic = async function (raw) {
const r = await realLookup(raw, { allowRpc: false });
if (r && r.busy) { global.__lookupRpcFallbacks = (global.__lookupRpcFallbacks || 0) + 1; return { found: false, query: r.query }; }
return r;
};
}
console.log('harness: addr=' + ADDR + ' id=' + ID + ' coldIndex=' + COLD);
require('../server.js');