Which FACET Check Belongs in Each Delivery Stage
A single green check cannot prove an AI system is safe to run. FACET has several checks because each one answers a different engineering question. The mistake is not missing a command. The mistake is running the right command at the wrong boundary and treating its result as a stronger guarantee than it provides.
I use a simple rule: move cheap structural failures as far left as possible, preserve semantic evidence in review, and keep effects behind the last runtime boundary.
The four-stage pipeline
| Stage | FACET command or artifact | Question answered | What it does not prove |
|---|---|---|---|
| Local edit | facet-fct build |
Does the contract parse, resolve, type-check, and satisfy static policy rules? | That tests pass or execution is safe |
| Pull request | facet-fct test plus inspect artifacts |
Do deterministic fixtures, mocks, assertions, layout, and effective policy match the intended change? | That a model will answer correctly |
| Release | pinned compiler, example/conformance suite, artifact diff | Is this revision reproducible against the approved compiler and migration corpus? | That external services will remain available |
| Runtime | facet-fct run with explicit inputs and host effect controls |
Can this concrete request cross the execution boundary under current inputs and policy? | Deterministic model output or correct third-party APIs |
This is not a maturity ladder where the last command replaces the earlier ones. It is a chain. Every stage removes a different class of uncertainty.
1. Local edits: fail before review
The fastest useful check is:
facet-fct build --input contracts/review.facet
The compiler documents build as parse, resolve, and type checking. That makes it suitable for an editor task, pre-commit hook, or a fast changed-file job. It catches malformed syntax, unresolved composition, invalid types, and static semantic failures without requiring a provider call.
The important design choice is scope. A local check should run against the contract being edited and its imports, not against an unrelated production environment. Developers need a short feedback loop. If the first signal arrives only after a remote CI queue, the contract language becomes friction instead of protection.
But a successful build is only structural permission to continue. It is not evidence that an authorization matrix behaves correctly, that a Token Box layout contains the expected sections, or that an effect should execute.
2. Pull requests: review behavior, not only source text
A pull request should add deterministic behavior checks:
facet-fct test --input contracts/review.facet --exec
facet-fct inspect --input contracts/review.facet \
--ast out/ast.json \
--dag out/dag.json \
--layout out/layout.json \
--policy out/policy.json
FACET keeps contract-local tests, inputs, mocks, and assertions close to the specification. The inspect command exposes resolved structures that ordinary line review cannot reconstruct reliably: the AST, dependency DAG, final context layout, and effective policy.
This changes the unit of review. The reviewer is no longer asked to infer the compiled request from several imports and overrides. The pipeline can attach the exact artifacts produced by the revision.
I would make the source diff mandatory but insufficient. For changes touching policy, imports, context allocation, or computed values, the review should include the corresponding semantic artifact diff. A small source edit can produce a large effective-policy change; a large refactor can preserve the same canonical result. Text size is not semantic risk.
This extends the FACET contract gate pattern without turning every pull request into a live model evaluation. The deterministic boundary should be exhausted before probabilistic evaluation begins.
3. Releases: pin the interpreter of the contract
A FACET document does not execute itself. Compiler semantics are part of the contract identity. A release pipeline should therefore record at least:
- the exact
facet-fctversion or commit; - the contract revision;
- the example or migration corpus used;
- the resulting canonical and policy artifacts;
- every accepted semantic delta.
The compiler repository provides ordered specification examples and scripts for smoke and matrix runs. Those suites are more useful at release time than in the innermost edit loop: they test the selected compiler against a broader language surface.
The release question is not “does the new binary start?” It is “does this compiler revision interpret our approved contracts in the way we intend?” That is why a compiler upgrade should be reviewed as a semantic migration, not a routine dependency bump. I described the full comparison workflow in How to Upgrade the FACET Compiler Without Silent Contract Drift.
A pinned version is necessary, but pinning alone only preserves a known behavior. The corpus and artifact diff tell us whether that behavior is acceptable.
4. Runtime: authorize the concrete request
Only the runtime stage has the actual input values and current effect boundary:
facet-fct run \
--input contracts/review.facet \
--runtime-input request.json \
--exec \
--format pretty
This is where abstract permission becomes a decision about one request. Runtime input validation, effective policy, bounded context construction, and host-side effect controls meet here.
FACET’s documented scope matters: it provides deterministic contract compilation and execution boundaries, not deterministic model generation or correctness of external APIs. The host still owns strict response-schema validation, bounded retry and fallback behavior, idempotency, authorization for real side effects, and recovery when a provider or tool fails.
That separation prevents a dangerous category error. Passing contract tests does not authorize sending money, deleting data, or publishing content. It proves that the contract behaved as tested. The concrete effect still needs current authority.
For effectful systems, I would link the runtime decision to the execution record: contract revision, compiler identity, input digest, effective policy hash, and result status. That gives an incident review something stronger than “the agent decided.”
One check, one claim
The pipeline becomes trustworthy when every green result has a narrow sentence attached to it:
- Build passed: the contract is structurally and statically valid under this compiler.
- Tests passed: the declared deterministic cases behaved as asserted.
- Inspection matched: the resolved artifacts equal the reviewed intent.
- Release corpus passed: the pinned compiler preserved accepted semantics across the selected suite.
- Runtime allowed: this concrete request crossed the current contract and policy boundary.
None of those sentences says “the model is correct.” That claim requires separate evaluation and evidence.
FACET is strongest when it does not pretend to remove uncertainty. It partitions uncertainty so that syntax, composition, policy, context, model behavior, and external effects stop collapsing into one vague AI test. A delivery pipeline should preserve those partitions from the first edit to the last side effect.