think
16px
820px

Task 11 Report — Frontend klasifikasi surfacing (Berakhirnya Status PT)

Status: DONE

Commit

5ec9ffcfeat(berakhirnya): klasifikasi surfacing — positive detect rung above peleburan + fine-label carrier mirror + create-route

4 files changed: frontend/src/lib/pembubaran-detect.ts, frontend/src/lib/__tests__/pembubaran-detect.test.ts, frontend/src/components/klasifikasi/detect-banner.tsx, frontend/src/pages/KlasifikasiPage.tsx.

What changed

  • isBerakhirnyaPackage's isClipping predicate now uses startsWith("BUKTI_PENGUMUMAN") (carrier mirror of mapToDocumentType, counting the _149/_152 fine labels toward the ≥2-clipping clause) instead of exact "BUKTI_PENGUMUMAN" equality. File-head comment updated: the predicate is no longer suppression-only — KlasifikasiPage now also detects berakhirnya POSITIVELY with it (backend inferSubmissionType remains the enforcement).
  • DetectedFlow union + FLOW_LABELS/FLOW_DESCRIPTIONS gained "berakhirnya" entries.
  • KlasifikasiLabelType union gained "berakhirnya"; berakhirnyaPaket inserted above the hasAktaPeleburan rung in both the computedLabelType and detectedFlow ladders (after hasSuratPerbaikan, before peleburan) — the byte-identical hasAktaPembubaran = !berakhirnyaPaket && ... suppression is untouched.
  • createSubmission.mutate onSuccess: new data.type === "BERAKHIRNYA_STATUS_PT" branch → navigate(/berakhirnya/${id}/extraction), placed ahead of the PEMBUBARAN_PT branch. No casts — CreateSubmissionResponse.type is already string, and the existing "supported" in data narrowing already precedes this block.

Test summary

  • Added test (pembubaran-detect.test.ts, "fine-label carrier mirror" describe block, verbatim from brief) — ran GREEN even pre-fix on the RED check, because both given cases are also satisfied by the pre-existing exact BUKTI_PENGUMUMAN_152 rung independent of isClipping. Not a defect — assertions are exactly as specified in the brief; the fix is still correct and necessary for the general carrier-mirror case (e.g. two _149s with no _152 present would need it).
  • Targeted regression run (detect-banner.test.tsx, detect-banner-laporan-rups, detect-banner-peleburan, pembubaran-detect, pembubaran-flow-config, akuisisi-flow, peleburan-flow, laporan-rups-flow): 8 files / 39 tests passed.
  • Full frontend suite: 91 files passed / 1 file failed, 504 tests passed total. The 1 failed file, PerbaikanReviewPage.test.tsx, fails with ReferenceError: DOMMatrix is not defined inside react-pdf/jsdom — pre-existing environment gap unrelated to any file touched by this task (failure originates in pdf-viewer.tsxreact-pdf, not in klasifikasi/detect-banner/pembubaran-detect/KlasifikasiPage code).

tsc

cd frontend && bunx tsc --noEmit — clean, no output.

Concerns

  • None blocking. Only note is the RED-step nuance above (the given test doesn't isolate the isClipping change in total isolation, since BUKTI_PENGUMUMAN_152 exact match already covers case 1 of the two given assertions) — a test-design observation, not a functional gap. Brief's exact test text was used verbatim per instructions.