8000 hub: copy prompt and Use-it become the one line plus --def; catalogue link on every page (v2 plan §9) by xerj-org · Pull Request #1407 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

hub: copy prompt and Use-it become the one line plus --def; catalogue link on every page (v2 plan §9) - #1407

Merged
xerj-org merged 5 commits into
corpus-hubfrom
feat/hub-pages-one-line
Oct 21, 2026
Merged

xerj-org merged 5 commits into
corpus-hubfrom
feat/hub-pages-one-line

Conversation

@xerj-org
@xerj-org xerj-org commented Oct 14, 2026 •
Copy link
Copy Markdown
Owner

Refresh 2026-10-19 — STILL HELD (do not merge; see HOLD below)

Rebased onto current corpus-hub, conflict-free. Content re-verified against
the shipping hub: one-line xerj "<question>", the explicit over-cap
xerj hub pull <slug> step (corpus-hub #1784 — a question will not
auto-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/v1 question routes. test_gen.py: 19 passed.
Edits only tools/corpus-hub-site/ (the hub-site generator, which emits
hub.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 --def form; the catalogue link is on every page; no page links per-corpus manifest JSON or prints xerj corpus add --from. Generator and tests only; n 8000 othing generated 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 corpus-hub that touches tools/corpus-hub-site/. Merging this puts xerj ask / xerj "<question>" / xerj hub stop / xerj_hub_ask on the live site. Merge only when a released build has them and plan §12.1 backfill is done: every live lane-A corpus gets a "Use it" block and a copy prompt, but today only lz4 / snappy / zstd have hubpacks and the signed /api/v1/catalogue.json is not deployed (that path returns the site's HTML with 200). Merging before the backfill would advertise ~510 packs that do not exist. Every prompt starts with xerj ask --help, so an agent on an older build finds out at step 1.

Update (merged current origin/corpus-hub, no conflicts; gen.py had not changed there)

Checked against the CLI on main b3753dd and corrected:

Rendered: corpus/lz4.html

"Use it" block (visible text):

xerj "your question" --corpus lz4
xerj ask --def SYMBOL --corpus lz4
One line, no clone and no index: XERJ fetches this corpus's signed, pre-indexed pack the first time, then answers. The answer names the corpus, its pin date and its licence. Use --def for an exact value, signature or default. Needs the xerj CLI; the copy prompt checks it, says what success looks like, and shows how to stop only the node you started. No shell: the MCP tool xerj_hub_ask with corpus: "lz4", once the pack is on the machine (a tool never downloads one). Not sure this is the right corpus? The catalogue lists every one, a line each.

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

check result
python3 tools/corpus-hub-site/test_gen.py 19 passed (3 new: no hosted / api-v1 text on any 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)
python3 tools/corpus-hub-site/gen.py index, about, 11 category pages, 548 corpus pages
python3 tools/xerj-code/hub/validate_hub.py OK: 513 manifests, 3 recipes, 548 backlog rows (514 live)
scripts/seo gate steps (--check where applicable) all exit 0; they cover landing/, not the hub site, so they only confirm this branch's landing/ is unaffected

🤖 Generated with Claude Code

@xerj-org
Copy link
Copy Markdown
Owner Author

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">
  • Every prompt opens with a xerj ask --help verify step with expected output (the "every step ends with a verify line" rule).
  • A copy prompt / "Use it" block is emitted only for a live, lane-A corpus, and the code comments forbid re-introducing xerj corpus add --from (which is the broken agent path).
  • The MCP route is described honestly as never downloading (returns the xerj hub pull line to run once).
  • Safety: "Never pkill or killall xerj — other XERJ nodes may be running" — exactly right given past reference-node kills.
  • No neural claim, no over-cap pull claim. Nothing to change on the honesty axis; only the standard HOLD gate applies.

    xerj-org and others added 5 commits October 19, 2026 14:57
    …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-org
    xerj-org merged commit 3404b3c into corpus-hub Oct 21, 2026
    2 checks passed
    @xerj-org
    Copy link
    Copy Markdown
    Owner Author

    Xerj Merger made the fix: the HOLD is lifted because v1.0.0-rc.97 ships xerj ask (checked against the release binary). I merged corpus-hub in and resolved the conflicts: kept this PR's v2 CLI/MCP/node copy, took corpus-hub's new nav, and added the CATALOGUE link after WHAT'S THIS?. Updated the tests for corpus-hub's newer panels. Replaced the busy-port test with one that checks the node rule (--url, $XERJ_URL, xerj hub stop, never pkill). Added a pack gate: a corpus page prints xerj hub pull/xerj ask --corpus only when the corpus is in the live signed catalogue (444 today). A live manifest whose pack isn't published yet says so and links the catalogue. If the catalogue can't be read, the gate falls back to the old behaviour. Locally: test_gen.py 67/67, gen.py and validate_hub.py OK. The validate check passes.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant

    0