Expand SX-Activity plan: the evaluable web

Reframe Phase 6 from "ActivityPub but SX" to the full vision: a new web
where content, components, parsers, transforms, server/client logic, and
media all share one executable format on IPFS, sandboxed by boundary
enforcement, with Bitcoin-anchored provenance. Updated context section
and nav summary to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 10:17:21 +00:00
parent 624b08997d
commit 59a8d2063d
2 changed files with 89 additions and 16 deletions

View File

@@ -107,7 +107,7 @@
(dict :label "Reader Macros" :href "/plans/reader-macros"
:summary "Extensible parse-time transformations via # dispatch — datum comments, raw strings, and quote shorthand.")
(dict :label "SX-Activity" :href "/plans/sx-activity"
:summary "ActivityPub federation with SX as wire format — IPFS-backed component registry, content-addressed media, Bitcoin-anchored provenance.")))
:summary "A new web built on SX — executable content, shared components, parsers, and logic on IPFS, provenance on Bitcoin, all running within your own security context.")))
(define bootstrappers-nav-items (list
(dict :label "Overview" :href "/bootstrappers/")

View File

@@ -134,9 +134,9 @@
(~doc-page :title "SX-Activity"
(~doc-section :title "Context" :id "context"
(p "ActivityPub federates social actions using JSON-LD over HTTP. It works, but JSON-LD is verbose, requires context resolution, and carries no computation — it's inert data that every consumer must interpret from scratch. Meanwhile SX already has: a compact wire format, a safe evaluable language, content-addressed DAG execution (artdag), IPFS storage with CIDs, and OpenTimestamps Bitcoin anchoring.")
(p "SX-Activity replaces JSON-LD with s-expressions as the federation wire format. Activities become " (strong "evaluable programs") " rather than inert data. Components travel with content, stored on IPFS, resolved by content address. Media is content-addressed. Provenance is anchored in the Bitcoin chain. The result: a federation protocol where receiving a post means receiving the ability to " (em "render") " it — not just the data, but the UI.")
(p "The key insight: " (strong "if the wire format is already an evaluable language, federation becomes code distribution.") " A Create activity carrying a Note isn't just data — it's a renderable document with its own component definitions, stylesheets, and media references, all content-addressed and independently verifiable."))
(p "The web is six incompatible formats duct-taped together: HTML for structure, CSS for style, JavaScript for behavior, JSON for data, server languages for backend logic, build tools for compilation. Moving anything between layers requires serialization, template languages, API contracts, and glue code. Federation (ActivityPub) adds a seventh — JSON-LD — which is inert data that every consumer must interpret from scratch and wrap in their own UI.")
(p "SX is already one evaluable format that does all six. A component definition is simultaneously structure, style (CSSX atoms), behavior (event handlers), data (the AST " (em "is") " data), server-renderable (Python evaluator), and client-renderable (JS evaluator). The pieces already exist: content-addressed DAG execution (artdag), IPFS storage with CIDs, OpenTimestamps Bitcoin anchoring, boundary-enforced sandboxing.")
(p "SX-Activity wires these together into a new web. Everything — content, UI components, markdown parsers, syntax highlighters, validation logic, media, processing pipelines — is the same executable format, stored on a content-addressed network, running within each participant's own security context. " (strong "The wire format is the programming language is the component system is the package manager.")))
(~doc-section :title "Current State" :id "current-state"
(ul :class "space-y-2 text-stone-700 list-disc pl-5"
@@ -389,27 +389,100 @@
(~doc-section :title "Phase 6: The Evaluable Web" :id "phase-6"
(div :class "rounded border border-violet-200 bg-violet-50 p-4 mb-4"
(p :class "text-violet-900 font-medium" "What it enables")
(p :class "text-violet-800" "The full vision: federation where content carries its own rendering, components are shared infrastructure, media is permanent, and authorship is cryptographically proven. A web that evaluates rather than merely displays."))
(p :class "text-violet-900 font-medium" "What this really is")
(p :class "text-violet-800" "Not ActivityPub-with-SX. A new web. One where everything — content, components, parsers, renderers, server logic, client logic — is the same executable format, shared on a content-addressed network, running within each participant's own security context."))
(~doc-subsection :title "Synthesis"
(~doc-subsection :title "The insight"
(p "The web has six layers that don't talk to each other: HTML (structure), CSS (style), JavaScript (behavior), JSON (data interchange), server frameworks (backend logic), and build tools (compilation). Each has its own syntax, its own semantics, its own ecosystem. Moving data between them requires serialization, deserialization, template languages, API contracts, type coercion, and an endless parade of glue code.")
(p "SX collapses all six into one evaluable format. A component definition is simultaneously structure, style (CSSX atoms), behavior (event handlers), data (the AST is data), server-renderable (Python evaluator), and client-renderable (JS evaluator). There is no boundary between \"data\" and \"program\" — s-expressions are both.")
(p "Once that's true, " (strong "everything becomes shareable.") " Not just UI components — markdown parsers, syntax highlighters, date formatters, validation logic, layout algorithms, color systems, animation curves. Any pure function over data. All content-addressed, all on IPFS, all executable within your own security context."))
(~doc-subsection :title "What travels on the network"
(div :class "space-y-4"
(div
(h4 :class "font-semibold text-stone-700" "1. Self-rendering posts")
(p "A federated post is a complete rendering program. It carries content (SX), references components (by CID), references media (by CID), and includes provenance (Bitcoin anchor). The receiving browser needs nothing beyond the SX evaluator to render it.")
(p "No framework lock-in. No CSS framework dependency. No build step. The post is its own application."))
(h4 :class "font-semibold text-stone-700" "Content")
(p "Blog posts, product listings, event descriptions, social media posts. Not HTML strings embedded in JSON — live SX expressions that evaluate to rendered UI. The content " (em "is") " the application."))
(div
(h4 :class "font-semibold text-stone-700" "2. Collaborative component ecosystem")
(p "Multiple servers contribute components to the shared IPFS pool. A blogging platform publishes ~article-layout. A commerce platform publishes ~product-card. A social network publishes ~thread-view. Any post can compose components from different origins — they're all just pure functions over data."))
(h4 :class "font-semibold text-stone-700" "Components")
(p "UI building blocks: cards, tables, forms, navigation, media players. Published to IPFS, referenced by CID. A commerce site publishes " (code "~product-card") ". A blogging platform publishes " (code "~article-layout") ". A social network publishes " (code "~thread-view") ". Anyone can compose them. They're pure functions — safe to load from anywhere."))
(div
(h4 :class "font-semibold text-stone-700" "3. Permanent content")
(p "Every artifact — content, components, media, provenance proofs — is content-addressed and available on IPFS. The " (em "origin server is optional") " after publication. Content survives server shutdown, domain expiry, and platform abandonment."))
(h4 :class "font-semibold text-stone-700" "Parsers and transforms")
(p "A markdown parser is just an SX function: takes a string, returns an SX tree. Publish it to IPFS. Now anyone can use your markdown dialect. Same for: syntax highlighters, BBCode parsers, wiki markup, LaTeX subsets, CSV-to-table converters, JSON-to-SX adapters. " (strong "The parser ecosystem becomes shared infrastructure."))
(~doc-code :code (highlight ";; A markdown parser, published to IPFS\n;; CID: bafy...md-parser\n(define parse-markdown\n (fn (source)\n ;; tokenize → build AST → return SX tree\n ;; (parse-markdown \"# Hello\\n**bold**\")\n ;; → (h1 \"Hello\") (p (strong \"bold\"))\n ...))\n\n;; Anyone can use it in their components\n(defcomp ~blog-post (&key markdown-source)\n (div :class \"prose\"\n (parse-markdown markdown-source)))" "lisp")))
(div
(h4 :class "font-semibold text-stone-700" "4. Client as universal renderer")
(p "The SX client becomes a universal content renderer. It doesn't need to know about specific servers or APIs. Given a CID, it can fetch content, resolve components, verify provenance, and render — all from IPFS. The browser becomes a " (em "federation peer") " rather than a passive consumer.")))))
(h4 :class "font-semibold text-stone-700" "Server-side and client-side logic")
(p "The same SX code runs on either side. A validation function published to IPFS runs server-side in Python for form processing and client-side in JavaScript for instant feedback. A price calculator runs server-side for order totals and client-side for live previews. " (em "The server/client split is a deployment decision, not a language boundary.")))
(div
(h4 :class "font-semibold text-stone-700" "Media and processing pipelines")
(p "Images, video, audio — all content-addressed on IPFS. But also the " (em "processing pipelines") " that created them. artdag DAGs are SX. Publish a DAG CID alongside the output CID and anyone can verify the provenance, re-render at different resolution, or fork the pipeline for their own work."))))
(~doc-subsection :title "The security model"
(p "This only works because of boundary enforcement. Every piece of SX fetched from the network runs within the receiver's security context:")
(ul :class "list-disc pl-5 text-stone-700 space-y-1"
(li (strong "Pure functions can't do IO. ") "A component from IPFS can produce markup — it cannot read your cookies, make network requests, access localStorage, or call any IO primitive. The boundary spec (boundary.sx) is enforced at registration time. This isn't a policy — it's structural. The evaluator literally doesn't have IO primitives available when running untrusted code.")
(li (strong "IO requires explicit grant. ") "Only locally-registered IO primitives (query, frag, current-user) have access to server resources. Fetched components never see them. The host decides what capabilities to grant.")
(li (strong "Step limits cap computation. ") "Untrusted code runs with configurable eval step limits. No infinite loops, no resource exhaustion. Exceeding the limit halts evaluation and returns an error node.")
(li (strong "Content addressing prevents tampering. ") "You asked for CID X, you got CID X, the hash proves it. No MITM, no CDN poisoning, no supply chain attacks on the content itself.")
(li (strong "Provenance proves authorship. ") "Bitcoin-anchored timestamps prove who published what and when. Not \"trust me\" — independently verifiable against the Bitcoin blockchain."))
(p "This is the opposite of the npm model. npm packages run with full access to your system — a malicious package can exfiltrate secrets, install backdoors, modify the filesystem. SX components are structurally sandboxed. The worst a malicious component can do is render a " (code "(div \"haha got you\")") "."))
(~doc-subsection :title "What this replaces"
(div :class "overflow-x-auto rounded border border-stone-200 mb-4"
(table :class "w-full text-left text-sm"
(thead (tr :class "border-b border-stone-200 bg-stone-100"
(th :class "px-3 py-2 font-medium text-stone-600" "Current web")
(th :class "px-3 py-2 font-medium text-stone-600" "SX web")
(th :class "px-3 py-2 font-medium text-stone-600" "Why")))
(tbody
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "npm / package registries")
(td :class "px-3 py-2 text-stone-700" "IPFS + component CIDs")
(td :class "px-3 py-2 text-stone-600" "Content-addressed, no central authority, structurally safe"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "CDNs for JS/CSS")
(td :class "px-3 py-2 text-stone-700" "IPFS gateways")
(td :class "px-3 py-2 text-stone-600" "Permanent, decentralized, self-verifying"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "REST/GraphQL APIs")
(td :class "px-3 py-2 text-stone-700" "SX activities over AP")
(td :class "px-3 py-2 text-stone-600" "Responses are evaluable, not just data"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "HTML + CSS + JS")
(td :class "px-3 py-2 text-stone-700" "SX (one format)")
(td :class "px-3 py-2 text-stone-600" "No impedance mismatch, same evaluator everywhere"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Build tools (webpack, vite)")
(td :class "px-3 py-2 text-stone-700" "Nothing")
(td :class "px-3 py-2 text-stone-600" "SX evaluates directly, no compilation step"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Template languages")
(td :class "px-3 py-2 text-stone-700" "Nothing")
(td :class "px-3 py-2 text-stone-600" "SX is the template and the language"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "JSON-LD federation")
(td :class "px-3 py-2 text-stone-700" "SX federation")
(td :class "px-3 py-2 text-stone-600" "Wire format is executable, content renders itself"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Trust-based package security")
(td :class "px-3 py-2 text-stone-700" "Structural sandboxing")
(td :class "px-3 py-2 text-stone-600" "Pure functions can't have side effects — not by policy, by construction"))))))
(~doc-subsection :title "The end state"
(p "A browser with an SX evaluator and an IPFS gateway is a complete web platform. Given a CID — for a page, a post, an application — it can:")
(ul :class "list-disc pl-5 text-stone-700 space-y-1"
(li "Fetch the content from IPFS")
(li "Resolve component dependencies (also from IPFS)")
(li "Resolve media (also from IPFS)")
(li "Evaluate the content (pure computation, sandboxed)")
(li "Render to DOM")
(li "Verify provenance (Bitcoin anchor)")
(li "Cache everything forever (content-addressed = immutable)"))
(p "No server needed. No DNS. No TLS certificates. No hosting provider. No build step. No framework. Just content-addressed s-expressions evaluating in a sandbox.")
(p "The server becomes optional infrastructure for " (em "IO") " — database queries, authentication, payment processing, real-time events. Everything else lives on the content-addressed network. The web stops being a collection of servers you visit and becomes a " (strong "shared evaluable space") " you participate in.")))
;; -----------------------------------------------------------------------
;; Cross-Cutting Concerns