Codex Codex commited on
Commit ·
3072bfd
1
Parent(s): 4d757c0
Add handoff docs, commit author rules, and fix Field Notes badge.
Browse filesPublish remaining-work checklist and message for Dimitris. Document that all agent commits must be authored by Codex.
Co-authored-by: Codex <chatgpt-codex-connector[bot]@users.noreply.github.com>
- app.py +1 -1
- docs/COMMIT_AUTHORS.md +30 -0
- docs/MESSAGE_TO_DIMITRIS.md +16 -0
- docs/REMAINING_WORK.md +153 -0
app.py
CHANGED
|
@@ -230,7 +230,7 @@ def hero_hackathon_panel_html() -> str:
|
|
| 230 |
(
|
| 231 |
"📓",
|
| 232 |
"Field Notes",
|
| 233 |
-
"
|
| 234 |
),
|
| 235 |
]
|
| 236 |
badge_items = "\n".join(
|
|
|
|
| 230 |
(
|
| 231 |
"📓",
|
| 232 |
"Field Notes",
|
| 233 |
+
"README, runbook, and eval docs capture how the app was built and how to run it.",
|
| 234 |
),
|
| 235 |
]
|
| 236 |
badge_items = "\n".join(
|
docs/COMMIT_AUTHORS.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Commit authorship
|
| 2 |
+
|
| 3 |
+
## Codex (agent) commits
|
| 4 |
+
|
| 5 |
+
All agent-generated commits must use:
|
| 6 |
+
|
| 7 |
+
```text
|
| 8 |
+
Author: Codex <chatgpt-codex-connector[bot]@users.noreply.github.com>
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
Example:
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
git -c user.name="Codex" \
|
| 15 |
+
-c user.email="chatgpt-codex-connector[bot]@users.noreply.github.com" \
|
| 16 |
+
commit -m "$(cat <<'EOF'
|
| 17 |
+
Your message here.
|
| 18 |
+
|
| 19 |
+
Co-authored-by: Codex <chatgpt-codex-connector[bot]@users.noreply.github.com>
|
| 20 |
+
EOF
|
| 21 |
+
)"
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
Do **not** use:
|
| 25 |
+
|
| 26 |
+
- `Cursor <cursoragent@cursor.com>`
|
| 27 |
+
- `chatgpt-codex-connector[bot]` as the author name without the `Codex` display name
|
| 28 |
+
- `Codex <codex@openai.com>` (legacy; rewritten in history)
|
| 29 |
+
|
| 30 |
+
Human commits (`ro_d`, `Dimitris`) stay on their own identities. Agent work is attributed to **Codex** only.
|
docs/MESSAGE_TO_DIMITRIS.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Message to Dimitris (copy-paste)
|
| 2 |
+
|
| 3 |
+
Hi Dimitris — here’s what’s left before submission. Full checklist for you and your agents: **`docs/REMAINING_WORK.md`**.
|
| 4 |
+
|
| 5 |
+
**Priority order:** custom model → copy pass → KB + videos (agents) → article → demo video.
|
| 6 |
+
|
| 7 |
+
1. **Custom model** — Publish/confirm the fine-tuned MiniCPM-V on Hub, set `ZEROGPU_MODEL_ID` on the Space, test real PDFs, run `modal_eval` for before/after numbers.
|
| 8 |
+
2. **Copy** — Tighten hero, trace steps, and README; fix badge claims (Well-Tuned only after model swap).
|
| 9 |
+
3. **Knowledge graph** — Expand beyond 107 markers via `markers.py` + `expand_lab_knowledge_graph.py` (agent task).
|
| 10 |
+
4. **Videos** — Replace reused YouTube URLs with marker/category-specific explainers (agent task).
|
| 11 |
+
5. **Article** — Problem → architecture → fine-tune proof → limitations + Space link.
|
| 12 |
+
6. **Demo video** — Laytimely-style: AI voice + screen recording + background music; record after 1–2 are done.
|
| 13 |
+
|
| 14 |
+
**Current baseline:** Space runs base OpenBMB model; KG has 107 markers; only 2/13 real eval reports labeled; article and demo not started.
|
| 15 |
+
|
| 16 |
+
Ping me when the model is on the Space or if you want me on copy/KB review.
|
docs/REMAINING_WORK.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Blood Test Explainer — Remaining Work
|
| 2 |
+
|
| 3 |
+
**For:** Dimitris + agents
|
| 4 |
+
**Repo:** `r0m4k/blood-test-explainer`
|
| 5 |
+
**Space:** `build-small-hackathon/blood-test-explainer`
|
| 6 |
+
**Last updated:** 2026-06-13
|
| 7 |
+
**Suggested order:** 1 → 2 → 3 & 4 (parallel) → 5 → 6
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
## Status snapshot
|
| 12 |
+
|
| 13 |
+
| Area | Now |
|
| 14 |
+
|---|---|
|
| 15 |
+
| Space / app | Live on Transformers (`openbmb/MiniCPM-V-4.6`) |
|
| 16 |
+
| Knowledge graph | 107 markers in `kb/cbc_knowledge_graph.json` |
|
| 17 |
+
| Marker videos | All 107 have `video_url`; ~44 unique YouTube IDs (many reused) |
|
| 18 |
+
| Real eval labels | 2/13 reports fully labeled in `eval/data/real/labels.jsonl` |
|
| 19 |
+
| Fine-tune pipeline | `train/modal_finetune.py` → merge → Hub push |
|
| 20 |
+
| Article / demo video | Not started |
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## 1. Insert the custom model
|
| 25 |
+
|
| 26 |
+
**Owner:** Dimitris (Modal + HF Space vars)
|
| 27 |
+
|
| 28 |
+
- [ ] Confirm fine-tuned Transformers repo on Hub (e.g. `dimitriskalligaridis/blood-test-minicpmv-4_6`) loads with `transformers[torch]==5.7.0`
|
| 29 |
+
- [ ] If not published yet: finish labeling → `modal run train/modal_finetune.py::main --real-labels eval/data/real/labels_train.jsonl` → `modal run train/modal_finetune.py::merge --repo-id <owner>/<name>`
|
| 30 |
+
- [ ] Set HF Space variables:
|
| 31 |
+
```bash
|
| 32 |
+
EXTRACTOR_BACKEND=transformers
|
| 33 |
+
ZEROGPU_MODEL_ID=<fine-tuned-repo>
|
| 34 |
+
```
|
| 35 |
+
- [ ] Rebuild Space; test 2–3 PDFs from `eval/data/real/`
|
| 36 |
+
- [ ] Run before/after eval: `modal run train/modal_eval.py::compare --finetuned-id <repo>` → save `eval/before_after.json`
|
| 37 |
+
- [ ] *(Optional, Llama badge only)* GGUF via `scripts/convert_to_gguf.sh` + `LLAMACPP_VISION=1` vars (see `README.md`)
|
| 38 |
+
|
| 39 |
+
**Done when:** Space uses custom model; we have a before/after metric for the article.
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## 2. Fine-tune app wording
|
| 44 |
+
|
| 45 |
+
**Owner:** Dimitris or copy agent
|
| 46 |
+
|
| 47 |
+
**Edit:** `app.py` (hero, upload hints, status, disclaimers), `src/pipeline_trace.py` (step copy), `README.md` (Space card)
|
| 48 |
+
|
| 49 |
+
- [ ] One clear pitch: upload → extract → explain → prepare for clinician conversation
|
| 50 |
+
- [ ] Badge claims match reality (Well-Tuned only after custom model is live)
|
| 51 |
+
- [ ] Consistent “educational, not diagnosis” disclaimer
|
| 52 |
+
- [ ] Less dev jargon in user-facing text (“pipeline phase”, etc.)
|
| 53 |
+
- [ ] Align hero badges with hackathon criteria (OpenBMB, Modal, HF, off-grid)
|
| 54 |
+
|
| 55 |
+
**Done when:** Hero + upload + report readable in under 60 seconds.
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## 3. Enlarge the knowledge graph
|
| 60 |
+
|
| 61 |
+
**Owner:** Agent task (Dimitris to review)
|
| 62 |
+
|
| 63 |
+
**Tools:** `src/markers.py`, `kb/knowledge_base.py`, `scripts/expand_lab_knowledge_graph.py`, `kb/cbc_knowledge_graph.json`
|
| 64 |
+
|
| 65 |
+
- [ ] Expand canonical markers in `src/markers.py` (target: 150–200 common lab markers)
|
| 66 |
+
- [ ] For each marker: description, importance, food/exercise/supplement guidance, age/sex stats (cite MedlinePlus / `kb/references/`)
|
| 67 |
+
- [ ] Add IDs to `MARKER_IDS` in `scripts/expand_lab_knowledge_graph.py`
|
| 68 |
+
- [ ] Run `python scripts/expand_lab_knowledge_graph.py`
|
| 69 |
+
- [ ] Run `pytest tests/test_report_pipeline.py`
|
| 70 |
+
- [ ] Spot-check 10 markers in UI after a real PDF upload
|
| 71 |
+
|
| 72 |
+
**Done when:** KG covers target marker list; multi-panel PDFs enrich correctly.
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## 4. Marker video review (per marker)
|
| 77 |
+
|
| 78 |
+
**Owner:** Agent task (Dimitris to review)
|
| 79 |
+
|
| 80 |
+
**Tools:** `kb/marker_videos.json`, `scripts/expand_lab_knowledge_graph.py`, `app.py` (`_youtube_embed_html`)
|
| 81 |
+
|
| 82 |
+
- [ ] Replace generic reused YouTube URLs with marker- or category-specific explainers
|
| 83 |
+
- [ ] Prefer: MedlinePlus, NHS, Cleveland Clinic, Osmosis-style education
|
| 84 |
+
- [ ] Avoid: treatment promises, irrelevant content
|
| 85 |
+
- [ ] Use category fallback when no single-marker video exists (CBC, liver, lipids, thyroid, etc.)
|
| 86 |
+
- [ ] Regenerate graph; QA embeds on high / low / normal marker cards
|
| 87 |
+
|
| 88 |
+
**Done when:** ≥80% markers have unique or category-specific videos; no empty `video_url`.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## 5. Create an article
|
| 93 |
+
|
| 94 |
+
**Owner:** Dimitris (+ Roman review)
|
| 95 |
+
|
| 96 |
+
**Publish to:** HF blog / Devpost / LinkedIn (pick one primary)
|
| 97 |
+
|
| 98 |
+
- [ ] Problem → approach (vision extract + deterministic KB, not LLM medical facts)
|
| 99 |
+
- [ ] Fine-tune story + before/after numbers from `eval/before_after.json`
|
| 100 |
+
- [ ] Architecture: Gradio + ZeroGPU, no hosted API
|
| 101 |
+
- [ ] 2 screenshots + Space link
|
| 102 |
+
- [ ] Limitations + disclaimer
|
| 103 |
+
- [ ] Links: Space, model repo, GitHub
|
| 104 |
+
|
| 105 |
+
**Blocked by:** #1 (custom model live), #2 (copy pass), metrics from eval.
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
## 6. Demo video (Laytimely-style)
|
| 110 |
+
|
| 111 |
+
**Owner:** Dimitris
|
| 112 |
+
|
| 113 |
+
- [ ] Script (~400–600 words): hook → upload → trace → report → one marker → disclaimer
|
| 114 |
+
- [ ] AI voiceover (same stack as Laytimely)
|
| 115 |
+
- [ ] Screen record Space or local app; strong PDF (`02_cbc_umc_johndoe.pdf` or `06_drlogy_cbc.pdf`)
|
| 116 |
+
- [ ] Show trace hover, marker card, embedded YouTube
|
| 117 |
+
- [ ] Royalty-free background music under voice (−18 to −24 dB)
|
| 118 |
+
- [ ] Captions + title/end cards with Space URL
|
| 119 |
+
- [ ] Publish (YouTube unlisted or HF README embed); link in article + submission
|
| 120 |
+
|
| 121 |
+
**Blocked by:** #1, #2, ideally #3/#4 so demo looks polished.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## Submission checklist
|
| 126 |
+
|
| 127 |
+
- [ ] Custom model on Space (`ZEROGPU_MODEL_ID`)
|
| 128 |
+
- [ ] Before/after eval documented
|
| 129 |
+
- [ ] Copy + badges accurate
|
| 130 |
+
- [ ] KG + videos polished
|
| 131 |
+
- [ ] Article published
|
| 132 |
+
- [ ] Demo video with AI voice + music
|
| 133 |
+
- [ ] README / Space card matches final story
|
| 134 |
+
|
| 135 |
+
---
|
| 136 |
+
|
| 137 |
+
## Key paths
|
| 138 |
+
|
| 139 |
+
| Path | Purpose |
|
| 140 |
+
|---|---|
|
| 141 |
+
| `train/modal_finetune.py` | LoRA train + merge + Hub push |
|
| 142 |
+
| `train/modal_eval.py` | Base vs fine-tuned comparison |
|
| 143 |
+
| `eval/data/real/` | Real PDFs + labels |
|
| 144 |
+
| `scripts/expand_lab_knowledge_graph.py` | Regenerate KB JSON |
|
| 145 |
+
| `kb/marker_videos.json` | Video catalog |
|
| 146 |
+
| `README.md`, `RUNBOOK.md`, `DEPLOY.md` | Deployment + llama.cpp docs |
|
| 147 |
+
|
| 148 |
+
## Agent notes
|
| 149 |
+
|
| 150 |
+
- Default extraction: `EXTRACTOR_BACKEND=transformers` — do not change unless badge work requires llama.cpp.
|
| 151 |
+
- Do not commit model weights, tokens, or PHI.
|
| 152 |
+
- Push to `origin` (GitHub) and `space` (HF) after merged changes on `main`.
|
| 153 |
+
- Workflow details: `RUNBOOK.md`
|