docs(spec): the platform app lives in Gitea — static page in custom/public, same-origin API via Traefik, no fork

This commit is contained in:
kert
2026-11-12 14:12:42 -05:00
parent d4ec1ffc73
commit da723a3ed8

View File

@@ -264,7 +264,7 @@ They are the "mapping study" layer of legal epidemiology.
- **S0, now.** Plan A continues: Tasks 7–13 (data, stakes, payment table, assembly and citecheck), 15 (chat) and 16 (golden test). **Task 14's standalone page is folded into S1**, so there is one page rather than two.
- **S1. App shell, Contents, Dossier and Sources (read-only).**
- Covers HOME-VISITS, with URL state, behind SSO, in the existing llm service.
- Covers HOME-VISITS, with URL state, behind SSO, served in Gitea at `git.<domain>/dossier`, with its API from the llm service.
- Acceptance is Plan A's golden home-visit dossier rendered in the app.
- **S2. Review queue, analyst store, job worker and corrections.** Sources management: add source, notes, qualitative codes. This is the Zotero abstraction.
- **S3. Surveillance grid and codebook.** A legal-variable extractor (rules first, local model second), `pfs.code_exposure` generalized to any coded variable, CSV and codebook export.
@@ -320,11 +320,17 @@ All existing repo rules apply:
- NLM/UMLS data never published;
- GPU budget shared with tagging and chat; extraction stays resumable.
### Tech (my call)
### Tech
- **Where it is served:** the existing llm FastAPI service at `/ui/app`.
- **Front end:** one HTML file plus vanilla ES modules and vendored libraries only, with no build step, matching `/ui/search` and `/ui/pdf`.
- **API:** a JSON API under `/api/policy/…` that reads the DuckDB replica (read-only), bib and the analyst store, plus a small write API for analyst actions.
**Where it lives (user decision, 2026-11-12): inside Gitea, as the stack's front door. No Gitea fork.**
- Gitea stays upstream with the fhirworx theme compiled in (`infra/gitea/README.md`: no source changes). Custom templates can only override existing pages, and they cannot read the dossier data, so the app is not a Go template page.
- **The page:** static files in Gitea's bind-mounted custom directory, `infra/gitea/custom/public/assets/dossier/`. That is one `index.html` plus vanilla ES modules and vendored libraries, with no build step.
- It is styled with the compiled fhirworx theme and the HTI-5 tokens that the homelab landing (`templates/homelab/landing.tmpl`) uses, so it looks native.
- It is linked from the Gitea navbar (`custom/extra_links.tmpl`) and from a tile on the homelab landing.
- **The URL:** `git.<domain>/dossier`. A Traefik router on the git host (priority 1000, the same pattern as `git-projects-filter` and `reach-releases`) applies `git-sso` and rewrites the path to `/assets/dossier/index.html`, which Gitea serves. A second router keeps `/assets/dossier/*` behind `git-sso` too. State lives in the URL fragment (`git.<domain>/dossier#/family/HOME-VISITS/timeline`).
- **The API:** same origin, so there is no CORS and the SSO cookie applies. A third Traefik router sends `git.<domain>/dossier/api/…` through `git-sso` and a strip-prefix middleware to the llm FastAPI service. The service exposes a JSON API under `/api/policy/…` that reads the DuckDB replica (read-only), bib and the analyst store, plus a small write API for analyst actions.
- **Caching:** Gitea caches `/assets/` for 6 h. The page loads its modules with a version query string, so a deploy reaches the browser at once.
## Left to the builder