14 The worked beginner curriculum
A program is stored text. A process is a running instance with its own memory, environment and working directory. A file path can be absolute or relative to that working directory.
Outcome: connect basic programming and operating-system concepts to a running service. Environment: local terminal; no administrator access or paid services. Files: labs/foundations.py, solutions/foundations.md, and the reference application's tests. Assessment: explain your result before reading the answer key.
Lesson 1: files, processes and errors
A program is stored text. A process is a running instance with its own memory, environment and working directory. A file path can be absolute or relative to that working directory. That distinction explains why two workers can accidentally open different jobs.db files.
From your VM workspace directory (~/playground), run:
The successful command writes JSON to standard output. The rejected command writes a message to standard error and returns a nonzero exit code. In bash, echo $? immediately after a command reveals its exit status. Learn this before writing scripts that continue after failure. Quoting keeps spaces in one argument; it does not make an untrusted shell script safe.
Predict what changes for punctuation, multiple spaces, emoji and a newline. len counts Python string code points, not storage bytes or visual grapheme clusters. A UTF-8 body-size limit and a character-count limit protect different resources. The service enforces both a body bound and a text length bound.
Lesson 2: variables, functions and data contracts
Read analyze. The parameter is a string; the return value is a dictionary of integer counts. strip tests for meaningful content, split separates words on whitespace, and len counts elements. A function should make its inputs, outputs and failure conditions understandable without requiring the reader to inspect every caller.
Change only your disposable practice copy to count sentences. Write examples first: empty input, one sentence, punctuation inside abbreviations. Explain why a simple full-stop counter is a heuristic. Keep the Course 0 workspace's reference copy unchanged so its tests remain a known comparison point. The lesson is defining a contract, not inventing an unsupported language-analysis claim.
Lesson 3: HTTP and JSON
An HTTP request has a method, path, headers and optional body. The response has a status, headers and optional body. JSON describes data; it does not carry permission. A client-supplied tenant field cannot authorize itself.
Run the Chapter 3 setup, then compare liveness, readiness, an authorized submission, a missing-token submission and a duplicate submission. Record the status and interpretation. 202 means accepted work; 401 means identity failed; 403 means insufficient permission; 409 means a conflicting state; 422 means the submitted shape is invalid; 429 means a quota rejected the request; 503 means a dependency is unavailable. A client must handle these paths deliberately.
Lesson 4: durable state and transactions
A process variable disappears when its process exits. A committed database row survives an application restart. A transaction groups changes that must succeed together. The example commits the job and daily admission counter together: either both persist or neither does. A unique constraint handles simultaneous duplicate requests across processes.
Run the concurrency tests. Explain why checking for an existing row and later inserting without a constraint is unsafe. Two callers can both observe absence. The constraint is the final arbiter; the application translates a duplicate into the documented result.
Lesson 5: reproducibility and debugging
pyproject.toml declares dependency intent; uv.lock records resolved versions. uv sync --frozen refuses to silently re-resolve an inconsistent lock. A virtual environment isolates dependencies, while a container also packages a userspace runtime. Neither removes the need to understand the host kernel, network and storage.
For each failure, state a hypothesis and one observation that could disprove it. If jobs stay queued, inspect worker state before changing DNS. If readiness returns 503, inspect the database before increasing API replicas. Change one cause at a time and retain the original symptom in the journal.
Lesson 6: first independent assessment
Without the answer key: explain every hop from client to result; start the system; submit a job; stop the worker; prove new work is durable; restart the worker; repeat the same request; verify the ID is unchanged; demonstrate rejection without credentials. Stop your own processes afterward.
Pass criteria are observable behavior and an explanation. A learner who can paste commands but cannot explain their target directory, credentials or failure output repeats the lab with guidance. The answer key is in solutions/foundations.md. Later chapters add tests and runbooks to this same service so you can see the engineering grow rather than jump between unrelated demos.
Curriculum map and evidence
| Stage | Build | Required evidence |
|---|---|---|
| Beginner | CLI then local API and worker | Correct result, meaningful error, durable job |
| Developing operator | Auth, migration, containers, HTTPS | Denied access, preserved rows, verified certificate |
| Reliable operator | Metrics, alerts, backup, restore | Delivered firing/resolved alert and recovered result |
| Advanced engineer | Releases, model boundary, remote MCP | Rejected candidate, rollback, budgets and JWT tests |
| Specialist | One chosen platform or server role | Target-system deployment, failure and recovery |
The provided checks are worked examples. To demonstrate your own competence, repeat them without the fixture credentials and explain one intentionally introduced failure. An expert assessment uses a new scenario, a time limit, a reviewer and a written tradeoff decision. Documentation can support this progression; reading alone cannot certify expertise.
Lock in what you just learned (3 quick questions)
200, 400, 401, 404, 500) alongside JSON response bodies?