Architecture Document · v1.0 · 4 October 2026

Skycrest OpsHub

Stock Control · Orders & Dispatch · Agentic AI — one order record from the airline PO or phone call to the truck, live stock that explains itself, ten always-on bots, a dashboard for every manager, and people keeping every decision.

📍 Marrickville, NSW🌐 skycrest.id🧱 PHP 8 · SQLite · vanilla JS🔒 Bots never move stock or money
✅
8
Modules live
🧭
1
New module · Orders & Dispatch
🤖
10
Always-on bots
🖥
5
Role dashboards
🏢
2
Entities · SkyCrest & Annie
01 · Business

Two kitchens’ worth of orders, one stock

The workflow sheet shows two lanes sharing one kitchen and one stock: SkyCrest airline orders and Annie Makes Cakes non-airline orders. They differ at intake and at dispatch — the middle is the same.

SkyCrest

Airline lane

01
Email PO
Airline orders, all by PO
02
SkyCrest Xero
Invoice
03
Production planner
Lines feed Alex’s matrix
04
Print order
Ticket to the kitchen
05
Confirm
Email to customer
06
Packing check
Enough stock?
07
Allocate / Make
Enough → allocate · Short → Alex makes
08
Day-before schedule
Interstate → Roadmaster · SYD → driver
09
Dispatch
Stock removed automatically
Annie Makes Cakes

Non-airline lane

01
Order in
PDF / HTML PO, email, phone, bespoke
02
Check stock
Availability & delivery date
03
Annie Makes Cakes Xero
Invoice
04
Print order
Ticket to the kitchen
05
Confirm
Email to customer
06
Packing check
Enough stock?
07
Allocate / Make
Short → inform Alex
08
Day-before schedule
All customers by date
09
Dispatch
Stock removed automatically
02 · Workflow

One order record, end to end

The order — not the spreadsheet row — is the stateful object. It survives invoicing, allocation, shortages, scheduling and dispatch, and every transition emits an event the bots subscribe to.

📝
NEW
Order captured · bot draft confirmed
Office
🧾
INVOICED
Xero invoice no. recorded
Office
👩‍🍳
IN KITCHEN
Ticket printed
Office
✉️
CONFIRMED
Customer emailed
Office
📦
ALLOCATED
Stock reserved
Packing
⚠️
SHORT
Make-list → Alex → stock in
Alex
🗓
SCHEDULED
Day-before schedule · booked
Office
🚚
DISPATCHED
Stock out transactions
Packing
⚖️
RECONCILED
Nightly ledger check
Bot
Allocate ≠ deduct

Allocation reserves stock (available-to-promise drops). Live stock only falls on dispatch, through normal OUT transactions with the order number — so every unit is explainable.

Short path

Not enough stock → airline shortfall shows on Alex’s Production Planning; non-airline triggers “Inform Alex”. When product is made and stocked IN, the Allocation Bot re-proposes.

03 · Today

What’s already live

Eight modules running on the existing single-file PHP app. The new module builds on the same stock ledger and planner, without touching existing data, users or passwords.

🔐Live

Login & roles

Sessions, hashed passwords, admin / user roles.

📦Live

Stock

Search, product card, stock IN / OUT in units or boxes, history.

🗂Live

Products

Catalog with category + subcategory filters, admin edit, set live stock.

🔄Live

Sync from XLSM

Upload Stock Control.xlsm → preview → apply.

✈️Live

Production Planning

Airline order matrix vs live stock, to-produce, snapshots, print.

🥧Live

Tartlet Orders

16 sizes, as-at date, date sort, colours, NEED TO MAKE.

👥Live

Users

Add / edit / delete, last-admin protection, change password.

📤Live

Export

Stock levels and transaction log as .xlsx.

🧭Planned

Orders & Dispatch

Intake → invoice → allocate → schedule → dispatch.

🖥Planned

Role dashboards

Alex, Annie, Ruth, Mark, Directors — each their own home screen.

🤖Planned

Agentic layer

Ten bots incl. Hermes reminders & calls, approval inbox, kill switches.

04 · Dashboards

A dashboard for every manager

Each manager lands on their own home screen with today’s work. The app knows who has looked — and the Hermes Reminder Bot chases anyone who hasn’t.

🥧Savoury Production Manager

Alex

Make-list for quiche, pies, croustades, scrolls · shortfalls blocking dispatch · weeks of cover · menu-change watch

🍰Sweets Production Managers

Annie & sweets team

Sweets make-list · tartlet NEED TO MAKE · Annie Makes Cakes orders & bespoke enquiries

🗂Office Manager

Ruth

Bot inbox · invoices for both Xeros · confirmations · tomorrow’s bookings · team seen board

🧭General Manager

Mark

Exceptions board · on-time dispatch · orders at risk · Hermes escalations · week vs average

🏛Directors

Tisna · Heri · Vivi

Monthly trends · customer concentration · product mix & menu cycle · compliance · risks (read-only, weekly summary)

Hermes Agent

Not seen your dashboard? The reminder ladder

07:00
Check-in time
Dashboard opened? → done
+15 min
WhatsApp / Telegram
“3 items need you today…”
+30 min
SMS
Summary · reply OK
+45 min
Phone call
Twilio voice · press 1 (opt-in only)
+60 min
Manager told
Mark / Ruth notified

Stops the moment the dashboard is opened or the person replies OK. One call per person per day, never outside 06:00–18:00. Directors get a Monday summary instead. See the dashboard mock-ups →

05 · Airline orders

By email, by PO — and very predictable

216 POs from Jul 2025 to Apr 2026 show airline orders arrive as system-generated purchase-order emails from dnata and Gate Gourmet, with a clear rhythm per kitchen.

3–4 days

Sydney

121 POs · Monday-heavy · small drops (17 ctns)

Weekly

Melbourne & Brisbane

Wednesday dispatch · 33–36 ctns · Roadmaster

3–6 wks

Perth · Adelaide

Rare but bulky · ~44 ctns, 5–8 products

16 of 40

Products = 80%

Menu turns over at new year · 12 codes stopped

Open the full airline analysis with charts →

06 · Agentic bots

Ten bots, one mandate

Always-on bots over a shared event stream, an approval inbox and an audit log. Every action lands on the dashboard as one plain-English line. Every bot has a kill switch — and starts switched off.

📥AI · L2

Order Intake Bot

inbox → draft order

Airline POs from dnata and Gate Gourmet are system-generated emails → fixed template parsers. Non-airline emails, PDFs and phone notes → AI extraction. Creates a draft order with a confidence score per field.

⛔ Never: Confirms an order or reserves stock
📊Rules · L3

Availability Bot

orders ↔ live stock

Calculates available-to-promise per line, suggests the earliest delivery date for non-airline orders and pushes airline lines into the Production Planning matrix.

⛔ Never: Promises a date to a customer
🧾Rules · L2

Invoice Prep Bot

orders → Xero

Picks the right Xero — SkyCrest or Annie Makes Cakes — and prepares the invoice lines. In V2 creates a draft invoice through the Xero API.

⛔ Never: Approves, sends or changes an invoice
✉️Rules · L2

Confirmation Bot

invoiced → confirmed

Drafts the customer confirmation email from a template with lines, dispatch date and delivery method, ready for the office to send.

⛔ Never: Sends without a human or changes quantities
👨‍🍳Rules · L3

Production Bot

shortfalls → make-list

Alex’s assistant. Builds a daily make-list by date and product from order shortfalls, planner “to produce” and tartlet NEED TO MAKE; alerts on non-airline missing items.

⛔ Never: Changes planner quantities or priorities
📦Rules · L2

Allocation Bot

packing queue

Proposes allocations earliest-dispatch-first, re-checks short lines the moment stock comes in, and flags orders competing for the same stock.

⛔ Never: Allocates or releases stock without a packer
🚚Rules · L2

Dispatch Scheduler

day-before schedule

At 14:00 the day before: Interstate by port → Roadmaster, Sydney → driver run, Non-airline → all customers. Drafts booking emails and lists orders not ready.

⛔ Never: Books transport or marks dispatched
⚖️Rules · L3

Stock Reconciler

ledger ↔ reality

Nightly checks: negative stock, dispatched-but-not-deducted, unusual manual adjustments, app vs XLSM differences after a sync.

⛔ Never: Adjusts stock
📞Hermes · L3

Hermes Reminder Bot

dashboard seen?

Runs on Hermes Agent. 07:00 to-do list per person; anyone who hasn’t opened their dashboard by check-in time gets WhatsApp → SMS → a Twilio phone call → then their manager is told.

⛔ Never: Calls anyone not opted in, or more than once a day
🔮Rules · L3

Order Pattern Bot

PO rhythm & demand

Learns each kitchen’s rhythm — SYD every 3–4 days, MEL/BNE weekly, PER ~3 weeks — flags expected orders that haven’t arrived and forecasts demand per product for the make-list.

⛔ Never: Creates orders or contacts customers
07 · Rhythm

The bots’ day

One cron line every five minutes; the dispatcher decides which bots are due. All times Australia/Sydney.

⏱ Execution calendar

Every 15 min
Inbox scan → draft orders · stock-IN watcher re-checks short lines
06:00–11:00 · 15 min
Hermes: who hasn’t seen their dashboard → WhatsApp → SMS → call → manager
06:30
Shortage sweep + Pattern Bot forecast → Alex’s and Annie’s make-lists
07:00
Daily digest — per-person to-do list
14:00
Day-before dispatch schedule + booking drafts + “not ready” list
16:00
Chase uninvoiced, unconfirmed and unbooked orders for tomorrow
20:00
Stock reconciliation report
02:00
Database backup — copy of stock.db, kept 30 days
Tuesday 10:00
Interstate check — MEL/BNE dispatch peaks Wednesday: Roadmaster booked?
Monday 08:00
Directors’ weekly summary via Hermes

✅ Approval flow

1
Bot proposes
draft order · allocation · email · booking · make-list
2
Lands in the Bot inbox
one plain-English line + the evidence
3
Named person decides
Approve · Edit & approve · Reject with reason
4
System acts & logs
decided_by, time, before/after
5
No answer in 1 day
appears on digest as overdue — loop health tracked
🧠 Only the Order Intake Bot uses an AI model (Claude API, key kept outside the web root). Every other bot is plain, testable rules over the database.
08 · Governance

Human in the loop

Bots execute, people decide. Every automated action sits on an explicit autonomy level — and autonomy can only be raised deliberately.

L1

Human only

Bot may show information; a named person acts.

Dispatch · allocation · invoices · customer promises · stock adjustments · cancellations

L2

Bot prepares, human approves

Nothing happens until someone clicks Approve.

Draft orders · proposed allocations · confirmation emails · booking drafts · make-lists

L3

Bot acts & reports

Reversible, no stock or money effect.

Reminders · digests · shortage flags · reconciliation · planner refresh

Eight rules that make the loop real

1Named human, not “the system”

Every approval records decided_by and time.

2Reversible by default

Bots create proposals, flags and messages only.

3Escalate, don’t guess

Low confidence goes to the human queue.

4Kill switch per bot

Admin → Agents, per bot and per action.

5No silent autonomy creep

Raising a level needs admin change + owner sign-off.

6Stock, money, promises stay L1

Permanently human decisions.

7Human override wins

Rejected proposals capture a reason and are not re-raised.

8Loop health is monitored

Waiting proposals show up like overdue orders.

Decision rights

Decision🤖 Bot👤 Human
Create orderDrafts from emailOffice confirms
Delivery dateSuggestsOffice confirms
InvoicePrepares linesOffice approves in Xero
Allocate stockProposesPacking confirms
What to makeBuilds make-listAlex decides
TransportDrafts scheduleOffice books
DispatchChecks readinessPacking dispatches
Stock adjustmentFlags differencesAdmin adjusts
09 · Roadmap

Build one phase at a time

Each phase ends with its checks in the Testing guide before the next begins. Before every deploy: back up stock.db, never touch users or passwords.

PHASE 0
Hardening
CSRF, backups, events, includes/
PHASE 1
Customers & Orders
Intake, invoice no., print, confirm
PHASE 2
Packing
Allocation, packing role
PHASE 3
Planner link
Airline orders feed the planner
PHASE 4
Dispatch
Schedule, bookings, stock out
PHASE 4b
Dashboards
Role dashboards, analytics
PHASE 5
Agents + Hermes
Inbox, rule bots, Hermes reminders & calls
PHASE 6
AI intake
Orders drafted from email
PHASE 7
Integrations
Xero API, SMTP (V2)
10 · Documents

Read the detail

The full project pack, written for both people and AI coding tools.

workflow.xlsx

Workflow infographic

Both order lanes and dispatch as one flow chart.

DASHBOARD.md

Role dashboards & Hermes

Five manager dashboards, seen tracking, message → call ladder.

AIRLINE_ANALYSIS.md

Airline order analysis

Order source, ports, rhythm, products, menu cycle.

PROJECT_STATUS.md

Project status

Modules, recent changes, risks, constraints, open questions.

TRD.md

Technical requirements

Stack, as-built system, new module, data model, constraints.

APP_FLOW.md

App flow

Every screen today, both order lanes, where bots fit.

AGENTIC.md

Agentic capabilities

Ten bots incl. Hermes, autonomy levels, rules, schedule, tech design.

IMPLEMENTATION_PLAN.md

Implementation plan

Phases 0–7 with deliverables and checks.

TESTING.md

Testing guide

Journeys, regression, bots, security, blockers.