# Maint Desk

**maint-desk.infinity-sdg.com** — maintenance management for plants and facilities. Hazardous work only starts under verified lockout/tagout, and every job is closed out by a second person.

```
area → asset (in service | down | retired) → PM plans (interval, next due)
service request: anyone reports a problem → AI suggests category, priority and asset
    → a supervisor accepts, overrides with a reason, or rejects (duplicate / not maintenance)
work order: open → assigned → in progress → completed → closed
    hazardous work starts only under a verified lock; labor and parts logged against active work
    close-out verified by someone other than the technician; a failed check reopens it with a note
lockout: applied → verified (zero energy, by a second person) → removed (only after the work)
nightly: PM plans past their next due date are flagged due
```

## What it enforces

| Rule | Why |
|---|---|
| Hazardous work starts only under a verified lockout | Lockout/tagout is a gate, not a checkbox |
| Whoever applied a lock can't verify zero energy | A second person tries the start |
| Locks come off only after the work is completed | Equipment isn't re-energized mid-job |
| No close-out while any lock is still on | Nothing is closed with a lock forgotten |
| The technician who did the work doesn't verify it | Independent close-out |
| Work is completed only with labor on record; parts and labor only against work in progress | Costs land on the right job |
| A request becomes work only after its AI triage was accepted or overridden | The AI suggests; a supervisor decides |
| Overriding the AI's triage, rejecting a request, reopening work, taking an asset down: each needs a note | Every exception is explained |
| Retired assets get no new work; a due PM plan resets only after its preventive work closes | The PM calendar reflects work actually done |

Every resource is audited. Assets, requests and work orders keep a readable history.

## Resources, views, roles

- **Resources:** area, asset, pmplan, servicerequest, workorder, lockout, part, partuse, laborentry
- **Views:**
  - `workQueue`
  - `locksOn`: every lock currently on equipment
  - `triageReview`: the AI's priority versus the supervisor's, with the reason
  - `duePlans`
- **Roles:**
  - `requester`: reports problems
  - `technician`: locks out, works, logs labor and parts
  - `supervisor`: triages, assigns, verifies close-out
  - `planner`: assets, parts, PM plans
  - `admin`

## Demo data

The demo is a food-packaging plant with 10 areas, 30 assets and 14 storeroom parts. One asset (the kettle mixer) is down right now, and one is retired.

There are 12 PM plans:

- 4 were reset after their preventive work closed
- 3 are due, with work in progress, assigned or open
- 1 is paused

There are 24 service requests that the AI triaged:

- 14 accepted
- 5 overridden by the supervisor with a reason. For example, a "low" drip was raised to high because it's the only line running the holiday order. A "transformer emergency" was lowered after an infrared scan.
- 3 rejected as duplicates or not maintenance
- 2 waiting

There are 30 work orders in every state:

- 17 closed
- 3 completed and awaiting verification
- 4 in progress
- 3 assigned
- 2 open
- 1 canceled

One close-out failed verification and was reopened: the cold room was still warm, and a failed defrost timer was replaced.

There are 26 lockouts. Each was applied by the technician and verified by the supervisor. Every lock on finished work has been removed, and 8 are on equipment now.

Every decision is made by the demo user who would make it (`requester1`, `tech1`–`tech3`, `super1`, `planner1`), with that user's own roles. That needs Kalos seeder 1.2.0 or later.

Everything in the demo is invented. To regenerate the data, run `python3 seeds/gen_seed.py`.

## Run it

```bash
scripts/kalos.sh validate    # static checks
scripts/kalos.sh start       # kalosd on :9223
scripts/kalos.sh verify      # live checks
```

By default, `KALOS_REPO` is `../kalos`.

Sign in with `admin` / `Admin123!`. The other users are `requester1`, `tech1`, `tech2`, `tech3`, `super1` and `planner1`, all with password `Demo123!`.

## Reselling

This is an original ISDG product for manufacturers, utilities, campuses and property operators. It has no customer data and no third-party branding. In a real deployment, lockout procedures, energy sources and PM libraries are configured per site, following the operator's own written energy-control program.
