Skip to content

TWS Labs 1.2.0: Skip never dead-ends

Choose a tag to compare

@LondheShubham153 LondheShubham153 released this 15 Oct 11:27
c7d9b18

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 aws commands 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, see docs/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 awk and sed (Sanket Dangat, #32) and process management (ps, top, background jobs, kill and kill -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/stats with an ADMIN_TOKEN, or from the usage log lines. The page also lists the hardest tasks.
    • AWS overlay for labs that use your own AWS account: AWS=1 ./start_local_labs.sh builds an image with the AWS CLI v2 (trimmed to the services the labs use, about +170 MB, only with AWS=1) and passes your AWS_* variables to those labs only. Includes deploy/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) and scripts/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).
  • For lab authors
    • Near-miss cases: cases/<task>/ scripts (wrong answers the check must reject, ok- alternatives it must accept), proven by validate-labs.
    • Setup for skipping ahead: setup/<task>.sh (with # cwd: and # no-skip: lines); validate-labs proves every task is solvable after skipping ahead.
    • lab.yaml can say requires: aws, and hint can be a list of tiers.
    • npm run lab:lint gives 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; --notes lists 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.js request handler is split into a router, route modules, guards and the terminal (no behaviour change).

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; vi opens it) and working man with 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 main landmark; Shift+Tab leaves 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.txt from the wrong folder passed), Files (extra lines passed "exactly"), Shell scripting (a single-quoted $NAME passed), Services (omitting type was rejected), Process management (pkill and kill -KILL were rejected), Dockerfile craft (copying only the app file was rejected), GitHub Actions (an empty name: passed; an exclude by one key was rejected), Ports and sockets (typing the expected error by hand passed).
  • The lab page stops polling /session/remaining once the session ends. Reported by Preetham Pereira (#36).
  • Track pages carry data-track on 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_SEC and LAB_HARD_CAP_SEC (testing knobs, seconds) next to the minute settings.

Upgrade notes

  • Local: rebuild the image once (./start_local_labs.sh does it for you). No settings changed. To try the AWS lab: set up the role (docs/aws-labs.md) and start with AWS=1.
  • Hosted: the image changed, so the next push to main redeploys it through deploy.yml. No Terraform changes. The hosted app now sets USAGE_STATS=1; its usage lines appear in the application log group. Optional repo secrets: ADMIN_TOKEN (turns on /admin/stats) and USAGE_SALT (consistent visitor counts across replicas); neither is required.
  • New, optional files: docker-compose.aws.yml and Dockerfile.aws (the AWS overlay). The default image is unchanged in purpose and stays under the 520 MB CI budget.
  • Authors: npm ci now also installs puppeteer-core and axe-core (dev only, not in the image) for npm 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.