Repository navigation
TWS Labs 1.2.0: Skip never dead-ends
Highlights
- Skip never dead-ends, and every miss tells you what to do next. Skipping ahead sets up the files the next task needs; a command you typed but did not run is called out; hints come in tiers; a button restarts the lab with fresh files; and when a session ends you are told why.
- Kubernetes is a track of four labs, and AWS gets its first lab on your own account: real
awscommands against a free-tier footprint you clean up yourself, with a least-privilege role and a budget alarm. - Four labs from the community (awk and sed, process management, Kubernetes Services,
.gitignore), plus artifacts and caching: see the credits below. - Every check is now proven both ways. About 370 near-miss and valid-alternative cases across the 27 offline labs, a play-through of every lab over the real server path, and browser tests in real Chrome. That found, and fixed, eight checks that were too lax or too strict.
- Accessible and calmer: AA contrast, visible keyboard focus, a skip link, no keyboard trap in the terminal.
- For teams that self-host: opt-in usage counters and a token-protected
/admin/stats(with the hardest tasks), per-audience invite codes with a rotation runbook.
Added
- Labs
- Kubernetes (now a live topic on the DevOps line, with a cross-link to Cloud): Pod and Deployment anatomy (Contributed by Preetham Pereira, @cloudwithpreetham, #35), Exposing Pods with Services (Sanket Dangat, @srdangat, #42), ConfigMaps and Secrets and Fix the broken manifest.
- AWS CLI first steps: the first lab on your own AWS account (identity, an S3 bucket, tags, versioning,
--query, cleanup). Needs the AWS overlay (AWS=1 ./start_local_labs.sh, seedocs/aws-labs.md). - Git and GitHub: ignoring files with
.gitignore(Sanket Dangat, #27) and GitHub Actions: artifacts and caching (Preetham Pereira, #26). - Linux Fundamentals: text processing with
awkandsed(Sanket Dangat, #32) and process management (ps,top, background jobs,killandkill -9; Muhammad Ishaq, @techwithiishaq, #45).
- A better lab page
- Skip never dead-ends. If you skip or jump to a task that needs files from an earlier one, the lab sets up what it needs (and moves your shell to the right folder), and tells you.
- Hints in tiers: a "Need a hint?" button reveals up to three, gentle to specific, after a failed Check.
- Restart lab: a fresh session with fresh starting files and a clean command history, after a second click to confirm. Your "done before" marks stay.
- Task progress is remembered in your browser: a track page shows "3 of 5 tasks" for a lab you started, and the step dots show which tasks you passed on an earlier visit. Nothing leaves your browser.
- Self-hosting and teams
- Usage counters (opt-in,
USAGE_STATS=1): sessions per lab, distinct visitors per day, task pass/fail and sessions per invite code, with no IP address or invite code stored. Read them at/admin/statswith anADMIN_TOKEN, or from theusagelog lines. The page also lists the hardest tasks. - AWS overlay for labs that use your own AWS account:
AWS=1 ./start_local_labs.shbuilds an image with the AWS CLI v2 (trimmed to the services the labs use, about +170 MB, only withAWS=1) and passes yourAWS_*variables to those labs only. Includesdeploy/learner-role.yaml(a least-privilege role and a $5 budget alarm, for your own account),scripts/aws-lab-creds.sh(one-hour credentials, so no long-lived keys) andscripts/aws-lab-sweep.sh(delete leftovers; a dry run by default). Guide:docs/aws-labs.md. - A runbook for giving each audience its own invite code and rotating one (
deploy/README.md).
- Usage counters (opt-in,
- For lab authors
- Near-miss cases:
cases/<task>/scripts (wrong answers the check must reject,ok-alternatives it must accept), proven byvalidate-labs. - Setup for skipping ahead:
setup/<task>.sh(with# cwd:and# no-skip:lines);validate-labsproves every task is solvable after skipping ahead. lab.yamlcan sayrequires: aws, andhintcan be a list of tiers.npm run lab:lintgives advice: tasks without a success message, checks that only read the typed history, hints that repeat the answer or are too short, labs over 15 minutes, tasks without a near-miss case. It never fails a build;--noteslists them.- Real-browser tests (
npm run e2e, Chrome via puppeteer-core as a dev dependency): a learner's whole journey, hints, Restart, Skip, accessibility with axe-core, and the hosted profile (invite code, seat cap, idle and time-limit ends, two tabs, a server restart). CI runs them and keeps the screenshots. - CI plays every offline lab through the real WebSocket server path, fails when the image outgrows its size budget (
image-size-budget.json, 520 MB) and builds the AWS overlay. - The
server.jsrequest handler is split into a router, route modules, guards and the terminal (no behaviour change).
- Near-miss cases:
Changed
- Kubernetes now sits on the DevOps line (with a cross-link to Cloud), since its labs are manifest practice that needs no cluster. The home map allows seven topics per line and its orbit draws all seven.
- The learner shell has full
vim(syntax highlighting;viopens it) and workingmanwith the standard manual pages. The image grows by about 80 MB uncompressed. - The README pitch now says "every offline task proven solvable by a script": account labs are proven on a real account, not in CI.
- A failed Check's button reads "Check again" instead of an error-like label.
Fixed
- A command you typed but did not run is noticed: a failed Check says "You have a command typed but not run yet. Press Enter", and the keyboard goes back to the terminal so Enter works at once.
- When a session ends you are told why, in plain words (idle, time limit, you typed
exit, the connection dropped or the server restarted), with "Press Restart lab to start again", instead of[session ended: 4000]. The countdown no longer keeps a stale value, and waiting-for-a-seat messages wrap at word boundaries. - Italics (
*word*,_word_) in lab text render as emphasis instead of showing the asterisks; step buttons no longer wrap into two lines. - Accessibility: faint text meets the WCAG AA contrast ratio on the dark theme; keyboard focus shows a thin ring everywhere, with a skip link and a
mainlandmark;Shift+Tableaves the terminal (Tab still goes to the shell); the logo no longer reads twice to screen readers. - Checks that were too lax or too strict, found by the new cases: Navigating (
cat readme.txtfrom the wrong folder passed), Files (extra lines passed "exactly"), Shell scripting (a single-quoted$NAMEpassed), Services (omittingtypewas rejected), Process management (pkillandkill -KILLwere rejected), Dockerfile craft (copying only the app file was rejected), GitHub Actions (an emptyname:passed; anexcludeby one key was rejected), Ports and sockets (typing the expected error by hand passed). - The lab page stops polling
/session/remainingonce the session ends. Reported by Preetham Pereira (#36). - Track pages carry
data-trackon their wrapper, which the progress script needs (#38, #39), and the roadmap loader's station link no longer has two identical branches (#40, #41). Both reported and fixed by Preetham Pereira. - The HTTP tests no longer hardcode how many topics are live, so a topic's first lab goes live without a test edit. Reported by Preetham Pereira (#30).
LAB_IDLE_SECandLAB_HARD_CAP_SEC(testing knobs, seconds) next to the minute settings.
Upgrade notes
- Local: rebuild the image once (
./start_local_labs.shdoes it for you). No settings changed. To try the AWS lab: set up the role (docs/aws-labs.md) and start withAWS=1. - Hosted: the image changed, so the next push to
mainredeploys it throughdeploy.yml. No Terraform changes. The hosted app now setsUSAGE_STATS=1; itsusagelines appear in the application log group. Optional repo secrets:ADMIN_TOKEN(turns on/admin/stats) andUSAGE_SALT(consistent visitor counts across replicas); neither is required. - New, optional files:
docker-compose.aws.ymlandDockerfile.aws(the AWS overlay). The default image is unchanged in purpose and stays under the 520 MB CI budget. - Authors:
npm cinow also installspuppeteer-coreandaxe-core(dev only, not in the image) fornpm run e2e.
Full history: CHANGELOG.md. New to TWS Labs? Start with the README: ./start_local_labs.sh and you are learning in a real terminal in a few minutes.