Skip to main content

GSpec and implementation spec

tmspec splits the spec into two levels. Understanding the difference between them is understanding most of the product.

GSpec: what the team has agreed​

The GSpec (grand spec) has three kinds:

KindAnswers the questionExample
RequirementWhat the product must do"Retrying a refund with the same key never pays twice"
DecisionWhat we chose and why"Use a queue instead of a synchronous call, because..."
ConstraintWhich limit must not be crossed and why"Customer data does not leave this region"

Each GSpec has a code such as PAY-R-12 (project PAY, kind R, number 12), a title, a body and, for a requirement, acceptance criteria (AC-1, AC-2...). The code never changes and is never reused, even when the spec moves to another Area.

A GSpec changes only through a change request. Each approval creates a new version; old versions stay readable and are never edited. A spec can be retired (taken out of the spec); retiring also goes through a change request, and a retired item cannot be reopened.

Implementation spec: how one part is built​

An implementation spec (code such as PAY-WS-14) describes in detail how one part of the product is built: flows, states, error codes, limits. It is not the place for new rules. Each implementation spec elaborates exactly one GSpec, chosen when it is created and unchanged afterwards.

An implementation spec does not go through a change request. The author works on a draft, edits freely, and every edit is kept in the history (who, when). A draft is not yet the spec.

Ready: the confirmation milestone​

An implementation spec becomes the spec only when a person clicks Ready. Ready freezes the draft into a milestone that can be read at its own address (for example PAY-WS-14@ready-1) and records who clicked, when, and which version of the GSpec it relies on. Things to remember:

  • Only the latest Ready is the spec. Anyone building from an implementation spec relies on the Ready milestone, not the draft. Edits to the draft after a milestone tell nobody until the next milestone.
  • When the GSpec changes, there is a flag. If the GSpec an implementation spec relies on changes after the Ready milestone, the implementation spec shows a "GSpec changed" flag until someone reviews it and clicks Ready again.
  • Found the GSpec wrong or missing while writing? Do not fix that in the implementation spec. Propose the fix to the GSpec with a change request; the implementation spec only describes how to build.

Clicking Ready is a judgement, so the credential needs the scope decide:wspec (an API key created with the default choices does not have this scope). The person who clicks is a reviewer or admin of the project, or the owner of that implementation spec if they are a contributor or above; retiring an implementation spec follows the same rule. See Roles and permissions.

In the CLI​

tmspec ws list # implementation specs, drafts included
tmspec ws new --area "Engineering / CLI" --elaborates r12 --file draft.yaml # create a draft (title and body in the file)
tmspec ws edit ws14 # edit the draft
tmspec ws ready ws14 # close a Ready milestone
tmspec ws history ws14 # the edits of the draft
tmspec log ws14 --ready # the Ready milestones
tmspec view ws14@ready1 # read the frozen content of milestone 1

ws ready and ws retire cannot be taken back, so the CLI asks for confirmation first.