# RAMA AG — Phase 01 clone report

Date: 26 November 2026 (Europe/Warsaw)

## Outcome

The independent RAMA AG application is running locally at **http://localhost:3400**.
Its codebase, database, credentials, keys, sessions, storage and Git history are separate from Quality.
No administrator account or default password was created. Nothing was deployed online.

**One security requirement remains partially unmet:** the existing shared MariaDB server gives all
accounts inherited PUBLIC privileges on generic `test` and `test_%` schemas. RAMA's explicit grant
is restricted to its own schema, and access to Quality is denied, but its effective server privileges
are therefore not exclusively confined to RAMA. Those shared grants were not changed because doing
so could affect unrelated applications. See the remaining-actions section.

## Source verification and preservation

- Source: `C:\Users\PANDAZZ\Desktop\Quality\quality-workforce-laravel`.
- Quality URL: `http://localhost:3200`; HTTP 200 verified initially on `/login` and finally on `/up`.
- Quality database: `quality_workforce_laravel`, server `127.0.0.1:3307`, MariaDB 10.11.19.
- Architecture inspected before copying: Laravel 13, Livewire 4, Blade, Vite, Dompdf,
  PhpSpreadsheet, policies, role/module gates, services, migrations and sq/de catalogues.
- SHA-256 comparison found no changes to 10,918 inspected source files, including copied
  application/dependency/runtime files. No source edits, commands booting Quality's Artisan,
  migrations, imports, resets or truncations were performed.
- Read-only server checksums of all 29 Quality business tables were unchanged across verification,
  including users, attendance, orders, reports, permissions and audit records.
- Routine sessions/cache were excluded from business checksums. Normal HTTP verification of Quality
  may create anonymous sessions and ordinary runtime activity; no direct Quality database writes
  or schema changes were issued.
- Existing Quality HTTP and MariaDB listener process IDs remained 11360 and 61324.

## New project and independent history

- Project: `C:\Users\PANDAZZ\Desktop\RAMA-AG\rama-workforce-laravel`.
- URL: `http://localhost:3400` (bound to loopback only).
- Port 3400 was checked before launch. No existing listener was stopped or reassigned.
- New independent Git repository initialized on `main`; no remote configured or copied.
- First-party source, migrations, language files, views, routes, tests and required public assets
  were copied through an allowlist. Dependencies and the PHP runtime have independent physical copies.
- Source `.env`, APP_KEY, Git/CI credentials, deployment material, backups, SQL dumps, database files,
  uploaded documents, sessions, caches and logs were excluded.
- Public assets contain rebuilt frontend code, the existing two decorative images and a new plain
  text RAMA placeholder. Quality's company logo was excluded.
- No linked source directories/files, copied private uploads or SQL/SQLite database files were found.
- Reviewed 447 staged source files before the report: no source or RAMA environment secret values.

## Database structure and clean initialization

| Purpose | Schema | Dedicated account |
| --- | --- | --- |
| RAMA application | `rama_workforce_laravel` | `rama_local@127.0.0.1` |
| Synthetic integration tests | `rama_workforce_laravel_test` | `rama_test@127.0.0.1` |

The schemas and users were created only after confirming they did not already exist. Each account
received its own random password and an explicit grant only on its corresponding schema.
Application/test accounts cannot access one another's schemas. RAMA cannot read Quality's users table;
MariaDB denied that query. Existing shared PUBLIC privileges are the exception described above.

All **16 source migrations** ran successfully against the initially empty application schema:

- **32 tables**, matching source table DDL after excluding live AUTO_INCREMENT counters.
- Columns, indexes, unique constraints, foreign keys and CHECK constraints match.
- Worksite/user relationships and permission structures match.
- **26 triggers** match source event/timing/table/action definitions.
- Trigger definers belong to `rama_local@127.0.0.1`, not Quality's account.
- Migration names match the source; RAMA's migration history was generated by running migrations.
- No source routines or scheduled database events were present.
- No schema-only transfer was necessary and no populated database was imported.

The only initialized business configuration rows are one migration-created `company_settings` row
and four migration-defined role capability grants. Migration history contains 16 entries. Anonymous
sessions were generated by RAMA's own HTTP checks. **Users, employee details, worksites, attendance,
material orders and reports contain no copied Quality records.** Test fixtures live in the dedicated
test schema or SQLite memory, not the application schema.

## Environment and storage isolation

- `APP_NAME="RAMA AG Workforce"`, `APP_URL=http://localhost:3400`, local environment, debug disabled.
- Quality, RAMA application and RAMA testing APP_KEY values were verified to be distinct.
- Separate `.env` and `.env.testing`, ignored by Git; file ACLs restricted to the current user and SYSTEM.
- Session cookie: `rama_ag_session`; locale cookie: `rama_ag_locale`.
- Cache prefix: `rama_ag_cache_`; browser sidebar preference: `rama_ag_sidebar`.
- RAMA does not emit the shared `XSRF-TOKEN` cookie. Blade forms and Livewire retain their
  per-session form/meta CSRF tokens, avoiding a localhost cookie collision with Quality.
- Private files use this project's `storage/app/private`; runtime files remain inside its own storage.
- `RamaIsolationServiceProvider` rejects incorrect database names, users, host, port and DB_URL overrides.
  It removes unused framework connections and checks session/cache namespaces and the storage root.
- Application startup requires the dedicated RAMA MariaDB identity. Testing also allows strictly
  SQLite `:memory:` for the source's guarded synthetic fixture suites; disk SQLite is not allowed.
- The legacy cross-company data-import command was excluded; automatic account seeding is disabled.

## Outbound communications

Phase 01 forces the array mail transport and cancels mail before transport delivery. External Laravel
notification channels are cancelled; in-app database notifications remain available. Broadcasting and
browser desktop notifications are disabled. Laravel HTTP requests without an explicit fake are blocked.
Original mail/API credentials and report recipients were not copied.

Tests verified actual mail cancellation and zero messages in the array transport. Inherited delivery
retry tests use only fake mail or a transport that immediately throws; they never contact SMTP.
No external mail or notification was sent during this work.

## Branding readiness

- RAMA company/application labels appear on login, sidebar, page titles, Settings, email templates,
  PDF report headers and Excel metadata/export filenames.
- `config/rama.php` and RAMA_* environment values configure company name, logo path, optional PNG
  report logo, address and contact details. Existing sq/de language infrastructure remains intact.
- Settings displays the configured company details to administrators. Existing operational company
  settings and role-permission interfaces remain available; no extra branding database columns were added.
- The favicon and sidebar/login logo use `public/brand/rama-placeholder.svg`, a plain text placeholder.
  PDF/Excel headers use the RAMA company name until a report-compatible PNG is supplied.
- No address, contact details, corporate logo or corporate colors were invented. Existing styling
  was retained. Internal `qw` identifiers and established order numbering remain for compatibility.

## Module compatibility

The original dashboard, employees/roles, attendance/GPS, worksites, schedules, leave requests,
daily/weekly/monthly reports, material orders, administrator Settings, role permissions and
automatic/manual attendance implementations remain the foundation.

The source's existing `QW_RETURN_TRAVEL_ENABLED=true` application setting was preserved. Worksite
selection retains the source's default opt-in behavior; no feature was automatically activated.
No RAMA-specific workflow redesign was introduced.

## Verification results

| Check | Result |
| --- | --- |
| Quality final health endpoint and RAMA login | Both HTTP 200 |
| RAMA login branding/cookies | RAMA present; Quality company absent; independent session; no shared XSRF cookie |
| Schema comparison / trigger integrity | Complete match; all 26 integrity triggers verified |
| Source business-table checksums | All 29 unchanged |
| Inspected source file hashes | All 10,918 unchanged |
| Main MariaDB test suite | 422 passed, 98 skipped, 8,801 assertions; runner exit 0 |
| Guarded SQLite-memory fixture suite | 96 passed, 1 skipped, 738 assertions; direct PHPUnit exit 0 |
| Final isolation regression subset | 6 passed, 17 assertions |
| JavaScript tests | 6 groups passed, including 30 timer checks and 5 GPS cases |
| Vite production build | Passed |
| Routes | Compiled successfully; cache then cleared for development/Livewire testing |
| Blade views | Compiled successfully |
| UTF-8 first-party text | 419 application/test files verified |
| Noninteractive administrator onboarding | Refused, as intended |
| Git remote / staged secrets | No remote; no environment secret values staged |

The main suite skips 97 tests that require the separate SQLite-memory harness, plus the obsolete
unmigrated-schema scenario because the worksite tables now exist. The memory suite skips one optional
browser screenshot capture. No interactive browser screenshot review was performed. The login test
authenticates a synthetic RAMA test user and verifies that Quality's encryption key cannot decrypt
the resulting RAMA session cookie; it does not create an account or authenticated session in Quality.

Test-only adaptations updated old logo/export expectations, a mojibake heading assertion, optional
worksite UI expectations and obsolete JavaScript method names. Mail tests were adapted to isolated
fakes/refusal transports. Business module behavior was retained.

## Remaining blockers and manual actions

1. **Strict effective database privilege restriction:** obtain an administrator review of the existing
   PUBLIC grants on `test` and `test_%`. Removing them is a shared-server change that could affect
   other applications and was outside this safe clone. Quality schema access is already denied.
   Do not describe the accounts as having exclusively RAMA effective privileges until this is resolved.
2. **Administrator onboarding:** run the command below in an interactive local terminal. It requests
   name, email, username, language and a hidden password with confirmation. Password length is
   12–128 characters, echo fallback is disabled, and no credentials are accepted as arguments.
3. Supply RAMA's real logo, report PNG, address/contact information and any later design requirements.
4. Outbound delivery remains disabled until a separately authorized phase configures and reviews it.

```powershell
Set-Location -LiteralPath 'C:\Users\PANDAZZ\Desktop\RAMA-AG\rama-workforce-laravel'
& '.\.tools\php\php.exe' artisan rama:admin
```

RAMA is already running. For a later restart, with the existing MariaDB service available:

```powershell
.\scripts\start-rama.ps1
```

The startup script refuses an occupied port; it does not stop Quality, MariaDB or unrelated services.
No online deployment or later-phase client workflow work was performed. Phase 01 ends with this report.
