Spaces:
Running
Running
| # PROGRESS.md | |
| Last Updated: 2026-05-28 05:20 | |
| Current Step: COMPLETE β | |
| ## Files | |
| β requirements.txt | |
| β .env (template) | |
| β rules/microba_rules.json | |
| β rules/logam_berat_rules.json | |
| β rules/cppob_rules.json | |
| β prompts/classify_prompt.txt | |
| β prompts/compliance_llm_prompt.txt | |
| β prompts/report_prompt.txt | |
| β data/regulations/ β 10 PDFs distributed across 4 category folders | |
| β src/__init__.py | |
| β src/ingest.py | |
| β src/extractor.py β FIXED: dot separator, multiline, TPC/Kapang dan Khamir | |
| β src/classifier.py β FIXED: DAIRY keywords, import re, gemini-2.0-flash | |
| β src/rule_engine.py | |
| β src/rag_query.py | |
| β src/llm_narrator.py β FIXED: project-root paths, gemini-2.0-flash | |
| β src/report_generator.py | |
| β src/app.py β FIXED: full dasar hukum display, MISSING handling, file_path | |
| β README.md | |
| ## Test Results | |
| - [x] Ingest test: ChromaDB populated (923 chunks: 131+186+389+217) | |
| - [x] Extractor test: BOTH colon format AND dot separator format pass β | |
| - [x] Classifier test: 4/4 categories correct β | |
| - [x] Rule engine test: 2 violations detected (ALT, Timbal_Pb) β | |
| - [x] RAG query test: semantic search returns relevant results β | |
| - [x] LLM narrator test: fallback narration works β | |
| - [x] Report generator test: PDF generated β | |
| - [x] App test: Gradio boots on http://127.0.0.1:7860 β | |
| ## Bug Fixes Applied (2026-05-28) | |
| 1. Extractor: Added flexible _SEP pattern for dot/colon/dash separators | |
| 2. Extractor: Added "Total Plate Count"/"TPC" aliases for ALT | |
| 3. Extractor: Handle "Kapang dan Khamir" combined format | |
| 4. Extractor: Handle "Kadar Timbal (Pb)" with dot separator | |
| 5. Extractor: Added _preprocess_text for multiline Key:\nValue format | |
| 6. Extractor: Added _extract_section for === SECTION === format | |
| 7. Extractor: Added "Tanggal Pengujian", "Produsen" to metadata patterns | |
| 8. Classifier: Added 'pasteurisasi', 'sapi', 'uht' keywords for DAIRY | |
| 9. Classifier: Moved 'import re' to top of file | |
| 10. Classifier: Fixed prompt path to use project root | |
| 11. App: Table column "Pasal" β "Dasar Hukum" with full regulation+pasal | |
| 12. App: Handle all-MISSING case (warns instead of "semua memenuhi") | |
| 13. App: Robust PROJECT_ROOT via __file__ | |
| 14. LLM Narrator: Fixed prompt paths to use project root | |
| 15. Gemini model: Updated from gemini-1.5-flash to gemini-2.0-flash | |
| ## Notes | |
| - Python 3.10 required | |
| - numpy<2.0 for torch 2.2.2 compatibility | |
| - sentence-transformers 2.7.0 + transformers 4.40.0 | |
| - google-generativeai deprecated β consider migrating to google.genai | |