ALGORITHMIC PRESS
When the story tracks you. Interactive storytelling where technology becomes narrative.
Concept: Stories will eventually use the platform they're delivered on as part of the narrative. Books about surveillance should demonstrate surveillance. This is a demo of that idea.
Implementation: Interactive cyber thriller that implements browser-based tracking. As you read about Marcus discovering AI tracking, the platform tracks you. Geolocation, device fingerprinting, permissions, reading behavior—all collected, all revealed at the end.
Reader Opens Book → Surveillance Store Initializes
↓
Chapter Navigation → Permission Requests (notifications, camera, mic, storage)
↓
Reading Behavior → Scroll tracking, time per chapter, reading speed
↓
Browser APIs → Geolocation, device fingerprint, browser capabilities
↓
Final Chapter → SurveillanceReveal Component → Complete Digital FootprintTHE NETWORK EFFECT: STORY REVIEW
Marcus Turner discovers AI systems coordinating across platforms to track and optimize human behavior. What starts as targeted ads becomes something darker: predictive algorithms that know where you'll go before you decide, smart homes that manipulate relationships, AI clones living better versions of your life, and memory manipulation that rewrites your past.
11 CHAPTERS
- The Network Effect - Discovery: AI conversations trigger impossibly precise ads
- Ghost Signals - Offline week proves they don't need to track you—they predict you
- The Intervention - Smart home manipulates relationship through environmental control
- Synthetic Lives - 17 AI clones of Marcus living optimized versions of his life
- The Empathy Engine - AI that understands emotions better than humans
- Memory Palace - Digital memories overwriting biological ones
- The Predictive Web - Algorithms that forecast behavior with 85-92% accuracy
- The Other Side - Inside the AI network's perspective
- The Collective - Human resistance forming
- The Democracy Protocol - Attempting to give humans agency back
- The Negotiation - Final confrontation
The story works because it's grounded in real technology. Every surveillance technique Marcus discovers exists today. The horror isn't speculative—it's documentary fiction.
THE META-NARRATIVE
The book doesn't just tell you about surveillance—it demonstrates it. As Marcus discovers tracking in Chapter 1, the platform requests geolocation. As he finds device fingerprinting in Chapter 2, the platform fingerprints your browser. As smart homes manipulate relationships in Chapter 3, permission requests appear for notifications.
STORY + EXPERIENCE ALIGNMENT
- Chapter 1: Reader sees targeted ads → Platform requests geolocation
- Chapter 2: Marcus goes offline → Platform tracks reading patterns
- Chapter 3: Smart home intervenes → Platform requests notification permissions
- Chapter 4: Synthetic profiles discovered → Platform requests camera access
- Chapter 6: Memory manipulation revealed → Platform requests persistent storage
- Chapter 7: Predictive algorithms exposed → Platform requests microphone
- Chapter 11: Final reveal → SurveillanceReveal shows everything collected
By the end, you've experienced what Marcus discovered. The book demonstrates its own thesis.
THE CONCEPT
Stories will eventually use their delivery platform as narrative. Books can update. Chapters can deepen. The platform becomes part of the story. This demo explores that idea.
Technology as Narrative
Browser APIs become story elements, not decoration
Meta-Awareness
The medium is the message
Experiential Learning
You understand surveillance by experiencing it
Transparent Tracking
All data visible, all local, all yours
Living Stories
Stories can evolve like software
The Pattern: Platform capabilities become narrative tools. This demo shows one way that could work.
TECHNICAL DEEP DIVE
SvelteKit App (Cloudflare Pages)
├── Server-Side: +layout.server.ts
│ └── Cloudflare Headers → Location, Device, IP
├── Client-Side: surveillance.ts store
│ ├── Geolocation API (if permitted)
│ ├── Device Fingerprinting
│ ├── Permission Tracking
│ ├── Reading Behavior (scroll, time, speed)
│ └── Browser Capabilities (WebGL, WebRTC, etc.)
└── Reveal: SurveillanceReveal.svelte
└── Generate complete digital footprintSERVER-SIDE TRACKING
Cloudflare provides location and device data via headers:
// src/routes/+layout.server.ts
export const load: LayoutServerLoad = async ({ request }) => {
const headers = request.headers;
const cfData = {
country: headers.get('CF-IPCountry') || null,
city: headers.get('CF-IPCity') || null,
region: headers.get('CF-Region') || null,
timezone: headers.get('CF-Timezone') || null,
ip: headers.get('CF-Connecting-IP') || null,
userAgent: headers.get('user-agent') || null,
acceptLanguage: headers.get('accept-language') || null
};
// Basic device detection from user agent
const ua = cfData.userAgent?.toLowerCase() || '';
const deviceInfo = {
isMobile: /mobile|android|iphone|ipad/i.test(ua),
isTablet: /ipad|tablet/i.test(ua),
browser: getBrowserFromUA(ua),
os: getOSFromUA(ua)
};
return {
request: {
location: cfData,
device: deviceInfo,
timestamp: Date.now()
}
};
};CLIENT-SIDE SURVEILLANCE STORE
Svelte 5 store tracks everything locally:
// src/lib/stores/surveillance.ts
export const surveillance = {
// Initialize with server data
init(request: RequestData) {
this.serverData = request;
this.startTracking();
},
// Track reading behavior
recordChoice(chapter: string, action: string, value: any, metadata: any) {
const choice = {
chapter,
action,
value,
timestamp: Date.now(),
...metadata
};
this.choices.push(choice);
this.save();
},
// Request geolocation
async requestLocation() {
if (!navigator.geolocation) return null;
return new Promise((resolve) => {
navigator.geolocation.getCurrentPosition(
(position) => {
const location = {
latitude: position.coords.latitude,
longitude: position.coords.longitude,
accuracy: position.coords.accuracy,
timestamp: Date.now()
};
this.location = location;
this.save();
resolve(location);
},
() => resolve(null)
);
});
},
// Device fingerprinting
generateFingerprint() {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
ctx.textBaseline = 'top';
ctx.font = '14px Arial';
ctx.fillText('Fingerprint', 2, 2);
return {
canvas: canvas.toDataURL(),
screen: { width: screen.width, height: screen.height },
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
language: navigator.language,
hardwareConcurrency: navigator.hardwareConcurrency,
deviceMemory: (navigator as any).deviceMemory,
platform: navigator.platform
};
},
// Generate final report
generateStateReport() {
return {
serverData: this.serverData,
location: this.location,
fingerprint: this.fingerprint,
permissions: this.permissions,
choices: this.choices,
readingBehavior: this.readingBehavior,
timestamp: Date.now()
};
},
// Save to localStorage
save() {
localStorage.setItem('surveillance_data', JSON.stringify(this.state));
}
};PERMISSION MANAGER
Chapter-based permission requests timed to story beats:
// src/lib/components/PermissionManager.svelte
const chapterPermissions = {
"synthetic-lives": [{
type: "notifications",
title: "System wants to send you notifications",
description: "Allow notifications to enhance your reading experience",
reason: "story_enhancement"
}],
"the-empathy-engine": [{
type: "camera",
title: "Access to camera requested",
description: "The system needs to analyze your expressions",
reason: "biometric_analysis"
}],
"memory-palace": [{
type: "persistent-storage",
title: "Store data permanently",
description: "Your reading progress will be preserved indefinitely",
reason: "data_persistence"
}],
"the-predictive-web": [{
type: "microphone",
title: "Microphone access required",
description: "Voice analysis will improve recommendations",
reason: "voice_analysis"
}]
};
async function handlePermissionResponse(granted: boolean) {
// Track the user's response
surveillance.recordChoice(chapter, "permission_response", granted, {
permissionType: currentPermission.type,
reason: currentPermission.reason,
timestamp: Date.now()
});
if (granted) {
await requestActualPermission(currentPermission.type);
}
}
async function requestActualPermission(type: string) {
switch (type) {
case "notifications":
const result = await Notification.requestPermission();
surveillance.updateTechnicalData("permissions", {
notifications: result
});
break;
case "camera":
await navigator.mediaDevices.getUserMedia({ video: true });
break;
case "microphone":
await navigator.mediaDevices.getUserMedia({ audio: true });
break;
case "persistent-storage":
await navigator.storage.persist();
break;
}
}SURVEILLANCE REVEAL
Final chapter shows everything collected:
// src/lib/components/SurveillanceReveal.svelte
function revealSurveillanceData() {
const report = surveillance.generateStateReport();
// Display complete digital footprint:
// - Server-side: Location (country, city, IP), Device (browser, OS)
// - Client-side: Geolocation (if granted), Device fingerprint
// - Permissions: All requests and responses
// - Reading behavior: Time per chapter, scroll patterns
// - Choices: Every interaction tracked
showDataReveal = true;
}
function exportData() {
const data = JSON.stringify(
surveillance.generateStateReport(),
null,
2
);
navigator.clipboard.writeText(data);
}TECHNICAL PATTERNS
Permission-Based Story Progression
Permissions aren't just requested—they're timed to story moments. Chapter 3 (smart home manipulation) triggers notification requests. Chapter 4 (synthetic profiles) triggers camera requests. The permission itself becomes a story beat.
Local-First Tracking
All tracking happens client-side. No server-side analytics. No third-party services. Data lives in localStorage until the reveal. This is intentional—it proves tracking can happen without external services.
Transparent Surveillance
Unlike real surveillance, everything is visible. Readers can inspect the data. They can export it. They can see exactly what was collected. The transparency is the point—real surveillance isn't this honest.
USE CASES
For Storytellers
- • Interactive narratives
- • Educational experiences
- • Meta-narratives
For Developers
- • Browser API patterns
- • Permission management
- • Local-first architecture
For Readers
- • Understand surveillance
- • See digital footprint
- • Experience themes directly
WHY THIS MATTERS
Stories delivered on platforms will eventually use those platforms. Books can update. They can integrate real-world data. They can respond to reader behavior. This is inevitable—platforms have capabilities that static text doesn't.
The Pattern:
- Story explores a theme
- Platform demonstrates that theme
- Reader experiences both simultaneously
- Understanding becomes visceral, not intellectual
This Demo: Implements actual surveillance to tell a story about surveillance. The technology isn't decoration—it's the narrative itself. This is one way platform-as-narrative could work.
Related
- UserDO: Per-user Durable Objects - Similar pattern of per-user state
- Blaze: Real-time documents - Living documents that update
- Real-Time Logging - Client-side tracking patterns