Facet
DeutschInstall
Team & product

List roadmap promises your data can't back yet, with FACET

Write a promise that waits for missing data into 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 it affects, with the reason and what will supply the data, list every such gap with one command, and get a reminder when the missing piece ships.

  • 8 min read
  • 6 steps
  • npm
  • Your coding agent

The product manager wants to write "30 days to return, counted from delivery" into the next newsletter. The roadmap says so. What nobody mentions: the shop does not store a delivery date, and the refund window counts from the day the order was placed. A developer noticed it months ago and wrote it into a pull request comment. Until someone finds that comment, the newsletter promises something the shop cannot do yet.

FACET keeps a short, checkable description of each feature, called a FACET recordA FACET record is a short, checkable description of one feature, kept as a YAML file next to the code. It states why the feature exists, the behaviour it promises as scenarios, and the tests that check it.In the glossary, next to your code; a record lists what the feature promises as scenarios. By the end of this guide that gap is written down at the exact scenario it affects: what is missing, why, and what will supply it. npx facet backing lists every such gap for product and support, and npx facet lint tells you when the missing piece ships, so the entry does not stay behind.

The commands below use the example shop from “One answer instead of three”. In your own project, take one screen, report or rule that waits for data that does not exist yet.

Step 1Find the data the promise depends on

The refund rule lives in src/orders/refund.ts:

ts
export const refundWindowDays = 30;export function requestRefund(order: Order, now = new Date()): { orderId: string; amountCents: number } {  const deadline = order.placedAt.getTime() + refundWindowDays * 24 * 60 * 60 * 1000;  if (now.getTime() > deadline) throw new ShopError("E3001");  return { orderId: order.id, amountCents: order.totalCents };}

The 30 days start at placedAt, the moment the order was placed. Look for anything in the code or the database that knows about a delivery:

sh
  • grep -rni deliver src db

It prints nothing. Neither the Order type in src/checkout/checkout.ts nor the orders table in db/migrations/0004_orders.sql has a delivery date. The code counts from the only date it has, so this is not a bug. It is a promise without data behind it.

Step 2Write the gap into the record of the feature

Describe refunds as a record, including the scenario the shop cannot keep yet. Create the folder:

sh
  • mkdir -p docs/facets/features/orders/refunds

Save this as docs/facets/features/orders/refunds/request-refund.yaml:

yaml
schema_version: "0.1"id: orders/refunds/request-refundlifecycle: activeintent:  summary: A customer asks for the money back on an order within the refund window and gets the order total refunded.contract:  scenarios:    - id: refund-within-window      statement: |        Given an order placed 29 days ago        When the customer requests a refund        Then the shop refunds the order total    - id: refund-after-window-is-refused      statement: |        Given an order placed 31 days ago        When the customer requests a refund        Then the shop refuses it with E3001    - id: window-starts-at-delivery      statement: |        Given an order placed on 1 October and delivered on 6 October        When the customer requests a refund on 3 November        Then the refund is accepted, because the 30 days count from delivery      backing:        state: unbacked        reason: |          The shop records no delivery date yet: neither the Order type nor the          orders table has one, and requestRefund counts the 30 days from          placedAt. Until it does, this refund is refused with E3001.        unblocked_by: carrier delivery events (SHOP-388)lineage:  owner:    team: orders  created_at: "2026-11-22"

The last scenario is the promise from the roadmap. The backing block says that it is not kept yet:

  • state: unbacked says the data this scenario needs does not exist yet. A scenario without backing counts as backed.
  • reason says what is missing and what the shop does in the meantime, in terms of the code.
  • unblocked_by says what will supply the data: a service, a store, a ticket or, as in step 5, the id of another record.

Connect the record to the code. In src/orders/refund.ts, add two lines directly above requestRefund:

ts
// @facet: orders/refunds/request-refund// @facet-role: primaryexport function requestRefund(order: Order, now = new Date()): { orderId: string; amountCents: number } {

Step 3List every promise that is waiting for data

sh
  • npx facet backing
Terminal output of npx facet backing: orders/refunds/request-refund, scenario window-starts-at-delivery, with why and unblocked by: carrier delivery events (SHOP-388); 1 unbacked scenario across 1 feature.Terminal output of npx facet backing: orders/refunds/request-refund, scenario window-starts-at-delivery, with why and unblocked by: carrier delivery events (SHOP-388); 1 unbacked scenario across 1 feature.
Each promise without data, with the reason and what will supply it.

That is the answer before the newsletter goes out: 30 days from delivery is not true yet, here is why, and SHOP-388 changes it. For a dashboard or a release checklist, add --json:

sh
  • npx facet backing --json

Step 4Check that the record passes

sh
  • npx facet lint
Terminal output of npx facet lint: a warning lists three refund scenarios with no verification proof, another lists two test files no record names, invoice.test.ts and refund.test.ts; 2 records and 2 anchors checked, 0 errors, 2 warnings.Terminal output of npx facet lint: a warning lists three refund scenarios with no verification proof, another lists two test files no record names, invoice.test.ts and refund.test.ts; 2 records and 2 anchors checked, 0 errors, 2 warnings.
A declared gap is not an error: 0 errors.

Declaring a gap never fails the check, so writing it down costs nothing. The first warning is about something else, and it is right: the record names no test, so none of the three scenarios is proven. tests/refund.test.ts, from the second warning, already checks the two that count from the order date. Once the record names it under verification, the first warning keeps only window-starts-at-delivery, the promise no test can check yet.

Commit the record and the AnchorAn anchor is a comment in the source code, starting with @facet:, that names the record the code belongs to. FACET reads these comments to know where each feature is implemented.In the glossary:

sh
  • git add docs/facets/features/orders src/orders/refund.ts
  • git commit -m "Describe refunds; delivery date for the refund window is not backed yet"

Step 5Point at the feature that will deliver the data

A ticket number is enough to find the work. If the missing data has its own feature, point at its record instead, and the check watches it for you. Write the planned feature. Create the folder:

sh
  • mkdir -p docs/facets/features/orders/shipping

Save this as docs/facets/features/orders/shipping/delivery-tracking.yaml:

yaml
schema_version: "0.1"id: orders/shipping/delivery-trackinglifecycle: plannedintent:  summary: The shop stores the delivery date the carrier reports for every order.contract:  scenarios:    - id: delivery-date-from-carrier      statement: |        Given an order handed to the carrier        When the carrier reports it as delivered        Then the order shows that date as its delivery date    - id: no-report-no-date      statement: |        Given an order the carrier has not reported as delivered        When anyone looks at the order        Then it has no delivery datelineage:  owner:    team: orders  created_at: "2026-11-22"

In request-refund.yaml, replace the unblocked_by line with unblocked_by: orders/shipping/delivery-tracking, keeping its indentation, and list the gaps again:

sh
  • npx facet backing
Terminal output of npx facet backing: the same scenario, now unblocked by: orders/shipping/delivery-tracking.Terminal output of npx facet backing: the same scenario, now unblocked by: orders/shipping/delivery-tracking.
The gap now names the feature that closes it.

When delivery tracking ships and its record becomes active, npx facet lint warns: scenario "window-starts-at-delivery" is unbacked pending "orders/shipping/delivery-tracking", which is now active. Then check that the refund code really uses the new delivery date, delete the backing block, and the promise is a plain scenario again.

Step 6If the check says something else

  • backing: missing property 'unblocked_by' (or 'reason'): an unbacked scenario needs both. Name what would supply the data, even if it is only a ticket.
  • backing/state: value must be 'backed': the same scenario also has a deviation block. A scenario is either a known bug or a promise waiting for data, not both. Decide which one it is and remove the other block.
  • value is not allowed in this context, with a line number: the YAML around that line is indented wrongly, usually the backing: line. Indent it exactly like statement: above it.
  • contract scenario(s) with no verification proof: a coverage warning, as in step 4. It never fails a build.

For more on keeping product promises and code in step, read “It’s done.” Does it do what we wanted?

Sources