| Service | ID / URL | Binding | Status |
|---|---|---|---|
| Worker | gfs-platform · mikelevine.workers.dev | — | LIVE |
| D1 Database | 3818ecd5-995e-4694-a08b-a273c94291da | DB | LIVE |
| KV Namespace | e880e40bc3674963bc37cf90e02f6369 | CACHE | READY |
| R2 Bucket | gfs-files | STORAGE | READY |
| Domain | ai-globalfoodsolutions.co · Zone 26a291b9ae64675bf5041d0affb22bc9 | — | ACTIVE |
| Worker Route | api.ai-globalfoodsolutions.co/* | — | SSL PENDING |
| Cron: Sync | */15 * * * * | — | RUNNING (Worker-side stub; local launchd does actual sync) |
| Cron: Report | 0 19 * * * | — | RUNNING (7pm UTC = Worker cron; local daily-report.sh is separate) |
| Pages | gfs-netsuite-tools.pages.dev | — | LIVE |
| Secret | API_KEY | — | SET |
| Service | ID | Type | Status |
|---|---|---|---|
| Account | 4656898 PRODUCTION | ERP | CONNECTED |
| SuiteAPI | #2948 | RESTlet | DEPLOYED |
| SuiteQL Tool | #2947 | Suitelet | DEPLOYED |
| Toolkit | #2949 | Suitelet | DEPLOYED |
| SuiteAttach | Custom RESTlet | RESTlet | DEPLOYED |
| MCP Server | Claude.ai integration | MCP | CONNECTED |
| Chartstone Pro | localhost:<PORT> | Local API | RUNNING |
| N/llm Module | Cohere Command R | Native AI | AVAILABLE |
| Type | Name | Value | Proxy |
|---|---|---|---|
| CNAME | api | gfs-platform.mikelevine.workers.dev | Proxied |
| CNAME | www | ai-globalfoodsolutions.co | Proxied |
| MX | @ | route1.mx.cloudflare.net (priority 87) | — |
| TXT | @ | v=spf1 include:_spf.mx.cloudflare.net ~all | — |
| TXT | _dmarc | v=DMARC1; p=none; ... | — |
| NS | @ | chance.ns.cloudflare.com · leanna.ns.cloudflare.com | — |
| Interval | 900 seconds (15 min) |
| Script | ~/Desktop/gfs-platform/sync.sh |
| RunAtLoad | true |
| Stdout | sync-stdout.log |
| Stderr | sync-stderr.log |
| PATH | /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin |
| Schedule | 7:00 PM daily |
| Script | ~/Desktop/gfs-platform/daily-report.sh |
| Output | daily-report-YYYY-MM-DD.md |
| Log | report.log |
| Queries | D1 KPIs via wrangler --json + python3 JSON parse |
https://ai-globalfoodsolutions.co https://www.ai-globalfoodsolutions.co http://localhost:3000 http://localhost:8787
| Field | Value |
|---|---|
| Type | Local desktop app, localhost HTTP API |
| URL | http://127.0.0.1:<PORT> (port changes on restart — check Chartstone app) |
| Auth | Bearer token from CHARTSTONE_SECRET in ~/.zshenv |
| NS Account | 4656898 PRODUCTION (Mike Bot, Administrator) |
| Tier | Pro (unlimited queries, 500K row ceiling) |
| Key Endpoints | POST /suiteql · POST /search · POST /record-json · GET /health |
| Headers | Accept: application/toon (25-50% token reduction) · Content-Type: application/json |
| Issue | Status | Impact | Fix |
|---|---|---|---|
sync.sh had macOS quarantine (com.apple.provenance) | FIXED | launchd sync was failing with "Operation not permitted" | xattr -d com.apple.provenance sync.sh |
| Custom domain SSL | PENDING | api.ai-globalfoodsolutions.co not yet serving HTTPS | Check CF dashboard Edge Certificates |
| Worker sync cron is stub | TODO | handleSync() only writes sync_log, doesn't call SuiteAPI | Implement RESTlet delta sync in Worker |
| Worker daily report email | TODO | handleDailyReport() only logs to console | Implement via Cloudflare Email |
| KV and R2 bound but unused | FUTURE | No endpoints read/write KV or R2 | Phase 4: KV caching, R2 file storage |
| vb_lines coverage | RESOLVED | 100% of bills with inventory items (11,631/11,631). 11,285 expense-only bills have no item lines by design. | No action needed |
| No DKIM TXT record found | CHECK | Email deliverability may be affected | Verify in CF dashboard Email Routing |
| Credential | Location | Notes |
|---|---|---|
| Cloudflare OAuth | ~/.wrangler/ | Managed by wrangler login, not a static key |
| CHARTSTONE_SECRET | ~/.zshenv | 64-char hex string, shared secret for Chartstone |
| API_KEY | Cloudflare secret store | Set via wrangler secret put, not on disk |
| CF Account ID | 9d209df5a6be33dfbf2b9dea3dfd35f9 | In wrangler error messages |
{
"name": "gfs-platform",
"main": "src/index.ts",
"compatibility_date": "2026-05-18",
"workers_dev": true,
"d1_databases": [{ "binding": "DB", "database_name": "gfs-netsuite", "database_id": "3818ecd5-..." }],
"r2_buckets": [{ "binding": "STORAGE", "bucket_name": "gfs-files" }],
"kv_namespaces": [{ "binding": "CACHE", "id": "e880e40bc367..." }],
"triggers": { "crons": ["*/15 * * * *", "0 19 * * *"] },
"routes": [{ "pattern": "api.ai-globalfoodsolutions.co/*", "zone_name": "ai-globalfoodsolutions.co" }]
}
cd ~/Desktop/gfs-platform # Edit src/index.ts wrangler deploy # Verify: curl -s https://gfs-platform.mikelevine.workers.dev/api/health
cd ~/Desktop/gfs-platform # Edit guide/*.html # Rebuild deploy dir: rm -rf /tmp/gfs-deploy && mkdir -p /tmp/gfs-deploy/docs /tmp/gfs-deploy/diagrams for f in guide/*.html guide/*.css; do cp "$f" /tmp/gfs-deploy/; done cp guide/diagrams/*.html /tmp/gfs-deploy/diagrams/ cp infrastructure-dashboard.html executive-dashboard.html /tmp/gfs-deploy/ cp docs/04-Power-Tools.html /tmp/gfs-deploy/docs/ wrangler pages deploy /tmp/gfs-deploy --project-name gfs-system-guide
# Single SQL file: wrangler d1 execute gfs-netsuite --remote --file=sql/01_customers.sql # Ad-hoc query: wrangler d1 execute gfs-netsuite --remote --command="SELECT COUNT(*) FROM transactions" # JSON output for scripting: wrangler d1 execute gfs-netsuite --remote --json --command="SELECT ..."
# Check sync status: cat ~/Desktop/gfs-platform/sync.log cat ~/Desktop/gfs-platform/sync-stderr.log # Check launchd: launchctl list | grep globalfood # If "Operation not permitted": xattr -d com.apple.provenance sync.sh # If Chartstone port changed: # Check Chartstone app for new port # Update sync.sh PORT variable # Manual sync test: bash ~/Desktop/gfs-platform/sync.sh
# Rotate Worker API key: cd ~/Desktop/gfs-platform wrangler secret put API_KEY # Type new key, then update all clients # Chartstone secret is in ~/.zshenv: # CHARTSTONE_SECRET=<64-char-hex> # CF OAuth — re-login: wrangler login
# Current: 29.6 MB / 18 tables / ~185K rows # D1 Limits (paid): 10 GB storage, 10M rows # Headroom: ~98% free # Growth rate: ~30 txns/day = ~11K/year # At current rate: decades of capacity # Check DB size: wrangler d1 execute gfs-netsuite --remote --json \ --command="SELECT * FROM sqlite_master" 2>/dev/null \ | python3 -c "import sys; print(len(sys.stdin.read()),'bytes')"
| Term | Definition |
|---|---|
SuiteQL | NetSuite's SQL dialect (Oracle-style). Used for querying NS data directly. |
RESTlet | NetSuite custom REST endpoint built with SuiteScript. SuiteAPI #2948 is a RESTlet. |
Suitelet | NetSuite custom web page built with SuiteScript. SuiteQL Tool #2947 is a Suitelet. |
SuiteScript | NetSuite's JavaScript-based scripting language (SS 2.0/2.1). Runs server-side in NS. |
N/llm | NetSuite's native AI module. Calls Cohere Command R. 0 governance units per call. |
MCP | Model Context Protocol. Lets AI agents (Claude) call tools in external systems (NetSuite). |
TBA | Token-Based Authentication. NS auth method using consumer/token key pairs. |
D1 | Cloudflare's serverless SQLite database on the edge. Our mirror of NS data. |
KV | Cloudflare Workers Key-Value store. Bound as CACHE, not yet used. |
R2 | Cloudflare's S3-compatible object storage. Bound as STORAGE, not yet used. |
Chartstone | Local desktop app providing unlimited localhost API access to NetSuite via SuiteQL. |
Entity | Customer or vendor internal ID on a transaction. Backfilled 78,616 records to 100%. |
Department | In GFS context = Brand (Right Start, Power Up, etc). Maps to ref_departments. |
Governance Units | NS script execution budget. Suitelets get 10,000. N/llm calls cost 0. |
SuiteFrame | Tim Dietrich's framework for building NS web apps. Single-Suitelet MVC pattern. |