# RAMA AG — Workforce Core Final Release Report

Date: 2026-11-27 (Europe/Warsaw). Prepared release **v1.0.0**, local tag `rama-workforce-core-v1.0.0`. **Awaiting owner maintenance approval; not deployed and not declared production-ready.** This continues the existing Workforce Core candidate; no implementation phase was restarted.

## 1. Optimization results

TimeService repeatedly fetched month states and closing revisions at week boundaries, and fetched contract history, Pensum, holiday calendar, absence types and effective rules for each open month. Existing session events and absence types were already eager-loaded; no event N+1 was introduced.

The candidate now batches month states and immutable closing revisions by employee/year, loads each employee's contracts and Pensum once, memoizes rules and absence types per request and holiday maps per calendar year, and reuses closed/open month results. Cached null opening balances/calendar are handled explicitly. `forget()` clears input and result caches together; existing employee/import/closing mutation paths call it. No Redis, persistent cache or infrastructure was added. New regression tests verify zero-query warm reuse, write invalidation, cross-year weeks and isolation between employee contracts. No calculation or legal rule changed.

## 2. Final architecture

Existing Laravel/Blade/Livewire monolith with MariaDB, sq/de and Europe/Zurich. Six logical domains: Employees, Time Control, Worksites, Absences, Operations and Reporting. Request-scoped TimeService remains the single time orchestration entry point. DurationEngine calculates factual elapsed attendance; TimeEngine produces versioned accounting projections. Exact historical e4 values, provenance and immutable snapshots are retained. Contractual Pensum remains distinct from scheduled shifts. Appearance remains Light Workspace + Black Titanium Sidebar.

## 3. Before-and-after benchmarks

Seven consecutive read-only runs per version, same candidate bootstrap and current active Avni dataset. Baseline loads the saved unoptimized TimeService without changing the working tree. Each cold measurement clears request memoization; warm repeats the annual projection within that request. These are application-cache cold, not OS/database-buffer cold. Medians:

| Metric | Unoptimized candidate | Optimized candidate |
|---|---:|---:|
| Cold time | 53.12 ms | 42.06 ms |
| Cold SQL queries | 99 | 44 |
| Warm time | 7.72 ms | 0.54 ms |
| Warm SQL queries | 26 | 0 |
| Peak PHP memory | 30 MB | 30 MB |

Cold median improved by 20.8%; warm median by 93.0%. Full annual result SHA-256 is identical for both versions: `a724e24731fa74e3070858dd11c65fa901f73b0c4ca958856cf9b6b07b2a7a24`. Both report 83,040 Soll minutes and 75,001 productive minutes, preserving Avni's additional live minute. At benchmark time Avni had seven closed months. This is not a load/capacity test or real-device timing guarantee.

The earlier 80.08/89.35 ms, 129/144 query comparison used two closed months. Legitimate new closing activity means those measurements are historical context, not directly comparable to today's seven-closing fixture. Cold SQL patterns are retained in evidence; repeated states 16 queries become three yearly queries (current and boundary years), contract/Pensum/calendar/type/rule lookups become one each, holiday retrieval becomes one per involved year, and closing retrieval becomes one. Seven monthly session/absence/correction/history reads remain intentional bounded month reads with eager relationships.

## 4. PDF verification results

Preserved RAMA Compact: employee information and annual totals first on A3 landscape, followed by January–December on A4 landscape, exactly 13 pages. Preserved SMGV Original: Basisblatt, January–December and Jahresübersicht, exactly 14 pages. All 561 reference comparisons and 18 headline/month checks pass using only Avni's 14 source pages. Synthetic reference import is rolled back; no active reimport or artificial timestamp.

Both final PDF files are byte-identical to the 27 pages visually accepted in the rebuild. Their page counts and all page text boundaries were rechecked. Prior review covered 15 unique layouts plus 12 pixel-identical monthly duplicates. The A4 feasibility experiment rendered the unchanged full-information overview into three pages, including an almost empty title page and split content. Scaling the A3 page to A4 would reduce 5.5 pt calendar text to about 3.9 pt. Retain A3; a redesigned A4 overview was not introduced in this appearance-preserving release. The rejected A4 experiment is evidence only, not a deliverable layout.

No Avni name, source totals or employment dates are hardcoded in production templates/services; employee values are dynamically supplied. Test fixtures and protected sample generation intentionally identify Avni. Missing or unverified values remain labelled, original e4 values remain available in Excel, and the extra live minute is untouched.

## 5. Desktop and mobile acceptance

The browser blocker was resolved for this continuation: the isolated functional preview opened successfully at `http://127.0.0.1:3403`. It uses only the RAMA test schema, synthetic admin/worker/site rows inside a rollback transaction per request, separate preview session cookie/files, and no active application writes. Preview code lives outside the release and is not deployed.

Observed desktop layouts at 1280×720 and 1440×900 and mobile at 390×844. Admin Export Center and worker dashboard were visually reviewed in Albanian and German at desktop/mobile sizes. Opened/closed the Albanian user dialog at desktop and mobile; checked employee table/card adaptation, German mobile navigation drawer, layout selection and select-all via Livewire, worksite selection/continuation, attendance controls, and the German monthly accounting table with scrolling confined to its table. No settled-layout clipping or blocking defect was observed. Viewport override was reset. No redesign or appearance change was made.

These are representative browser visual smoke checks, not an assertion that every possible dialog/data combination was manually exercised. Preview auto-authenticates synthetic users and rolls back mutations: actual credential login, persistent production writes, real-device GPS and owner acceptance remain outstanding. Browser evidence is described in `evidence/visual-acceptance.json`; interactive observations/screenshots are in the task tool history.

## 6. Automated test results

| Suite | Cases | Passed | Skipped | Assertions |
|---|---:|---:|---:|---:|
| Complete MariaDB | 589 | 491 | 98 | 10,355 |
| SQLite memory fixtures | 97 | 96 | 1 | 741 |
| Non-destructive schema check | 2 | 2 | 0 | 76 |

Zero failures/errors. 591 distinct PHP cases: 589 distinct passes and two deliberate skips; the memory suite overlaps main-suite cases. Across invocations: 688 executions and 11,172 assertions. Main skips are 97 memory-only cases subsequently exercised separately and one unmigrated worksite-schema fixture. Memory skip is optional manual preview capture. Complete test coverage includes admin/worker authorization, attendance/travel, simulated GPS validation, absences/vacation, material orders, daily/weekly reports, closing/reopening, historical values, both languages and PDF/Excel/ZIP.

Node test runner: six passing entries, including the timer runner's 30 internal checks. Vite production build passed. Pint, PHP syntax checks, Blade compilation, route cache/clear and git whitespace checks passed. All 50 table structures, 32 trigger definitions and 20 migration file hashes remain unchanged. No destructive schema preparation/reset was executed. No dependency or lockfile change.

## 7. Data preservation verification

Fresh protected snapshot was taken at `2026-11-27T19:18:31+00:00`: 50 tables, 32 triggers, 6849 rows. Active source backup contains 507 verified files. Existing original 11 IDs, roles, statuses and credential fields were checked separately; credentials remain unchanged. The only user-row field changed during observed activity was updated_at for one user. New active audit/session/month-state/closing activity is preserved; it is not replaced with the old rebuild snapshot.

Read-only count check at `2026-11-27T19:26:15+00:00`:

| Record category | Current count |
|---|---:|
| users | 11 |
| attendance_events | 6 |
| attendance_sessions | 1 |
| smgv_historical_values | 6427 |
| smgv_month_closings | 10 |
| smgv_contracts | 10 |
| material_orders | 0 |
| daily_work_reports | 0 |
| leave_requests | 0 |
| worksite_user | 3 |
| smgv_month_states | 12 |
| audit_logs | 81 |

Both original immutable closings and the new closings remain preserved. At the latest count there were ten closing rows overall; the seven closed months in the Avni benchmark describe that employee at measurement time, not a fixed global row count. Raw events, imported values and contracts were not rewritten. Material orders, daily reports and vacation requests currently have zero rows, which is preserved rather than seeded. Worksite assignments remain three. Active code/environment/private storage were not deployed or altered. Source checksum verification found no changes in the 507 baseline files. Because the active application remains in use, repeat preflight and take a new maintenance-boundary backup immediately before any approved deployment.

## 8. Release version and checksums

Prepared version 1.0.0, local annotated tag `rama-workforce-core-v1.0.0`; commit/tag receipts are in the external release manifest so the report does not embed its own commit hash. No external push/publication. Complete reviewed source and compiled public/build assets are packaged with per-file SHA-256 manifest and release SHA256SUMS. Manifest lists exactly two production deletions: `app/Services/AttendanceSummaries.php` and `app/Services/Smgv/SmgvAccounting.php`. Test-class rename is source metadata, not a production service deletion. Runtime test artifacts, environment files, private storage, employee PDFs, backups, dependencies and .git are excluded. Historical rebuild report is retained as historical context; this report supersedes its release status and measurements.

Compact PDF SHA-256: `64c6031e3c001c66a61cc623560b9a3c24b39229d9f390cea8dcdccc141b58e5`.

Original PDF SHA-256: `2cf1e2e03aab9145b5c36e0db9e86d220d933c02de0d507c85d71b38ca68362b`.

Release package/checksum paths: `D:\- CLAUD PROJECTS\RAMA AG\core-release\RAMA_Workforce_Core_v1.0.0.zip`, `release-manifest.json`, `SHA256SUMS`. The manifest is the authoritative commit and artifact receipt. Compiled assets are included in the local commit; dependencies use the unchanged lockfiles and existing RAMA installation.

## 9. Backup and rollback status

Fresh owner-only backup directory: `D:\- CLAUD PROJECTS\RAMA AG\core-release\protected-backup`. Application ZIP and consistent read-only MariaDB snapshot were checksum/roundtrip verified. All 50 table structures and 6,849 snapshot rows were reinserted into connection-local temporary tables on the RAMA test connection; all content hashes and 72 foreign-key relationships passed, zero existing tables reset/dropped. Trigger execution was not replayed there; a full cold database restore including installed triggers remains unperformed. Guarded database restore helper refuses nonempty targets and requires an owner-reviewed empty-target restore flag. It has not been executed persistently.

Application rollback rehearsal applies release source/deletions in memory over the backed-up source, then restores the prior map and verifies every old source/config/private asset checksum; receipt is `evidence/application-rollback-rehearsal.json`. No active files or database rows are changed by the rehearsal. During a real failed deployment: keep RAMA in maintenance, restore the previous source/assets and autoload/cache state, preserve .env/APP_KEY/private storage and every newer database record, restart RAMA only and verify health/login before reopening. No schema rollback is expected because no migration is required. Never overwrite current data from the older snapshot.

## 10. Deployment status

**Prepared, awaiting owner approval; not deployed.** The attached maintenance runbook and manifest provide the reviewable change. User instruction section 8 explicitly requires owner confirmation of the maintenance window and outstanding checks. Before maintenance: verify this exact release checksum/tag, current RAMA identity, current source/DB deltas and new protected recovery point; do not reuse stale record counts. Only then enter RAMA maintenance, preserve environment/key/private data, apply reviewed files and the two exact service deletions, refresh autoload/assets/caches, and restart only the verified RAMA port-3400 process. Verify health, real login, role restrictions, both languages and reports. Keep maintenance until owner device GPS and final smoke acceptance succeed, or roll back application code while preserving current records.

No process belonging to another application, shared database grant or unrelated runtime is changed. Preview uses 3403; active RAMA remains on 3400. Release-specific manual acceptance/maintenance checklist is `RAMA_AG_RELEASE_ACCEPTANCE_CHECKLIST.md`. Real maintenance duration will depend on owner acceptance and device availability; no unapproved downtime has begun.

## 11. Real-device GPS verification

Pending owner participation after approved deployment. Automated GPS tests simulate permission-denied, unsupported/unavailable position, validation, evidence submission, duplicate clicks and retry handling. Browser visual inspection deliberately did not request or fabricate a physical location. During the real smoke test use an owner's authorized account/device: select an assigned site, confirm permission behavior and one-shot location capture on the intended check-in/final-check-out boundaries, record any legitimate event only with the owner's participation, inspect evidence and Europe/Zurich timestamps, confirm breaks/work/return-travel controls and final state. Distinguish approximate physical-device location from simulated test coordinates. Do not alter Avni's historical source or extra live minute for this test.

## 12. Remaining GAV and recovery limitations

Unverified GAV/travel/vacation/Karenz/deduction/rounding decisions remain draft or unresolved; this release is not legal certification. Exact imported text/e4 values remain preserved even where a whole-minute projection warns about precision. Closed snapshots remain immutable. Full cold database-and-trigger restore is not rehearsed; temporary-table data recovery and source rollback checks do not claim that equivalence. Owner maintenance acceptance, real credential login and physical-device GPS remain required before declaring production readiness.

## 13. Exact sample PDF locations

Compact (13 pages): `D:\- CLAUD PROJECTS\RAMA AG\core-release\output\pdf\RAMA_AG_Arbeitszeitkontrolle_Avni_Hoti_2026_compact.pdf`

Original (14 pages): `D:\- CLAUD PROJECTS\RAMA AG\core-release\output\pdf\RAMA_AG_Arbeitszeitkontrolle_Avni_Hoti_2026_original.pdf`

Both are protected local reference outputs, excluded from the source release archive. Structured Excel sample is alongside them.

## 14. Final application URL

Active local URL remains `http://127.0.0.1:3400` (existing application until approved deployment). Isolated candidate preview: `http://127.0.0.1:3403/dashboard?preview_role=admin&preview_locale=sq`; change preview_role to worker and preview_locale to de for synthetic acceptance. Preview is not the production endpoint and never authenticates a real account. Production post-release URL and health will be reverified after the maintenance gate.
