# Development status

_Last updated: 19 Nov 2026_

## Current phase: 1 — Foundation (code complete, awaiting first test run)

The code for this phase was written in an environment that could not download Composer packages. Every PHP file passes `php -l`, but **the automated test suite has not been run yet.** The first thing to do on a machine with Composer is:

```bash
composer install && php artisan test
```

Then fix anything that fails before starting Phase 2. Phase 1 is not "Done" (Part 0.3) until the tests pass.

## Done in Phase 1

| Module | Notes |
|---|---|
| Skeleton | Laravel 12 slim structure, Vite + Tailwind 4 + Alpine, phpunit, Larastan config |
| Locations | countries, provinces, districts, tehsils, localities, location_redirects. Denormalised ancestor IDs. Operational status, verification gate, admin editing, CSV import (preview → confirm) and export. 709-tehsil seed. |
| Access control | roles, permissions, role_permissions, role_assignments (scope_type/scope_id, expiry, revocation). `ScopeResolver::allows()` and `apply()`. `permission:` middleware. `Gate::before` bridge. |
| Feature switches | `config/features.php` registry (55 keys), `feature_flags` table, dependencies, regional overrides, scheduled switch fields, admin UI, artisan commands, `feature:` route middleware, `@feature` Blade directive |
| Reporters | Registration (encrypted CNIC and address, CNIC HMAC for duplicates, private documents, EXIF stripping, honeypot, rate limit). Verification state machine. Info requests. Internal notes. Document viewing, audit-logged. Reporter role granted on approval, scoped to the tehsil. Reporter status dashboard. |
| Platform | Append-only audit log with redaction. System settings with defaults. Policy acceptance records. Security headers. Login with rate limiting. Password re-confirmation. |
| Bilingual UI | `/ur` and `/en` prefixes. RTL/LTR. Noto Nastaliq Urdu typography rules. Full ur/en translation files (parity checked). Urdu validation messages. |
| Tests | 6 feature test files, about 35 tests |

## Known gaps and issues

- **2FA for staff (Part 4.1)** is not built yet. Password re-confirmation is in place. Next step: add TOTP (for example `pragmarx/google2fa`) or Laravel Fortify.
- **Phone OTP** is switched off until an SMS provider is chosen (decision D-05).
- **The Noto Nastaliq Urdu font files** must be added to `public/fonts/` by hand (see the multilingual guide).
- **Rejected applications:** the scheduled purge of their identity documents (90-day retention) is not written yet.
- **Role assignment UI:** staff roles can only be assigned through tinker or a seeder for now. An admin screen is planned for the start of Phase 2.
- Legal and policy pages are placeholders until legal review.

## Next three tasks

1. Run `composer install && php artisan test`, then fix any failures.
2. Build the admin screen for role and scope assignment, plus staff 2FA.
3. Phase 2: `news_articles` and `news_translations`, the submission form, and the editorial workflow state machine.

## Open decisions

D-01 (default language), D-03 (Urdu digits), D-05 (SMS provider), D-10 (payout cycle), D-11 (pilot districts), D-12 (editorial hours), D-15 (brand name and domain). See `PROJECT_REQUIREMENTS.md` Part 44.
