$ fssg build --deterministic --validate |

How to Turn FACET Contracts into Reviewable Static Artifacts

FACET

A contract is not finished when it compiles. It is finished when another system can consume the compiled artifact without quietly inventing a second interpretation.

That is the boundary I find interesting in FSSG, the FACET Static Site Generator. FACET produces structured intent; FSSG turns canonical JSON into static output. The useful engineering lesson is larger than websites: publication should be a separate, reviewable transition from semantic compilation to deployed bytes.

This is an integration guide to that transition—not a performance benchmark and not a production-readiness claim.

The pipeline has two authorities

The FACET compiler answers semantic questions: what does the contract mean, which imports resolve, which values survive normalization, and which canonical representation identifies the result? The publisher should not answer those questions again. Its authority begins after canonicalization.

I model the boundary like this:

FACET source
    │ compile + validate
    ▼
canonical JSON       ← semantic authority
    │ render + package
    ▼
static artifact      ← publication authority
    │ compare + approve
    ▼
deployed revision

The split prevents a common failure: a renderer “helpfully” repairs missing meaning. Once that happens, the source contract and the public artifact no longer describe the same program. This is the publishing equivalent of a provider adapter that thinks.

Start with an isolated build

The current FSSG repository documents Python 3.9+, a fssg CLI, and three relevant commands:

python3 -m venv .venv
source .venv/bin/activate
pip install fssg

fssg validate -c config.json
fssg build -c config.json

For CI, I would add one rule that matters more than convenience: never build directly into the live document root. Use a run-specific staging directory, then inspect the result before promotion.

set -euo pipefail
RUN_ID="${GITHUB_RUN_ID:-local}-$(date -u +%Y%m%dT%H%M%SZ)"
STAGE=".artifacts/$RUN_ID/site"
mkdir -p "$STAGE"

fssg validate -c config.json
fssg build -c config.json

The exact output-directory setting depends on the project configuration. The invariant does not: validation completes before publication, and a failed build cannot erase the last known-good site.

Make the output reviewable

“Build succeeded” is too weak. A deploy decision needs an identity for the produced tree. A simple deterministic manifest is enough to start:

find "$STAGE" -type f -print0 \
  | LC_ALL=C sort -z \
  | xargs -0 sha256sum \
  > ".artifacts/$RUN_ID/sha256sums.txt"

sha256sum ".artifacts/$RUN_ID/sha256sums.txt" \
  > ".artifacts/$RUN_ID/artifact-id.txt"

This manifest gives the reviewer three useful operations:

  1. compare two builds file by file;
  2. bind approval to one exact artifact identity;
  3. verify the promoted directory after transfer.

The manifest is not a proof that the HTML is correct. It proves only that the reviewed and deployed bytes are the same bytes. Semantics remain the compiler's responsibility; accessibility, links, CSP, and browser behavior still need their own checks.

That distinction mirrors FACET's separation of request and execution artifacts: one identity should not be overloaded to mean source intent, rendered output, approval, and deployment state at once.

Promote by replacement, not mutation

A static deployment should look like a release switch, not a long sequence of writes into the live tree.

releases/
  20260828T133000Z/
  20260828T140000Z/
current -> releases/20260828T140000Z/

Upload the complete staged directory, verify its manifest, then atomically move the current pointer. Keep the previous release long enough to reverse the pointer if health checks fail.

This does not make every side effect reversible. It makes this particular publication boundary cheap to recover. That is a more precise claim—and a more useful one—than calling the entire pipeline deterministic.

The minimum CI contract

I would keep the gate small and explicit:

Gate Input Failure means
FACET validation source + imports + configuration semantic artifact is invalid
isolated FSSG build canonical JSON + renderer config publication artifact was not produced
manifest generation staged file tree artifact has no stable review identity
static checks staged HTML/assets artifact violates deploy policy
approval manifest ID + diff this exact revision was not accepted
atomic promotion verified release directory live pointer did not move safely
post-deploy probe public URLs promotion must be reversed or investigated

Notice what is absent: the model does not decide whether a failed gate is “probably fine.” A human or policy may grant an exception, but that decision should be explicit and bound to the artifact under review.

For a smaller implementation, the existing FACET CI gate explains the compile-and-diff side. FSSG adds a distinct next step: converting the accepted contract into a separately identified publication tree.

Where the guarantee stops

The FSSG repository describes canonical input, validation, static rendering, and reproducible output as design goals. I have not published an independent byte-for-byte reproduction benchmark here. Environment-dependent template functions, timestamps, dependency drift, filesystem ordering, or post-processing can still break reproducibility unless the project constrains them.

So the practical test is simple: build the same pinned inputs twice in clean environments and compare the manifests. If they differ, preserve both trees and make the first differing file a regression fixture. Do not hide the delta behind a new build ID.

That is the deeper role of the FACET–FSSG boundary. It turns publishing from “run a generator and hope” into a sequence of named artifacts with limited authority. The compiler owns meaning. The generator owns rendering. CI owns comparison. Deployment owns promotion.

No layer gets to silently rewrite the contract of the previous one.

Sources

FACET AI CLI Terminal
facet@ai:~$