The script was hitting /api/v1/packages/{owner}/container/{name}/versions
which doesn't exist (Gitea returns 404 — interpreting the request as a
version named "versions"). Replaced with the actual endpoint
/api/v1/packages/{owner}/container/{name} which returns the array of
version rows directly. Delete path is now
/api/v1/packages/{owner}/container/{name}/{version} (URL-encoded version
string, not numeric ID).
Refactored the keep-set: always preserve `latest`, top --keep-latest
YYYY.MM.DD date tags AND top --keep-latest short-SHA tags (the rollback
pins) by created_at desc. Anything within --keep-days is kept; older
date/sha tags are deleted. sha256:* blob versions are skipped — Gitea's
internal package GC reclaims them when their last tag goes away.
Also added an explicit User-Agent header because git.jpaul.io sits
behind Cloudflare, whose Bot Fight Mode 403s the default
"Python-urllib/X.Y" UA with error code 1010. Affected run 104's GC
step (curl was fine; urllib was blocked).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 3/6/7/8 in one pass since they depend on each other.
* docs_mcp/server.py
- Wire search_docs / get_page / list_versions tool bodies.
- search_docs flow: BM25 first (rag.bm25 FTS5) → over-fetch RERANK_POOL
chunks → POST to RERANK_URL/v1/rerank → return top-k. Dense is the
fallback when BM25 finds nothing. HYBRID_SEARCH=true switches to
dense+BM25+RRF (fused via the new _rrf_fuse helper).
- All retrieval failures are caught and fall back to the next layer,
so a dead reranker or missing BM25 db never blocks a search.
- Source URLs built from the bundle's docId so results link straight
into support.hpe.com.
* eval/
- 22 hand-curated golden queries grounded in real corpus page titles.
- DenseRetriever / BM25Retriever / HybridRetriever / RerankedRetriever
+ MRR/Recall@K/nDCG@K harness. RERANK_URL env activates the
reranked variants.
- Committed eval/results/baseline.md. On this corpus:
dense: MRR 0.539
bm25: MRR 0.880
hybrid_rrf: MRR 0.692
bm25+rerank: MRR 0.920 (winner)
hybrid_rrf+rerank: MRR 0.875
HPE structured docs use controlled vocabulary, so lexical match
dominates. Hybrid loses because dense pollutes the fused pool.
* scripts/rerank_server.py
- Minimal HTTP /v1/rerank over sentence-transformers
cross-encoder/ms-marco-MiniLM-L-6-v2. Cohere-style request/response.
- This is the dev/CPU fallback; production replaces it with the
llama.cpp + jina-reranker-v2-base GGUF sidecar (same wire protocol).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>