A response can be healthy and still come from the wrong instance. Before an exercise changes server state, identify both the workspace supplying its tools and the process answering its requests. This lesson adds the synthetic Aster Service Desk API, checks it from a browser and uses reset without discarding client work. You will also preserve a draft before applying a checkpoint and recover an incomplete setup without deleting the workspace.
Allow about 40–60 minutes after lesson 02. The qualified path is macOS 15.7.9/arm64/zsh with the selected local Node 24.19.0/npm 12.2.1. Other platforms are not qualified here. Reuse the owned application, local tools and cache from lesson 02. If its optional cleanup removed dependencies, repeat its locked install and doctor before starting the client. You need the same browser/inspector and built-in archive/checksum/file tools; there is no new package, global CLI, account, Docker or cloud service.
The fixture uses Node's built-in modules. Its records, identifiers and controls are original learning inputs, not real service-desk data or a production identity system. The Angular page remains the workspace-02 baseline. You will make an explicit browser Console request; Angular HTTP integration comes later.
Read the boundary before changing state
An origin is the URL's scheme, host and port. http://127.0.0.1:4317 and
http://127.0.0.1:4318 are different origins. The app serves the Angular page;
the API serves health and synthetic request data. Use the literal loopback host
127.0.0.1; this supplied fixture does not accept an arbitrary hostname or a
trailing path as an origin.

Blue arrows are the two browser reads. Opening the Angular page does not make the second arrow happen: you initiate that fetch below. The orange control arrow ends at the running fixture's memory. The checkpoint helper's separate file arrow ends in your owned directory. A server reset and applying source files therefore have different effects.
| Operation | Changes | Retains |
|---|---|---|
| Preview checkpoint | Nothing; lists proposed file writes. | All current files and processes. |
| Preserve draft | A bounded snapshot of declared files on disk. | The current working files; unlisted files remain untouched. |
| Apply checkpoint | Five declared fixture inputs, after snapshot checks. | Original client source, package/lock/marker and prior snapshots. |
| Reset live fixture | In-memory seed/mode; increments reset generation. | The same live instance UUID and client source/draft. |
| Restart fixture | Fresh memory and a new instance UUID. | Source and snapshots on disk. |
The temporary runtime descriptor is a connection record, not the server's dataset. Graceful shutdown removes that instance's descriptor; an abrupt exit can leave it behind. Its presence alone does not prove that a process is live.
Extract the supplement beside the existing app
Keep a terminal C for setup and controls. Restore the existing-workspace
variables with lesson 02's resumption block:
ASTER_STUDY, ASTER_LAB, ASTER_NODE, ASTER_NODE_HOME, ASTER_NPM_CLI and
ASTER_CACHE. ASTER_LAB must be the resolved pwd -P application root.
Do not create another app or extract over the current one.
Download Aster fixture — lesson 03 supplement from this lesson's Practice files panel. Set the actual ZIP path and compare its checksum with the panel before extraction:
ASTER_SUPPLEMENT_ZIP="$HOME/Downloads/aster-fixture-03.zip"
shasum -a 256 "$ASTER_SUPPLEMENT_ZIP"
After the digest matches, choose a new directory under your owned parent:
ASTER_ADDON_PARENT="$ASTER_STUDY/lesson-03-inputs"
mkdir "$ASTER_ADDON_PARENT" &&
ditto -x -k "$ASTER_SUPPLEMENT_ZIP" "$ASTER_ADDON_PARENT" &&
ASTER_SUPPLEMENT="$(cd "$ASTER_ADDON_PARENT/aster-fixture-03" && pwd -P)" &&
ASTER_HELPER="$ASTER_SUPPLEMENT/apply.mjs"
The connected commands stop if creating/extracting the new directory fails. If the example directory exists, select a new one. The original lesson 02 ZIP stays unchanged. This eight-file supplement supplies its helper, definition, README and complete five-file payload; it is not a replacement app or lockfile.
Preview, preserve and apply a named checkpoint
Here a checkpoint is a declared set of supplied source files, not a reading
completion flag. The only supported identifier in this supplement is
open-and-reset-the-aster-fixture, with checkpoint fixture-03. Do not pass a
guessed lesson, arbitrary destination or untrusted script.
The helper's preview action checks the resolved base root, workspace-02
marker, exact manifest/lock bytes and selected Node. It verifies every supplied
payload hash and rejects symlink paths, unknown options or an existing fixture
descriptor before proposing writes:
"$ASTER_NODE" "$ASTER_HELPER" preview --root "$ASTER_LAB" \
--lesson open-and-reset-the-aster-fixture
Inspect the root and these five targets. A first application should say
create; a successfully applied identical checkpoint says unchanged.
| Target | Purpose |
|---|---|
fixture/common.mjs | Root/input checks, exact origin validation, local/remote identity checks and a free-port probe. |
fixture/server.mjs | Foreground loopback server, public reads, controlled modes and in-memory reset. |
fixture/control.mjs | Inspect/reset/mode commands and guarded stale-descriptor recovery. |
fixture/seed.json | Three synthetic requests and initial revision 4. |
.aster-fixture.json | Receipt identifying fixture-03 and hashes of its four source/data files. |
Before preservation, add a harmless CSS comment to your own
src/app/app.css, such as /* lesson03 draft */, using your editor. This is
your draft to retain, not a required change to application behavior. Then:
"$ASTER_NODE" "$ASTER_HELPER" preserve --root "$ASTER_LAB" \
--lesson open-and-reset-the-aster-fixture
The output's generated snapshot_id names
.aster-checkpoints/<snapshot-id>/ under this app. It copies the declared 18
base files and any existing fixture targets, then writes snapshot.json last.
Files absent at that moment are recorded as absent. Additional personal files
are not included in this bounded backup, but the helper does not touch them.
This is not a general backup of every file under your parent directory.
Record the UUID from your own preserve output, replacing the placeholder:
ASTER_SNAPSHOT='<snapshot UUID from your preserve output>'
"$ASTER_NODE" "$ASTER_HELPER" apply --root "$ASTER_LAB" \
--lesson open-and-reset-the-aster-fixture --backup "$ASTER_SNAPSHOT"
shasum -a 256 "$ASTER_LAB/src/app/app.css" \
"$ASTER_LAB/.aster-checkpoints/$ASTER_SNAPSHOT/files/src/app/app.css"
The two CSS hashes should match. Inspect your comment in the current source
and snapshot as well. apply refuses if a captured file, its snapshot copy or
an absent target changed after preservation. Preserve the current state again
instead of bypassing that refusal. The original app marker/package/lock are not
replaced, so lesson 02's doctor remains applicable.
In apply.mjs, the maintained write-order excerpt is:
const names = [...payloadNames, '.aster-fixture.json']; // Receipt is always written last.
payloadNames is the four-file list above. The definition restricts that list
and the base snapshot paths; confined checks each path segment for symlinks
or an escape. Each complete file is staged inside the identified snapshot and
renamed to its declared target. Rename makes that file replacement atomic; the
whole five-file batch is not a filesystem transaction. A partial batch must
be preserved and reconciled again. The last receipt is checked against all four
files before a fixture can start. Your earlier snapshot remains available.
Choose two ports and start two owned processes
Use separate unused unprivileged ports. The following are examples, not reservations. Set these same chosen values in terminals A, B and C; new shells also need the existing-workspace variables from lesson 02:
ASTER_APP_PORT=4317
ASTER_API_PORT=4318
ASTER_APP_ORIGIN="http://127.0.0.1:$ASTER_APP_PORT"
ASTER_API_ORIGIN="http://127.0.0.1:$ASTER_API_PORT"
lsof -nP -iTCP:"$ASTER_APP_PORT" -sTCP:LISTEN
lsof -nP -iTCP:"$ASTER_API_PORT" -sTCP:LISTEN
An unidentified listener is a reason to choose another port. Do not kill its PID. A free-port observation is only a point-in-time check. Both processes still have to bind their requested ports, and the app/API origins must differ.
In terminal A, from the owned app root, start the already-taught client:
cd "$ASTER_LAB"
ASTER_PORT="$ASTER_APP_PORT" PATH="$ASTER_NODE_HOME/bin:$PATH" \
"$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run start
Wait for its actual URL and verify Aster Service Desk / workspace-02 in the browser. In terminal B, from the same root, start the supplied API:
cd "$ASTER_LAB"
"$ASTER_NODE" fixture/server.mjs --port "$ASTER_API_PORT" \
--app-origin "$ASTER_APP_ORIGIN"
This checks the base and fixture receipt, refuses an existing descriptor,
binds only 127.0.0.1 and creates .aster-runtime/fixture.json exclusively.
An occupied API port fails without stopping its owner. There is no global
background service to find or terminate. Keep this foreground terminal open.
An illustrative public readiness excerpt is:
status: fixture-ready
checkpoint: fixture-03
instance_id: <new UUID for this process>
api_origin: http://127.0.0.1:4318
app_origin: http://127.0.0.1:4317
revision: 4
mode: valid
generation: 0
The real output is JSON. Ports follow your choices; the instance UUID changes on restart. Record those values from your own launch, not a healthy response at an unrelated URL. The local descriptor also contains a random control token; it is private connection material, not part of this public report. Do not paste the descriptor/token into browser code, screenshots or course inputs. It is a local control guard, not production authentication or a real persona.
Inspect identity before exercising the API
In terminal C, set the UUID you recorded from B, then inspect:
cd "$ASTER_LAB"
ASTER_INSTANCE='<instance UUID from your own fixture launch>'
"$ASTER_NODE" fixture/control.mjs inspect --instance "$ASTER_INSTANCE"
Require identity-matched, your UUID, the selected origins and revision 4.
localDescriptor first checks the supplied UUID against this root's descriptor
and validates its loopback origins. The complete maintained remote-check function
in fixture/common.mjs is:
export async function checkedHealth(record) {
const response = await fetch(record.api_origin + '/health', {redirect: 'error', signal: AbortSignal.timeout(1500)});
if (response.status !== 200) throw Error(`Health returned ${response.status}; no control action sent.`);
const body = await response.json();
for (const key of ['course_id', 'checkpoint', 'instance_id', 'api_origin', 'app_origin']) if (body[key] !== record[key]) throw Error(`Remote identity mismatch: ${key}. No control action sent.`);
return body;
}
The URL comes from the checked local descriptor. Redirects are refused, and the request has a 1500 ms timeout. HTTP 200 alone is insufficient: the body must identify the expected course, checkpoint, process UUID and origins. Each control action runs this check before sending a POST. A timeout is a failure to establish identity, not evidence that the server is absent or safe to reset. These checks reduce accidental targeting; a cooperating local fixture is not an adversarial security attestation.
Open DevTools Console on the app page from terminal A, not a blank page or
another site's tab. Run this complete read expression, replacing the API port
if yours differs. Browser JavaScript cannot read your shell's ASTER_* variables:
await (async () => {
const response = await fetch('http://127.0.0.1:4318/api/requests');
return {status: response.status, body: await response.json()};
})();
The small async function gives each run fresh local variables. Expect status
200, REQ-101, REQ-102, REQ-103, revision 4 and the same instance_id.
The complete supplied seed is:
{
"revision": 4,
"items": [
{"id": "REQ-101", "title": "Replace a synthetic keyboard", "queue": "hardware", "priority": "normal"},
{"id": "REQ-102", "title": "Investigate a synthetic Wi-Fi drop", "queue": "network", "priority": "high"},
{"id": "REQ-103", "title": "Prepare a synthetic monitor", "queue": "hardware", "priority": "normal"}
]
}
Queue and priority values are synthetic categories, not permissions. The server
also supplies GET /health. It allows browser reads only from its configured
app origin using CORS (Cross-Origin Resource Sharing). CORS governs whether
browser JavaScript can read a cross-origin response; it is not authentication.
Terminal programs are not constrained by browser CORS, and client-side guards
cannot demonstrate production authorization.
An incorrect origin can cause the browser's fetch to reject without exposing a readable response to this script. Inspect the actual page origin, API URL and startup configuration rather than disabling browser protections. The fixture additionally rejects an unexpected HTTP Host header. These are this bounded fixture's local boundaries; SSR and production security are later work.
Compare a changed mode with a reset
In C, choose the empty response mode, then repeat the browser read expression:
"$ASTER_NODE" fixture/control.mjs mode --instance "$ASTER_INSTANCE" empty
Expect status 200 with items: []. Then choose error and read again:
"$ASTER_NODE" fixture/control.mjs mode --instance "$ASTER_INSTANCE" error
Expect status 503 and a synthetic error object. A fetch promise does not reject
merely because an HTTP response has status 503; inspect response.status.
A network/CORS rejection is a different observation. This does not yet teach
Angular's HttpClient error path.
Reset the identified live fixture:
"$ASTER_NODE" fixture/control.mjs reset --instance "$ASTER_INSTANCE"
Require seed-reset, the same instance UUID, mode: valid, revision 4 and
an increased generation. Repeat the browser read and confirm the three seed
IDs. generation counts resets within this process; it is not a record revision.
Reset restores this supplied seed/revision instead of advancing revision to 5.
Later write/conflict lessons define their own operation contracts.
control.mjs obtains the private token locally and sends the control POST only
after identity matches. Browser-origin control requests are refused. Reset
changes fixture memory; verify your CSS draft and snapshot still exist. It does
not reset an Angular form, remove client files or prove a server rollback.
Two independent recovery cases
Case 1: a healthy process, the wrong expected UUID
With your fixture running, predict this deliberately wrong control attempt in C:
"$ASTER_NODE" fixture/control.mjs reset \
--instance 00000000-0000-4000-8000-000000000000
Verify that it refuses and that inspection with your real UUID still identifies the original process with no extra reset generation. Why must HTTP health alone not authorize the action?
Hint 1: compare the expected UUID with B's launch report and the local descriptor.
Hint 2: localDescriptor must agree before checkedHealth can authorize a control request.
Answer and reasoning
The expected UUID does not identify this root's launch, so the command fails without sending a reset. Use the UUID you recorded from your own process, then inspect its origins/checkpoint before choosing an action. A different process can answer HTTP 200; that response does not establish the intended target. After a restart, an old UUID must similarly be rejected. Never bypass this by editing a descriptor to match an unfamiliar listener.
Case 2: a checkpoint did not finish
First stop your own API in B with Ctrl+C. Confirm its descriptor is gone; leave the app/source and snapshots intact. In C, simulate a missing final receipt by renaming just that supplied file. If the saved filename already exists, choose a new saved filename before this exercise; do not overwrite it:
cd "$ASTER_LAB"
if [ -e .aster-fixture.saved.json ] || [ -L .aster-fixture.saved.json ]; then
printf '%s\n' 'Saved receipt exists; choose a new saved filename before this case.'
else
mv -n .aster-fixture.json .aster-fixture.saved.json &&
"$ASTER_NODE" fixture/server.mjs --port "$ASTER_API_PORT" \
--app-origin "$ASTER_APP_ORIGIN"
fi
The attempted launch should fail before creating a new descriptor. Diagnose
with preview, preserve this partial state using a new snapshot and apply
the declared checkpoint again. Retain your draft and earlier snapshot. Do not
delete the workspace or reuse the old pre-apply snapshot blindly.
Hint 1: the five file writes are not one transaction; a receipt is useful only when present and matching every declared input. Hint 2: an old snapshot's absent/present file set no longer describes this state.
Answer and reasoning
Preview should propose creating the receipt while the other four targets are
unchanged. Run the taught preserve command again, record its new UUID and
use it with apply. A stale snapshot fails its current-file/absence checks;
that refusal protects the intervening work. The restored receipt/source hashes
allow another start, which produces a new instance UUID. Update ASTER_INSTANCE
from that launch before inspecting or resetting. The saved receipt and CSS
draft remain local files; the helper did not delete them.
Resume and stop only what you own
In a new terminal, restore the existing lesson 02 variables plus your actual
supplement/helper path and chosen origins. If the API is still running, use
the UUID recorded from that launch and run inspect. Do not repeat apply
merely because a terminal closed. If it stopped gracefully, start it again and
record the new UUID; no checkpoint or dependency install is needed just to
restart the Node fixture.
After an abrupt exit, an old .aster-runtime/fixture.json may block startup.
With the UUID you retained from that launch, the supplied recovery command is:
"$ASTER_NODE" fixture/control.mjs recover --instance "$ASTER_INSTANCE"
It removes only that descriptor after local identity matches, the endpoint refuses connection, a loopback bind probe finds the port free and the descriptor bytes remain unchanged. A replying listener, occupied port, timeout or identity mismatch refuses recovery. It stops zero processes. This is not a port reservation; a later start still has to bind. An unidentified/still-running owner must be inspected, not killed to make the command succeed.
Stop the API in B and client in A with Ctrl+C in each own foreground terminal. An intentional interruption exit 130 is expected. Check the two ports again; do not assume any later listener is yours. Graceful API shutdown removes its own descriptor while source, the supplement, snapshots and CSS draft remain. Do not manually delete a descriptor while the fixture is live.
Keep those inputs for the next lesson. If reclaiming generated client outputs, use only lesson 02's guarded cleanup after both owned processes and all installs/builds have stopped. It leaves the fixture source, snapshots and tools intact; the next client resume then needs the locked install. Do not treat retained backups or an empty runtime directory as a cleanup failure.
Check the distinction
Explain what persists after reset, graceful stop and restart. Which two identity observations precede a control POST, and why is a source checkpoint not the same operation as resetting a running process? A useful answer traces disk files, temporary connection identity, in-memory mode/seed and the browser's actual response separately. A working local fixture does not establish later Angular state, authorization, SSR or production deployment behavior.
References
- Node 24.19.0 release checksums and process behavior.
- Node HTTP server, file-system operations, loopback bind, URL origin and random identifiers/hashes.
- HTTP semantics and Fetch/CORS. The Aster routes, reset generation and checkpoint format are original course contracts, not universal framework or HTTP requirements.