# How do I run a standard in order from code?

Checked 2026-11-15 against GilbApp d5296208bbffa2ab70076e6194f5537c4be1ddf7.

Read the standard's units, check that orderSemantics is sequence and runnable is served, then run the units by ordinal.

## Before you start

The standard's id, the last part of its address, and its vault's host.

## Steps

1. Read the standard with its units.

   Fetch the standard and its units, with a token and [a new proof](http://support.gilb.com/help/how-do-i-make-a-dpop-proof-for-each-request) if its vault is not public:
   GET https://&lt;vault host\>/lws/procedure/&lt;id\>/proceduresteps?limit=200

   A unit is one point of a standard: a step, a rule, a question. Each other kind of standard has the same route, ending /lws/ruleset/&lt;id\>/rules, /lws/checklist/&lt;id\>/questions, /lws/policy/&lt;id\>/statements, /lws/template/&lt;id\>/specimens, /lws/lookup/&lt;id\>/entries or /lws/referencedocument/&lt;id\>/exhibits. A page holds 20 units unless you set limit, up to 200; complete false means there are more. Each unit comes back only if you may read it, and a standard you may not read answers 404.
2. Check that orderSemantics is "sequence".

   Walk the units as steps only when the answer's orderSemantics is "sequence". With "display-fidelity" the numbers say only where each unit is shown, not an order to do them in.

   A Procedure, the kind of standard that holds an agent, answers "sequence", with orderSemanticsTerm t:Sequence. Rule sets, checklists, policies, templates, lookups and references answer "display-fidelity", with t:Indicate. The steps of a Process come back without orderSemantics: a Process is run by moving one run of it on, as [the answer on how processes and decisions run on GilbPlatform](http://support.gilb.com/help/how-do-processes-and-decisions-run-on-gilbplatform) shows.
3. Check that runnable is served.

   Run the units only when runnable.served is true. When it is false, runnable holds no units, and runnable.unserved names each unit whose address does not resolve.

   An unresolved unit is one whose own address, GET /lws/r/&lt;id\>, does not answer with a body.
4. Run the units in order of ordinal.

   Sort runnable.units by ordinal and do each one's payload.value, the text of that step, in that order.

   payload.key names the field the text came from, such as a:procedureStep. id.value is the unit's own address; it can be read, but it is not kept when a standard is imported again. tag.value, when there is one, is the unit's tag, such as Agent.Coder.Role, the short name it is cited by. A step that hands off names another standard; [the answer on following a hand-off](http://support.gilb.com/help/how-do-i-follow-a-hand-off-to-another-standard) shows what to do.

## Deeper

Checked on production on 2026-11-11, with no token: the Procedure Agent.Coder at https://appbuilder.gilb.com/lws/procedure/06gf80g4e5xhzfm96gsrtbh8g4/proceduresteps answered orderSemantics "sequence", runnable.served true and 15 units in order, from Agent.Coder.Role to Agent.Coder.HumanActs; a rule set in the same vault answered "display-fidelity".

With an offset above 0, complete is never true, so read up to 200 units in one page; the reading of a longer standard is not covered here. GilbPlatform does not run the steps for you: your code or your agent does what each step says.

Source: GilbPlatform 498d29a0 \(live at https://id.gilb.com/version, read 2026-11-11\): src/lws/standard-family.ts:62-84 \(ORDER\_SEMANTICS sequence \| display-fidelity \| unitless; t:Sequence, t:Indicate; unitIdentity @id, "dereferenceable-not-reimport-stable"\), :101-113 \(the ordinal's meaning is orderSemantics; Procedure ordinal IS the sequence\), :160-224 \(RunnableUnit id, ordinal, payload, tag; served false: unserved leg unitIdentity "framed id does not resolve", precondition "GET /lws/r/&lt;id\> must return 200 with a body"\), :405-430 \(the document answer: orderSemantics, orderSemanticsTerm, executionPayloadKey, runnable, complete, pageSize\); src/lws/standard-family-page.ts:72 \(max 200\), :118 \(default 20\), :194 \(complete only at offset 0\); src/lws/procedures.ts:35, :40 \(sequence\); src/lws/rulesets.ts:62, :68, checklists.ts:62, :67, policies.ts:60, :65, templates.ts:90, :95, lookups.ts:29, :34, references.ts:34, :39 \(display-fidelity\); src/lws/process-steps.ts:67 \(process steps, another module\). Public reads, no token, 2026-11-11: https://appbuilder.gilb.com/lws/procedure/06gf80g4e5xhzfm96gsrtbh8g4/proceduresteps -\> 200, orderSemantics sequence, t:Sequence, executionPayloadKey a:procedureStep, runnable served, 15 units The example \(as plain JS\) ran: 15 units Agent.Coder.Role ... Agent.Coder.HumanActs in order; ruleset 06gjdq7m01y1sc3qrfevnpy5rc -\> "the order is display-fidelity, not a sequence". Repo team notes §10.3 not linked. Row: Developer.RunStandardInOrder.

## For developers

### TypeScript: steps-in-order.ts

```typescript
type Unit = {
  id: { carrier: "@id"; value: string };
  ordinal: number;
  payload: { key: string; value: unknown };
  tag?: { carrier: string; value: unknown };
};

// documentUrl: such as https://<vault host>/lws/procedure/<id>/proceduresteps
// headers: Authorization and a new DPoP proof, if the vault is not public.
export async function stepsInOrder(documentUrl: string, headers: Record<string, string> = {}): Promise<Unit[]> {
  const page = await (await fetch(`${documentUrl}?limit=200`, { headers })).json();
  if (page.orderSemantics !== "sequence") throw new Error(`the order is ${page.orderSemantics}, not a sequence`);
  if (!page.runnable?.served) throw new Error(`not served: ${JSON.stringify(page.runnable?.unserved)}`);
  if (!page.complete) throw new Error("more than 200 units: read the rest before you run any");
  return [...page.runnable.units].sort((a: Unit, b: Unit) => a.ordinal - b.ordinal);
}
```
