Textile Globe phasedoc

Static snapshot exported 2026-10-28. Tick state is as of that date.

P0 Foundation and local setup 5/5 done

P0.1 Run the app locally

P0.1.1 Repository cloned
Acceptance: test -f package.json && git rev-parse --is-inside-work-tree prints true
P0.1.2 Dependencies installed and setup doctor passes
Acceptance: npm run doctor prints a line starting with 'Ready.'
P0.1.3 Dev server serves the app
Acceptance: with npm run dev running, curl -s -o /dev/null -w '%{http_code}' http://localhost:4173 prints 200
Checked against the PM2-managed server (port 4173), per the machine's process-management rule.

P0.2 Provider keys

P0.2.1 Five free provider keys configured
Acceptance: npm run doctor shows Cesium ion, AISStream, NASA FIRMS, TomTom and Mapillary as [OK]
P0.2.2 Secrets stay out of git
Acceptance: git check-ignore .env prints .env, and git ls-files lists no .env file

P1 Textile data layers 8/9 done

P1.1 Curated datasets

P1.1.1 Cotton regions dataset
Acceptance: node parse of cotton-regions.geojsonl: 28 Point features, each with name and detail
P1.1.2 Textile hubs dataset
Acceptance: node parse of textile-hubs.geojsonl: 41 Point features, each with name and detail
P1.1.3 Textile ports dataset
Acceptance: node parse of textile-ports.geojsonl: 36 Point features, each with name and detail
P1.1.4 Trade lanes dataset
Acceptance: node parse of trade-lanes.geojsonl: 11 LineString features, none crossing the antimeridian

P1.2 Wiring into the app

P1.2.1 Four layers registered with stable share-link tokens
Acceptance: node --test src/data/layerState.test.mjs src/app/constructCatalog.test.mjs passes
P1.2.2 Datasets ship in the production build
Acceptance: npx vite build succeeds and emits cotton-regions, textile-hubs and textile-ports assets
P1.2.3 Panel lists textile layers and hides unrelated ones
Acceptance: node --test src/ui/layerPanel.test.mjs passes; src/textileProfile.js hides 20 layer ids

P1.3 Seen working in a browser

P1.3.1 Every textile layer draws markers or lines on the globe
Acceptance: headless Chrome walk with each layer on: screenshot shows markers, 0 console errors
Seen on 2026-10-28 in headed Chrome on the real GPU against the live hosted app: all four textile layers draw on the Google 3D globe (green cotton, orange hubs, cyan ports, pink lanes) with their notes, plus live ships and fires. No page errors. Embed-mode captures are in the demo video.
P1.3.2 Clicking a marker opens a detail card
Acceptance: headless Chrome click on a hub marker shows a card with its detail line
Not attempted: needs the markers visible first.

P2 Live data feeds 4/7 done

P2.1 Live ships from AISStream

P2.1 Live ships from AISStream
Acceptance: with the server running, curl http://localhost:4173/api/vessels returns HTTP 200
HTTP 200 with 3,479 vessel rows at check time; the feed status flapped between connecting and 'websocket closed' while reconnecting.

P2.2 Active fires from NASA FIRMS

P2.2 Active fires from NASA FIRMS
Acceptance: with the server running, curl http://localhost:4173/api/firms returns HTTP 200
HTTP 200, 191,589 fire records. The very first call after server start timed out at 30 s; later calls took under 0.1 s.

P2.3 Weather layers stay available

P2.3 Weather layers stay available
Acceptance: src/textileProfile.js does not hide wind, weather-radar, weather-satellite, weather-lightning or weather-cyclones

P2.4 Show cargo and container ships only

P2.4 Show cargo and container ships only
Acceptance: vessel layer with the filter on shows zero tankers or passenger ships in a sampled snapshot

P2.5 Live weather and crop signals over cotton regions

P2.5 Live weather and crop signals over cotton regions
Acceptance: each cotton region card shows a current temperature and rainfall from a live source

P2.6 Port congestion estimate from ship dwell time

P2.6 Port congestion estimate from ship dwell time
Acceptance: a port card shows ships waiting nearby computed from live positions

P2.7 Live data reachable from the public site while the Mac is on

P2.7 Live data reachable from the public site while the Mac is on
Acceptance: from outside, GET <public app>/api/vessels returns complete JSON with rows 12 times in 12; /api/setup/status returns 404
Checked 2026-10-28: 12/12 complete vessel responses and 3/3 fires responses through textile-app-mu.vercel.app; setup, TomTom and OpenAI routes return 404. Before the gateway sent exact Content-Length, 2 of 3 responses were truncated by Vercel's proxy. Only works while the Mac is on; Tailscale Funnel on the gateway (port 4176).

P3 Voice control 3/6 done

P3.1 Upstream improvements merged

P3.1 Upstream improvements merged
Acceptance: git merge-base --is-ancestor upstream/main HEAD exits 0 (at the merge of upstream 6be2559)

P3.2 Voice runs on a ChatGPT sign-in, no API credits

P3.2 Voice runs on a ChatGPT sign-in, no API credits
Acceptance: with the server running, /api/realtime/oauth-status says available:true and /api/realtime/token?auth=oauth returns 200
Server side checked (status available, token mint 200). Microphone use was confirmed working by the owner in their own browser.

P3.3 Textile layers addressable by voice

P3.3 Textile layers addressable by voice
Acceptance: node --test src/voice/layerManifest.test.mjs src/voice/actionSchemas.test.mjs passes

P3.4 Voice can answer textile questions

P3.4 Voice can answer textile questions
Acceptance: asking 'which hubs are in Bangladesh' returns Gazipur / Dhaka, Narayanganj and Chattogram

P3.5 Textile-specific voice instructions and first-run copy

P3.5 Textile-specific voice instructions and first-run copy
Acceptance: first-run panel and voice prompt name cotton, hubs, ports and lanes instead of flights and satellites
Confirmed open: the first-run panel still says Live Contacts / Space Missions / Environmental and the header still reads GOD'S EYE VIEW.

P3.6 Free voice fallback that needs no OpenAI account

P3.6 Free voice fallback that needs no OpenAI account
Acceptance: with OPENAI_API_KEY blank and no Codex sign-in, the mic still executes 'show cotton regions'

P4 Quality and release 3/5 done

P4.1 Full unit test suite passes

P4.1 Full unit test suite passes
Acceptance: npm test reports fail 0
6,214 passed, 0 failed, 1 skipped. Three timing-sensitive tests can time out when the whole suite runs under load and pass when rerun alone.

P4.2 Code published to GitHub

P4.2 Code published to GitHub
Acceptance: git ls-remote origin main prints the same hash as git rev-parse HEAD
origin/main matched local HEAD (6b304db) after push; re-pushed with this tick.

P4.3 Upstream MIT licence and credit preserved

P4.3 Upstream MIT licence and credit preserved
Acceptance: LICENSE exists and names the original author
LICENSE is the upstream MIT licence, copyright Bilawal Sidhu. Textile changes are credited in the betadoc.

P4.4 Dataset accuracy review

P4.4 Dataset accuracy review
Acceptance: every coordinate and claim checked against an independent source, review recorded in a note
Hub and port coordinates were written from general knowledge, not looked up. Treat as approximate until reviewed.

P4.5 Textile branding in the app shell

P4.5 Textile branding in the app shell
Acceptance: page title, header and credits describe the textile product while crediting upstream

P5 Documentation 5/6 done

P5.1 Phasedoc cockpit running

P5.1 Phasedoc cockpit running
Acceptance: curl each of the five cockpit tabs on its port returns 200 with 0 server errors

P5.2 Betadoc site written

P5.2 Betadoc site written
Acceptance: betadoc/index.html and betadoc/documentation.html exist and every internal link resolves
LONG format. Links and anchors checked by script (0 broken, no external resource loads). No demo video, no hosted live app, by design stated on the page.

P5.3 Betadoc published on a static host

P5.3 Betadoc published on a static host
Acceptance: the public subdomain returns 200 from outside the machine
Checked 2026-10-28 after the three CNAMEs were added at Hostinger: textile / textileapp / textile-phasedoc .agent01.online all return 200 over valid HTTPS; betadoc also fetched successfully from a different network. Certificates had to be requested explicitly with vercel certs issue. Live app address also relays ships and fires (10/10 complete).

P5.4 Narrated demo video

P5.4 Narrated demo video
Acceptance: a video file streams in the betadoc hero without a full download
Re-recorded 2026-10-28 as one continuous narration (flow fix). Current file: 80.8 s, 11.3 MB, H.264+AAC, faststart, -16 LUFS. Checked after deploy: HTTP 206 range support, real Chrome plays it, no media error.

P5.5 Studio-quality voiceover for the demo video

P5.5 Studio-quality voiceover for the demo video
Acceptance: narrate.mjs run with ELEVENLABS_API_KEY set writes mp3 clips (provider elevenlabs in audio/durations.json) and the video is re-rendered with them
Done 2026-10-28; redone as ONE continuous ElevenLabs request with per-character timing (with-timestamps) so camera moves, layers, captions and the legend fire at the exact words. Voice: Alice (built-in; library voice gave HTTP 402 on a free plan). Key scoped to text-to-speech; stored only in video/.env (git-ignored).

P5.6 Demo video can be rebuilt from a clean checkout

P5.6 Demo video can be rebuilt from a clean checkout
Acceptance: from a fresh clone, node video/narrate.mjs, capture.mjs, build-composition.mjs and npx hyperframes render produce a 75-90 s MP4 with one continuous voice
Chain run end to end on this Mac: story.json -> narrate.mjs -> capture.mjs -> build-composition.mjs -> hyperframes render -> ffmpeg compress. Not yet from a fresh clone. Needs Node 24, ffmpeg, Chrome, and npx playwright install ffmpeg.

P6 Future roadmap 1/7 done

P6.1 Cloud twin so the demo is up 24x7

P6.1 Cloud twin so the demo is up 24x7
Acceptance: a hosted copy answers 200 behind a PIN with keys held only by a gateway

P6.2 Real factory and mill locations from OpenStreetMap

P6.2 Real factory and mill locations from OpenStreetMap
Acceptance: a Factories layer loads at least 1,000 verified textile sites worldwide

P6.3 Cotton price and trade-flow feeds

P6.3 Cotton price and trade-flow feeds
Acceptance: a panel shows a current cotton futures price and monthly export volumes by country

P6.4 Supply-chain disruption alerts

P6.4 Supply-chain disruption alerts
Acceptance: a storm, fire or port closure near a hub raises a visible alert within 15 minutes

P6.5 Saved views and shareable briefings

P6.5 Saved views and shareable briefings
Acceptance: a share link restores layers, camera and voice summary on another machine

P6.6 Several public demos share one tunnel port through Caddy

P6.6 Several public demos share one tunnel port through Caddy
Acceptance: Funnel on port 10000 -> Caddy 8000; the app's rewrites use the /__textile prefix; 12 of 12 public vessel responses complete
Done 2026-10-28. Tailscale Funnel on port 10000 -> Caddy 127.0.0.1:8000 (PM2) -> /__textile/* -> gateway. From outside: vessels 12/12 complete, fires 20,999, wind and cyclones 200; / , no-prefix, setup, oauth routes 404, POST 405. Public site (textileapp.agent01.online) re-deployed with rewrites to :10000/__textile; 12/12 complete and forced cache misses (2-3 s) appeared in Caddy's log. First attempt returned empty 200s: Caddy site was 127.0.0.1:8000 but tunnelled requests carry the tunnel Host header; fixed with a bare :8000. Old direct tunnel on 443 still on until the owner runs tailscale funnel --https=443 off.

P6.7 Push-to-deploy with GitHub Actions

P6.7 Push-to-deploy with GitHub Actions
Acceptance: a push to main rebuilds and redeploys the three Vercel projects and the run succeeds
Workflow written at deploy/ci/vercel-deploy.yml, inactive: needs copying to .github/workflows and 5 repository secrets.

In plain language

P0 Foundation and local setup

Getting the app running on a laptop. This phase is about the basics: copying the code, installing what it needs, and adding the free access keys that unlock maps, ships, fires, traffic and street photos. Nothing here is textile-specific yet, but everything later depends on it.

P1 Textile data layers

This is the heart of the textile product. We added four new map layers that show where cotton is grown, where clothes and fabric are made, which ports they ship through, and the main sea routes between them. The data is a hand-curated starter set, so it does not update by itself. The remaining work is proving it looks right in a real browser.

P2 Live data feeds

Some information can be live. Ship positions, wildfires near farms and weather already come in from public services, and the public website relays them from the builder's own computer, so they are only live while that computer is on. The open work is making that live information textile-aware: only cargo ships, weather over cotton fields, and a rough read on how crowded a port is.

P3 Voice control

Talking to the globe. You can say 'show cotton regions' or 'take me to Tiruppur' and it responds. It currently works through a ChatGPT sign-in because the paid developer account has no credit. That route is experimental, so the open work is a free fallback and teaching voice about textile questions.

P4 Quality and release

Making sure what we built is trustworthy and shared properly. The automated checks all pass and the code is on GitHub. Still open: double-checking every place name and coordinate against a second source, and re-skinning the app so it reads as a textile product while crediting the original authors.

P5 Documentation

Telling the story. This phase covers the internal progress window you are looking at now (the phasedoc) and the public website and written guide for outsiders (the betadoc). The website, the app and this page are on the internet at their own agent01.online addresses; a 81-second demo video is on the betadoc with an AI voice from ElevenLabs.

P6 Future roadmap

Where the product could go next. Hosting a copy that is always online, loading real factory locations at scale, adding cotton price and export data, raising alerts when a storm or fire threatens a hub, and letting teams save and share briefings. None of this is started, so every item here is honestly open.

Plan of record

Textile Globe — plan of record

Disclosure: retrospective seeding. This phasedoc was created after most of
phases P0 to P4 were already built. Tick dates are the dates the checks were
re-run when the tracker was seeded, not the dates the work happened. The
acceptance column records what was actually run at that time. Work marked
open has not been done.

The Textile Globe is a fork of an open-source 3D world monitor called God's Eye View (MIT licence, by Bilawal Sidhu). We changed it to show the textile industry: where cotton grows, where fabric and clothing are made, and how goods ship between them.

P0 Foundation and local setup

The app runs on a laptop with a single command. We copied the code, installed its dependencies, and added five free access keys (called API keys, which are passwords that let our app ask outside services for data): Cesium ion for 3D maps, AISStream for ship positions, NASA FIRMS (Fire Information for Resource Management System) for wildfires, TomTom for traffic, and Mapillary for street photos. The keys live in a private file that is never uploaded to GitHub.

P1 Textile data layers

Four new map layers were added: Cotton Regions (28 growing areas), Textile Hubs (41 manufacturing clusters), Textile Ports (36 container ports) and Trade Lanes (11 sea routes). They come from curated files stored with the code, written from general knowledge, so they are approximate and do not update on their own. The layer list was trimmed so unrelated layers (flights, military, satellites and others) are hidden but not deleted. The automated tests and the production build pass; what is still missing is a recorded walk through a real browser showing each layer draws and each marker opens its information card.

P2 Live data feeds

Ships (from AISStream, the Automatic Identification System that vessels broadcast), wildfires and weather are live, and they reach the public website through a small read-only server on the builder's own computer. That means the live layers only work while that computer is on. Three textile-specific upgrades are open: show only cargo and container ships, show weather over cotton regions, and estimate port congestion from how long ships sit near a port.

P3 Voice control

A microphone button lets you speak commands. The paid OpenAI developer account had no credit, so voice runs on an experimental ChatGPT sign-in route that the upstream project added. It works, but OpenAI has not promised that route will keep working. Textile layers are registered with the voice system, so you can say "show cotton regions". Open work: answering questions like "which hubs are in Bangladesh", textile wording in the first-run screen, and a free fallback that needs no OpenAI account (an on-device voice option exists upstream).

P4 Quality and release

All 6,214 automated tests pass and the code is on GitHub at nishadiyer/World-Monitor. The original MIT licence and credit to the upstream author are kept. Still open: an independent accuracy review of every place and coordinate in the datasets, and replacing the remaining generic branding with textile branding while still crediting the original project.

P5 Documentation

Two documents tell the story. This phasedoc is the internal, honest progress window for the builders. The betadoc is the public website and written guide for outsiders. Both are written and published on Vercel at textile.agent01.online (betadoc) and textile-phasedoc.agent01.online (this page); the live app is at textileapp.agent01.online. A 81-second narrated demo video is embedded in the betadoc; its voice is an AI voice from ElevenLabs.

P6 Future roadmap

Nothing here is started. Ideas, in rough order: host an always-on copy behind a PIN; load real factory locations from OpenStreetMap at scale; add cotton price and export figures; raise alerts when a storm, fire or port closure threatens a hub; and let teams save and share briefings.