Platform Architecture & Capabilities
14 Module Families · 112 Documented Capabilities
Fossil Studio provides a hermetic web execution foundation. Below is the complete platform capability register mapped to exact runtime contracts, APIs, configuration manifests, and process flows.
Public Site and CMS (Entries 1–14)
Ahead-of-time static compilation, Liquid layouts, CommonMark Markdown, Pikchr vector graphics, clean canonical URLs, and asset preservation. See in action: Story 1 — Instant Ops →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 1 | Ahead-of-time SSG generation | build.pages.{input,output}; buildPages() | Reads .md and .json sources and compiles static HTML artifacts into public/. | Implemented |
| 2 | Liquid layout chaining | Frontmatter layout; fossil.ssg.renderPage() | Resolves parent layouts, provides page/site scope, and renders Liquid templates around converted body. | Implemented |
| 3 | Reusable Liquid includes | Liquid {% raw %}{% include 'name.html' %}{% endraw %} | Resolves partial templates from _includes/ and injects them during layout compilation. | Implemented |
| 4 | CommonMark Markdown parsing | parseFrontmatter(); fossil.ssg.markdownToHtml() | Extracts YAML frontmatter, converts CommonMark body to HTML, and retains first heading. | Implemented |
| 5 | Embedded Pikchr diagrams | fossil.markdown(markdown) | Compiles fenced ```pikchr code blocks into responsive inline SVGs inside native C engine. | Implemented |
| 6 | JSON-authored content pages | content/*.json; fossil.ssg.markdownToHtml() | Parses standalone JSON files, renders the content field with Markdown rules, and exposes attributes. | Implemented |
| 7 | Arbitrarily nested sections | Recursive list(input + '/'); outputPagePath() | Preserves subdirectories: index.md becomes directory index; other files become nested HTML files. | Implemented |
| 8 | Clean canonical URLs | canonicalUrl(); / routing | Maps source files to extensionless URLs; runtime redirects .html and trailing slashes to canonical paths. | Implemented |
| 9 | Data-driven navigation & datasets | _data/*.json; loadData(config) | Loads JSON data files under their filename keys into global Liquid template scope (e.g. navigation, site). | Implemented |
| 10 | Custom Liquid filters | registerTemplateFilters(engine) | Registers filters for markdown, currency, json, and asset_url before rendering. | Implemented |
| 11 | In-memory SSG host runner | fossil.ssg.renderPage(layout, body, json, url) | Renders complete page strings in-memory without writing to disk; powers live draft preview. | Implemented |
| 12 | Renderer fallback chain | fossil.ssg.markdownToHtml → fossil.markdown | Keeps SSG build operational using in-repository Liquid runner if native C helpers are missing. | Implemented |
| 13 | Byte-preserving asset copying | build.copy; readBytes() / writeBytes() | Copies configured static files and binary assets into public/ unchanged without mutation. | Implemented |
| 14 | Automated sitemap & robots | build.sitemap; buildSitemap() | Scans generated public pages, applies exclusions, and outputs sitemap.xml and robots.txt. | Implemented |
Site Routing and Build Configuration (Entries 15–26)
Hostname/path mount resolution, longest-prefix matching, branch pipelines, commit hooks, CORS headers, and two-file hermetic runtime. See in action: Story 1 — Instant Ops →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 15 | Host and path mounts | app.json.mounts[] (id, host, path, branch, mode) | Binds incoming HTTP host/path prefixes to repository branches and serving modes (static, api, admin). | Implemented |
| 16 | Longest-prefix precedence | Longest path, then longest host | Resolves site mounts deterministically; preserves more-specific API and Admin routes over catch-alls. | Implemented |
| 17 | Default serving branch fallback | app.json.serving.branch | Selects default branch and mount when no explicit mount rule matches the incoming request. | Implemented |
| 18 | Live-tag revision resolution | Fossil setting live-tag | Serves the published revision tagged live with fallback to trunk/tip for zero-downtime releases. | Implemented |
| 19 | Source-to-target branch pipelines | pipelines[].on / target | Matches check-ins on source branches (e.g. site/*) and commits build artifacts to target branches. | Implemented |
| 20 | Lifecycle commit hooks | hooks.before-commit, hooks.after-commit | Runs validation before commits (can abort), runs SSG build after commits, processes synced changes. | Implemented |
| 21 | Branch role separation | app.json.branches.harness / admin | Isolates agent configurations (studio/harness) and Admin UI (studio/admin) from public sites. | Implemented |
| 22 | Per-mount revision pinning | POST /api/admin/publication (pin/latest) | Pins a mount to an immutable check-in UUID or returns it to latest branch tip. | Implemented |
| 23 | Path-matched HTTP headers & CORS | app.json.headers[]; automatic OPTIONS | Matches response headers by pattern; automatically responds to API CORS preflights with 204. | Implemented |
| 24 | Runtime and build quotas | settings.{apiTimeoutMs, apiMemoryMb, ...} | Enforces strict execution timeouts and memory limits on SQLite, QuickJS, and build processes. | Implemented |
| 25 | Hermetic two-file deployment | Executable + SQLite .fossil repository | Serves 100% from repository blobs; zero external dependencies, no host filesystem fallback. | Implemented |
| 26 | Authenticated batch commit | POST /_fossil/commit | Accepts multi-file payloads, validates credentials, and commits atomically to named branches. | Implemented |
API and Data Runtime (Entries 27–35)
Embedded QuickJS serverless API routes, request/response lifecycle, parameterized SQLite reads/writes, transactional migrations, and table shielding. See in action: Story 1 — Instant Ops →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 27 | Dynamic serverless API routing | api/; req.params | Resolves scripts on-the-fly; passes trailing path tokens as parameters; zero server restarts. | Implemented |
| 28 | Complete request context | req.method, path, query, headers, json, user | Populates request context in C before QuickJS execution; includes caller capabilities and client IP. | Implemented |
| 29 | Response formatting helpers | res.status(), res.setHeader(), res.json(), res.send() | Sets HTTP status and headers; serializes JSON or raw strings through native output stream. | Implemented |
| 30 | Parameterized SQLite access | fossil.db.query(sql, params); fossil.db.execute() | Binds parameters to prevent SQL injection; returns JS objects or change/insert ID counts. | Implemented |
| 31 | Transactional DDL/DML & migrations | BEGIN IMMEDIATE, COMMIT / ROLLBACK | Discovers ordered migration scripts, checks hashes, executes transactionally, records in ledger. | Implemented |
| 32 | Native table authorizer & shielding | C SQLite authorizer callback | Intercepts all API queries; blocks direct access to protected Fossil repository tables. | Implemented |
| 33 | Native ingress rate limiting | C ingress rate limiter | Enforces request budget per client before QuickJS executes; drops abusive calls at ingress. | Implemented |
| 34 | Prewarmed script cache & WAL | Bytecode cache & SQLite WAL mode | Pre-compiles QuickJS bytecode for active branches; executes queries concurrently via WAL mode. | Implemented |
| 35 | Ahead-of-time bytecode compilation | fossil.compileJs(); build.compile | Compiles api/**/*.js to .qs bytecode at commit; runtime executes bytecode directly. | Implemented |
Identity and Security (Entries 36–38)
Native Fossil authentication, capability-based authorization, session status, and OpenSSL cryptographic primitives. See in action: Story 5 — Privacy & Speed →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 36 | Fossil Admin session management | GET/POST/DELETE /api/admin/session; fossil.auth.* | Validates credentials, manages HTTP-only session cookies, checks HTTPS policy, logs out. | Implemented |
| 37 | Capability-based authorization | req.user.{isAdmin, canWrite, canRead, ...} | Inspects caller permissions on every protected endpoint; enforces least-privilege access. | Implemented |
| 38 | Native OpenSSL cryptography | fossil.crypto.{bcrypt, sha256, p256, aes128Gcm} | OpenBSD Bcrypt hashing, random UUIDs, SHA256 digests, P-256 ECDH key exchange, and AES-GCM. | Implemented |
Integrations and Repository Storage (Entries 39–48)
curl-impersonate outbound HTTP, browser TLS profiles, concurrent fetchMany, unversioned storage (fossil.uv), VCS operations, and HTML-to-Markdown. See in action: Story 4 — Site Migration →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 39 | Native outbound HTTP fetch | fetch(url, opt) / fossil.http.fetch() | Executes outbound HTTP requests synchronously with headers, timeout, and response helpers. | Implemented |
| 40 | Concurrent batch fetch | fossil.http.fetchMany(requests, options) | Executes up to 64 concurrent requests via libcurl multi; returns array of responses in input order. | Implemented |
| 41 | Browser TLS impersonation | Option impersonate: 'chrome120' | 'firefox120' | Matches authentic browser TLS handshakes and HTTP/2 settings using embedded curl-impersonate. | Implemented |
| 42 | Unversioned key-value storage | fossil.uv.readText/Bytes/writeText/Bytes | Stores text and binary assets in repository unversioned storage without creating commit history. | Implemented |
| 43 | Unversioned catalog & hashing | fossil.uv.list(glob), hashBytes(), delete() | Enumerates unversioned entries, calculates SHA-256 digests, and deletes orphaned assets. | Implemented |
| 44 | Versioned VCS operations | fossil.vcs.{read, list, commit, sync} | Reads file blobs from any branch, lists trees, commits versioned files, and synchronizes remotes. | Implemented |
| 45 | Isolated branch workflows | fossil.repo.commitBranch(), diff(), resetDraft() | Creates isolated work branches, computes structured diffs, and resets drafts safely. | Implemented |
| 46 | Native Base64 conversion | fossil.base64.encode() / decode() | Encodes and decodes binary buffers to Base64 for transport and embedding. | Implemented |
| 47 | Native Markdown & path helpers | fossil.markdown(), fossil.ssg.publicUrl() | Converts Markdown and maps public URLs to internal repository artifact storage paths. | Implemented |
| 48 | Native HTML-to-Markdown converter | fossil.htmlToMarkdown(); SQL html_to_md() | Converts scraped HTML into clean CommonMark/GFM in pure C in both QuickJS and SQLite queries. | Implemented |
Notifications and Background Work (Entries 49–51)
Transactional email delivery, SQLite-backed outbox retry processing, and lease-coordinated backoffice workers. See in action: Story 1 — Instant Ops →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 49 | Transactional email delivery | fossil.email.send({to, subject, text, html}) | Sends transactional emails directly or queues to outbox; reports configured delivery status. | Implemented |
| 50 | Durable email outbox | SQLite outbox tables & retry queues | Stores outbound messages transactionally in SQLite; guarantees delivery across restarts. | Implemented |
| 51 | Lease-coordinated background work | fossil.backoffice.run(); lease locks | Coordinates background workers using SQLite leases; executes deferred tasks without overlapping. | Implemented |
Live Operations and WebSockets (Entries 52–58)
Native RFC 6455 WebSocket gateway, Linux/Windows transport, channel publish/subscribe policy, SQLite change detection, ws_broadcast, and event replay. See in action: Story 1 — Instant Ops →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 52 | Native RFC 6455 WebSocket gateway | Embedded HTTP-to-WS upgrade on /ws | Handles handshake, framing, heartbeat ping/pong, and subprotocols inside the C engine. | Implemented |
| 53 | Cross-platform socket transport | Linux epoll / Windows I/O transport | Provides reliable asynchronous socket transport across Linux and Windows with TLS proxy support. | Implemented |
| 54 | Channel authorization policies | app.json.websockets.channels | Enforces granular publish/subscribe policies per channel (public, authenticated, admin). | Implemented |
| 55 | Task & agent event integration | type: "chat_send"; task message events | Streams agent execution progress and chat messages in real time to connected clients. | Implemented |
| 56 | SQLite change data capture (CDC) | SQLite table triggers & commit hooks | Detects row mutations in application tables and automatically prepares live update events. | Implemented |
| 57 | Live event broadcasting | fossil.ws.broadcast(channel, event, payload) | Publishes events from QuickJS APIs or SQL triggers; returns integer event ID and delivers frames. | Implemented |
| 58 | Event replay via after_event cursor | Gateway param /ws?after_event= | Replays missed events from retained buffer on reconnect; prevents dropped messages during disconnects. | Implemented |
CRM, Orders, and Bookings (Entries 59–73)
Lead capture, pipeline stages, order intake, fulfillment lifecycle, reservation booking, seating management, and business schemas. See in action: Story 6 — Modular Business Apps →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 59 | Public CRM lead intake | POST /api/public/crm | Validates contact name, email, company, and captures incoming business leads into SQLite. | Implemented |
| 60 | Lead attribution & value capture | studio_crm_leads schema | Records lead source, estimated deal value, priority rating, and notes in dedicated table. | Implemented |
| 61 | Pipeline stage progression | Stages: lead, qualified, proposed, won, lost | Tracks business lead progression through defined lifecycle stages with audit timestamps. | Implemented |
| 62 | Staff lead management & pagination | GET/POST /api/admin/modules/crm | Provides paginated lead listings, search filtering, and stage advancement in Admin. | Implemented |
| 63 | CRM metrics & pipeline summaries | SELECT count(*), sum(value) FROM studio_crm_leads | Calculates total active leads and gross pipeline deal volume for executive dashboards. | Implemented |
| 64 | Public order intake | POST /api/public/orders | Validates customer details, auto-generates order numbers, and records order lines. | Implemented |
| 65 | Order itemization & channel capture | studio_orders schema | Stores customer contact, item summary, order total, and acquisition channel. | Implemented |
| 66 | Fulfillment lifecycle & tracking | Statuses: pending, confirmed, shipped, delivered | Updates order fulfillment state and records third-party carrier tracking codes. | Implemented |
| 67 | Staff order queue & operations | GET/POST /api/admin/modules/orders | Enables staff to view, filter, paginate, and advance order fulfillment states in Admin. | Implemented |
| 68 | Order volume & revenue metrics | SELECT count(*), sum(total) FROM studio_orders | Aggregates completed orders count and gross merchandise volume across fulfillment channels. | Implemented |
| 69 | Public booking & reservation intake | POST /api/public/bookings | Validates guest contact, requested date/time slot, and guest party size. | Implemented |
| 70 | Guest details & table assignment | studio_bookings schema | Stores guest dietary preferences, special requests, and assigned table identifier. | Implemented |
| 71 | Reservation lifecycle management | Statuses: requested, confirmed, seated, completed | Advances reservations from initial request to seated guests and completed dining. | Implemented |
| 72 | Staff seating & reservation desk | GET/POST /api/admin/modules/bookings | Lists upcoming reservations, manages table allocations, and handles cancellations. | Implemented |
| 73 | Cover counts & booking summaries | SELECT count(*), sum(party_size) FROM studio_bookings | Calculates total reservation counts and anticipated guest covers for service planning. | Implemented |
Admin Website Operations (Entries 74–83)
Admin application shell, draft page editor, published-vs-draft preview mode, media upload management, API editor, test runner, and changeset review. See in action: Story 2 — Safe Publishing →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 74 | Admin application shell | _layouts/admin.html; /admin mount | Provides authenticated control panel with responsive navigation, module drawers, and session guard. | Implemented |
| 75 | Website page editor & drafts | api/admin/pages.js | Enables visual and Markdown editing of site pages with draft saving and change isolation. | Implemented |
| 76 | Draft rendering & preview mode | assets/fossil-preview-mode.js | Renders live previews of proposed page drafts side-by-side with current published content. | Implemented |
| 77 | Media & asset manager | api/admin/assets.js | Handles image and asset uploads, organizes media files, and generates responsive URLs. | Implemented |
| 78 | Site metadata & navigation editor | api/admin/settings.js | Modifies global site configuration, menu items, header/footer text, and SEO defaults. | Implemented |
| 79 | API endpoint inventory & editor | api/admin/apis.js | Lists all live serverless API routes, displays execution metrics, and allows code inspection. | Implemented |
| 80 | Admin API test runner interface | tests/admin-*.test.json | Executes declarative test suites directly from Admin UI with pass/fail assertion output. | Implemented |
| 81 | Overview operations dashboard | Admin home view & module summaries | Summarizes site traffic, active leads, pending orders, and system health in unified dashboard. | Implemented |
| 82 | Changeset review & publish controls | fossil.publish.selectVersion() | Displays line-by-line diffs of proposed changes and publishes them atomically to the live site. | Implemented |
| 83 | Purposeful user-facing UI | Minimalist design system | Suppresses internal commit messages and developer chatter; presents clean, functional management views. | Implemented |
Agent Workbench (Entries 84–99)
Embedded Wuwe agent runtime, persona synchronization, declarative skills, custom QuickJS tools, ticket DAG scheduling, isolated branches, and guarded publication. See in action: Story 3 — Guarded AI Workflow →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 84 | Embedded Wuwe agent runtime | Native agent runtime engine in C | Hosts internal AI personas with isolated sandboxes, tool dispatching, and turn-based reasoning. | Implemented |
| 85 | Persona synchronization & models | .fossil/team.json; .fossil/agents/* | Loads agent definitions, role prompts, model bindings, and temperature settings from studio/harness. | Implemented |
| 86 | Declarative agent skills | .fossil/skills/*/SKILL.md | Supplies modular instructions and domain guidelines with checksum integrity validation. | Implemented |
| 87 | User-defined QuickJS agent tools | .fossil/tools/*.js | Defines executable custom tools in JavaScript that agents can invoke securely inside the sandbox. | Implemented |
| 88 | Per-agent tool allowlists | tools: [...] in agent persona manifest | Restricts available tools per persona (e.g. coder has repo tools, architect has ticket DAG tools). | Implemented |
| 89 | Native agent tool catalog | 39 native dispatch tools in C | Provides surgical tools: repo_outline, repo_grep, repo_patch, ticket_create, chat_send. | Implemented |
| 90 | Ticket-first branch isolation | Feature branches agent/tkt- | Agents commit exclusively to isolated ticket branches; direct trunk commits are strictly denied. | Implemented |
| 91 | Ticket dependency DAG scheduling | Ticket parent/child links & DAG engine | Coordinates complex epics by ordering subtasks according to dependency graph requirements. | Implemented |
| 92 | QA bounce circuit breaker | Bounce counter & threshold logic | Detects repeated QA rejections; halts automated rework and escalates to CTO after 3 failures. | Implemented |
| 93 | CTO triage and escalation | @agent-architect escalation route | Re-routes blocked or unassigned requests to CTO persona for structural architecture decisions. | Implemented |
| 94 | Parallel autonomous dispatch | Asynchronous worker queue | Dispatches multiple tickets in parallel across independent branches without resource collisions. | Implemented |
| 95 | Internal SSE status streaming | Server-sent events endpoint | Streams agent token generation, tool call execution, and step progress live to the browser. | Implemented |
| 96 | Chat team selection & context | @team and persona mentions in /chat | Preserves multi-turn conversation context; routes requests to specialized personas automatically. | Implemented |
| 97 | Guarded branch merge & publish | Admin approval gate | Enforces mandatory human supervisor approval before any agent branch can be merged to trunk. | Implemented |
| 98 | Provider credential configuration | Admin AI Team credentials pane | Configures API keys, base URLs, and model aliases securely in repository storage. | Implemented |
| 99 | Surgical repository patching | repo_patch with exact search/replace | Performs targeted multi-file code modifications without wiping or overwriting entire source files. | Implemented |
Quality and Developer Tools (Entries 100–104)
Declarative autotest runner, in-memory SQLite shadow clones, syntax validators, code formatters, and fossil agent CLI. See in action: Story 3 — Guarded AI Workflow →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 100 | Declarative autotest runner | fossil autotest tests/*.test.json | Executes multi-step test suites with fixture injection, session preservation, and response assertions. | Implemented |
| 101 | In-memory SQLite shadow clones | Zero-lock in-memory database cloning | Spawns isolated in-memory SQLite databases for test execution; runs without locking repository files. | Implemented |
| 102 | In-engine API test execution | fsl_test_run_suite() | Runs integration test suites hermetically from CLI or internal agent tools without network dependencies. | Implemented |
| 103 | JavaScript & HTML syntax validators | format_js, format_html | Validates code syntax and standardizes formatting before committing changes to branches. | Implemented |
| 104 | fossil agent CLI workflows | CLI command fossil agent | Controls agent dispatching, persona listing, skill verification, and test execution from terminal. | Implemented |
Module Catalog and Release Management (Entries 105–112)
module.json manifests, migration ledgers, runtime module discovery, Fossil bundle packing, atomic installation, non-destructive revocation, and rollback. See in action: Story 6 — Modular Business Apps →
| ID | Capability | Exact Method / Runtime Contract | Process & Operational Behavior | Status |
|---|---|---|---|---|
| 105 | Declarative module manifests | modules/ | Declares module identity, version, capabilities, public endpoints, Admin drawers, and table ownership. | Implemented |
| 106 | Module migration ledger | studio_module_migrations table | Records every applied migration ID with timestamp; ensures idempotent execution across releases. | Implemented |
| 107 | Runtime module discovery | GET /api/admin/modules | Discovers installed modules dynamically from branch artifacts; summarizes record counts. | Implemented |
| 108 | Per-client module licensing | Entitlement manifests | Enables selective module packaging and licensing tailored to individual client requirements. | Implemented |
| 109 | Native Fossil bundle packing | fossil.release.packBundle() | Packages module artifacts, migrations, and assets into hermetic binary bundles for atomic distribution. | Implemented |
| 110 | Integrity verification & atomic install | Per-file SHA-256 validation | Validates checksum of every incoming artifact before applying migrations; rolls back on failure. | Implemented |
| 111 | Non-destructive module revocation | Manifest unlinking with table retention | Disabling a module removes public routes (returning 404) while preserving 100% of stored SQLite data. | Implemented |
| 112 | Release history & cumulative rollback | studio_releases; rollback engine | Maintains audit trail of all installed releases; allows instant cumulative rollback to prior version. | Implemented |