Skip to content

Commit 6a54be1

Browse files
committed
changing format back
1 parent 08b1576 commit 6a54be1

8 files changed

Lines changed: 103 additions & 87 deletions

File tree

instruqt/01-run-monolith/assignment.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ timelimit: 600
4848
enhanced_loading: null
4949
---
5050

51+
# Chapter 1: Run the Monolith
52+
5153
Before you decouple anything, run the application as it ships today and
5254
feel where the seams are. This chapter is observation only. There is no
5355
code to edit.
5456

55-
# Why this chapter exists
57+
## Why this chapter exists
5658

5759
Every distributed-systems story has a "before" picture, and this is ours.
5860

@@ -96,7 +98,7 @@ half independently. The bridge between the two will be a Temporal
9698

9799
But first, the monolith.
98100

99-
# What you will do
101+
## What you will do
100102

101103
- Start the Payments Worker as it exists today (compliance and all).
102104
- Run three transactions through it: a low-risk approval, a medium-risk
@@ -105,7 +107,7 @@ But first, the monolith.
105107
ordinary `ActivityTaskScheduled` event in the Payments workflow's
106108
history. There is no boundary to be seen.
107109

108-
# Step 1: Start the Payments Worker
110+
## Step 1: Start the Payments Worker
109111

110112
Click the [button label="Worker" background="#444CE7"](tab-1) terminal.
111113
Start the Worker:
@@ -137,7 +139,7 @@ Two things to notice in that banner:
137139

138140
Leave the Worker running. The next step uses a different terminal.
139141

140-
# Step 2: Run three transactions
142+
## Step 2: Run three transactions
141143

142144
Click the [button label="Starter" background="#444CE7"](tab-2)
143145
terminal. Run the starter:
@@ -188,7 +190,7 @@ blocks should look something like this:
188190
> function returned cleanly. This distinction matters again in
189191
> Chapter 7 when we look at real failures.
190192
191-
# Step 3: Inspect the Web UI
193+
## Step 3: Inspect the Web UI
192194

193195
Click the [button label="Temporal UI" background="#444CE7"](tab-3) tab.
194196
Make sure the namespace selector at the top is set to `default`.
@@ -219,7 +221,7 @@ replace the Activity call with a **Nexus Operation** call: a typed
219221
remote-invocation primitive that runs in a different namespace, with a
220222
different worker, owned by a different team.
221223

222-
# Step 4: Stop the Worker
224+
## Step 4: Stop the Worker
223225

224226
Back in the [button label="Worker" background="#444CE7"](tab-1)
225227
terminal, stop the Worker with `Ctrl+C` so it does not pollute the next
@@ -235,7 +237,7 @@ You can also stop it from the Starter terminal with:
235237
pkill -f "payments.worker" || true
236238
```
237239

238-
# Wrapping up
240+
## Wrapping up
239241

240242
In this chapter you ran the application as it exists before any Nexus
241243
work. Three transactions executed end-to-end through a single Worker

instruqt/02-service-contract/assignment.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ timelimit: 1200
4444
enhanced_loading: null
4545
---
4646

47+
# Chapter 2: Define the Nexus Service Contract
48+
4749
In this chapter you define the shared Nexus Service contract between the
4850
Payments and Compliance teams, and stand up the routing infrastructure
4951
that will carry calls across the team boundary: a Nexus Endpoint that
5052
points callers at the Compliance team's task queue.
5153

52-
# Why this chapter exists
54+
## Why this chapter exists
5355

5456
Nexus exists so that two teams can call each other's Temporal code
5557
without sharing a codebase or a namespace. The mechanism that makes that
@@ -85,7 +87,7 @@ reads first when they want to call your Service.
8587
> what makes the contract a third artifact rather than something
8688
> either team can change unilaterally.
8789
88-
# What you will do
90+
## What you will do
8991

9092
- Apply **TODO 1** to add `@nexusrpc.service` and the typed Operation
9193
declarations to `shared/service.py`.
@@ -94,7 +96,7 @@ reads first when they want to call your Service.
9496
CLI, attaching a Markdown description from `compliance-endpoint.md`.
9597
- Find the Endpoint in the Web UI and read its Markdown description.
9698

97-
# Step 1: Apply TODO 1 in `shared/service.py`
99+
## Step 1: Apply TODO 1 in `shared/service.py`
98100

99101
Open `shared/service.py` in the
100102
[button label="Code Editor" background="#444CE7"](tab-0). The file
@@ -146,7 +148,7 @@ stub until Chapter 6 turns it into a real Update sender.
146148
> lines must use the `nexusrpc.Operation[Input, Output]` annotation
147149
> form (no `=`, no body).
148150
149-
# Step 2: Verify the namespaces
151+
## Step 2: Verify the namespaces
150152

151153
The Payments and Compliance teams will live in separate namespaces from
152154
Chapter 3 onwards. Each namespace is its own isolated execution
@@ -163,7 +165,7 @@ temporal operator namespace list
163165
You should see `payments-namespace` and `compliance-namespace`
164166
alongside `default` and `temporal-system`.
165167

166-
# Step 3: Create the Nexus Endpoint
168+
## Step 3: Create the Nexus Endpoint
167169

168170
A Nexus Endpoint is a routing rule. It tells the server: when a caller
169171
invokes the Endpoint named `compliance-endpoint`, deliver the request
@@ -198,7 +200,7 @@ temporal operator nexus endpoint get --name compliance-endpoint
198200
The `get` output should include the Markdown description from
199201
`compliance-endpoint.md` under the `Description` field.
200202

201-
# Step 4: Find the Endpoint in the Web UI
203+
## Step 4: Find the Endpoint in the Web UI
202204

203205
Click the [button label="Temporal UI" background="#444CE7"](tab-2)
204206
tab. In the left navigation, click **Nexus Endpoints** (or browse to
@@ -213,7 +215,7 @@ exposes before writing a caller workflow against it.**
213215
The Endpoint exists at the cluster level. It is not scoped to any one
214216
namespace. That is what lets it bridge teams.
215217

216-
# Wrapping up
218+
## Wrapping up
217219

218220
You wrote the contract that the Payments and Compliance teams will
219221
share, and you registered the routing rule that the dev server will use

instruqt/03-sync-handler/assignment.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ timelimit: 1800
5656
enhanced_loading: null
5757
---
5858

59+
# Chapter 3: Implement the Sync Handler
60+
5961
Now you write the Compliance side. By the end of the chapter the
6062
Compliance Worker will be running in `compliance-namespace`, polling
6163
the `compliance-risk` task queue, with a registered handler for the
6264
`check_compliance` Nexus Operation. Payments is unchanged; it still
6365
calls a local Activity.
6466

65-
# Why this chapter exists
67+
## Why this chapter exists
6668

6769
A Nexus Operation has two sides: the **caller** (the workflow that
6870
invokes the Operation) and the **handler** (the code that fulfills it).
@@ -90,7 +92,7 @@ The decorator stack that turns a class into a Nexus handler is small:
9092
That is the whole API. The handler is just an async method that takes
9193
the typed input and returns the typed output.
9294

93-
# What you will do
95+
## What you will do
9496

9597
- Apply **TODO 2** to decorate `ComplianceNexusServiceHandler` and
9698
implement the `check_compliance` and `submit_review` methods.
@@ -104,7 +106,7 @@ because Chapter 4 has not happened yet. The Compliance Worker is up
104106
but nothing is calling it. That is expected. We are validating the
105107
plumbing, not the data flow.
106108

107-
# Step 1: Apply TODO 2 in `compliance/service_handler.py`
109+
## Step 1: Apply TODO 2 in `compliance/service_handler.py`
108110

109111
Open `compliance/service_handler.py` in the
110112
[button label="Code Editor" background="#444CE7"](tab-0). The file
@@ -154,7 +156,7 @@ contract. If you mistype the input or output, Python's type checker
154156
will not catch it at file-load time, but the Nexus runtime will reject
155157
the registration when the Worker starts.
156158

157-
# Step 2: Apply TODO 3 in `compliance/worker.py`
159+
## Step 2: Apply TODO 3 in `compliance/worker.py`
158160

159161
Open `compliance/worker.py`. Find the TODO 3 comment in the `Worker(...)`
160162
constructor call. Add the `nexus_service_handlers` argument:
@@ -171,7 +173,7 @@ The Worker polls the `compliance-risk` task queue (set above by the
171173
`TASK_QUEUE` constant). That name **must** match the
172174
`--target-task-queue` you gave when creating the Endpoint in Chapter 2.
173175

174-
# Step 3: Start the Compliance Worker
176+
## Step 3: Start the Compliance Worker
175177

176178
Click the
177179
[button label="Compliance Worker" background="#444CE7"](tab-1)
@@ -198,7 +200,7 @@ Two things to notice:
198200

199201
Leave the Worker running.
200202

201-
# Step 4: Start the Payments Worker
203+
## Step 4: Start the Payments Worker
202204

203205
Click the
204206
[button label="Payments Worker" background="#444CE7"](tab-2) terminal.
@@ -212,7 +214,7 @@ This is still the **monolith** version of the Payments Worker. It runs
212214
in `payments-namespace`, polls `payments-processing`, and uses its
213215
local `check_compliance` Activity. We swap that out in Chapter 4.
214216

215-
# Step 5: Run the starter
217+
## Step 5: Run the starter
216218

217219
Click the [button label="Starter" background="#444CE7"](tab-3)
218220
terminal. Run the starter:
@@ -230,7 +232,7 @@ routed through Nexus yet.**
230232
That is the expected end-state for Chapter 3. The Compliance Worker is
231233
a Nexus participant, but no caller has been wired to it.
232234

233-
# Step 6: Confirm both Workers are healthy
235+
## Step 6: Confirm both Workers are healthy
234236

235237
In the Web UI, click **Workers** in the left navigation. Switch
236238
namespaces with the selector at the top.
@@ -242,7 +244,7 @@ namespaces with the selector at the top.
242244

243245
Both Workers are alive. Chapter 4 connects them.
244246

245-
# Step 7: Stop both Workers
247+
## Step 7: Stop both Workers
246248

247249
Press `Ctrl+C` in both Worker terminals (or use the cleanup at the
248250
end of the challenge). You can also stop them from the Starter
@@ -253,7 +255,7 @@ pkill -f "compliance.worker" || true
253255
pkill -f "payments.worker" || true
254256
```
255257

256-
# Wrapping up
258+
## Wrapping up
257259

258260
You wrote the synchronous handler that fulfills the `check_compliance`
259261
contract, and you stood up a brand new Compliance Worker to serve it.

instruqt/04-caller-swap/assignment.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ timelimit: 1500
5656
enhanced_loading: null
5757
---
5858

59+
# Chapter 4: Swap the Caller to Nexus
60+
5961
This is the moment the application stops being a monolith. The
6062
Payments Workflow stops calling a local Activity for compliance and
6163
starts calling the Compliance team's Nexus Operation instead. Once
6264
that swap lands, no Compliance code runs in the Payments Worker.
6365

64-
# Why this chapter exists
66+
## Why this chapter exists
6567

6668
Chapter 3 stood up the Compliance handler. Chapter 2 created the
6769
Endpoint. Both halves of the routing infrastructure exist. What is
@@ -94,7 +96,7 @@ Payments Worker's Activities list. The Payments Worker no longer
9496
needs that import; it lives entirely on the caller side of the Nexus
9597
boundary.
9698

97-
# What you will do
99+
## What you will do
98100

99101
- Apply **TODO 4** to swap the activity call for a Nexus call in
100102
`payments/workflows.py`.
@@ -107,7 +109,7 @@ boundary.
107109
- Inspect the Event History to confirm the two-event sync pattern
108110
(`NexusOperationScheduled`, `NexusOperationCompleted`).
109111

110-
# Step 1: Apply TODO 4 in `payments/workflows.py`
112+
## Step 1: Apply TODO 4 in `payments/workflows.py`
111113

112114
Open `payments/workflows.py` in the
113115
[button label="Code Editor" background="#444CE7"](tab-0). Find the
@@ -160,7 +162,7 @@ Two things to notice:
160162
Also remove the now-unused `check_compliance` import from the top of
161163
the file. Your editor or `ruff` will flag it.
162164

163-
# Step 2: Apply TODO 5 in `payments/worker.py`
165+
## Step 2: Apply TODO 5 in `payments/worker.py`
164166

165167
Open `payments/worker.py`. Find the TODO 5 comment in the Activities
166168
list:
@@ -193,7 +195,7 @@ Two cleanups:
193195
After this, **the Payments Worker no longer imports any Compliance
194196
code.** Browse the file imports if you want to verify.
195197

196-
# Step 3: Start the Compliance Worker
198+
## Step 3: Start the Compliance Worker
197199

198200
Click the
199201
[button label="Compliance Worker" background="#444CE7"](tab-1)
@@ -205,7 +207,7 @@ uv run python -m compliance.worker
205207

206208
Same Worker as Chapter 3. Leave it running.
207209

208-
# Step 4: Start the Payments Worker
210+
## Step 4: Start the Payments Worker
209211

210212
Click the
211213
[button label="Payments Worker" background="#444CE7"](tab-2) terminal:
@@ -220,7 +222,7 @@ is created inside the workflow at runtime, not registered on the
220222
Worker.) The Activities list should be `validate_payment,
221223
execute_payment` only.
222224

223-
# Step 5: Run the starter
225+
## Step 5: Run the starter
224226

225227
Click the [button label="Starter" background="#444CE7"](tab-3)
226228
terminal:
@@ -237,7 +239,7 @@ TXN-C declined HIGH. **Same outcomes, different mechanism.**
237239
> real human-in-the-loop review by replacing the sync handler with a
238240
> workflow-backed one that waits on a Workflow Update.
239241
240-
# Step 6: Inspect the Event History
242+
## Step 6: Inspect the Event History
241243

242244
Click the
243245
[button label="Temporal UI" background="#444CE7"](tab-4) tab. Switch
@@ -264,7 +266,7 @@ the Endpoint, and the namespace boundary, **without** paying for a
264266
second workflow. For short interactions, that is exactly what you
265267
want.
266268

267-
# Step 7: Stop both Workers
269+
## Step 7: Stop both Workers
268270

269271
Press `Ctrl+C` in both Worker terminals, or:
270272

@@ -273,7 +275,7 @@ pkill -f "compliance.worker" || true
273275
pkill -f "payments.worker" || true
274276
```
275277

276-
# Wrapping up
278+
## Wrapping up
277279

278280
This was the structural pivot of the workshop. Before this chapter,
279281
Compliance and Payments were one process. After this chapter, they

0 commit comments

Comments
 (0)