Repository navigation
hub: copy prompt and Use-it become the one line plus --def; catalogue link on every page (v2 plan §9) - #1407
Conversation
|
Adversarial review — hub copy-prompt generator (read-only; not an approval; HELD/draft). Reviewed the generated prompt text for honesty/safety traps. Clean — and it actively avoids several known footguns: < 8000 ul dir="auto">xerj ask --help verify step with expected output (the "every step ends with a verify line" rule).xerj corpus add --from (which is the broken agent path).xerj hub pull line to run once).No neural claim, no over-cap |
…ink the catalogue from every page (v2 plan §9) Corpus Hub v2 plan section 9, hub pages. Edits the generator (gen.py) and its tests; no generated output is committed. HOLD: do not merge until the release that has `xerj ask`. deploy-hub-pages.yml deploys hub.xerj.org on every push to this branch that touches tools/corpus-hub-site/, so merging this puts commands on the live site that no released binary has. Commit 7d7d584 (#1370) made these pages work on the released binary on purpose; this change deliberately ends that, which is why every prompt now opens with `xerj ask --help` (an older build finds out at step 1, not at step 2). What the pages say now - Per-corpus COPY PROMPT: check the CLI (`xerj ask --help`, success: it prints usage), ask `xerj "<your question>" --corpus <slug>` with the three success lines in the renderer's exact shape, the exact form `xerj ask --def <SYMBOL> --corpus <slug>`, the stop-only-your-own-node rule (`xerj hub stop`, never pkill/killall), the no-shell MCP call (`xerj_hub_ask`), and the catalogue. - Per-domain COPY PROMPT: the same, without a corpus name. XERJ routes the question and names the corpus; the domain's corpora are still listed for context, and exit 4 (more than one fits) tells the agent to re-run with `--corpus`. - The "Use it" block on a corpus page: `xerj "your question" --corpus <slug>` and `xerj ask --def SYMBOL --corpus <slug>`, one note, the MCP tool, and a link to the catalogue. - Nav on every page: CATALOGUE -> llms.txt ("the catalogue, one line per corpus", the project's own name for it in landing/llms.txt). The footer's LLMS.TXT link stays. - The generated hub llms.txt follows the same flow: decision rule, the stale-prior frame, the one line, `--def`, `xerj hub pull`, exits 1/3/4, the node rule, where the question goes, MCP and plain HTTP. What is gone: the manifest download (`curl -fsSLO .../<slug>.json`), `xerj corpus add --from`, `xerj corpus index`, `xerj code <slug>` and `xerj_code_search` from every prompt, block and the hub llms.txt, and the HUB_RAW / SETUP_STEPS / add_cmds helpers that built them. A test fails if any of them comes back. One behaviour change beyond the copy: an entry that is not live lane-A (a curated pack, a candidate) no longer shows commands. It has no hub pack, so the old curl/add/index lines could only fail; the block says so and links the catalogue. Verification: python3 tools/corpus-hub-site/test_gen.py (16 passed: the 4 existing plus 12 new, 4 of which run the real generator over the real registry into a temp dir and check every generated page); python3 tools/xerj-code/hub/validate_hub.py (OK, 513 manifests, 515 live); python3 tools/corpus-hub-site/gen.py as deploy-hub-pages.yml runs it. Copy rules kept: no em or en dashes in generated copy (tested), every step names what success looks like, no line over 300 characters above the first command in the hub llms.txt (tested).
`xerj "<question>"` is the bare form of `xerj ask "<question>"` only when the question contains a space (plan §5: argv[1] is not a subcommand, does not start with "-", and contains a space). `xerj compressBound` has no space, so it falls through to the server's argument parser and fails with an error that has nothing to do with the hub. An agent that asks about a single identifier would hit exactly that. The per-corpus and per-domain copy prompts and the hub llms.txt now say so on the line after the one-line command: a question of one word needs `ask` (`xerj ask "<word>"`). The exact-symbol case already has its own form, `xerj ask --def <SYMBOL>`. Tests: the three places assert the note (python3 tools/corpus-hub-site/test_gen.py, 16 passed).
…ls never download Brings the held hub-pages PR (plan §9, §12.2) up to the binary on main, after merging current origin/corpus-hub (no conflict; gen.py had not changed there). Still held until a release with `xerj ask`. What changed, and why: - The answer shape no longer offers `answered from: hosted hub`. The CLI has no hosted client (main.rs -> run_ask(&parsed, None)) and plan §12 takes hosted out of scope for the release. The shape is now what xerj_common::hub::render prints: per hit a header line and the passage, then `answered from: local pack`, then warning lines (observed verbatim on a main build against the real lz4 pack). - The generated hub llms.txt no longer prints https://hub.xerj.org/api/v1/{search,code,def}: no such API exists (those paths return the site's HTML with status 200). The HTTP-only route is now POST <node>/xc-<slug>-*/_search on a node holding a pulled pack, which was run and returns hits. - Copy prompts, the Use-it block and the hub llms.txt say a hub MCP tool reads only packs already on the machine and never downloads; a missing pack returns the `xerj hub pull <slug>` line (observed: "run: xerj hub pull snappy (10.8 MB)"). - Hub llms.txt: every exit code 1-5 (ASK_USAGE, #1491/#1629), xerj_hub_find, per-client MCP registration (Claude Code line, mcpServers, VS Code servers + type stdio), the node rule with --url/$XERJ_URL, and --prefix for local corpora (#1580/#1606). - Exit 1 followed by `closest corpora:` now says re-ask with --corpus: on main, routed free-text questions exit 1 with that line even when the hub holds the answer. - A node the user started refuses to restore a pack (`... not in limits.snapshot_repo_allowlist`); prompts and the hub llms.txt give the verified recovery (point XERJ_URL at an unused loopback port so XERJ starts its own node). - Step 1's success line is the exact first line of `xerj ask --help`. Tests: test_gen.py 19 passed (3 new: no hosted/api-v1 text on any generated page or the hub llms.txt; every exit code, xerj_hub_find, the never-downloads note, per-client MCP keys and --prefix in the hub llms.txt; prompts say a tool never downloads). gen.py generates index, about, 11 category pages, 548 corpus pages; validate_hub.py OK (513 manifests, 3 recipes, 514 live); no line above "Live corpora" over 300 characters.
…j hub pull <slug>` (§12.2) Every live lane-A corpus page now prints `xerj hub pull <slug>` first: it fetches the signed pack, checks SHA-256 + signature, and restores it, and unlike a question it is not limited by the auto-pull size cap. The copy prompt gains the same step 2 with its success line and the exit-3 (failed verification) stop. Pages without a pack still print no command. test_gen.py: 20 passed.
…igned catalogue Resolve conflicts in gen.py (keep v2 CLI/MCP/node copy, take corpus-hub's nav and add CATALOGUE link) and test_gen.py (keep both sides). Only print pull/ask commands for corpora in the live signed catalogue (444 today); live manifests whose pack is not published yet say so instead. Falls back to the previous behaviour when the catalogue cannot be read.
|
Xerj Merger made the fix: the HOLD is lifted because v1.0.0-rc.97 ships |
Refresh 2026-10-19 — STILL HELD (do not merge; see HOLD below)
Rebased onto current
corpus-hub, conflict-free. Content re-verified againstthe shipping hub: one-line
xerj "<question>", the explicit over-capxerj hub pull <slug>step (corpus-hub #1784 — a question will notauto-download a pack over 50 MiB, the explicit pull does), signed / SHA-256
packs, lexical-not-neural honesty, the three MCP hub tools that never
download, per-client MCP registration, and the catalogue link on every page.
No hosted answers and no
/api/v1question routes.test_gen.py: 19 passed.Edits only
tools/corpus-hub-site/(the hub-site generator, which emitshub.xerj.org/llms.txt) — it does not touch
landing/llms.txt.Plan §9, "Hub pages" bullet, plus §12.2: the copy prompt and the "Use it" block become the one line plus the
--defform; the catalogue link is on every page; no page links per-corpus manifest JSON or printsxerj corpus add --from. Generator and tests only; n 8000 othing generated is committed.Update (merged current origin/corpus-hub, no conflicts; gen.py had not changed there)
Checked against the CLI on main b3753dd and corrected:
answered from: … (or: hosted hub)is gone and the generated hubllms.txtno longer printshttps://hub.xerj.org/api/v1/{search,code,def}(no such API exists). HTTP-only route:POST <node>/xc-<slug>-*/_searchon a node holding a pulled pack (run; returns hits).llms.txtsay so; a missing pack returns thexerj hub pull <slug>line (observed:run: xerj hub pull snappy (10.8 MB)).llms.txt: exit codes 1-5 (ASK_USAGE, fix(hub): a build with no hub key says so on every hub surface (exit 5) #1491/fix: hide hub tools without a key, and correct the docs that disagree with the build #1629),xerj_hub_find, per-client MCP registration (Claude Code line,mcpServers, VS Codeservers+"type": "stdio"), the node rule with--url/$XERJ_URL,--prefixfor local corpora (xerj init: the AGENTS.md section and skill it writes never mention --prefix, so agents search ax-* and find nothing #1580/fix(init): hub skill and init closing text show --prefix (#1580) #1606).hub::renderprints it (per hit header + passage, thenanswered from: local pack, then warnings); step 1's success line is the exact first line ofxerj ask --help.… not in limits.snapshot_repo_allowlist); routed free-text questions exit 1 withclosest corpora: …even for "lz4 block format", so the domain prompt and hubllms.txtsay to re-ask with--corpus.Rendered: corpus/lz4.html
"Use it" block (visible text):
The nav on every page carries
<a href="../llms.txt" title="The catalogue: every live corpus, one line each">CATALOGUE</a>(tested on every generated page: 562 HTML files).Both printed commands were run against the real lz4 pack on a main build:
xerj "how does LZ4 frame decompress work" --corpus lz4→ exit 0,lz4 pin 2026-10-02 (15 days old) mixed: BSD-2 (lib) / GPL-2.0+ (rest) lz4/lib/lz4frame.h:186…answered from: local pack;xerj ask --def LZ4_VERSION_RELEASE --corpus lz4→lz4/lib/lz4.h:133,value: 0.Checks
python3 tools/corpus-hub-site/test_gen.pyxerj_hub_find, the never-downloads note, per-client MCP keys and--prefixin the hub llms.txt; prompts say a tool never downloads)python3 tools/corpus-hub-site/gen.pypython3 tools/xerj-code/hub/validate_hub.pyscripts/seogate steps (--checkwhere applicable)landing/, not the hub site, so they only confirm this branch'slanding/is unaffected🤖 Generated with Claude Code