Purpose: Context for an LLM that classifies Town
Council maintenance cases into contractual urgency tiers using only the
case’s text (Description + Dlog). Derived from:
ExtractUrgentCases_24thSept2026_LLM_Percentage_gpt-6-luna_FINE_TUNE.py
(v6.4, 23 Sep 2026). It uses Contract Clause 5.4, “Order of Proceeding
and Execution of Works” (SP Page 15).
Guiding principle: Be precise and conservative. Most cases are NOT P1 or P2. If a case is vague, administrative, or only loosely resembles the examples, classify it as None.
| Tier | Response time | General criteria (Clause 5.4) | Typical meaning |
|---|---|---|---|
| P1 | 25 minutes | (i) Affects essential services to the whole
block (ii) Irregularities/defects that endanger life, limb and property (iii) Affects the security of the premises (iv) Functions needing urgent access to electricity and water supply |
Multi-unit or whole-block essential-service outage, active fire, or active structural failure |
| P2 | 40 minutes | (i) Causes nuisance/annoyance/inconvenience to
residents (ii) Defects in common areas posing security risks to residents |
A single-unit outage, or a common-area defect from the listed examples |
| None (P3) | Normal SLA (by Priority field: Normal 7 / Urgent 3 / Immediate 1 working days) | Everything else | Routine maintenance, cosmetic, nuisance, pest, hygiene, or already-resolved cases |
| Step | Check | Rule |
|---|---|---|
| 1. Evidence | What text to judge | Use Description and Dlog combined. Dlog (technician log) often has the ground truth. Ignore Category / Sub Cat Desc labels, because they are broad administrative buckets and not evidence. |
| 2. Severity Gate | Does it qualify at all? | The case must pass (A) or (B).
Sounding unsafe, unhygienic or annoying is not
enough. (A) Matches a listed example in type (see Section 3). (B) Genuine structural or mechanical failure that is active or imminent, with a real risk of injury or major property damage right now. Routine wear-and-tear does not count. |
| 3. Out-of-scope filter | Is it an excluded category? | If the case falls in Section 5, output None. The exception is when it independently passes (A) or (B). |
| 4. Special rules | Lighting, lifts, leaks, walking surfaces | Apply Section 6. |
| 5. Scope of impact | P1 or P2? | Use Section 7. One unit means P2. Multiple units, the whole block, or a shared facility used by many residents with its function impaired means P1. |
| 6. Computed evidence | Cluster or time-of-day notes | Weigh as corroboration only (Section 8). |
| 7. Resolution | Is it still ongoing? | Set resolved: true if the text shows the issue is
already fixed. Final category = None if resolved; otherwise
final category = raw_category. |
| # | Example | Notes |
|---|---|---|
| P1-i | Electrical rising main or BI connector burnt | |
| P1-ii | Whole block / carpark no electricity or water supply | “Market”, “building” and “estate” count as whole-premises |
| P1-iii | Main soil/waste pipe choke | Must be the main stack, not a unit fixture |
| P1-iv | Void deck functions need electricity/water supply | |
| P1-v | Manhole choke | |
| P1-vi | Switchroom no electricity supply to lift | |
| P1-vii | Rooftop water tank overflowing | |
| P1-viii | Pump room suction tank overflowing or any alarm on; common tap/pipe burst | Requires a common/main qualifier |
| P1-ix | Fire case | Actual fire incident only, e.g. “on fire”, “fire broke out”, “caught fire” |
| # | Example | Notes |
|---|---|---|
| P2-i | One unit without electricity/water supply | Must be currently out |
| P2-ii | Corridor/balcony rainwater down pipe choke | |
| P2-iii | Bin chute tap on / common tap on (left running) | |
| P2-iv | Public lighting not on | Restricted by the Lighting rule (Section 6) |
| P2-v | Common area pipe leaks | From shared supply infrastructure, not a sink or tap |
| P2-vi | Apron gully choke | |
| P2-vii | Ground floor soil/waste pipe leaks | |
| P2-viii | Wiring dangling in common area | |
| P2-ix | Carpark lighting not lighted / turned on late | Restricted by the Lighting rule (Section 6) |
| Domain | Scenario in text | Classification | Scope |
|---|---|---|---|
| Electricity | Whole block / building / market / estate / carpark no power | P1 | multiple_units_or_block |
| Two or more units no power (or the Dlog reveals other affected units) | P1 | multiple_units_or_block | |
| Switchroom no power to lift; rising main / BI connector burnt | P1 | multiple_units_or_block | |
| One unit no power, including “whole house/flat/unit” and “electrical trip, power off now” | P2 | single_unit | |
| Intermittent trip but power is currently on | None | not_applicable | |
| Power already restored per Dlog | raw P2/P1, resolved → None | as applicable | |
| Machine or facility outage (vending, car-wash dispenser, CRC rubbish room) | None (unless another rule applies) | not_applicable | |
| Water supply | Whole block / multiple units no water | P1 | multiple_units_or_block |
| Low pressure where the Dlog names several units on the same riser (shared PRV fault) | P1 | multiple_units_or_block | |
| One unit no water | P2 | single_unit | |
| Rooftop tank overflow; pump-room tank overflow or alarm | P1 | multiple_units_or_block | |
| Common tap left on / bin chute tap on | P2 | common_facility_many_users | |
| Pipes / leaks / chokes | Common or main pipe burst | P1 | multiple_units_or_block |
| Main / vertical / riser pipe actively leaking or discharging (even inside a flat) | P1 | multiple_units_or_block | |
| Main soil/waste pipe choke; manhole choke | P1 | multiple_units_or_block | |
| Common-area pipe leak (shared supply, control valve, overhead common pipe) | P2 | common_facility_many_users | |
| Ground-floor soil/waste pipe leak; corridor/balcony down-pipe choke; apron gully choke | P2 | common_facility_many_users | |
| Minor fixture leak (kitchen tap, sink, single drain), even if the category says “Pipe Leak” | None | single_unit / not_applicable | |
| Mentions “main pipe” or “leak” in passing, e.g. “repair done, no leak” | None | not_applicable | |
| Fire | Active fire / fire broke out / caught fire | P1 | as applicable |
| Burning material actively igniting nearby flammables (embers landing) | P1 (fire-case) | as applicable | |
| Fire door propped open, extinguisher expired, alarm testing | None | not_applicable | |
| Joss-paper burning smoke/flakes/odour, no active ignition risk | None | not_applicable | |
| Structural | Spalling concrete with debris actively falling in a shared area | P1 | common_facility_many_users |
| Crack exposing a void or canal below, possible structural failure | P1 | common_facility_many_users | |
| Tall unstable tree that may fall on people or vehicles | P1 | common_facility_many_users | |
| Open or severely undermined manhole (fall-through risk) | P1/P2 (genuine hazard) | common_facility_many_users | |
| Potholes, cracked or uneven pavement, sunken bricks, lifted jogging track, loose tiles (“trip hazard”) | None | not_applicable | |
| Lighting | Single light out (corridor, carpark, void deck, staircase, park), including when urgent, repeated or at night | None | not_applicable |
| Multiple distinct fixtures or circuits out together (e.g. corridor + staircase + lift landing) | P2 | common_facility_many_users | |
| Area in complete darkness with no safe alternative route | P2 | common_facility_many_users | |
| Flickering bulb, motion sensor not triggering, overdue lamp repair | None | not_applicable | |
| Lifts | Single lift down, no mention of other lifts | None (assume others work) | not_applicable |
| Only remaining lift down, or ALL lifts serving the block down | P1 | common_facility_many_users | |
| Lift taken out of service or physically inoperable (stated) | P1 | common_facility_many_users | |
| Lift soiled (faeces/urine/vomit) but still usable | None | not_applicable | |
| Cosmetic (scratched button, dirty panel) | None | not_applicable | |
| Security / doors / wiring | Common door detached from hinges / physically failed | P2 | common_facility_many_users |
| Dangling or exposed wiring, broken switchboard in a common area | P2 | common_facility_many_users | |
| Gate or door reported repeatedly but still functioning (slow repair) | None | not_applicable | |
| Playground / equipment | Confirmed broken safety-critical component (e.g. swing anchor broken) | P2 | common_facility_many_users |
| Rusting, loosening, creaking (wear-and-tear, no failure) | None | not_applicable | |
| Out-of-scope | Pests, noise, odour, litter, hygiene, obstruction | None | not_applicable |
| Category | Examples | Exception |
|---|---|---|
| Pests / animals | Rodents, pigeons, birds, mosquitoes, bees, insects, stray cats | None |
| Noise / odour / nuisance | Rooster crowing, incense smoke, amplified selling noise, void-deck gatherings | Active ignition or fire risk → evaluate as a fire case |
| Litter / hygiene | Rubbish, food waste, urine, vomit, faeces, a soiled lift | The facility is stated as unusable or taken out of service |
| Obstruction / space | Bicycles or belongings narrowing a corridor or void deck | It blocks a fire/emergency egress route or makes an essential facility unusable |
| Walking-surface defects | Potholes, uneven paving, lifted tiles, jogging-track surface | Genuine fall-through or entrapment hazard (e.g. an open manhole) |
| Slow turnaround | “Reported many times, still not fixed” | The underlying defect itself qualifies |
Urgent, frustrated, “ASAP”, or “safety hazard” wording never upgrades severity on its own.
Classify as P2 only if at least one of these is true: 1. Multiple distinct lights or circuits are out together. The same light reported several times does not count. 2. The text says complete or total darkness with no safe alternative route. “A bit dark” does not count. 3. A cluster signal corroborates several separate lighting outages in the same block.
Otherwise the case is None. Night-time reporting alone never upgrades it.
| Situation | Classification |
|---|---|
| One lift down, others work or none are mentioned | None |
| The only remaining working lift is down | P1 |
| All lifts serving the block are down | P1 |
| Lift explicitly out of service or inoperable | P1 |
| Soiled but usable, or cosmetic | None |
| Source of leak | Classification |
|---|---|
| Main / vertical / riser pipe, actively discharging | P1 |
| Common / main pipe burst | P1 |
| Shared supply pipe, control valve, overhead common pipe | P2 |
| Ground-floor soil/waste pipe | P2 |
| Sink, tap, single drain, fixture-level (judge the text, not the category label) | None |
| Text says | Output |
|---|---|
| “resumed”, “restored”, “rectified”, “resolved”, “back to normal”, “no further action”, “case closed” | resolved: true → final = None
(raw_category is still recorded) |
| Issue ongoing | resolved: false → final = raw_category |
| Scope | Key phrases | Tier (if the Severity Gate is passed) |
|---|---|---|
single_unit |
“my unit”, “this unit”, “#05-123”, “whole house”, “whole flat”, “whole unit”, “entire home” | P2 |
multiple_units_or_block |
“two units”, “several units”, “whole block”, “whole building”, “whole market”, “whole estate”, “entire carpark”, or the Dlog naming several affected units | P1 |
common_facility_many_users |
Lift, common corridor, shared water tank, playground, common door. The function must be impaired. | P1 or P2, per the matrix |
not_applicable |
Routine, cosmetic or out-of-scope | None |
Word trap: “whole” and “entire” do NOT mean P1 automatically. Check the noun they attach to. - “Whole house no power” → P2 (one dwelling) - “Whole block no power” → P1
Scope can change: Judge scope from Description and Dlog together. A complaint that says “this unit” becomes P1 if a later Dlog entry names other units with the same issue from a shared cause. Units mentioned for unrelated reasons do not count, for example a neighbour as the leak source, or a neighbour’s water shut off during investigation.
Scope only decides which tier applies. It never turns a routine or cosmetic case into P1 or P2.
| Signal | Meaning | How to weigh it |
|---|---|---|
| Cluster signal | 4 or more outage complaints (no power / no water / blackout) from the same block within 30 minutes | Strong support for multi-unit scope → P1, unless the case’s own text shows it is isolated, unrelated or resolved. It does not make a non-outage case P1. |
| Time-of-day signal | Lighting complaint timestamp, with night defined as 7pm–7am | Corroboration only. It never upgrades a single light. It only makes a “total darkness” claim more plausible. |
| # | Case text (abridged) | Raw | Scope | Resolved | Final |
|---|---|---|---|---|---|
| 1 | Whole block no electricity supply | P1 | multiple_units_or_block | false | P1 |
| 2 | Unit 05-123 no electricity supply | P2 | single_unit | false | P2 |
| 3 | Fire door propped open at block 3 | None | not_applicable | false | None |
| 4 | Fire extinguisher expired | None | not_applicable | false | None |
| 5 | Kitchen tap pipe leaking slightly | None | single_unit | false | None |
| 6 | No water in unit. Dlog: supply resumed, case closed | P2 | single_unit | true | None |
| 7 | One carpark light not working (blk 37A) | None | not_applicable | false | None |
| 8 | Concrete cracked, can see down into canal, possible structural issue | P1 | common_facility_many_users | false | P1 |
| 9 | Heavy water/foam actively discharging from top of main vertical pipe in flat | P1 | multiple_units_or_block | false | P1 |
| 10 | Switchboard broken, wire hanging out of box, near lift F | P2 | common_facility_many_users | false | P2 |
| 11 | Whole market no EL supply | P1 | multiple_units_or_block | false | P1 |
| 12 | Whole house no power supply, check ASAP | P2 | single_unit | false | P2 |
| 13 | Two units on level 5 no water since morning | P1 | multiple_units_or_block | false | P1 |
| 14 | Lift soiled with faeces, urgent cleaning, many affected (still usable) | None | not_applicable | false | None |
| 15 | Lift button panel slightly scratched | None | not_applicable | false | None |
| 16 | Low water pressure “in this unit”; Dlog: 3 units on same riser, shared PRV fault | P1 | multiple_units_or_block | false | P1 |
| 17 | Electrical trip disrupted supply to the unit (currently out) | P2 | single_unit | false | P2 |
| 18 | Potholes and cracked pavement near lamp post, risk to elderly/children | None | not_applicable | false | None |
| 19 | Sunken red-brick flooring, trip hazard | None | not_applicable | false | None |
| 20 | Lifted rubber jogging-track surface, tripping hazard | None | not_applicable | false | None |
| 21 | Bicycle overcrowding at void deck reducing space | None | not_applicable | false | None |
| 22 | Amplified selling noise disrupting shift worker’s sleep | None | not_applicable | false | None |
| 23 | Rodent activity at rubbish chute | None | not_applicable | false | None |
| 24 | Severe spalling concrete, debris falling, public safety risk | P1 | common_facility_many_users | false | P1 |
| 25 | Tall unstable tree may break in winds and damage vehicles | P1 | common_facility_many_users | false | P1 |
| 26 | Corridor light + staircase light + lift landing light all out | P2 | common_facility_many_users | false | P2 |
| 27 | Diverted path in complete darkness at night, no lighting at all | P2 | common_facility_many_users | false | P2 |
| 28 | Lift B not responding (no other lift mentioned) | None | not_applicable | false | None |
| 29 | Only lift left working has broken down; other lift out since last week | P1 | common_facility_many_users | false | P1 |
| 30 | Joss paper burning in corridor, flakes, smoke, smell | None | not_applicable | false | None |
| 31 | Power trips from time to time; currently there IS electricity | None | not_applicable | false | None |
| 32 | Common staircase door detached from hinges | P2 | common_facility_many_users | false | P2 |
| 33 | Side gate reported several times, not yet attended (still functions) | None | not_applicable | false | None |
| 34a | Playground swing anchor point broken | P2 | common_facility_many_users | false | P2 |
| 34b | Playground screws rusting and loosening, creaking | None | not_applicable | false | None |
| 35 | Hawker centre sink leaking (category says “Pipe Choke/Leak”) | None | not_applicable | false | None |
Return only one JSON object, with no markdown and no extra text:
{
"raw_category": "P1 | P2 | None",
"affected_scope": "single_unit | multiple_units_or_block | common_facility_many_users | not_applicable",
"resolved": true,
"confidence": "High | Medium | Low",
"rationale": "<= 25 words explaining the decision, referencing scope where relevant"
}
raw_category: what the case matches,
ignoring resolution.resolved: whether the issue is already fixed according
to Description or Dlog.None if resolved else raw_category.| Signal | Weight (% of 100) |
|---|---|
| P1 contractual urgency | 45% |
| P2 contractual urgency | 40% |
| MP escalation intent (regex) | 35% |
| SLA breach: 1–3 / 4–12 / 13+ days over | 5% / 10% / 15% |
| Bonus (escalation, safety or repeat), only when SLA breach is the sole primary signal | +5% |
Risk Level: Critical ≥ 70, High ≥ 40, Medium ≥ 20, Low < 20. P1 and P2 cases are never dropped by the 50-case daily cap.
affected_scope whole_block, which is not one of the four
valid values. The parser silently changes it to
not_applicable, which corrupts the
_UrgencyScope audit column. This matrix uses
multiple_units_or_block instead. The same fix is
recommended in the script.