Task 7 Report — Pembubaran PT routing + gating (THE LAUNCH SWITCH)
Status: COMPLETE — commit 458de24 feat(pembubaran): LAUNCH SWITCH — BUILT flip + Berakhirnya doc-set predicate + ladder rung below akuisisi on feat/pt-flows-registry.
What was done (TDD: RED → GREEN)
- RED first: created
backend/src/routes/__tests__/pembubaran-routing.test.tsverbatim from the brief (7 tests); confirmed failing (BERAKHIRNYA_PACKAGEnot exported). backend/src/services/akta-txn-classifier.ts
-BUILT_AKTA_TXN_TYPES+="pembubaran"(LAUNCH SWITCH — third v2-generic tenant).
-SYSTEM_PROMPT: replaced the two overlapping one-liners with the spec §4.2 appoints-vs-accepts cue (pembubaran = deed DISSOLVES + APPOINTS likuidator, liquidation BEGINS; berakhirnya = deed ACCEPTS pertanggungjawaban, liquidation ENDS).backend/src/routes/submissions.ts
- ExportedBERAKHIRNYA_PACKAGE(files: InferableFile[]): booleandirectly abovedetectUnsupportedAktaType, exactly per the brief (AKTA_BERAKHIRNYA / LAPORAN_LIKUIDASI / SURAT_PERMOHONAN / BUKTI_PENGUMUMAN_152 clauses + the ≥2-carrier count viamapToDocumentType, never the raw label; full §6.2 doc-comment incl. the C5 "quoted identically" note; the brief's NOTE honored — noBUKTI_PENGUMUMAN_152map line added).
-detectUnsupportedAktaType: predicate check FIRST → returns"berakhirnya"before the per-file unbuilt scan.
-inferSubmissionType: return union +="PEMBUBARAN_PT"; precedence doc-comment updated (… > Akuisisi > Pembubaran > Perubahan > …); rung inserted BETWEENAKTA_AKUISISIandAKTA_PERUBAHANwith the belt-and-braces&& !BERAKHIRNYA_PACKAGE(files)guard (BELOW akuisisi — opposite of peleburan's placement; brief's comment kept).
-mapToDocumentType("SURAT_LIKUIDATOR") → "SURAT_LIKUIDATOR"(next to the BUKTI_PENGUMUMAN line, above the AKTA fallback);getProcessingOrder("SURAT_LIKUIDATOR") → 4(next to domisili).backend/src/routes/klasifikasi.ts
-PEMBUBARAN_DOC_TYPES(11 entries verbatim from the brief) afterPELEBURAN_DOC_TYPES; added to theLABEL_MAPspread;?type=pembubaranbranch in the labels endpoint + route-comment type list extended.- Stale fixture flips (canonical unbuilt example moves pembubaran → berakhirnya; launched-state assertions only, nothing weakened):
-laporan-rups-routing.test.ts:14→AKTA_BERAKHIRNYA/berakhirnya; describe-title ladder text now includesPembubaranbetween Akuisisi and Perubahan.
-klasifikasi-akta-txn.test.ts→ unbuilt example flips toAKTA_BERAKHIRNYA(comment updated per brief); built-types test GAINSAKTA_PEMBUBARAN → null; override test nowAKTA_BERAKHIRNYA → AKTA_PERUBAHAN. The refine test'sAKTA_PEMBUBARANlabel expectations unchanged.
-peleburan-routing.test.ts:12(risk-flagged; not in the brief's file list) → dark-type fixture flips toAKTA_BERAKHIRNYA.
-akta-txn-classifier.test.ts(found in self-scan; not in the brief's file list): BUILT-set enumeration gains"pembubaran"; the twosupported:falsepembubaran assertions flip totrue("recognized-and-supported (its flow shipped)") — same launched-state pattern the file already applied to peleburan/laporan_rups.
Verification
- New suite:
pembubaran-routing.test.ts— 7/7 pass (RED first, then GREEN). - Brief's GREEN set (pembubaran + klasifikasi-akta-txn + laporan-rups + peleburan + akuisisi): 42 pass / 0 fail.
- Broad regression (those + akta-txn-classifier + supporting-doc-classifier + submission-dispatch + flow-engine dispatch-routing / pembubaran-flow / -schema / -context / registry / rules-pembubaran + akta-pembubaran-deed-passes + pembubaran-rups-fallback + resume-pembubaran-recovery): 103 pass / 0 fail, 415 expects, 17 files.
- Typecheck:
bunx tsc --noEmitclean. - Tests ran against the isolated
ahu_ocr_testDB (bunfig preload confirmed).
Self-review traces (predicate both-sides + ladder position)
- Co-upload pembubaran + akuisisi → AKUISISI_PT: the
AKTA_AKUISISIrung is checked before the new pembubaran rung; assertedinferSubmissionType([AKTA_PEMBUBARAN, AKTA_AKUISISI]) === "AKUISISI_PT"(and+ AKTA_PELEBURAN → PELEBURAN_PT). Rung sits BELOW akuisisi. - Bare pembubaran → PEMBUBARAN_PT:
detectUnsupportedAktaType([AKTA_PEMBUBARAN]) === null(BUILT) andinferSubmissionType([AKTA_PEMBUBARAN, KTP]) === "PEMBUBARAN_PT", incl. the userOverride confident-wrong re-map. - 6-doc Berakhirnya package → NOT pembubaran, both sides: gate side —
detectUnsupportedAktaType([AKTA_PEMBUBARAN, 2× BUKTI_PENGUMUMAN]) === "berakhirnya"and the live create route returns{supported:false, detectedType:"berakhirnya"}with no Submission row; rung side — the!BERAKHIRNYA_PACKAGE(files)guard means even a directinferSubmissionTypecall can't steal the package. A single Ps.147 clipping does NOT trip it ([AKTA_PEMBUBARAN, BUKTI_PENGUMUMAN] → PEMBUBARAN_PT).
Deviations from the brief
- Two extra test files flipped and committed beyond the brief's
git addlist (peleburan-routing.test.ts,akta-txn-classifier.test.ts) — both used pembubaran as the dark-type/unsupported fixture and would have broken at this commit; flips are launched-state-only, matching the plan's risk flags. No production-code deviation. - This file previously held the Peleburan cycle's task-7 report (commit e8e81aa); overwritten per the task directive (the Peleburan report remains in git history).
Concerns
- None blocking.
BUKTI_PENGUMUMAN_152currently falls to the"AKTA"fallback inmapToDocumentType— intentional per the brief's NOTE (the explicit predicate clause covers it until the Berakhirnya flow maps the _149/_152 fine labels). - The predicate's LAPORAN_LIKUIDASI / SURAT_PERMOHONAN clauses are dormant until those labels exist upstream — written now so Berakhirnya only appends names (C5).