Khula Platform · Case Study
Portfolio / Rootline

A production SLP-compliance platform Khula built for South African mining — spec-driven, AI as the primary builder, shipped in four days without dropping a single production standard.

Rootline  |  Multi-tenant SLP compliance for SA mining  ·  Plan to proof

Author the plan. Track the work. Prove it to the regulator.

Rootline is a multi-tenant platform for mining operations to write Social & Labour Plans, track delivery against every Mining Charter commitment, and leave behind an immutable record a DMRE inspector can read. One data model, tenant-isolated by row-level security, from first draft to audit file.

Conventional build plan6–8 weeks
Rootline, as built by Khula4 days
~10× faster Same production bar, a fraction of the calendar.
Rootline Sightline dashboard: dark-green sidebar listing the eight modules (Sightline, Rootplan, Linewatch, Clearline, Timberline, Faultline, Rootmark, Rootguide) plus Administration, and six tracked compliance tables showing tracked rows, period columns, and overdue/at-risk counts at a glance; tenant-identifying details are blurred for confidentiality.
Built in four days

How the calendar shrank, and what it didn’t cost.

Four days is not a corner-cutting story. It is what a locked spec, AI used as the primary build assistant, and one shared data model do to the parts of a build that normally take weeks.

4 daysfrom spec to hardened build
6–8 wksconventional plan for the same scope
8modules shipped in one system
0AI runtime dependencies (AI optional, off by default)
Mechanism

Spec-driven build

The data model, roles, and Mining Charter section structure were locked on day zero, so implementation was execution against a fixed target instead of discovery.

Mechanism

AI as the primary builder

AI wrote the bulk of the schema, RLS policies, workflow, and doc-generation code under review — not bolted into the product, but used to compress the writing of it.

Mechanism

One model, every surface

Authoring, tracking, reporting, and the audit trail read from a single Postgres schema, so a rule written once renders everywhere instead of being rebuilt per screen.

What four days didn’t cut

Tenant isolation is enforced in the database with Postgres row-level security, not in application code. The audit trail is immutable — append-only, no edit path. The build carries 80%+ test coverage, and the data model is POPIA-aligned from the schema up. Speed came out of how the code was written, not out of the standards it was held to.

The problem

A plan in one place, the proof in twelve others.

Under the Mining Charter, a mining right carries a Social & Labour Plan — commitments on skills, procurement, local economic development, and housing that the operation must deliver and report on to the DMRE. The plan is a document. The delivery happens across departments over years.

In most operations the SLP lives in Word and PDF, the commitments get re-keyed into spreadsheets, and the evidence that each commitment was met is scattered across email, shared drives, and people’s memory. When a Reg 45 report or an inspection lands, someone spends weeks reassembling a story the systems never held in one place.

The gap is not effort. It is that the plan, the tracking, and the proof were never the same object.

Disconnected SLP documents

The authored plan and the day-to-day delivery data live in different tools, so the plan drifts out of date the moment work starts.

Manual Reg 45 reporting

Annual compliance reports are hand-assembled from spreadsheets and folders — slow, error-prone, and impossible to reproduce.

Scattered proof for the regulator

When an inspector asks “show me,” the evidence has to be hunted down after the fact rather than captured as work happens.

The system

Eight modules, one compliance record

Each module carries a branded name and the plain UI label it ships under. They share one tenant-isolated data model, so a commitment authored in Rootplan is the same object Linewatch tracks and Rootmark proves.

1

SightlineDashboard

The tenant’s live status view — tracked compliance tables and where every SLP edition currently stands.

2

RootplanSLP authoring

Write the Social & Labour Plan against the Mining Charter section skeleton, one structured commitment at a time.

3

LinewatchCompliance tracking

Track actual delivery against each planned commitment and surface drift before it becomes a finding.

4

ClearlineReports

Generate Reg 45-shaped compliance reports straight from the tracked data as a Word or PDF document.

5

TimberlineCalendar

Keep reporting deadlines and commitment milestones on a single timeline the whole tenant works from.

6

FaultlineDirectives

Log regulator directives and internal actions, and hold them against the commitments they affect.

7

RootguideTraining

Reference material that keeps authors and reviewers aligned on how each SLP section should be filled in.

8

RootmarkEvidence & Audit

The append-only spine — every change, approval, and piece of evidence captured in an immutable trail an inspector can follow.

Plan to proof

One spine, five stages

A commitment moves through Rootline in a straight line — and the moment it is locked, the record behind it stops being editable.

01

Author

Write commitments in Rootplan against the Charter skeleton.

02

Review & approve

Reviewers check each section and sign it off by role.

03

Lock

The edition is frozen. The audit trail becomes append-only from here.

04

Track

Linewatch records actual delivery against every locked commitment.

05

Prove

Clearline and Rootmark render the report and the evidence file.

Product tour

Inside the two screens that carry the work

Authoring on one side, tracking on the other — the same commitment object, seen at two points in its life.

Rootline Rootplan SLP authoring screen showing the Regulation 46 section editor, block-based content tools, and a live document preview panel; tenant-identifying details are blurred for confidentiality.

The Rootplan authoring screen, mid-edit — identifying details are blurred for client confidentiality.

Rootplan — SLP authoring

Write the plan as structured commitments, not prose

Rootplan holds the Mining Charter section structure as a skeleton and asks the author to fill it in commitment by commitment — each with an owner, a target, and a section it answers to. Because every line is a typed object rather than a paragraph, the plan is trackable from the moment it is written.

Reg 41–46Charter sections as a fixed skeleton
Per roleauthor and reviewer permissions
Lockededitions freeze on approval
Rootline Linewatch compliance-tracking screen showing the compliance update table, tracked SLP table selector, and the original SLP table for comparison; tenant-identifying details are blurred for confidentiality.

The Linewatch tracking screen — identifying details are blurred for client confidentiality.

Linewatch — Compliance tracking

Track actual against planned, and see drift early

Linewatch reads the locked commitments and lets teams record what was actually delivered against each one. Planned-versus-actual sits in a single view, so a commitment falling behind shows up as it happens rather than at report time — and every update lands in the audit trail.

Planned vs actualon every commitment
Drift flagsbehind-target surfaced early
Append-onlyeach update written to Rootmark
Multi-tenant by design

One platform, many operations, no data bleed

Rootline Administration screen on the Tenants tab, showing a tenant-control panel with an Acting as tenant selector and a Switch button; the tenant name in the selector is deliberately blurred for confidentiality.

The Administration / Tenants control. Khula operates across tenants from one place; the tenant name in the selector is intentionally redacted here.

Every mining operation on Rootline is a tenant with its own SLP editions, tracking, evidence, and branding. Isolation is enforced in Postgres with row-level security — a tenant’s rows are unreachable from another tenant’s session at the database layer, not merely filtered in application code.

White-label branding lets each operation see its own identity, while Khula operates centrally: an authorised operator switches the active tenant from the Administration screen and works inside that workspace, with the top-of-page tenant header making the current context unmistakable.

The result is a single platform Khula can run and support across many mining clients, without any client’s compliance data ever touching another’s.

Before & after

From a spreadsheet of commitments to a tracked record

The same SLP commitments, seen the old way and the Rootline way. Illustrative rows — the shape of the change, not a specific client’s data.

Before — Excel SLP commitments

Commitments re-keyed into a spreadsheet. Status is a hand-typed word, proof lives elsewhere, and nothing is reproducible.

CommitmentTargetStatusProof
Portable skills120 learnersUnknownEmail?
Local procurement40%BehindDrive
LED — clinicPhase 1Verbal
Housing units60 unitsStaleFolder
Bursaries25 awardsManualInbox
⋮ re-keyed each reporting cycle
After — Linewatch tracked view

Each commitment is a locked object with planned-versus-actual, a live status, and an evidence link written to the audit trail.

CommitmentTargetStatusEvidence
Portable skills120On trackLogged
Local procurement40%At riskLogged
LED — clinicPhase 1MetLogged
Housing units60BehindLogged
Bursaries25MetLogged
+ report generated from this data →
1source of truth for plan, tracking & proof
Livestatus per commitment, not per cycle
Immutableevidence trail behind every row
Reg 45reports generated, not reassembled
The four days

How the build ran, day by day

A locked spec on day zero, then four days of execution — each day standing on the isolation and audit foundations laid the day before.

0

Spec locked

Data model, roles, Mining Charter section structure, and the plan-to-proof flow fixed before a line was written.

1

Foundations

Auth, multi-tenancy, and Postgres row-level security stood up first, so every later feature inherited isolation by default.

2

Rootplan

SLP authoring and the review-approve-lock workflow, writing structured commitments against the Charter skeleton.

3

Linewatch & Clearline

Compliance tracking of actual-versus-planned, plus Reg 45-shaped report generation via docxtemplater and Playwright.

4

Harden & review

Notifications, background jobs, test coverage to 80%+, and a security review of the tenant-isolation and audit-trail guarantees.

Under the hood

The stack that made four days safe

Boring, proven pieces in a deliberate order — isolation and immutability at the bottom, document generation at the top.

Stack, foundation to output

Next.js (App Router) Supabase Postgres + RLS Drizzle ORM pg-boss jobs Vercel docxtemplater / Playwright doc-gen
Tenant-isolated via RLS Immutable audit trail AI optional, off by default 80%+ test coverage POPIA-aligned
One engine, different policy

The Mining Charter is a skin, not the machine

Strip Rootline back to its mechanics and there is nothing mining-specific about them: structured commitments against a policy skeleton, planned-versus-actual tracking, escalation when the two drift apart, and an immutable record left behind. That engine would outlive its first client’s framework.

The Mining Charter gives Rootline its current skeleton — Reg 41–46 sections, SLP commitments, Section 29 directives, a compliance file. But those are the policy layer. Underneath sits a domain-agnostic pattern that Khula designed the platform around.

Consider what the same engine would look like pointed at a management consultancy’s cadence-management practice — the SDCA (Sustain-Do-Check-Act) and PDCA (Plan-Do-Check-Act) discipline a firm like Semousu-Moloi Projects runs with its clients. This is illustrative, not a live integration: swap the skeleton and the machine keeps turning. You would replace Reg 46 sections with SDCA/PDCA checkpoints, SLP line items with work-practice or KPI targets, Section 29 directives with missed cadence checkpoints, and the regulator’s compliance file with an audit-trail proof record for the engagement.

Nothing in the tracking loop would have to change. This is the shape a management consultancy’s engagement tooling would take on the same engine — and it is why Khula treats the pattern, not the Mining Charter wiring, as the reusable asset. The engine outlives the first client’s specific framework.

Illustrative only. The SDCA/PDCA column is a hypothetical second application shown to make the point that the pattern is domain-agnostic. It does not describe an existing Rootline deployment or customer.

Same engine, two policy skins

The engine’s four moving parts, mapped onto what is built today and onto one hypothetical second domain.

Engine partMining SLP (built)Consultancy KPI tracking (same engine, illustrative)
SkeletonReg 41–46 sectionsSDCA / PDCA checkpoints
Commitment typeSLP line itemsWork-practice / KPI targets
Escalation triggerSection 29 directiveMissed cadence checkpoint
Proof left behindCompliance fileAudit-trail proof record
Also applicable: ISO / QMS standards, franchise playbooks, safety programs

Rootline was built so a mining operation never again has to reassemble its compliance story after the fact. The plan you author is the thing you track, and the thing you track is the thing you prove.

Plan to proof, in one tenant-isolated record — authored, locked, tracked, and left behind as evidence an inspector can follow without taking anyone’s word for it.

Want a product built this fast?

Rootline went from locked spec to a hardened, tenant-isolated platform in four days — standards intact. If you have a compliance, tracking, or reporting problem trapped in spreadsheets, tell us what it is. The first discovery call is free.