Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

This page was generated based on a 100% coding agent's review. No human change was involved.

Squillify C4 architecture

Back to the notice

1. Scope

This page describes Squillify with the C4 model:

  1. System context: the people and outside services around Squillify.
  2. Containers: the applications and data services that run separately.
  3. Components: the main parts inside the web service and the projection worker.
  4. Code hotspots: the rules that protect security, billing, and availability.
LabelMeaning
IncludedPart of the running platform.
Separate switchBuilt, and turned on only for that capability.
OptionalUsed when that option is configured.
ExternalOperated outside the main Squillify service.

The stores in the diagrams are separate jobs. They may sit with the same provider, but their access, retention, and integrity rules stay different.

2. Summary

Squillify is a multi-tenant platform. It offers deterministic, metered MicroSkills to AI agents over REST and the Model Context Protocol, and it gives people a tenant workspace and a separate operator workspace.

A successful billable response does not get ahead of the PostgreSQL billing record. Streams, caches, and archives can make the platform faster or more durable. They do not replace that record.

3. System context

Who or whatRelationship
AI agentsDiscover contracts and run MicroSkills with a Squillify API key.
Tenant usersManage keys, capabilities, usage, files, and the subscription.
Platform operatorsRun tenants, plans, trust, telemetry, commerce, and support.
ClerkIdentifies people. Tenant access and operator access stay separate.
StripeTakes payments and subscriptions. Incoming notices are signature-checked before they are stored and processed.
HostingRuns the web service, the projection worker, both websites, and optional workers.
PostgreSQLHolds the authoritative records and durable work queues.
Redis-compatible storeHandles admission, caches, and the fast quota path.
KafkaMoves telemetry and feeds an independent archive.
Object storageHolds temporary files, telemetry archives, support attachments, and invoice documents as separate jobs.
Heavy workersRun bounded document and media operations outside the web service.
Operations stackCollects metrics, shows health, and alerts operators.
Email providerSends support mail and, when configured, product messages. It is never the record of payment, access, or tickets.
Formula and diagram renderersRender those formats over HTTP. They are not a fallback for the heavy workers.
Who talks to Squillify

Who talks to Squillify at 100 percent.

Loading diagram.

AI agents, tenant users, and platform operators use Squillify. Squillify uses identity, payments, heavy workers, managed data services, operations metrics, support email, and optional formula and diagram rendering.

4. Containers

PartRole
Public and tenant websiteCatalog, pricing, and the tenant workspace.
Operator websiteSeparate site for internal operations.
Web runtimeAPIs, skill execution, control planes, files, billing intake, and telemetry intake.
Projection workerTurns stored usage deliveries into reporting models. It does not serve customer APIs.
Heavy workersDocument and media engines outside the web runtime.
Formula and diagram renderersExternal renderers with no local substitute.
PostgreSQLSystem of record for tenants, billing, files metadata, and reporting models.
Redis-compatible storeLimits, leases, caches, and the fast quota path.
KafkaTelemetry transport and the source for the telemetry archive.
Temporary file storeTenant file bytes. The database owns who the file belongs to.
Telemetry archiveCompressed telemetry objects, indexed in the database.
Financial document archiveCreate-only invoice and credit-note files, switched on separately.
Operations stackHealth and metrics. Push-based export is optional and off unless configured.
How the services are separated

How the services are separated at 100 percent.

Loading diagram.

Agents and the two websites reach the web runtime. The web runtime uses identity, payments, Redis, PostgreSQL, Kafka, three object stores, and heavy workers. A separate projection worker reads durable deliveries from PostgreSQL and writes reporting models back. Operations metrics are collected from both runtimes.

The two process roles are separate deployments, even though they share one program:

5. Inside the web runtime

The web runtime is easier to read as several contracts than as one diagram.

Who is allowed in

Each kind of caller uses its own door. A person's login is not an API key. An API key is not an operator login. A payment notice is accepted without a login, and it is still signature-checked.

DoorWho it admits
SupportTenant and operator ticket routes. Public ticket creation stays closed.
MetricsOperations collection, with its own token.
WebhooksIdentity, payment, and email notices. Each one is signature-checked.
OperatorsOperator login, limited to the operator organization.
PublicCatalog, pricing, health, and public downloads that carry their own signed token.
Tenant workspaceTenant login, resolved to that tenant.
FilesAPI key for file routes. A login token is refused there.
Skill runtimeAPI key for execution and the agent protocol.
Separate doors for each kind of caller

Separate doors for each kind of caller at 100 percent.

Loading diagram.

An incoming request is routed to the public site, a person login, a signed webhook, the file API, the skill runtime, or the closed public support door.

Running a skill

Agents get three stable operations: search, read a contract, and execute. The catalog can grow without turning every skill into a separate tool. Search, contract, and execution use the same access decision, including skills inherited from a Capability Set.

What happens when an agent runs a skill

What happens when an agent runs a skill at 100 percent.

Loading diagram.

The agent is authenticated, admitted under rate and concurrency limits, then checked for access and quota. The skill runs locally or through a heavy worker. Usage is written to PostgreSQL before success is returned.

For a billable call the order is fixed: reserve quota, run the skill, save the usage record, settle the quota, then report success. If the usage record cannot be confirmed, the reservation is released and the caller is asked to retry.

Limits

Plan limits live in PostgreSQL. The fast path can answer from the Redis-compatible store when that path is healthy. If it is not, the database path remains. Pressure on the service can also shed load without treating that as a billing event.

Usage and reporting

Billing record and later reporting

Billing record and later reporting at 100 percent.

Loading diagram.

The invocation writes the billing record to PostgreSQL. A separate telemetry stream is accepted and queued, then a projection worker builds reporting models.

The usage ledger is the billing record. Reporting models are built afterward. They do not replace the ledger.

Telemetry archive

Telemetry archive

Telemetry archive at 100 percent.

Loading diagram.

Telemetry is batched, privacy-mapped, and stored as compressed objects. PostgreSQL keeps the index. Replay and erasure update that index rather than treating the object store as the only record.

A record that cannot be archived is kept as a failure and then acknowledged. If the object or its index cannot be saved, the batch is retried. The object store alone is not the index.

Invoices

Invoices and their files

Invoices and their files at 100 percent.

Loading diagram.

Commercial changes and signed payment notices update PostgreSQL. An invoice is issued there with an archive task. A later worker writes a create-only document file and stores a verified receipt. The file step does not undo the invoice.

Invoice files are not taken from the telemetry stream. They follow the invoice record. If the file store is unavailable, the invoice remains issued and the file is retried. A conflicting file is quarantined rather than overwritten. This archive is switched on only with its own document store.

Files

Temporary files

Temporary files at 100 percent.

Loading diagram.

An upload records ownership in PostgreSQL and bytes in object storage. Downloads use a signed token. Cleanup repairs records that no longer match stored bytes.

Temporary files, telemetry archives, and invoice documents do not share one retention rule. They stay separate jobs even when an environment places more than one of them with the same storage provider.

Heavy workers

Parsers, codecs, and office engines that need a lot of memory or native code do not run inside the web service. Each family is its own service, with its own workspace, and it is reached only through Squillify. The platform decides which published build is allowed to run. The worker does not share the API process disk, and it cannot see another tenant's files except the bytes Squillify sends for that one job.

The families, taken from the skills catalog, are:

WorkerEngineWhat it does
Document analysisPDF and office parsersInspect a PDF, check its structure, extract layout, images, and form fields, fill a form, split or merge pages, render pages, and create a workbook.
PDF tablesA dedicated table engineExtract ruled and borderless tables from a PDF. This stays separate from general PDF analysis.
HTML to PDFA pinned headless browserTurn HTML or Markdown into a PDF. Each call gets a fresh browser context. Remote pages, local file addresses, and unsandboxed browsing are refused.
Office renderingA pinned office suiteConvert a DOCX document to PDF in a fresh process and user profile.
Office parsingAn isolated office parserInspect and extract content from office documents without rendering them.
Image rastersA bounded image libraryInspect a raster image, preflight it, resize, crop, rotate, flip, convert format, strip metadata, and compare pixels. It does not decode PDF, SVG, raw camera files, or the other formats outside its allowlist.
OCRA dedicated text-recognition engineRead text from an image or scanned page. It does not share the image-raster worker, its credentials, or its capacity.

Formula rendering and diagram rendering sit beside this list, not inside it. They are lighter HTTP renderers. If one of them is down, that render fails rather than being invented locally.

A heavy-worker call

A heavy-worker call at 100 percent.

Loading diagram.

The web runtime checks the worker identity and approved build, sends a bound request, and receives the result only through Squillify file handling. There is no path that runs the same engine inside the web service.

Every worker of this kind follows the same shape:

The platform keeps a declaration for each worker. A call is refused unless every identity field matches:

Declared factWhat it fixes
Worker identityWhich service this declaration belongs to.
AddressWhere that service is reached.
Network identityThe exact authenticated name the connection must present.
Image and manifestThe approved build and the signed description of that build.
Allowed operationsWhich jobs this worker may perform.
Engine inventoryWhich engines and versions that build contains.
Time and size limitsHow long a job may run and how large its input and output may be.
CapacityHow many jobs may run or wait at once.
Tenant activationWhich tenants are allowed to use this worker.

If any of those fields do not match, the worker is unavailable. Squillify does not quietly run the same job inside the web service instead.

While a job runs, the platform records how many jobs are active, how deep the queue is, how often work is rejected or times out, how long it takes, whether the circuit is open, restarts, workspace size, output size, and failed identity checks. Alerts cover a worker that stays saturated, restarts in a loop, presents the wrong identity, times out too often, fails to clean up, or loses readiness.

Logs name the worker, the request, a tenant pseudonym, the operation, the status, the duration, and the byte counts. They do not include the file contents, file names, paths, credentials, the raw tenant identifier, or the worker's own error body.

A new build is activated only after its identity and readiness have been checked, and first for a limited set of tenants. Widening that set is a separate step. Rolling back restores the previous approved build and its signed description. The engine inventory is recorded for every build that is promoted.

Errors and operations

Every response can carry a request id. Public errors name the problem and whether a retry makes sense. They do not include stack traces, queries, file paths, secrets, or another tenant's data. Health information is public. Detailed metrics require the operations token.

6. Projection worker

Projection worker

Projection worker at 100 percent.

Loading diagram.

A scheduler reads durable deliveries from PostgreSQL, projects them into reporting models, and exposes only health and protected metrics.

This process does not include the web runtime's APIs, login, skill execution, or telemetry intake. That keeps reporting work from opening those doors.

7. Rules that must hold

AreaRule
BillingNo billed success before the usage record is durable. A reservation is settled or released once.
QuotaThe database and the fast path agree, and the database can correct the fast path.
API keysSecrets stay hashed. Revocation is honored. One tenant cannot use another's key.
Skill accessSearch, the contract, and execution show the same permissions.
Runaway useAbuse locks are enforced from the database. A blocked call is not billed.
Telemetry intakeDuplicates are safe. Poison records are recorded. The projection worker owns its backlog.
Telemetry archiveA batch is finished only when the object and its index are saved.
InvoicesThe invoice and its archive task commit together. Files are create-only and verified.
Heavy workersNo call without attested identity. No local fallback.
FilesOwnership, token scope, retention, and size limits are enforced.
DoorsLogin, API keys, webhooks, files, metrics, and support do not share one authorization rule.

8. Decisions

DecisionWhat it means
One policy for REST and the agent protocolBoth paths share access, limits, execution, metering, and errors.
PostgreSQL is the commercial recordPlans, entitlements, invoices, and billable usage live there. Streams and reports are copies.
Uncertain billing fails closedThe caller does not get a billed success when the ledger write is uncertain.
Two process rolesThe web runtime and the projection worker share a build, not a running application.
Three object-storage jobsTemporary files, telemetry, and invoices keep different access and retention rules.
Two archive pathsTelemetry is archived from the stream. Invoices are archived from the database task.
Invoice files are written after the recordA file-store problem does not undo the invoice. Conflicts are quarantined.
Heavy engines stay outsideLarge or native work runs in isolated services.
The fast path is explicitThe Redis-compatible store is used for speed only with a fallback and a way to reconcile.
Present is not the same as switched onCode can exist while a surface stays off until it is deliberately enabled.

9. Where each kind of data lives

DataRecord of truthCopies
People and organizationsIdentity provider, with a link stored by SquillifyThe signed-in session
API keysPostgreSQLShort-lived caches that can be invalidated
Skill descriptionsThe published skill catalogPublic pages and search indexes
Which skills a key may runPostgreSQLThe access decision used at runtime
Plans, subscriptions, and adjustmentsPostgreSQL, with the payments provider for provider-managed objectsWorkspace views
QuotaPostgreSQLFast-path counters and reconciliation evidence
Billable usagePostgreSQL usage ledgerTelemetry and reporting models
Telemetry streamKafka, for its retention windowAcceptance state and archive objects
Telemetry archive indexPostgreSQLCompressed archive objects
Temporary filesObject storage for bytes, PostgreSQL for ownershipSigned download tokens
Invoices and credit notesPostgreSQLA signed document plus a verified receipt
Provider paymentsPayments providerStored references and applied local effects
Support ticketsPostgreSQLSearch projections and email delivery
Operations metricsRuntime metersThe operations stack and operator views