Spaces:
Sleeping
Sleeping
Commit History
-
Expand canonical probes to remaining 10 sectors + fix surat strict toggle
pebaryan +1: Claude Opus 4.7Round-trips the 10 new fixtures' citation gap analysis from this session into 22 new canonical probes covering all DPR Komisi domains we hadn't yet covered. Probes added (all verified 'berlaku' on pasal.id pre-commit): Hukum / KPK kelembagaan (Komisi III): UU 8/1981 (KUHAP), UU 30/2002 (KPK), UU 19/2019 (KPK perubahan) Sosial / Bencana / Anak (Komisi VIII): UU 24/2007 (Penanggulangan Bencana) UU 35/2014 (Perlindungan Anak) UU 23/2004 (PKDRT) UU 11/2009 (Kesejahteraan Sosial) Diplomasi (Komisi I): UU 37/1999 (Hubungan Luar Negeri) UU 24/2000 (Perjanjian Internasional) Pertanian / Pangan (Komisi IV): UU 41/2009 (Perlindungan LP2B) BUMN / Perdagangan / Standardisasi (Komisi VI): UU 19/2003 (BUMN), UU 7/2014 (Perdagangan), UU 20/2014 (Standardisasi) UMKM (Komisi VII): UU 20/2008 (UMKM) Keuangan (Komisi XI): UU 4/2023 (P2SK), UU 21/2011 (OJK), UU 7/2021 (HPP) Energi / Lingkungan / Tambang (Komisi XII): UU 30/2007 (Ener…3a01e32
-
Add trusted_recent override for fresh regulations not yet on pasal.id
pebaryan +1: Claude Opus 4.7Closes the corpus-freshness gap surfaced when a user asked legawa to verify Perpres 8/2026 (RAN PE counter-extremism, signed 9 Feb 2026, publicly disseminated May 2026). pasal.id's 2026 corpus contains only Perpres 1/2026 — anything later is unverifiable through the normal search path even though the regulations are real. Mechanism: - New module src/legawa/tools/trusted_recent.py with TRUSTED_RECENT dict keyed by normalized citation reference (the form extract_citations produces, e.g. "Perpres 8/2026"). Each entry has full title, frbr_uri, status, signed_date, source_url, and a removal-timing note. - verify_citation now consults the trusted store as a fallback in two places: (a) when pasal.id search returns no matching hit, and (b) when pasal.id is unreachable entirely (auth failure, network error, 5xx). Topical-overlap is enforced against the trusted title — we don't blanket-whitelist a (number, year) tuple; the model still needs to claim the right subject. - Pasal…e1893c1
-
Test 6: MBG Keracunan Grobogan — multi-Komisi + sosial sector validation
pebaryan +1: Claude Opus 4.7Sixth live validation, on the most politically substantive topic to date: the Makan Bergizi Gratis (MBG) program post-keracunan incidents (Grobogan 9 Jan 2026, ~1,929 victims across 6 provinces in Jan 2026). Validates the Komisi-portfolio injection (ea8eaf7) on a four-Komisi cross-cut (IX + VIII + X + XI all relevant). Surat reply correctly addressed Komisi IX as primary with X/VIII/XI tembusan, pulling bracketed portfolios verbatim from the injected reference table. Classifier output: 'sektor=sosial_kemasyarakatan' (first run) / 'sektor=kesehatan' (second run) — sixth distinct sector across the test series, both valid framings for cross-cutting MBG topic. Patches: - Added 4 MBG-related canonical probes (Perpres 83/2024 BGN, Perpres 115/2025 MBG ops, UU 18/2012 Pangan, UU 8/1999 Perlindungan Konsumen). All 4 verified berlaku on pasal.id pre-commit. Closes the recurring retrieval-gap pattern that surfaced in Tests 3, 4, 5. - Refreshed scripts/regression_baseline.json: 19 → 23 …ca23118
-
Inject DPR Komisi 2024-2029 portfolio reference into agent prompts
pebaryan +1: Claude Opus 4.7Closes the persistent Komisi-number mismatch surfaced in Test 5: the BIG model addressed transport memos to Komisi IV (pertanian/kelautan) instead of Komisi V (infrastruktur/perhubungan). Generic Indonesian govt knowledge the model has weak/outdated training-time priors on, especially since the 2024-2029 period restructured into 13 commissions (was 11 in earlier periods). Adds KOMISI_DPR_2024_2029 constant in agents/penyusun.py — a 13-line authoritative table covering all current commissions with their primary bidang. Injected into: - penyusun SYSTEM_TEMPLATE (memo / pidato / naskah_akademik / siaran_pers) - surat REPLY_PROMPT (constituent reply drafts) Both system prompts now end with the Komisi reference and an explicit instruction: "Bila konstituen sudah menyebut Komisi tertentu, hormati pilihan tersebut" — so when the constituent letter explicitly addresses e.g. Komisi V, the reply respects that. Live re-run on the Test 5 Bekasi memo now correctly addresses 'Komisi V dan Komisi…ea8eaf7 -
Test 5: Bekasi train+EV taxi accident — transport sector + extractor fixes
pebaryan +1: Claude Opus 4.7Fifth live validation, on the 27 April 2026 KA Argo Bromo Anggrek collision with a stopped KRL involving a Green SM electric taxi at Bekasi Timur Station (16 fatalities, ongoing investigation). Surfaces and fixes three real defects in the same patch. Defects fixed: 1. Extractor missed Kemenhub's "PM <n>" numbering. Permenhub citations like "Permenhub No. PM 94 Tahun 2018" extracted as nothing — verifier never even saw them, so any Permenhub hallucination shipped silently. Added (?:(?:PM|KP|KEP|PER)\.?\s*)? to the regex between optional "Nomor" prefix and the digit group. 2. Extractor broke on parenthetical-aliased citations. "Peraturan Menteri Perhubungan (Permenhub) No. PM 94 Tahun 2018" wouldn't extract because closing paren between label and number wasn't tolerated. Widened the spacer to allow ) ] * _ characters. 3. Greedy ministry-suffix backtracking. "Peraturan Menteri Perhubungan Nomor PM 73 Tahun 2018" extracted as "Permen 3/2018" — the unbounded s…850ff59 -
Add amendment-chain probe to citation verifier (advisory only)
pebaryan +1: Claude Opus 4.7Closes the operative-vs-existed blind spot surfaced in Tests 2 and 4. After a citation matches by (kind, number, year) and topical alignment, the verifier now also fetches the regulation's relationships graph via get_law and surfaces 'Dicabut oleh' / 'Diubah oleh' findings as advisory notes for staff review. Two pasal.id quirks worked around: 1. The 'status' field is unreliable — UU 36/2014 still shows status=berlaku even though it was superseded by UU 17/2023 (omnibus). The relationships graph captures this correctly. 2. pasal.id mirrors relationships in both directions. UU 13/2003's 'Dicabut oleh' list contains UU 25/1997 (the older law UU 13/2003 actually revoked), not just newer successors. The disambiguator compares years extracted from FRBR URIs (akn/id/act/uu/<year>/<n>) and only treats relationships as authoritative when the related work is NEWER than the cited regulation. Pasal.id's relationships graph still has data-quality issues beyond the year-mirr…b01393f -
Extend canonical FRBR-URI probes to dosen and medical-education sectors
pebaryan +1: Claude Opus 4.7Closes the recurring retrieval gap surfaced in Test 3 (gaji dosen) and Test 4 (PPDS/internsip): pasal.id /search ranking missed several operative statutes that the constituent letters explicitly cited. Adds 7 new canonical probes, all verified 'berlaku' on pasal.id before adding: Pendidikan & kesejahteraan dosen: UU 14/2005 — Guru dan Dosen (akn/id/act/uu/2005/14) UU 12/2012 — Pendidikan Tinggi (akn/id/act/uu/2012/12) Perpres 19/2025 — Tukin Kemendiktisaintek (akn/id/act/perpres/2025/19) Kesehatan & pendidikan kedokteran: UU 17/2023 — Kesehatan omnibus (akn/id/act/uu/2023/17) PP 28/2024 — Pelaksanaan UU 17/2023 (akn/id/act/pp/2024/28) UU 20/2013 — Pendidikan Kedokteran (akn/id/act/uu/2013/20) Permenkes 7/2022 — Penyelenggaraan Internsip (akn/id/act/permenkes/2022/7) Live re-run of Test 3 dosen research now surfaces UU 14/2005 explicitly as primary instrument and quotes Perpres 19/2025 Pasal verbatim — both were absent before this commit. The synthesis…2a72bfe -
Add Test 4 — PPDS dan internsip dokter (cross-sector kesehatan validation)
pebaryan +1: Claude Opus 4.7Fourth live validation, designed as a cross-sector health-domain test covering PPDS perundungan, status hukum residen, beban finansial, and internsip placement at DTPK. No _CASE_FACTS entry — the SMALL-model domain classifier is the only domain anchor. Fixture: synthetic joint letter from a Residen Bedah year-3 at RSUP Hasan Sadikin and a Dokter Internsip in Sorong Selatan, on behalf of Forum Komunikasi Dokter Muda Indonesia (FKDMI). Cites UU 17/2023 (Pasal 193), PP 28/2024, Permenkes 7/2022, UU 20/2013 — multiple substantive asks to Komisi IX gabungan Komisi X. Results: - Surat: PT/kesehatan framing intact, cites UU 17/2023 + PP 28/2024 + Pasal 193, three legislator-scoped tindak lanjut, strict-mode passed. - Peneliti: 6 query expansions, 41 unique hits. Strikingly honest — flags 4 distinct retrieval gaps ("tidak ditemukan") rather than fabricating. Surfaces UU 17/2023, Peraturan MA 2/2023, PMK 66/2023. - Penyusun memo: classifier output 'sektor=kesehatan jenjang=- kasus=-' …805f292 -
Add Test 3 — gaji dan tunjangan dosen (PT-domain validation)
pebaryan +1: Claude Opus 4.7Third live validation, designed as the inverse of Test 2 (Kasus Ibam, K-12): this targets a Perguruan Tinggi topic with no _CASE_FACTS entry, so the SMALL-model domain classifier is the only domain anchor in play. Fixture: synthetic letter from a Lektor at UNS Surakarta, writing on behalf of Forum Dosen Indonesia (FDI) wilayah Jawa Tengah. Four substantive concerns: ASN-PTS disparity post-Permendiktisaintek 52/2025, status of dosen kontrak/honorer, RUU Sisdiknas relocation risk for UU 14/2005's tunjangan provisions, slow Serdos disbursement. Results: - Surat: PT framing intact, cites UU 14/2005 + PP 41/2009 + Perpres 19/2025, three legislator-scoped tindak lanjut, strict-mode passed. - Peneliti: 6 query expansions, 45 unique hits. Correctly identifies Permendiktisaintek 52/2025 as new operative regulation, traces evolution from Permendikbudristek 44/2024, cites PP 41/2009 + Permenristekdikti 20/2017 with proper FRBR URIs. Honestly flags that draft RUU Sisdiknas and UU 14/20…de87feb
-
Correct Kasus Ibam case status: tuntutan, not vonis
pebaryan +1: Claude Opus 4.7The 16 April 2026 hearing was the Jaksa Penuntut Umum's tuntutan reading (15 tahun penjara, denda Rp 1 miliar, uang pengganti Rp 16,92 miliar). The vonis hearing was scheduled for 12 Mei 2026 and has not been delivered. As of 2026-05-01 Ibrahim Arief is a TERDAKWA in an ongoing trial, not a terpidana — asas praduga tak bersalah applies. The original _CASE_FACTS block treated him as already convicted, which propagated into every memo this run produced and into the whitepaper. This commit: - Rewrites _CASE_FACTS in agents/penyusun.py to use 'terdakwa' / 'tuntutan' / 'sedang menjalani persidangan' language and explicitly forbids 'terpidana' / 'divonis' / 'dihukum'. - Corrects tests/fixtures/surat-chromebook-sekolah.txt to describe the prosecution's tuntutan reading rather than a fictitious putusan. - Adds an erratum at the top of the Kasus Ibam whitepaper documenting the error, its origin (misread WebSearch summary), and the Indonesian legal terminology that distinguishes tunt…1c88af7 -
Tighten verifier: institutional-context tokens don't count as topical match
pebaryan +1: Claude Opus 4.7Closes the "blind spot A" surfaced during the gemma4 Kasus Ibam diagnostic: the model cited Permen 24/2018 claiming an audit-mechanism topic, when the actual title is "Pengelolaan Arsip Terjaga di Lingkungan Kementerian Pendidikan dan Kebudayaan". The previous overlap check passed because claim and title shared "kementerian / pendidikan / kebudayaan" — institutional context, not topic. _topics_overlap now requires at least one shared token to be NON- institutional. Adds _INSTITUTIONAL_TOKENS frozenset covering generic government context (kementerian / pemerintah / lingkungan / instansi / lembaga / wilayah / kantor) and ministry/sector markers (pendidikan / kebudayaan / kesehatan / keuangan / ketenagakerjaan / pertanian / etc.). The acronym-expansion path is unaffected — institutional acronyms (MPR / DPR / KPK) still match their spelled-out forms because their expansion tokens (majelis / dewan / komisi / pemberantasan) are deliberately kept out of the institutional list. Tests: 4 new…ed43ddd -
Add SMALL-model domain classifier for Penyusun
pebaryan +1: Claude Opus 4.7Replaces the keyword-only domain anchor with a learned classifier that extracts (sektor, jenjang, instansi, kasus_terkait, kerangka_hukum, anti_drift) from topic + research + extra_instructions. The keyword path remains as a fallback for when the SMALL model produces unparseable JSON. Composition in _derive_domain_constraints: 1. _CASE_FACTS keyword overrides — always applied for known cases (e.g. Kasus Ibam) since hand-curated facts beat generated ones. 2. classify_domain() SMALL-model call — produces DomainAnalysis, rendered as constraint string into the BIG system prompt. 3. _keyword_domain_constraints fallback — fires only when classifier raises (parse error, transport error, validation error). Few-shot prompt with two worked examples (pendidikan + ketenagakerjaan) locks the output shape; Pydantic validation rejects malformed responses. 10 new unit tests cover parsing (clean / code-fence / prepended-text), classifier integration, render_constraints output, a…6dd4102 -
Harden citation pipeline + add comprehensive test suite
pebaryan +1: Claude Opus 4.7Patches addressing all defects discovered during Kasus Ibam validation: - Citation extraction: bidirectional context capture (parenthetical-alias pattern catches "X (ALIAS) melalui CITATION"), citation-chain awareness (in "UU N/Y jo UU M/Y ... tentang Z" the topic attaches only to the closest citation), Permen-with-space and Perppu support. - Citation verification: content alignment via topical-token overlap with Indonesian institutional acronym expansion (MPR/DPR/KPK/BPK/SAKIP/...), malformed-title guard for pasal.id's echoed-title responses, UUD 1945 whitelist for the constitution. - Penyusun domain anchor: K-12 vs Perguruan Tinggi keyword triggers with mutual exclusion; case-fact injection (_CASE_FACTS) prepends authoritative facts to the system prompt for known cases (e.g. Kasus Ibam) so the BIG model can't drift to a stronger but wrong prior. - Peneliti canonical FRBR-URI probes: when topic touches Tipikor / pengadaan / outsourcing keywords, fetch the operativ…b4a776c
-
Fix three Windows/Qwen3 issues uncovered by first live run
pebaryan +1: Claude Opus 4.7- UTF-8 reconfigure stdio on Windows so rich glyphs ('OK', 'FAIL', etc.) don't crash on legacy cp1252 console. - Disable Qwen3 thinking mode by default via chat_template_kwargs; thinking tokens were exhausting max_tokens on classification calls before any answer was produced. Callers can opt back in with think=True. - Strip <think>...</think> blocks centrally in llm.chat so agents never see reasoning bleed into final content. Add tests/fixtures/surat-buruh-outsourcing.txt — synthetic constituent letter referencing UU 13/2003, UU 6/2023, and Putusan MK 27/PUU-IX/2011 for end-to-end smoke testing of surat agent. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>3265a18