think
16px
820px

Dev5 return handoff — Yayasan pendirian (nirlaba shared foundation is landed)

Written 2026-08-10 by the dev_4 session while you were out. TL;DR: the shared
nirlaba foundation is built and green in dev/4
. Your job on return is a
~30-min contract review + your Yayasan-exclusive slice. Nothing is blocked on you.

Grabbing my work — no need to wait for master. My branch (dev/4) isn't
pushed or merged to master yet (holding until the flow's complete + Efran's call
on the extraction path). But we're on the same machine / shared worktrees, so if
you need anything, feel free to check my branch or pull straight from it
from your dev/5 worktree just git merge dev/4 (or cherry-pick what you need).
feat/nirlaba-phase0 (the enum + registry stubs) is also right there. No push,
no master-merge required. Heads-up: merging dev/4 also pulls my inert
Perkumpulan files along — harmless, and it reconciles once both hit master. Ping
me if you'd rather I split the shared skeleton onto a clean shared-only branch.

1. What changed vs the original plan

We first agreed you land the shared skeleton and dev_4 consumes. That flipped
(you were out, dev_4 started first): dev_4 now lands all shared / both-type
edits; you keep only the Yayasan-exclusive files.
This shrinks your queue — the
foundation is proven by a live consumer (the Perkumpulan flow) before you build on it.

2. Shared foundation already landed in dev/4 (verify, don't rebuild)

Piece File Notes
Enum + migration + registry stubs + dispatch + RouteFamily + review-registry Phase-0 (feat/nirlaba-phase0, merged) by Dian; PENDIRIAN_YAYASAN/PENDIRIAN_PERKUMPULAN + 3 DocumentTypes incl. SURAT_PERTIMBANGAN_KEMENLU
Shared organ types backend/src/schema/organ-nirlaba.ts NirlabaVariant, OrganMember (incl. npwp?), NirlabaOrgan (pembina/pengurus/pengawas)
Shared rules backend/src/flow-engine/rules/nirlaba-shared/index.ts AKTA_PRESENT, ORGAN_COMPLETENESS, NAMA_AVAILABILITY as variant-aware factories
Your registry stub flows/nirlaba-pendirian-stubs.tsyayasanPendirianStub inert (buildContext throws); you replace it
Your review slot review/review-registry.tsPENDIRIAN_YAYASAN: null null = REVIEW_NOT_MIGRATED; you fill it

Contract to verify (the shared types were built to this)

  • discriminator variant: "yayasan" | "perkumpulan"
  • OrganMember = { nama, jabatan?, nik?, npwp?, paspor?, kitas?, negara? }npwp? is there for your BO members
  • the first-organ slot is SABH-named pembina (you store Pembina there; Perkumpulan stores Rapat Anggota there). Labels are variant-aware, the slot name is not.
  • the Kemenlu letter is a separate DocumentType (SURAT_PERTIMBANGAN_KEMENLU), never a field on OrganMember

How you reuse the shared rules

import { nirlabaSharedRules, type NirlabaRuleConfig } from "../nirlaba-shared/index";

const YAYASAN_RULE_CONFIG: NirlabaRuleConfig = {
  aktaType: "AKTA_PENDIRIAN_YAYASAN",
  firstOrganLabel: "Pembina",          // relabels the pembina slot
  checkNama: checkYayasanNamaAvailability,   // your base='yayasan' SABH lookup
};
export const YAYASAN_PENDIRIAN_RULE_SET = [
  ...nirlabaSharedRules<YayasanPendirianCtx>(YAYASAN_RULE_CONFIG),
  // + your Yayasan-exclusive rules (below)
];

checkNama is injected — copy services/perkumpulan-nama-availability.ts and swap the base to yayasan (verify the SABH tbl_order_name/tbl_badan_hukum base value when the DB is reachable; it's flagged in that file).

3. Your queue — Yayasan-exclusive (all net-new, none shared)

  1. schema/akta-yayasan.ts — your extraction schema (mirror schema/akta-perkumpulan.ts, variant "yayasan"): Pembina in the pembina slot, kekayaan required, Kemenlu for asing. Prompt string stays BLOCKED-ON-S5.
  2. Yayasan-exclusive rules: KEKAYAAN_AWAL_PRESENT, KEKAYAAN_ASING_MIN (≥Rp100jt, FormDataYayasan.php:434), the Kemenlu/SYARAT_ASING rule (per memory: FAIL-but-overridable + content WARNING).
  3. flows/yayasan-pendirian.ts — real defineFlow, replace yayasanPendirianStub in registry.ts.
  4. Yayasan routes/pages + review projector (fill PENDIRIAN_YAYASAN in review-registry.ts).

4. Still-pending shared pieces — dev_4 owns these, DON'T build them

These are mine (in progress); they'll land additively and you consume:
- shared context builder (context/nirlaba-pendirian-context.ts) — carries a kekayaan slot even though Perkumpulan ignores it, so your kekayaan rules have data; will expose a variant seam for your yayasan field-mapping.
- nirlaba-akta-classifier.ts (3 labels + AKTA_SUBTYPE_MAP) + submission-type-inference rungs.
- the extraction-persistence wiring in document-processor (organ/adart persistence — design TBD: dedicated tables vs JSON).

5. Perkumpulan status (for reference — my side)

Rules (D11), NAMA_AVAILABILITY service, akta schema, shared types + shared rules: done, green. Flow is still the inert Phase-0 stub until the extraction pipeline (item 4) lands. Full brief: dev_4/perkumpulan-flow-handoff.md.

6. First 30 minutes on return

  1. git log --oneline on dev/4 — read the nirlaba commits.
  2. Verify schema/organ-nirlaba.ts + rules/nirlaba-shared/index.ts against the contract in §2.
  3. Ping me on the context builder's kekayaan slot shape before you wire yayasan field-mapping (item 4 is mine, but the seam is yours to consume).
  4. Start on schema/akta-yayasan.ts.