In the planning meeting someone asks whether the old checkout can finally go. new_checkout_v2 went live in March, and the pull request said the legacy path would be removed by the end of that month. It is still in the code. Nobody knows whether any customer still gets the old flat shipping, and nobody wants to be the one who deletes it and finds out.
FACET keeps a short, checkable description of each feature, called a record, next to your code, and facet lint checks records and code against each other. By the end of this guide the flag has a written retirement date next to the feature it gates. facet lint warns once that date has passed, and it fails the run when someone deletes the flag from the code but leaves the record still saying the feature is gated.
The commands below use a small example shop written in TypeScript, set up as in “One answer instead of three”. In your own project, use the key of one flag that was supposed to be temporary.
Step 1Find every place the flag still decides something
List every line that names the flag:
git grep -n new_checkout_v2
git grep -n new_checkout_v2src/checkout/checkout.ts:26: if (!isEnabled("new_checkout_v2")) return SHIPPING_FEE;src/flags.ts:3: * SHOP_FLAGS="new_checkout_v2=off".src/flags.ts:7: new_checkout_v2: true,tests/checkout.test.ts:22: process.env.SHOP_FLAGS = "new_checkout_v2=off";
One line in the product decides something: with the flag off, every order pays 4.90 EUR shipping; with it on, orders from 50 EUR ship free. The flag is on by default, and SHOP_FLAGS=new_checkout_v2=off turns it off for one process. That is what the record needs to say.
Step 2Write the flag and its deadline into the feature's record
The flag gates part of placing an order, so it belongs to that feature's record. Create the folder:
mkdir -p docs/facets/features/checkout/orders
Save this as docs/facets/features/checkout/orders/place-order.yaml:
schema_version: "0.1"id: checkout/orders/place-orderlifecycle: activeintent: summary: A customer turns a cart into an order and pays shipping only below 50 EUR.contract: scenarios: - id: free-shipping-from-50-eur statement: | Given a cart worth 50 EUR or more after its discount When the customer places the order Then shipping is free - id: shipping-below-50-eur statement: | Given a cart worth less than 50 EUR after its discount When the customer places the order Then the order adds 4.90 EUR shipping - id: empty-cart-is-refused statement: | Given an empty cart When the customer places the order Then no order is createdflags: - key: new_checkout_v2 system: env default: true rollout: Everyone. SHOP_FLAGS=new_checkout_v2=off brings back flat shipping on every order. retire_by: "2026-03-31"verification: unit_tests: - id: tests/checkout.test.ts proves: [free-shipping-from-50-eur, shipping-below-50-eur, empty-cart-is-refused]lineage: owner: team: checkout created_at: "2026-11-22"
keyis the flag exactly as it is spelled in the code. FACET searches the source for it.systemnames where the flag lives:envhere, orlaunchdarkly,unleash,statsig,custom.rolloutsays in plain words who sees what today.retire_byis the date the flag should be gone, asYYYY-MM-DD. Use the date the team agreed back then, even if it has passed.
Connect the record to the code with two comment lines directly above placeOrder in src/checkout/checkout.ts:
// @facet: checkout/orders/place-order// @facet-role: primaryexport function placeOrder(cart: Cart, paidWith: PaymentMethod, now = new Date()): Order {
Step 3See the overdue flag in the check
npx facet lint


The check exits with status 0. An overdue flag is debt with a name and a date, not a broken build. From now on the warning shows up in every LintLint is FACET's check that records and code still point at each other: every record matches its schema, every anchor names an existing record, and every active record has an anchor. It runs locally and in CI on every pull request.In the glossary run, locally and in CI, until someone decides.
That leaves two decisions. If the flag has to stay, agree a new date, change retire_by to it and check ahead of time that the warning comes back on that day. With retire_by: "2026-12-31":
npx facet lint --today 2027-01-01
The warning names the new date, was due for retirement on 2026-12-31, and a plain npx facet lint stays quiet until then. The other decision is to remove the flag, as the next steps do.
Step 4Remove the flag and the legacy path
In src/checkout/checkout.ts, delete the import and the line that falls back to flat shipping:
import { isEnabled } from "../flags.js";if (!isEnabled("new_checkout_v2")) return SHIPPING_FEE;In src/flags.ts, delete the flag's entry with its comment, and drop the flag's name from the example in the file comment:
const defaults = {} as const;In tests/checkout.test.ts, delete the test charges shipping on every order in the legacy checkout. It only exists to check the path you just removed.
Check that nothing in the product names the flag any more, then run the tests:
git grep -n new_checkout_v2 -- src tests
npm test
git grep prints nothing and exits with status 1, because it found no match. The test run ends with Tests 18 passed (18).
Step 5Let the check catch the record that still mentions the flag
npx facet lint


The record still says the feature sits behind a flag, and the code says it does not. The command exits with status 1, so a pull request that removes a flag without telling the record fails.
Delete the whole flags: block from place-order.yaml. The ScenarioA scenario is one behaviour a feature promises, written in a record as Given/When/Then steps. Each scenario has an id that tests and other records can refer to.Read more here stay: free shipping from 50 EUR is now simply true for everyone. Run the check again:
npx facet lint


Step 6Commit the removal as one change
Commit the code, the test and the record together, so the history shows the flag and its description leaving at the same time:
git add docs/facets/features/checkout/orders/place-order.yaml src/checkout/checkout.ts src/flags.ts tests/checkout.test.tsgit commit -m "Remove new_checkout_v2: free shipping from 50 EUR for everyone"
Do the same for every other temporary flag: one flags: entry with a retire_by date in the record of the feature it gates. Each one then reminds the team on its own date.
Step 7If the check says something else
- No
was due for retirementwarning, although the date has passed: check thatretire_byis aYYYY-MM-DDdate. The check compares with today in UTC;--todaysets another date. - Still only the warning after you deleted the flag: the key still appears somewhere in the source, often in a comment, a test or the flag defaults.
git grep -n <key>finds it. Comments count, because the check searches text. flag key "…" appears nowhere in source, although the flag is still in use: the code spells the key differently from the record, or the file that uses it is excluded by.facetignoreor.gitignore. Copy the key from the code intokey:.flags/0: additional properties 'owner' not allowed, or another field name: a flag entry accepts onlykey,system,default,variants,rolloutandretire_by.
For more on keeping an old codebase understandable while it changes, read Nobody wants to touch the pricing logic. And everyone has to, eventually.