Repository navigation
deploy: prepare Hugging Face and demo API for 1.2.0 - #14
Merged
Merged
Conversation
Synchronise the engine bundled in hf_artifacts/space/reponeedle with the 1.2.0 root package (5 files differed; reponeedle/mcp/ is intentionally not bundled) and update the demo surfaces that run it. - api.py: version metadata, /health and OpenAPI version come from the imported bundled engine (1.2.0). New optional request field enable_experimental_abstention (default false) and an additive `abstention` object in the response. Endpoint paths, the two demo repositories, validation and budget limits are unchanged. 500 responses no longer echo exception text; details go to the server log. - Gradio Space: V1.2.0 labels; unchecked "Enable experimental abstention" control with an uncalibrated/experimental disclosure. Only the selective example opts in, explicitly. Pin fastapi<0.113 in requirements.txt: Gradio 4.x fails to serve with Starlette 1.x (verified with 4.29.0 and 4.44.1). - Static Space: V1.2.0 title, badge and footer; opt-in checkbox (off by default) sent as enable_experimental_abstention; abstention status shown in diagnostics. API URL default and editable field unchanged. - scripts/prepare_hf_release.py: version read from pyproject.toml; bundle must match the root package and version; validates only the selected targets; --dataset-only/--space-only mutually exclusive; refuses to upload the Gradio app into an existing non-Gradio Space; verifies the repository head is the uploaded commit; redacts the token from error messages. - Tests: tests/test_hf_space_bundle.py (bundle sync, Gradio smoke test in a fresh process, release-script safeguards with a fake Hub client); tests/test_public_api.py (version source, bundled-engine import, both repositories, abstention default and opt-in, error redaction). - Docs: deployment guide for 1.2.0 (components, HF repository IDs, version response, deployment order, unchanged dataset, abstention default); clarified the dated note in HF_RELEASE_CHECKLIST.md. For the five non-selective examples, retrieval results are identical before and after the sync. No ranking, routing or packing code, dataset, package version or tag changed. Nothing was uploaded or deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the repository-managed demo artifacts from RepoNeedle 1.1.0 to 1.2.0:
hf_artifacts/space/;api.py);Nothing was uploaded or deployed. No Hugging Face repository or Render setting was changed. The live services still run 1.1.0.
Important
Merging this PR may deploy the API. Render builds the demo API from
main. If auto-deploy is enabled for that service (I can't see Render settings from here), merging will redeployhttps://reponeedle.onrender.comwith 1.2.0. That API is backward compatible with the current static Space: the request field is optional, and the response field is additive. The two Spaces are never auto-deployed; they need manual uploads.Bundled engine sync
hf_artifacts/space/reponeedle/__version__reponeedle/__init__.py,cli.py,core/abstention.py,engine.py,models.py)reponeedle/mcp/The demo runs the bundled engine in a fresh process:
api.pyandapp.pyboth puthf_artifacts/spacefirst onsys.path. Results for all Space examples through the API, before and after the sync:Changes
api.py)/,/healthand the OpenAPI version come from the imported engine'sreponeedle.__version__; there are no hard-coded copies.enable_experimental_abstention(defaultfalse). New additive response objectabstention={enabled, status, experimental: true, calibrated: false}.hf_artifacts/space/)value=False, with an experimental/uncalibrated disclosure (0 of 82 on the ARB v2 selective split).requirements.txtgainsfastapi<0.113(see below). Gradiosdk_version4.29.0 is unchanged.hf_artifacts/static_space/)enable_experimental_abstention. The abstention status appears in the engine diagnostics.https://reponeedle.onrender.com) and the editable URL field are unchanged, and so is the layout.scripts/prepare_hf_release.pypyproject.toml. The bundle must be file-for-file identical to the root package (minusmcp/), and its version must match.--space-onlynever touches the dataset, and--dataset-only/--space-onlyare mutually exclusive.gradio. Previously--org Krishikaxwould have pushed the Gradio README and app over the live static Space.docs/STATIC_PLAYGROUND_DEPLOYMENT.mdnow covers 1.2.0: components, Hugging Face repository IDs, how the static frontend, Render API and bundled engine fit together, the/healthresponse, deployment order, the unchanged dataset, and the abstention default and limitation. The existing security and scope disclosures are kept.HF_RELEASE_CHECKLIST.md: its dated note now says the Space bundled 1.1.0 when the note was added. The historical checklist itself is unchanged.Gradio Space dependency issue (found during smoke testing)
With the current
requirements.txt, the Gradio Space fails to start. Gradio 4.x raisesTypeError: unhashable type: 'dict'from Jinja when serving its page, because unpinned FastAPI pulls Starlette 1.x. I reproduced this with Gradio 4.29.0 (the Space'ssdk_version) and with 4.44.1. It is independent of the engine, so a fresh deploy of the old 1.1.0 Space would fail the same way.fastapi<0.113(Starlette 0.38.6) fixes it on both versions.Hugging Face repository IDs
Krishikax/RepoNeedle-Playgroundkrishikax-reponeedle-playground.hf.spacestatic, running. Itsindex.htmldiffers frommainin one respect: the live API URL field has no default value.RepoNeedle/RepoNeedle-Playgroundprepare_hf_release.pyKrishikax(a member of theRepoNeedleorg), the Hub returns repository-not-found. The README badge currently points to a missing Space.RepoNeedle/RepoNeedle-Benchhttps://reponeedle.onrender.comindex.htmldefault; deployment doc/healthcurrently returns"version":"1.1.0"Testing
tests/test_public_api.py/health={"status":"ok","service":"reponeedle-demo-api","version":"1.2.0"};/and OpenAPI report 1.2.0; a fresh process importshf_artifacts/space/reponeedleat 1.2.0; both repositories retrieve; abstention disabled by default and evaluated on opt-in; explicitfalse= default; non-boolean flag → 422; a 500 doesn't leak details.tests/test_hf_space_bundle.pymcp; versions match; divergence detected; line endings ignored; Gradio app smoke test in a fresh process (both repositories, default off, single explicit opt-in, unchecked checkbox); release script (no upload in check-only, token never printed,--space-onlyskips the dataset, static-Space guard, missing Space created as Gradio, head-commit verification, diverged bundle and version mismatch stop publishing).gradio==4.29.0fromrequirements.txt, launched and called throughgradio_clientFalse. With unpinned FastAPI: startup failure (see above).index.htmlin headless Chrome (Playwright); the default API URL is routed to a localuvicorn api:app, so no live service was contactedConnected · RepoNeedle API 1.2.0; default request sendsfalseand returns context; opt-in sendstrueand abstains with a disclosure;psf/requestsexample works; no horizontal scroll at 390 px; no page errors; no other hosts requested.prepare_hf_release.py --check-only --space-only(authenticated, read-only)--org RepoNeedle: preflight succeeded; the Space doesn't exist yet.--org Krishikax: blocked by the new static-Space guard. Nothing created or uploaded. The token didn't appear in the output.read_project_version(tomllibunavailable)Deployment after merge (manual steps, not done here)
GET /health→"version":"1.2.0".Krishikax/RepoNeedle-Playground. Uploadhf_artifacts/static_space/README.mdandindex.htmlmanually, then check the page shows V1.2.0 and connects to API 1.2.0. This also restores the default API URL, which the live copy lacks.python scripts/prepare_hf_release.py --check-only --space-only, then--space-only.Not changed
v1.2.0tag.requirements-api.txt.Remaining unverified
🤖 Generated with Claude Code