think
16px
820px

Handoff — Blackbox pass + docx for "Berakhirnya Status Badan Hukum" (PT)

For: the follow-up PT blackbox session (new terminal or the previous PT session).
Requested by: Dev1, via Efran (2026-08-21).
Branch: dev/4 (worktree ahu-ocr-dev/dev_4).


The one deliverable

Produce one file and place it here:

docs/blackbox-testing/report/docx/PT/pt-berakhirnya.docx

That is the whole job. The .docx in that directory is the deliverable. You do
NOT need to commit anything (docs/blackbox-testing/ is gitignored on purpose),
you do NOT need to push, and you do NOT need to upload to Drive (Efran handles
Drive). Just generate pt-berakhirnya.docx and drop it in report/docx/PT/.

The .md source and the build/ intermediate are only means to that end — they
feed the docx pipeline. The final artifact Dev1 wants is the docx.


Why this exists (context)

BERAKHIRNYA_STATUS_PT (Berakhirnya Status Badan Hukum — end of a PT's legal
entity status after liquidation) is fully built and well-tested in code, but
it was never in the original PT blackbox scope (that was 8 flows: pendirian,
perubahan, akuisisi, merger, pembubaran, laporan-rups, perbaikan, peralihan-pp-pt).
So there is no pt-berakhirnya.md report and no pt-berakhirnya.docx — it's
only cross-referenced inside pt-pembubaran.md and pt-00-summary.md. This pass
closes that gap so the PT set goes 8 → 9.

The flow is real and wired:
- Route: app.route("/api/berakhirnya", ...) (backend/src/index.ts:130)
- Flow: backend/src/flow-engine/flows/berakhirnya-status-pt.ts (registered in flow-engine/registry.ts)
- Context/rules: flow-engine/context/berakhirnya-context.ts, flow-engine/rules/berakhirnya/
- Frontend pages: BerakhirnyaStatusPage.tsx, BerakhirnyaExtractionPage.tsx, BerakhirnyaReviewPage.tsx, VerifikatorBerakhirnyaReviewPage.tsx
- Tests: 13 backend + 2 frontend files (routing, routes, verifikator, klasifikasi, integration, flow, context, rules, schema, rups-fallback, doc-classifier) + corpus fixtures. It's green.

Fact to bake into the report: the akta date window for Berakhirnya is 30
days
(SABH parity, aktaDateWindowDays = 30 set explicitly in
berakhirnya-context.ts), overridable with a reason. Set this session (commit
b766e30b, our "A2b"). Pembubaran and Laporan RUPS have NO window; Pendirian is
60 days and locked. Don't contradict this in the writeup.


Inputs already staged for you

Real test data (6-doc bundle, ready to upload through the UI):

e2e/data/real-intake/pt/berakhirnya/
  Surat Permohonan Berakhirnya Status Badan Hukum PT. GPU_...pdf   <- the permohonan
  Salinan Akta Pembubaran Tahap 2 PT. GPU No. 01 ...pdf            <- the akta (tahap 2)
  Laporan Hasil Akhir Likuidasi PT. Global Putra Utama_...pdf
  RUPS_Notulen Pembubaran PT. GPU (Dalam Likuidasi)_...pdf
  Koran Pasal 149 PT. Global Putra Utama_...pdf
  Koran Pasal 152 PT. Global Putra Utama_...pdf

Report template: docs/blackbox-testing/01-documentation-template.md
Closest sibling to mirror (same shape/tone): docs/blackbox-testing/report/pt-pembubaran.md
(berakhirnya is the natural sibling of pembubaran — dissolution vs end-of-status.)

Running stack (dev_4): backend 47014, frontend 47024, Postgres 47030.
Reports are written in Indonesian (see any existing pt-*.md). Role seeding
for Playwright: page.addInitScript setting localStorage["userRole.v2"].

Reminder — plain Indonesian, no AI-looking glyphs in the writeup: avoid
em-dashes, , §, , ×, ÷, . Use plain words (Efran's standing rule).


Steps to produce the docx

  1. Run the blackbox pass against BERAKHIRNYA_STATUS_PT using the staged data:
    upload via the Klasifikasi board, let OCR + extraction run, walk the Review
    page (fields + validation panel + finalize gate), then the verifikator stage.
    Capture positive and negative cases + all accessible UI, same as other PT
    reports. Grab screenshots into docs/blackbox-testing/report/img/ named
    berakhirnya-0N-*.png (follow the existing naming).

  2. Write docs/blackbox-testing/report/pt-berakhirnya.md following the
    template and mirroring pt-pembubaran.md. Include the two mermaid blocks
    (flow + state machine) like the other reports — the pipeline renders them.

  3. Render mermaid → PNG:
    cd e2e && node report-build/render-mermaid.mjs
    (Writes report/img/pt-berakhirnya-diagram-*.png and updates the manifest.)

  4. Register the screenshot gallery. In e2e/report-build/build-docx.mjs,
    add a "pt-berakhirnya" key to the GALLERIES map (list your
    berakhirnya-0N-*.png files with Indonesian captions; append SHARED.klasifikasi
    and SHARED.verifikator, as pembubaran does). Without this entry the build
    still runs, but the docx won't get its "Bukti visual" gallery.

  5. Build enriched markdown:
    cd e2e && node report-build/build-docx.mjs
    (Reads report/pt-berakhirnya.md, inlines the diagram PNGs + gallery, writes
    report/build/pt-berakhirnya.md. It auto-picks up any pt-*.md.)

  6. Convert to docx with pandoc (/home/developer/.local/bin/pandoc), landing
    it in the PT subfolder. Mirror the flags used for the siblings; the working
    invocation is run from the report dir so image paths resolve:
    cd docs/blackbox-testing/report pandoc build/pt-berakhirnya.md -o docx/PT/pt-berakhirnya.docx --resource-path=.:img
    If a sibling docx used different flags, match those. Open the result and
    confirm diagrams + screenshots render, comparing against
    report/docx/PT/pt-pembubaran.docx (~915 KB with images — a tiny output means
    images didn't embed).

  7. Done when docs/blackbox-testing/report/docx/PT/pt-berakhirnya.docx exists
    and opens cleanly with its diagrams and screenshots.


Optional (nice, not required by Dev1)

If you have spare cycles, add the 9th row to pt-00-summary.md / modul-pt.md
and regenerate those docx too, so the PT summary count matches. But the ask is
strictly the pt-berakhirnya.docx; everything else is bonus.

Do NOT

  • Do not touch the flow code — it's built, tested, and green. This is a
    documentation-coverage pass only.
  • Do not commit the report/docx (gitignored) and do not push.
  • Do not re-run or alter the other flows' reports.