Paperful workbench

A local GUI over the same verbs as the CLI. docker compose up (or paperful serve) binds http://127.0.0.1:8765. Zotero remains the catalogue and reader. Grab fetches to out/. Attach writes the library — you press it (manual, the default) or Grab does it (automatic, Settings) when the library can be written.

Status: shipped. Ask is on the default nav (/ask; opt-in [rag] + [llm]). An optional unsigned Firefox add-on saves the page you are reading into out/. The Zotero Connector stays the way to save into Zotero. Hosted SaaS stays later — see ROADMAP — Product split.

Jobs, with screenshots: Walkthroughs (first fill, grow, tidy). Tool catalog: What it does.

Wanted is the home page: missing PDFs selected for Preview, Grab, Attach

Discover: topic filled, ready to search or follow people


Product framing

Three jobs sit on the default nav:

Nav

CLI verbs

Job

Wanted

gaps, run, attach

See missing PDFs, preview fetch, grab to out/, attach chosen copies

Discover

snowball, authorwatch, watches, search

Find new works (topic, person, or web grey hits), review, add metadata parents

Ask

ask, ask --from-file

Cited answers from PDFs already copied to disk (simple / advanced; needs [rag] + [llm] and an index). Per-sentence support vs the index is CLI ask --claim-check (no LLM; not on this page)

Library, Activity, and System support the loop. Repair, Mirror, Index (ingest / search / extract; Briefs is reached from it), Peer review, Suggest edits, Stuff, and Settings appear only when Advanced is on (reveal only; does not enable Scholar, Sci-Hub, or LLM).

  Browser  ──HTTP──►  paperful serve  ──►  paperful.* (same as CLI)
                              │
                              ├── LibraryBackend (Zotero / …)
                              └── Ledger: out/ + state/
  CLI / MCP  ─────────────────┘

Control rules match the CLI: dry-run before bulk fetch, Preview → Grab with a review token (refuse if the library changed), opt-in Scholar / Sci-Hub / LLM / browser-agent. No built-in scheduler — Check again on Discover, not cron.


Shell chrome

Control

Role

Logo

Product lockup (box + Nunito wordmark) links to Wanted; fonts match the public site (Fraunces / Nunito / Source Sans 3), self-hosted under /static/fonts — no third-party requests

Collection chip

Scoped collection (remembered in a cookie)

Preset chip

Open access (oa) or Campus (eoi) — the simple source choice; a browser cookie, not config.toml

Health dot

Worst cached doctor status; links to System. Amber until the first System visit; pages never block on a full doctor

Advanced toggle

Cookie only; reveals extra nav and form fields

Cookies

SameSite=Strict, suffixed with the port when it is not 8765, so two workbenches on one host keep separate chips

Row actions

Icon buttons (detail drawer, set collection scope) with the action name as the tooltip; one shared <dialog> is filled from each row’s inert <template>

Help tips

(i) buttons (keyboard-reachable, aria-describedby tooltip). The prose is the help; ledes stay short

Apply buttons

Any button that posts a review token (Add selected, Apply inbox, Attach held, Recover, Apply ingest-dois, Apply add) is disabled until its Preview has finished

Long lists

Discover uses tabs (Explore / Topic / Grow / People / Web / Queue / Following); Queue paginates. Ask threads and batches, Briefs archives, Wanted Advanced and Waiting-from-Discover, and the Repair queue fold into collapsible sections

Errors

Browser navigations get an HTML error page (404, 403, 409 stale preview, 500 with the one-line cause and links back); API paths keep JSON

Layout

Reflows at 1000 px (nav wraps) and 720 px (forms stack, tables scroll inside their panel); prefers-reduced-motion honoured

Advanced toggle: the nav grows from six pages to thirteen; nothing else changes

Layout: table-first rows, native <dialog> drawer (no embedded PDF viewer). Long jobs return a command id; Activity subscribes to GET /v1/runs/{id}/events (SSE), with JSON poll fallback via GET /v1/runs/{id}. Bind 127.0.0.1. docker compose up publishes 127.0.0.1:8765:8765 only. Non-loopback bind (--host 0.0.0.0) requires --allow-remote-bind and is unauthenticated unless PAPERFUL_UI_TOKEN or serve --ui-token is set — see SECURITY.md. compose.gui.yaml is a no-op shim for older -f compose.gui.yaml --profile gui invocations.


Simple loop

  1. Wanted — first nav item, and GET / lands here. With no collection, or when the library is down, an amber coach line points at System. Missing rows use miss-surface icons (hover for MISS_SURFACE_PLAIN). Held / Have use the same icon+tooltip pattern for PDF verification (doi_match, doi_mismatch, unverified, snapshot; not “% complete”). A Found stamp appears only on doi_match (the PDF’s DOI equals the library item’s); every other file on disk gets a Check stamp. Each Missing row prints its one-line reason under the title (the same MISS_SURFACE_PLAIN text as the tooltip). Report (GET /wanted/report, format=md|json|csv) uses the same stamps, so “N found” equals the number of Found stamps; csv is the misses.csv shape for the cleaning service. A library PDF flag with no file on the mirror (verification missing, “No PDF file on disk”) lands on Missing with the missing-file icon. The default tab is the first non-empty bucket (Missing → Held → Have). Waiting from Discover (panel above the tabs) lists kept queue rows and watch / keepup / authorwatch inbox rows that are not yet in the collection; each row can show a Why suggested line from the candidate’s why. Preview add → Apply add creates metadata parents in this collection (DOI rows only); they then appear under Missing. Title-only rows still need Discover. Preview → Grab (fetch to the out/ folder on this computer; selected vs all; Grab passes the same item_keys as the preview token). Manual (default): Attach writes attachable pending PDFs into Zotero (doi_match and hand-ticked rows on Held with a pending file). The main button skips DOI mismatches and short PDFs (use Advanced Attach to override). CLI paperful run still attaches mismatches unless you pass --strict-pdf-doi. The label reads Attach N PDFs to Zotero when N are pending, Attach selected PDFs once rows are ticked, and Attach PDFs to Zotero (disabled) when N is 0 and no attachable rows are ticked (mismatch/short ticks alone stay disabled on the main button). Attach needs Zotero 10 or newer; on 7–9, attach files in Zotero. Automatic (Settings → After Grab, shown only after at least one successful Attach): Grab also attaches when the library supports write. Zotero 7–9 never receives the file from Paperful. DOI mismatch and short PDF still wait for Attach.

  2. Discover — Tabs: Explore, Topic, Grow (Advanced), People, Web, Queue (map + paginated candidates), Following. Explore: paste a DOI or a title and Open map (an ambiguous title offers a picker and Open map for selected) to land on Queue with a citation map seeded from that one paper. Topic: keyword search (snowball search dry-run queue), then open Queue for per-row Keep/Skip and Preview apply → Add selected (snowball apply, metadata only). Queue rows show Why suggested when the candidate carries a why line. Advanced Topic can also set OpenAlex study designs and listed in (trusted journal lists such as DOAJ or MEDLINE). Membership is the maintainer’s list, not a quality score; works with no journal list never match. Map (on Queue) draws that queue before you open a PDF: older + highly cited is foundational, recent + highly cited is influential, recent + fewer citations may be emerging. OpenAlex study designs (RCT, meta-analysis, …) appear as category badges and filter chips on top of those roles. Click a paper to Keep/Skip or expand one hop (references, or papers that cite it). When a stopping rule is on, Next hop scores those marks and fetches one more hop (snowball continue). Fill PDFs opens Wanted. Briefing / Digest (buttons on Topic once a run exists) write briefing.md / digest.md on the queue (shown on Queue; digests are not auto-created). Search itself redirects to Queue. Advanced can tick File collection note (--apply + collection chip) to file a Zotero collection note tagged paperful:frontier-briefing. Keep an eye on this (on Queue) saves a topic watch only when a snowball profile is chosen; with no saved profile the click returns an error banner — save one on Advanced Topic first. People: create/delete a list, Follow (ORCID + optional backfill), add/edit/remove, resolve, Run list, Get suggestions (method + limit + collection) → tick rows → Accept selected (+ optional Initial seed from date), import CSV/JSON/ORCID or saved social HTML, people briefing (inbox plus OpenAlex recent works / co-authors for pollable members; same markdown as CLI authorwatch briefing); Network panel (ORCID ego co-authorship map, phase slices, D3; [ui].coauthor_network or the Settings checkbox Co-author network on People); inbox uses the same Preview → apply pattern (authorwatch apply). Web: SearXNG grey query (hosts, filetype, max); hit table; Preview apply → Add selected creates metadata parents (paperful search --apply). Save watch / Run stores a URL poll (search watch; you still cron it). Hide with [ui].web_search = "off" or the Settings checkbox Web search on Discover. Unset SearXNG shows an amber hint (no enqueue). PDFs still need Wanted. Check again re-runs a saved topic watch or person list. Topic watches also offer Preview apply / Apply inbox (snowball watch apply). Advanced topic watches offer Watch briefing / Watch digest (same optional collection note). Cron alert loop: keepup.

    Discover Queue: citation map of the last topic run, with read-first list and study-design chips

    Discover Following: saved topic watches and people lists, each with Check again

  3. Library — Nested collection collapsibles with item / missing-PDF counts; target icon sets scope (collection chip) and lands on Wanted. Counts are cached for ten minutes per process (Refresh counts or POST /library/refresh recomputes). Scoped items paginate (default 50 per page; sizes in [ui] — see config.example.toml).

    Library: collection tree with item and missing-PDF counts; the target icon sets the chip

  4. Activity — Command history (started, verb linking back to its page, status dot, duration, result summary or error text) + trust line from last-run.json. Queued and running rows keep polling until they finish (SSE, three reconnects, then JSON; rows older than 30 minutes are left alone). Records left queued/running by a previous process are marked failed (“server restarted before this job finished”) when the workbench starts. The GUI queue holds at most 20 pending jobs; a form submitted past that limit fails (too many queued jobs) rather than silently queueing. ?all=1 shows up to 500 rows.

    Activity: newest jobs first, with status and error columns

  5. System — doctor rows with a status dot; amber/red rows show the next step, green rows show the detail. The first visit runs doctor inline; later visits render from the process cache (“Checked 3 min ago”, stale after ten minutes) and Re-check (POST /system/recheck) runs doctor as a background job, so a slow Camofox or GROBID probe no longer blanks the page.

    System: doctor rows, each with a one-line next step


Advanced surfaces

Same shell; extra verbs call the same domain entrypoints as the CLI. Discover adds snowball kinds (hybrid/doi/orcid/collection), crawl knobs (including Prioritize hop-0 recency / popular / historical, stop rule, stop eps, stop k, stop max screened, and Twenty writeback → cfg.twenty_writeback_listings), profile save/run, resume, briefing, frontier digest, refs gap, ingest-dois (Preview → Apply token), authors, and packs promote. Wanted adds attach overrides (Allow DOI mismatch / Allow short PDF → Preview attach → Attach held PDFs), Preview recover / Recover (from last run: browser_agent_miss, missing, browser_agent_not_found — same as recover --from-last-run-mode), Handoff, Drain inbox, Reachout, plus Grab filters (year / type / retry / try-all / browser-agent / upgrade). Repair Preview runs dry-run then Apply writes: lint (read-only report), fix-metadata, dedupe (Phase select + Include title+year merges), versions, attachments (Fix broken / Merge files / Rename / Link (personal library)), ocr, and screen (retractions, PubPeer, tortured phrases; Apply adds the tag and child note). Apply appears only after a successful Preview of that same verb. Mirror Preview/Apply: sync, snapshot, restore, cache clean. Ask: cited Ask when [rag] and [llm] are on and the index has rows. Mode (simple / advanced) starts at [rag].ask_mode; a change is this run only (Settings does not write it). After an advanced answer the page shows how many passages were scored and kept. Batch Ask (state/ask-batch/) is on the same page when Advanced is on (same Mode select). Focus presets (including conflict), custom prompts (inline, upload, path, or saved under state/prompts/), item keys, types, years, and top-k; batch adds --force and a questions file upload. If the index is empty, Ask offers a compact ingest. Details: rag.md. Index (Advanced): rag ingest / search when [rag] is on; Extract questions (rag questions) and Already answered? (rag answered, state/rq-answered/) use the same scope. Collection chip is the scope. Synthesize on Index when [llm] is on (Preview / Write report; Briefs labels the same pair Dry-run / Write report). Extract sections (extract-sections → state/sections/) is on Index too — mirror PDFs, no [rag].enabled required; optional GROBID checkbox. See rag.md and GROBID.

Index: ingest scoped and a passage search run over ocean/BBNJ

Ask: a cited answer from PDFs already on disk in ocean/BBNJ

Briefs: collection summarize / synthesize when [llm] is on. Synthesize has a Layout control (default, conflict, review; CLI --layout). Ask --focus stays on /ask. Per-item Summarize this / Summarize in Wanted (Held / Have rows) and Library (rows with a PDF) drawers, Advanced and [llm] on. Settings writes config.toml; it does not enable [rag] or [llm]. Fields: Unpaywall email, out/ path, Preset (Open access / Campus), After Grab (Manual / Automatic; shown after the first Attach), Citation map edits (Both / Sidebar only / Popup only / Off), Auto-search PDF after Add to library, Co-author network on People, Web search on Discover.

Briefs: summarize a collection, then synthesize a review with a Layout choice

Peer review (Advanced): pick a collection item or drop a draft (pdf/docx/odt/html/rtf/txt/md/pptx, 40 MB). Writes state/peer-reviews/ (pack.md). Uploads stay under state/peer-reviews/uploads/ and are not imported to out/ or Zotero. Optional review lanes need [llm] (item form also has force-LLM and write-child-note). Checkboxes are labeled by what they return (independent reviewer notes; experiments/clarity/impact; argue against conclusions; review as an outline; claims this text supports, plus held cited-PDF locators when state/rag/text exists; section gaps; compare with this library, three retrieve rounds; compare with published work, goes online). Tooltips hold the lane ids (reviewers, marg, adversary, outline, claims, verify — not a truth check, context, context-web). Checkboxes are independent and pre-check from [peer_review].lanes (or the llm/advanced shims). GROBID sidecar is for MARG-S / claims / verify PDF chunks (pre-checked from [grobid].enabled; ticking it is --grobid even when that setting is false). Optional AI-model checkbox requests a Binoculars extra (git overlay; not installed by default). Optional Vale checkbox runs house-style lint when vale is on PATH. The box is not pre-checked; [peer_review].vale = true still runs the pass. Optional Forensics (PaperGuard) checkbox runs paperguard scan when that binary is on PATH ([peer_review].forensics = true still runs the pass). Show-dismissed is item-only. Not a score. See peer_review.md.

Peer review: library item or uploaded draft, lane checkboxes, recent packs

Suggest edits (Advanced; /rewrite, CLI paperful rewrite): pick a recent peer-review pack, optional replacement draft if the file moved, area/output/comments controls. Writes state/rewrites/ (edit plan, optional sidecar, tracked-changes Word / OpenDocument / PDF). Never overwrites the source. Empty state: Run Peer review first. Style glossary/Vale swaps run with [llm] off. See rewrite.md.

Suggest edits: pick a peer-review pack, choose areas and outputs, optional comments

Review (Advanced route /review, not in the nav; CLI paperful sr) records include / exclude / maybe against a protocol. Apply stays disabled until Preview. See sr-mode.

Stuff (Advanced; /stuff, CLI paperful stuff): pick a collection item or drop a draft. Extra library cites per sentence (manuscript) or outline section. Writes state/stuff/ (pack.md / pack.json). Needs [rag] and a built index; does not need [llm]. Never writes Zotero. --apply stays later. See stuff.md.

Stuff: library item or uploaded draft, lane and k, recent packs

Stays CLI (no GUI control): session login, doctor --guide, mid-run EZProxy re-login, snowball approve-each, collections add, Sci-Hub source toggles; Ask TTY multi-turn, --show-context, named run profiles, ask --claim-check, paperful evidence, and summarize --receipts (Briefs summarize does not turn receipts on). paperful all / named run configs stay workflows.


HTTP capability API (P0 + GUI)

JSON capability routes live on paperful serve (serve.py). HTML + form POSTs are mounted by paperful.ui (mount_ui).

Method

Path

Behaviour

GET

/health

{ok, version}

GET

/v1/doctor

Same as doctor --json

GET

/v1/collections

Collection tree

GET

/v1/runs/last

state/last-run.json

GET

/v1/runs/{id}

GUI command record under state/gui/commands/ (created, started, finished, result)

POST

/system/recheck

Enqueue doctor; redirect /system?run=

POST

/library/refresh

Drop collection-count + scope caches; redirect /library?refresh=1

GET

/v1/runs/{id}/events

SSE status events until done or failed

POST

/v1/refs-gap

Dry-run refs gap envelope

POST

/v1/ask

Same as MCP ask (optional ask_mode; not linked from simple HTML)

POST

/v1/gui/noop

Smoke / readiness for the GUI process

GET

/wanted/report

Read-only stamp cards for the scoped collection (`format=md

POST

/wanted/preview

Review token for Grab (Advanced: year/type/retry/… flags)

POST

/wanted/grab

Consume token; fetch to out/ (item_keys from preview). Attaches only when [ui].attach_mode is auto and the library can write

POST

/wanted/attach/preview

Review token for held PDF attach

POST

/wanted/attach

Selected keys or all attachable pending in scope (no mismatch/short on the main button). review_token: consume Advanced preview

POST

/wanted/recover/preview

Review token for browser-agent recover

POST

/wanted/recover

Consume token; recover

POST

/wanted/handoff

list / tabs / walk / watch (never fetches)

POST

/wanted/inbox/drain

One-shot inbox drain

POST

/wanted/pending-preview

Review token: add Waiting-from-Discover DOIs (metadata only)

POST

/wanted/pending-apply

Consume token; create parents → Missing

POST

/wanted/reachout

Export contact rows; optional RG tabs

POST

/wanted/summarize

Enqueue single-item summarize; redirect ?run=

GET

/item/{key}/summary

Per-item HTML under state/summaries/

POST

/discover/explore

Resolve a DOI or title into an explore queue; open Map (picker when title is ambiguous)

POST

/discover/topic

Enqueue snowball kind (Advanced) or keyword search; redirect /discover?tab=queue&run=

POST

/discover/continue

Next hop: score Keep/Skip marks and fetch one more hop (snowball continue); redirect ?tab=queue&run=

POST

/discover/profile-save

Save snowball profile from the topic form

POST

/discover/refs-gap

Dry-run refs gap pack for the collection chip

POST

/discover/ingest-preview

Classify DOIs / refs-gap pack; review token

POST

/discover/ingest-apply

Consume token; create parents

POST

/discover/authors

Authors frequency (optional --apply pack seed)

POST

/discover/packs-promote

Promote a proposed field author pack

POST

/discover/follow

Follow ORCID into a list (authorwatch run)

GET

/discover/graph

Citation map JSON for run_id (paperful.citation_graph.v1); optional watch_name, compare_run

GET

/discover/graph/meta

Collections/tags plus [ui].citation_map_* prefs for the map panel

POST

/discover/graph/expand

One OpenAlex hop (refs, cites, or both) merged into that queue

POST

/discover/graph/repair

Re-link rows to hop-0 seeds via OpenAlex (Keep unchanged)

POST

/discover/graph/halo

Library neighbours as ghost overlay (mirror DOIs; not queued)

POST

/discover/graph/annotate

Stage tags / note / collection on a queue node (live when already in library)

POST

/discover/graph/add

Add one new candidate to the library; optional Find PDF when citation_map_auto_search

POST

/discover/graph/find-pdf

Grab PDF for one item_key

POST

/discover/graph/remove

Trash library item for a map node (citation_map_remove = trash)

POST

/discover/keep

Mark a queue DOI keep/skip (form POST reloads; format=json or Accept: application/json returns { graph, keep, doi } for the map panel)

POST

/discover/check-again

Re-run topic watch or person list

POST

/discover/resume

Enqueue snowball resume

POST

/discover/profile-run

Enqueue snowball from a named profile

POST

/discover/briefing

Write queue briefing.md; optional collection note

POST

/discover/digest

Write queue digest.md; optional collection note

POST

/discover/watch-briefing

Watch inbox briefing; optional collection note

POST

/discover/watch-digest

Watch digest; optional collection note

POST

/discover/watch

save_watch (profile required)

POST

/discover/apply-preview

Review token for snowball/authorwatch apply

POST

/discover/apply

Consume token; snowball apply / authorwatch apply

POST

/discover/aw/save

Create authorwatch list

POST

/discover/aw/add

Add ORCID (optional display name / affiliation)

POST

/discover/aw/remove

Remove person from list

POST

/discover/aw/resolve

Enqueue authorwatch resolve

POST

/discover/aw/run

Enqueue authorwatch run (optional backfill / caps)

POST

/discover/aw/suggest

Enqueue authorwatch suggest (method, limit, collection)

POST

/discover/aw/accept

Enqueue accept checked suggestions (+ optional seed date)

POST

/discover/aw/edit

Update member display name / affiliation

POST

/discover/aw/delete

Delete list ledger (--yes on CLI)

POST

/discover/aw/import

CSV/JSON/ORCID/saved social HTML upload → list (resolve off); files under state/gui/uploads/

POST

/discover/aw/briefing

Write list briefing.md (inbox + OpenAlex people context)

GET

/discover/network/meta

Saved ORCID ego-network runs (paperful.network.v1)

GET

/discover/network

Graph + metrics for run_id (optional phase)

POST

/discover/network/run

Enqueue network orcid (People tab)

GET

/discover/search/meta

Saved web-search runs (paperful.search.v1) + watches (paperful.search.watch.v1) + whether SearXNG is set

GET

/discover/search

Candidates + summary for run_id

POST

/discover/search/run

Enqueue paperful search (Web tab)

POST

/discover/search/apply

Preview (review token) or apply selected URLs (-C from the collection chip)

POST

/discover/search/watch/save

Save a grey watch (query / hosts / interval)

POST

/discover/search/watch/run

Enqueue search watch run (inbox on disk; no library write)

POST

/prefs/advanced

Toggle Advanced cookie

POST

/prefs/collection

Remember collection chip cookie

POST

/settings

Write allowed config.toml fields

GET

/peer-review

Advanced Peer review: item picker, upload, last pack

POST

/peer-review

Enqueue peer-review for --item or a staged --file; redirect ?run=

GET

/rewrite

Advanced Suggest edits: recent peer-review packs, optional draft, area/output/comments; empty state Run Peer review first

POST

/rewrite

Enqueue rewrite for a pack (optional staged --file); redirect ?run=

GET

/rewrite/download/{name}

Download pack.md / plan.json / sidecar / tracked.docx / .pptx / .odt / .pdf from state/rewrites/

GET

/stuff

Advanced Stuff: item picker, upload, lane/k, last pack

POST

/stuff

Enqueue stuff for --item or a staged --file; redirect ?run=

GET

/stuff/download/{name}

Download pack.md / pack.json from state/stuff/

POST

/repair/preview

Dry-run repair verb + review token

POST

/repair/apply

Consume token; apply repair verb

POST

/mirror/preview

Dry-run mirror verb + review token

POST

/mirror/apply

Consume token; apply mirror verb

GET

/ask

Ask page (threads, cited answer, batch). ?thread= selects a thread

POST

/ask

Enqueue cited Ask turn (ask_mode on the form); redirect to /ask?thread=&run=

POST

/ask/batch

Enqueue batch Ask (ask_mode on the form); redirect /ask?run=

POST

/index/ask

Alias of POST /ask

POST

/index/ask-batch

Alias of POST /ask/batch

POST

/index/ingest

Enqueue rag ingest (Preview dry-run or Build); redirect ?run= (next=ask returns to /ask)

POST

/index/search

Redirect to /index?q= (sync search on GET)

GET

/index/batch/{stamp}

answers.md under state/ask-batch/<stamp>/

POST

/index/rag-questions

Enqueue rag questions (dry-run or write); redirect ?run=

POST

/index/rag-answered

Enqueue rag answered; redirect ?run=

GET

/index/answered/{stamp}

pack.md under state/rq-answered/<stamp>/

POST

/index/synthesize

Enqueue synthesize (dry-run or write); redirect ?run=

POST

/index/extract-sections

Enqueue extract-sections (dry-run or write; optional GROBID / LLM fill); redirect ?run=

GET

/index/report/{slug}

HTML under state/reports/

POST

/briefs/summarize

Enqueue summarize; redirect /briefs?run=

POST

/briefs/synthesize

Enqueue synthesize (dry-run or write); redirect ?run=

GET

/briefs/summary/{key}

HTML under state/summaries/

GET

/briefs/report/{slug}

HTML under state/reports/

HTML routes: /discover, /wanted, /ask, /library, /activity, /system, plus advanced /repair, /mirror, /index, /briefs, /peer-review, /rewrite, /stuff, /settings. GET / → /wanted. /repair/preview and /mirror/preview enqueue work and redirect with ?run=; Apply posts review_token from that command record (stale previews return HTTP 409). GET /index?thread= redirects to /ask?thread=. POST /ask enqueues a cited Ask turn; POST /index/ask is the same handler.

Every POST passes an origin guard first: a request whose Sec-Fetch-Site is cross-site, or whose Origin / Referer host differs from Host, returns 403 {"ok": false, "error": "cross-origin request blocked"} (same-origin forms and header-less curl pass). Every response carries a Content Security Policy (script-src 'self'); the templates have no inline scripts or on*= handlers, and authorwatch list_name values are validated (400) before they reach a template. POST /library/refresh drops the collection-count and scope caches; POST /system/recheck enqueues doctor. The GUI job queue holds at most 20 pending jobs; a submit past that fails (too many queued jobs, HTTP 500) instead of growing the queue — wait for Activity to drain. Writes over HTTP use review tokens under state/gui/reviews/; stale library fingerprints return 409. Discover Add selected / inbox apply, ingest-dois Apply, and Wanted Grab / recover require Preview first (tokens may bake Grab flags). Grab fetches to out/ only; Attach is a separate labelled library write (ticked keys from Wanted, or Advanced preview then apply). Repair / Mirror Apply require Preview first. Keep an eye on this needs an existing snowball profile (save_watch); it does not write an empty watch.json. Long jobs land under state/gui/commands/; Activity streams GET /v1/runs/{id}/events (falls back to polling GET /v1/runs/{id}).

Run status (SSE)

Long GUI jobs write a command record under state/gui/commands/<id>.json (queued → running → done | failed). The workbench opens EventSource on GET /v1/runs/{id}/events (Content-Type: text/event-stream).

Each change emits:

event: status
data: {"ok":true,"id":"…","verb":"…","status":"running",…}

The payload matches GET /v1/runs/{id} (ok plus the on-disk record, including review_token, error, and result when present). The server sends the current record immediately, then pushes again when the ledger file changes; comment heartbeats (: ping) appear about every 15s while the job is still active. The stream closes after a terminal status. Missing ids return 404 JSON (not SSE). workbench.js reloads the page on done / failed and falls back to JSON polling if the stream errors. After a form POST that enqueues work, the redirect includes ?run= (or Wanted Preview uses ?poll=); the target page shows queued / running beside that form until the job finishes.


Non-goals

  • Second Zotero (reader, annotations, collection drag-and-drop)

  • Systematic-review screening as the primary UX

  • Chat-over-library as the default landing

  • Sci-Hub on simple pages or in Preview

  • Replacing Zotero sync or WebDAV