Admin dashboard
Internal operating deck. Cmd+K for the command palette (or click the chip bottom-right).
Surfaces only what's actionable RIGHT NOW. Rules: HITL>0 · red-tier health customers · failing crons 24h · CostCapDO breach · active bid deviations · workflow.failed 24h · sync errors 2h. Cards hidden when value=0.
Color: price hitl sync email workflow customer ar. Click any row → /timeline.html
💬 Quick chat — scoped by pillar 10 chat roles · 7 job pillars + admin + 2 specialist
R96 consolidated 11→7 pillars; R52 added admin + 2 specialist roles for 10 total. Order Mgmt absorbs Inventory + Logistics + USDA; Reports merged into All. Bid kept separate from Price. Each pillar narrows the chat's tool set + lowers cost (single-mode pillars ~30× cheaper than council). Council v2 is the default chat mode (~$0.007/query). Click to open chat scoped to that pillar.
🧱 Substrate R549–R586 · the operating fabric
The substrate-level systems that make every workflow auditable, every event observable, and every decision reversible. Live counts pull from /api/healthcheck, /api/tool-registry/list, /api/workflow/runs, /api/events/recent, /api/admin/compute-customer-health-now.
32 wikis · 12 sections each
The operating documentation layer. 32 workflow wikis × 12 sections = 384 documented surfaces. R586 added 4 new sections per wiki: Changelog · Schema · Runbook · Backlog. When something breaks at 2am, open the Runbook tab.
Open wiki index ↗26 v2 contracts · runs + verify
Contract-driven execution: 22 original + 4 NS expansion (R585e — work_order_lifecycle, assembly_build_request, inventory_reconciliation, sales_order_lifecycle). Logs to workflow_run_log, steps to workflow_step_log, verify scores to workflow_verify_results. R563 verify scheduler (8,38 * * * *).
Open ops console →Events · workflow.completed / partial / failed
Append-only ledger (events) + drain state (event_drain_state) + subscriptions (event_subscriptions). Endpoints: /api/events/{record,drain,recent}.
Open timeline →At-risk customers · nightly compute
Predictive scoring via R558 nightly cron + R567 bootstrap. Tables: customer_health_scores, customer_health_signals, customer_health_score_history. Chat tools: get_customer_health_score, list_at_risk_customers.
Open health board →50 tools · 10 role palettes
Registry-driven tool selection. Tables: tool_registry, tool_role_palettes, tool_invocations. Chat tool: search_tools. Seed: /api/admin/tool-registry/seed.
Open catalog →3,371 chunks · Vectorize ns_knowledge
NetSuite knowledge corpus indexed for chat. Table: knowledge_chunks. Refresh cron: 15 4 * * SUN (R566). Chat tool: search_netsuite_knowledge. Ingest: /api/knowledge/ingest.
Search via chat →Self-correction log · atomic claim
Workflow self-reflection (reflexion_log) + R560 HITL race-fix (UPDATE…RETURNING atomic claim before enqueue). Every write-back to NS lands here for approval. Invariant: Mike is always the loop step.
Open HITL queue →R586 wiki structure · 12 sections per wiki
R585 created the wiki hub (32 wikis × 8 sections). R586 extended every wiki with 4 new sections so operators have everything in one place:
📜 Changelog
Every R-tag that touched this workflow with the diff hash. Audit trail for behavior drift.
🗂️ Schema
D1 tables read/written + columns + indexes touched by the workflow. The mechanical contract.
🚨 Runbook
What to check when this workflow fails at 2am. Diagnostic queries, kill switch, rollback steps. Operators check Runbook first.
🎯 Backlog
Known gaps + planned improvements per workflow. Pulls forward from GAPS_TO_CLOSE.md.
📊 Live operations strip R586 · D1-backed snapshots
Build-time snapshots from D1. Numbers refresh per round; live tickers below pull from worker endpoints when bearer set.
AI cost surface
7-day rolling: $11.34 across 1,123 queries. council_v2: 571 / $9.46. single: 552 / $1.88. CostCapDO holds $5/day per role. Source: chat_decision_audit.cost_usd.
Open live cost diagram ↗GFS v10 score · 87.1 / B
108 files audited + auto-fixed against v10 tokens (Inter + IBM Plex Mono + cobalt + reduced-motion + dark-mode-safe). Admin dashboard included. Pass threshold: 85. Hold ≥85 on future edits.
Open audit report →580 events
Append-only ledger volume last 7 days. Domains: workflow.completed/partial/failed · sync.* · push.* · intake.*. Source: SELECT COUNT(*) FROM events WHERE occurred_at >= date('now','-7 days').
Open timeline →🗺️ Flow diagrams R586 · gfs-flows.pages.dev
104+ deployed flow diagrams covering every workflow, substrate system, and process graph. v10 cobalt design language applied (R578–R579 v9 + R585d v10 audit at 87.1/B). Each diagram is interactive — click nodes for popovers, see REAL vs STUB states, watch playback against the workflow runner (R571 Play animation + R572 node-active fix + R576 codex Majors fix).
R585 wave — 5 new high-value diagrams (agent C)
R583 wave — 5 refreshed system flows
R585e wave — 4 NS expansion contracts as flow diagrams
v10 tokens: cobalt palette · Inter + IBM Plex Mono · cobalt-tinted shadows · reduced-motion safe · dark-mode safe. Source: docs/GFS_DESIGN_V9_TOKENS.md + ~/.claude/skills/gfs-design-10.0/SKILL.md. Admin dashboard audit-fixed in R585d.
🎯 Bid command center B5875 · NYC DOE Food Distribution
Active bid response platform. 246 specs (Amend 13), 6 PPI tabs, GFS price quotes, Sept 2026 menus (214 rows, 5 core menus, K-8 + HS deduped, 100% dated), 34 Fall 2026 recipes. Live at gfs-nycdoe-hub.pages.dev. B5875 due 2026-06-03.
B5875 internal dashboard
Specs, pricing, USDA drawdown, submissions, deviation notes. Submit prices even when spec deviates (pack/format mismatch); keep notes vague — let buyer evaluate.
Open command center →NYC DOE hub (public-facing)
The buyer-visible response. Mirrors specs + pricing + menus + recipes from the command center.
Open public hub ↗🚦 Pipeline health intake · learning · email
Live from /api/intake/queue, /api/learning/promotions, /api/mailbox-routes, /api/email-templates, /api/outbound-emails. Bearer required.
… checking…
Service health
Live checks against the Worker. If api.ai-globalfoodsolutions.co is unreachable, the page falls back to the workers.dev URL.
| Service | Endpoint | Status |
|---|---|---|
| Worker — health | api.ai-globalfoodsolutions.co/api/health | … |
| Worker — sync-status | api.ai-globalfoodsolutions.co/api/sync-status | … |
| D1 database | gfs-netsuite | Provisioned |
| KV namespace | CACHE (e880e40b…) | Provisioned |
| R2 bucket | gfs-files | Provisioned |
| Custom domain | api.ai-globalfoodsolutions.co | … |
Risk register
Strategic risks (separate from per-item GAPS tracker). Source: data/risk-register.json.
| Risk | Description | Mitigation |
|---|---|---|
| Chartstone SPOF | Entire sync pipeline depends on Chartstone Pro running on a single Mac. If machine is off/asleep/broken, D1 stops updating. No monitoring, no alerting, no failover. | Move to Worker-based sync via SuiteAPI RESTlet (eliminates localhost dependency) |
| Single Admin | Only Michael Levine can deploy Workers, manage D1, rotate secrets, and access all CF/NS admin. Bus factor = 1. | Document all procedures (done in runbook). Cross-train second admin. Share CF access. |
| No Backups | No D1 backup strategy, no NS data export schedule, no disaster recovery plan. If CF account compromised, D1 data could be lost. | D1 has point-in-time recovery (paid plan). Schedule regular wrangler d1 export. |
| 48 Public Suitelets | Internal ops portal, all broker portals, and product program portals accessible without NS login. Data exposure risk. | Audit each isonline=T deployment. Restrict internal ops immediately. Broker portals may need to stay public. |
Known issues
Operational truth board — current bugs and limitations with status. Source: data/known-issues.json.
| Issue | Status | Impact | Fix |
|---|---|---|---|
| Cloudflare Access on Pages | OPEN | Tier 1 GAP — Pages site is wide-open. Internal data exposure risk. | Configure CF Access policy (mikelevine@globalfoodsolutions.co email gate) on gfs-netsuite.pages.dev |
| Period close (NS) | OPEN | All 154 NS periods open since 2018. Tier 1 GAP. Affects financial integrity. | Close historical periods in NS Setup → Accounting → Manage Accounting Periods |
| Worker sync cron stub | FIXED | Was stub through R54; replaced by live tiered sync in R55–R121 | R55 TBA + custom RESTlet (customscript_gfs_platform_query) |
| sync.sh launchd quarantine | OBSOLETE | Local launchd retired — Worker scheduled() runs all sync now | No action — local sync deprecated |
| Worker daily report email | TODO | handleDailyReport() still logs to console only | Implement via Cloudflare Email Routing send |
| KV and R2 utilization | FIXED | Both in active use: KV for cache/sessions/cost-caps; R2 for specs/bid attachments/SuiteAttach | No action |
| vb_lines coverage | RESOLVED | 100% of bills with inventory items (11,631/11,631). Expense-only bills have no item lines by design. | No action needed |
| Custom domain SSL | CHECK | Verify api.ai-globalfoodsolutions.co cert health quarterly | Check CF dashboard Edge Certificates |
| No DKIM TXT record found | CHECK | Email deliverability may be affected | Verify in CF dashboard Email Routing |
| D1 scheduled backup | TODO | wrangler d1 export available manually; no scheduled job | Add to wrangler cron or external job |
Build status
Live snapshot of platform component readiness.
| Component | Status | Notes |
|---|---|---|
| Worker — REST endpoints | Complete | 175+ endpoints, CORS, security headers, Bearer auth (R52 state) |
| D1 — schema + load | Complete | 162 tables (R563 verified), 311K+ rows, 129 migration files (R585e added 129_ns_expansion_workflows.sql) |
| Workflow runner (R549) | Live | 26 v2 contracts (22 original + 4 NS expansion R585e). R571 Play animation + R572 node-active fix + R576 codex Majors fix + R585c audit findings. workflow_run_log + workflow_step_log + workflow_verify_results + reflexion_log |
| Event ledger (R555) | Live | events + event_subscriptions + event_drain_state. workflow.completed/partial/failed fire from runner |
| Customer health (R558/R567) | Live | Nightly compute + bootstrap. customer_health_scores + signals + history |
| Tool registry (R562) | Live | 50 tools paletted to 10 roles. tool_registry + tool_role_palettes + tool_invocations |
| Knowledge corpus (R564) | Live | 3,371 chunks in Vectorize ns_knowledge. Weekly refresh cron (R566). 32 wiki docs added R585 + 4 sections per wiki added R586 (Changelog/Schema/Runbook/Backlog). |
| HITL race fix (R560) | Live | UPDATE…RETURNING atomic claim before enqueue |
| KV — CACHE namespace | In use | Query cache, session storage, cost-cap counters |
| R2 — gfs-files bucket | In use | Spec PDFs, bid attachments, SuiteAttach uploads |
| Vectorize — ns_knowledge | In use | 3,371 NS knowledge chunks for chat retrieval (live D1 count) |
| Sync — Worker scheduled() | Live | 14+ NS tables on 2/5/60-min tiers via SuiteAPI + custom RESTlet (R55–R121) |
| Pages — gfs-netsuite | Deployed | Consolidated platform live |
| Pages — gfs-flows (R580–R586) | Deployed | 104+ flow diagrams + 32 wikis (12 sections each = 384 surfaces) · v10 design language · audit 87.1/B · gfs-flows.pages.dev |
| Admin dashboard (this page) | v10 audit-fixed | R582 cobalt refresh → R585d v10 audit (87.1/B) → R587 R586 content refresh. Reduced-motion + dark-mode safe. |
| Pages — legacy gfs-system-guide | Deprecated | Pre-consolidation deploy, kept until migration confirmed |
| Cloudflare Access on Pages | Not configured | Tier 1 GAP — Pages site is wide-open |
| Period close (NS) | Open | All 154 periods open since 2018; Tier 1 GAP |
| Custom domain SSL | Pending | api.ai-globalfoodsolutions.co serving HTTPS — confirm cert health |
| DKIM record | Check | Email deliverability may be affected |
| git baseline | Active | 69 commits, 4 tags (R52 state). Per-round commit discipline (R76+) |
| Backup strategy (D1) | Partial | wrangler d1 export available; scheduled job still a gap |
Sync status & crons
NS-to-D1 sync runs in the Worker via scheduled() against SuiteAPI + custom RESTlet (R55–R121). 14+ NS tables on tiered cadence (2/5/60 min). See infrastructure → cron for the full wrangler.jsonc cron declaration.
| Job | Source | Cadence | Function | Status |
|---|---|---|---|---|
| NS sync — hot tier | syncTable / handleSyncTier | every 2 min | SOs, POs, invoices, customer payments delta | Live |
| NS sync — warm tier | syncTable / handleSyncTier | every 5 min | customers, items, vendors, contacts | Live |
| NS sync — cold tier | syncTable / handleSyncTier | every 60 min | employees, GL, departments, locations, subsidiaries | Live |
| r563_verify_scheduler | scheduled() | 8,38 * * * * | Workflow verify-results sweep against workflow_run_log | Live |
| r558_customer_health | scheduled() | nightly | Compute customer_health_scores + signal extraction | Live |
| r566_corpus_refresh | scheduled() | 15 4 * * SUN | Refresh knowledge_chunks → Vectorize ns_knowledge | Live |
| Worker cron 0 19 | wrangler.jsonc | 7pm daily | Daily report (handleDailyReport) | Logs only |
Integrations
Full inventory at NetSuite reference → integrations.
| Integration | Internal ID | Status |
|---|---|---|
| SuiteAttach File Upload RESTlet | tba:11/app:318 | active |
| NetSuite Analytics Warehouse | tba:2/app:11 | active |
| Atlas Agent (Read Only) - 315 | tba:10/app:315 | inactive |
| Atlas Agent (Read Only) - 314 | tba:9/app:314 | inactive |
| Twin Agent | tba:8/app:313 | inactive |
| integrator.io (Celigo) 1 | tba:7/app:112 | inactive |
| integrator.io (Celigo) 2 | tba:6/app:112 | inactive |
| integrator.io (Celigo) 3 | tba:5/app:112 | inactive |
| Zapier 1 | tba:4/app:12 | inactive |
| Zapier 2 | tba:3/app:12 | inactive |
| Tray.IO | tba:1/app:4 | inactive |
| Chartstone Toolkit RESTlet | restlet:2949 | active |
| SuiteAPI RESTlet | restlet:2948 | active |
| File Upload RESTlet (SuiteAttach) | restlet:2512 | active |
| Attach File - Zapier RESTlet | restlet:989 | active |
| Celigo IO RESTlets (5) | restlet:1805-1811 | active |
| Zapier Suite (13 RESTlets) | restlet:990-2747 | active |
| ECOB Bill of Lading Integration | bundle:312584 | active |
| Cash 360 Bundle | bundle:cash360 | active |
| Costed BOM Bundle | bundle:costedbom | active |
| APM Bundle | bundle:apm | active |
| Last Sales Activity Bundle | bundle:lsa | active |
| Allergen Statement Bundle | bundle:allergen | inactive |
| Dashboard Tiles Bundle (185219) | bundle:185219 | active |
| Dunning Bundle (392827) | bundle:392827 | active |
| Electronic Payments Bundle (533070) | bundle:533070 | active |
| Supply Chain Management Bundle (47193) | bundle:47193 | active |
| Tax Audit Files Bundle (4599) | bundle:4599 | active |
| Prompt Payment Discount Bundle (STC) | bundle:stc | active |
| NetSuite PS/PM Bundle (39609) | bundle:39609 | active |
| Vendor Bill Bundle (240841) | bundle:240841 | inactive |
| Client Audit Trail | bundle:cat | active |
| File Drag and Drop | bundle:filedragdrop | active |
| SII (Spain) Bundle | bundle:sii | inactive |
| Intrastat Bundle | bundle:intrastat | inactive |
| Norway SAF-T Bundle | bundle:saftno | inactive |
| UAE Emirate Bundle | bundle:uae | inactive |
| France Tax Bundle | bundle:fr | inactive |
Pricing pipeline status ADR-012 · Phase 1 done
Live pull from /api/pricing/audit/summary. Static counters fall back to the last documented derive if the API is unreachable. Full procedures in runbook → pricing pipeline. Roadmap in cloudflare → pricing roadmap.
Three-bucket diff
| Bucket | Rows | Action |
|---|---|---|
| Listed + Recent | 434 | Drift check — compare proposed vs current price, flag > threshold |
| Listed + Stale | 830 | Deprecate — item on NS list but no invoice in 18+ months |
| Not-Listed + Recent | 227 | Close gap — customer is buying but not on NS price list (negotiated at SO time) |
Live operations round 7 wire-up
Live from /api/healthcheck, /api/ai/metrics, /api/ai/caps, /api/ns/touchpoints, /api/bids, /api/mapping/unmatched. Bearer required; placeholders shown when no key.
Healthchecks (ADR-018)
AI economics (ADR-020/021)
NetSuite touchpoints (ADR-019)
Bids (Pillar 2)
Mapping coverage (Phase 4 prereq)
Data quality
Grades reflect coverage of mandatory or important fields per entity.
| Entity | Rows | Grade | Notes |
|---|---|---|---|
| Customers | 283 | B | 71% have terms set (28 missing), category gaps on ~10% |
| Vendors | 484 | F | 93% missing payment terms (451), 70% missing emails (341) |
| Items | 1,148 | F | 78% missing GTIN/UPC (765), 71% missing case weight (694), 75% missing storage temp |
| Transactions | 102,367 | A | Full coverage 2018-2027, all 20 types, sync running |
| Customer pricing | 1,264 | C | Stale-price alert exists, manual refresh |
| Employees | 116 | B | All active employees, some role assignments incomplete |
| GL accounts | 152 | A | Full chart of accounts |
| Contacts | 490 | B | Coverage adequate, email/phone gaps on some entities |
NetSuite reference at a glance
Related surfaces 70+ surfaces · all internal
Ops console
Workflow runs, step logs, verify scores, reflexion entries. Live view into the workflow runner.
Event timeline
Append-only event ledger. workflow.* + sync.* + push.* + intake.* events with drain state.
Customer health board
At-risk customers, signal breakdown, score history. Updated nightly.
Bid command center
B5875 NYC DOE — specs, pricing, USDA, submissions. Due 2026-06-03.
Proposed actions
AI-proposed writes pending Mike's approval. Every NS write-back lands here first.
Tools catalog
50 tools paletted to 10 roles. Live invocation stats per tool.
Cost ingestion
Vendor cost upload + diff vs current item costs. Pre-pricing-roll workflow.
Flow diagrams (104+)
26 contracts + 27 archify + 4 substrate + 11 system + 32 wikis. v10 cobalt design (audit 87.1/B).
Wiki hub · 32 wikis
32 wikis × 12 sections = 384 documented surfaces. R586 added Changelog/Schema/Runbook/Backlog per wiki.
AI cost surface (live)
$11.34 / 1,123 queries · 7d. Council_v2 vs single split. CostCapDO $5/day cap holds.
Runbook
Onboarding, secret rotation, incident response, pricing procedures.
Infrastructure
175+ Worker endpoints, cron, bindings, secrets map, DNS records.
Cloudflare
Workers, D1, KV, R2, Vectorize, Queues, Workflows, Durable Objects, Pages.
Data model
162 D1 tables, schema, relationships, KV/R2 usage.
NetSuite reference
Every NS object across 15 categories — 3,486 items.
Decision log · 36 ADRs
All architectural decisions including ADRs 032–036 (R561 substrate batch).
Gaps to close
4-tier backlog. Tier 1: CF Access on Pages + period close.
Architecture blueprint
Full platform architecture incl. R549–R580 substrate arc.