---
name: lfcs-docket-check
description: Check whether today's signed docket photo has been received for the active LFCS dayworks/hybrid job. Flag at-risk revenue if missing.
version: 0.1.0
metadata:
  hermes:
    tags: [lfcs, construction, docket, revenue, dayworks]
    category: domain
    requires_toolsets: [terminal]
    config:
      - key: lfcs.jobs_root
        description: Root directory holding active LFCS job folders.
        default: "/home/ccuser/opsman-work/Jobs/Ongoing Jobs"
---

# LFCS Docket Check

## When to use

Rocky says: "docket check", "did I sign the docket", "is today's docket in", or `/lfcs-docket-check`.
Also fires automatically from the EOD cron at 17:00 if there are dayworks or hybrid jobs ongoing.

## Procedure

1. Identify the active job. Read its `00-brief.md` to confirm `type:` is dayworks or hybrid (no docket needed for pure price work).

2. Check `<job>/07 - Site Documents/07a - Dockets/` for a file matching `YYYY-MM-DD-signed.*` for today's date.

3. Reply with one of:
   - **Found** → "✅ Docket signed today (07a/2026-MM-DD-signed.jpg). Day billable." (only one line)
   - **Missing AND it's before EOD** → "⚠ Docket not yet received. Get signed before leaving site or revenue at risk."
   - **Missing AND past EOD** → "🚨 AT-RISK REVENUE: today's docket missing. Last day's = [last seen date]. Chase tomorrow morning. Per LFCS rules: no signed docket = no invoice line."
   - **Missing >48h** → "🚨🚨 AT-RISK REVENUE 48hr+: today's and yesterday's dockets missing. Escalate to admin (Hasibul) for a chase email."

## How "today" is decided

Use Australia/Sydney timezone. Date format: YYYY-MM-DD.

## Output format

ONE line on the happy path. Two lines max if missing. Don't pad.

## Pitfalls

- Don't false-positive on filenames that have today's date but aren't dockets. Match strict `YYYY-MM-DD-signed.*` pattern.
- If type is `price` (not hybrid/dayworks) and there's no dockets folder → reply: "n/a — price contract, no docket needed."
- If multiple jobs are ongoing, check each one and reply per-job.

## Verification

After replying:
1. Re-read `<job>/07 - Site Documents/07a - Dockets/` and confirm the file count/match aligns with what was reported.
2. If a Telegram alert was sent (missing case), confirm the alert went to Rocky via gateway log (`/root/.hermes/logs/`), not to a group.
3. Date used in match must be Australia/Sydney TZ — sanity-check by comparing against `TZ=Australia/Sydney date +%Y-%m-%d`.
