add an unauthenticated read surface for published reviews - #81
Merged
tekrajchhetri merged 1 commit intoAug 13, 2026
Merged
Conversation
Nothing could read a review its author marked Public. Every synth-scholar route
depends on get_current_user, GET /reviews is owner-scoped, and _session_or_404
404s for non-owners — so the public web pages at /knowledge-base/synth-scholar
failed for anonymous visitors and showed signed-in ones their own reviews. The
is_public flag was write-only.
Add /api/synth-scholar/public/reviews{,/{id},/{id}/log,/{id}/export}. Three rules
hold across all four:
* no get_current_user, so an anonymous browser can read them;
* every lookup goes through store.list_public / get_public, which require
is_public AND completed — the filter is in SQL, not the caller, so other
people's drafts are never shipped to a browser to be filtered there;
* an unpublished id answers 404, not 403, so the status code does not confirm
it exists.
list_public skips the runtime-state merge: a completed review has none, and
consulting it would leak progress for a row being re-run.
Export shares one _export_session helper with the authenticated route (the two
were identical past the access check) and one _EXPORT_FORMAT_PATTERN constant, so
a format added for signed-in users cannot silently 400 on a public review.
No behaviour change to the authenticated routes. Nothing new is exposed: the
detail payload already excludes openrouter_api_key from run_request, and these
routes serve only what an author explicitly published.
tekrajchhetri
added a commit
that referenced
this pull request
Aug 13, 2026
…ards, CORS Brings the three commits added after PR #81 was merged. The aiohttp one is the reason ml_service could not boot (gunicorn exit 3), so deploying this branch without it would reintroduce that crash on the next --no-cache rebuild: c970966 survive an unimportable structsense; fail the build instead be4eac8 unpin aiohttp 3.8.6, widen the import guards to Exception 29c1fb0 make the four CORS origin lists identical, add CORS_ALLOWED_ORIGINS
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.
This PR adds public endpoints for listing, viewing, logging, and exporting reviews. Public access:
Requires reviews to be both public and completed, enforced at the SQL/store layer.
Supports anonymous access without exposing drafts or runtime state.
Returns 404 for unpublished reviews to avoid confirming their existence.
Reuses the existing export logic and format validation.
Authenticated routes remain unchanged, and no additional sensitive data is exposed.