Files
SToneX 0fd8c70c67 feat(search): serve the job-first answer to agents (search_experiment v2)
MCP catalog_search answered from the lexical ranker with the v1 judge's say
over it. The judge recovered a quarter of the searches the lexical gate
admitted nothing for and barely moved the rest: its page was the lexical
candidates filtered and reordered, with no vendor the words did not reach, and
an empty page told the agent to try other words, so half of all searches were
followed by another search. The engine behind /catalog/find (recall by job and
by meaning, one judge request, every vendor of a fitting job, a verdict that
can say the catalog lacks it) now answers agents in a new experiment mode.

- search_experiment gains mode v2: arm_for deals v2 as the majority arm, the
  same two holdouts keep the pure lexical and the pure v1 judged page, so v2
  is read against what it replaces. Arms are dealt by team and email where the
  search resolved them (an OAuth token rotates hourly), else by token.
- catalog_find: decide takes the verdict for its rule 8 (a person gets none,
  an agent keyword: its input always means something), an abstain keeps the
  judge's reason, expand returns its groups (expand_groups) and answer_v2
  splits into judge_and_decide and lay_out, so a holdout that only records
  lays out nothing. store gains routed_discovery_on and routed_parent, the
  one reader of each where four were.
- application/catalog_search lays the answer out for an agent (agent_page):
  the best limit // 2 jobs, rows dealt round-robin and laid out job by job,
  members the judge rated on their own leading their job, a routed parent
  leading a strong or closest job's group, a listed hub tool joining its job
  with no lexical gate, and per job the vendors the page left out.
- The verdicts an agent sees: strong, closest, name, and none only for a
  catalog gap (an empty page that says so, with catalog_request and no near
  misses). Not-a-task, an abstaining judge, a failure or a caller past the new
  per-caller cap (search_judge_max_per_caller_hour, the only bound on what an
  unmetered search can spend; it guards every dealt caller before any judge)
  serve the lexical page under keyword.
- The response adds verdict, reason, jobs, and per row job and more_providers;
  score is null on a judged answer (no probability reaches an agent); the hint
  says only what to do next. Both MCP surfaces answer alike.
- SearchLog: every served row records its job in every mode, so the report
  credits a call to any vendor of a job the page showed (a v2 hint sends the
  agent there); v2 rows carry find's readings and the verdict; the lexical
  holdout still has v2 judged and recorded, the counterfactual on a false
  none. The report gains conversion by job per arm and verdict, calls after a
  none, and the re-query rate per verdict.
- scripts/search_agent_bench.py scores the v2 answer offline against searches
  agents made and what they called next (job-hit, hit@limit, false-none by
  arm), beside the pages the log served, on find_bench's harness (the judge
  and the query vectors cached on disk, the card vectors warmed once).
- find_index: stored vectors decode as arrays, the index builds off the loop.

The HTTP route and the CLI still answer from the lexical ranker; they follow
once the route's hub read holds no session through a judge call and the CLI
sends its token.

Fragments: search-experiment.md, find.md, catalog.md, mcp-oauth.md; llms.txt
and skill.md (and the generated SKILL.md copies) say what the verdict means.
2026-10-01 20:19:52 +08:00

7.1 KiB
Raw Permalink Blame History

tools-registry — design fragments

Small, focused fragments that mirror the codebase. Each declares the source files it covers (frontmatter sources:). Regenerate this index with python3 .claude/skills/tools-registry-context/scripts/build-map.py.

Foundation

Fragment Status Covers
Tools Registry — charter (what it is, why, the proxy model) foundational 2026-06-30-jason-tools-registry.md, README.md

Architecture (proxy, auth, data model)

Fragment Status Covers
Google Ads conversion tracking — capture, outbox, upload shipped adsconv.py, signup.py, adtrack.js, gtag.js
Archive - versioned history and cache admission building archive.py, hunter.yaml, results.py, 0031_archive_result_admission.py, …
Auth & secrets — injectors, encryption, OAuth freshness, health shipped injectors.py, ssrf.py, crypto.py, oauth.py, …
Endpoint catalog — what you can DO with a connected key, and which provider should do it shipped fetchinio.yaml, fetchinio.svg, fetchinio.linkedin.user.profile.json, fetchinio.linkedin.company.profile.json, …
Application composition and deployment roles shipped bootstrap.py, bootstrap_handlers.py, bootstrap_http.py, call_surface.py, …
Data model — the registry tables, async DB, audit writer shipped 0042_pinned_read_scope.py, alembic.ini, env.py, 0001_baseline_current_schema.py, …
Feedback - private intake for problems and suggestions shipped feedback_contract.py, __init__.py, reports.py, reviews.py, …
Find tools for a job - /catalog/find, recall by job and one judge request building catalog_find.py, find_recall.py, find_index.py, embed.py, …
The tool hub — tools a maker publishes, made of other tools built (phases 1–10, 2026-09-09/14; pricing flexibility 9.1–9.5 (docs/hub-pricing-decisions.md), listing + public run log 10.1–10.5 (docs/hub-listing-decisions.md)); behind hub_enabled (TREG_HUB_ENABLED), off in production until the final merge __init__.py, manifest.py, refs.py, graph.py, …
Enforced import boundaries shipped pyproject.toml, ci.yml, __init__.py, __init__.py, …
Instagram OAuth — direct Login and optional Facebook Page tools built; Meta configuration and live verification pending catalog_ingest.py, access.py, resolve.py, service.py, …
Local proxy — catch a program's own outgoing calls (treg <command>) shipped localproxy.py, server.js
Local CLI runs — run a vendor CLI as a dedicated user with a server-held credential (treg run) shipped localrun.py, egress.py, fsjail.py
MCP — the front door for assistants, and treg as an OAuth authorization server shipped auth.py, mcp.py, health.py, mcp_oauth.py, …
Media hosting - reference files a vendor can fetch (treg host) shipped media.py, media.py, models.py, 0037_media_hosting.py, …
Money — prepaid balance, the ledger, Stripe, and the reports that check it shipped tavily.yaml, tinyfish.yaml, test_tinyfish.py, __init__.py, …
Multi-tenancy — orgs, memberships, invites, per-org scoping shipped access.py, 0042_pinned_read_scope.py, test_pinned_read_scope.py, models.py, …
The proxy — faithful credential-injecting relay + tool resolution shipped relay.py, ssrf.py, api.py, authorize.py, …
Discovery experiment — a relevance judge behind catalog search, measured on what the caller does next; the job-first answer served to agents building catalog_search.py, search_experiment.py, interleave.py, judge.py, …
Super-admin — cross-tenant read + control shipped api.py, admin.py, evidence_retention.py, access.py, …
The table layer — one call, answered as rows and columns (/table/) built, behind table_enabled (TREG_TABLE_ENABLED), off by default __init__.py, table.py, table.py, call.py, …

Interfaces (API · CLI · skill)

Fragment Status Covers
The API — the only brain (FastAPI) shipped media.py, sitetrack.js, api.py, bootstrap_handlers.py, …
Catalog browse taxonomy — open placement and naming decisions backlog —
The CLI (treg) + skill scaffolding shipped cli.py, test_released_cli_compat.py, test_cli_key_compatibility.py, auth_helpers.py, …
The web dashboard (served from FastAPI) shipped App.vue, views.ts, controller.js, base.css, …
Enrich Arena — paid comparisons, one-click feedback, and visible waterfalls shipped arena.py, arena.py, arena.py, models.py, …
Import — scan a .env AND/OR a skills dir, auto-register as tools + bundles in-progress providers.py, skills.py
Landing sandbox backend - front-end entry removed shipped sandbox.py, sandbox_identity.py, pubfeed.py, sandbox.py, …
Onboarding — the first-run demo team (dashboard + CLI) shipped auth.py, __init__.py, demo.py, cli.py, …
Search surfaces — robots, sitemap, the crawlable catalog, and the social card shipped api.py, web.py, agent_pages.py, robots.txt, …
Shell mode (treg shell) — transparent CLI interception shipped shell.py, cli.py
Test cases for the ChatGPT plugin submission reference —
Tool justifications for the ChatGPT plugin submission reference —
The shippable tools-registry skill (3 personas) shipped skill.md, SKILL.md, SKILL.md, web.py, …

Ops (deploy, scale)

Fragment Status Covers
Provider capacity — knowing what treg's own vendor accounts have left shipped __init__.py, collectors.py, policy.py, sweep.py, …
Running & deploying the server shipped pyproject.toml, hatch_build.py, build-dashboard.sh, build-web.sh, …

Reference

Fragment Status Covers
Glossary reference 2026-06-30-jason-tools-registry.md

guides

Fragment Status Covers
Expanding a catalog category — the add-a-provider playbook guide oauth_providers.py, authorization.py, oauth_flow.py, oauth_exchange.py, …