Skip to content

Proposal: Kubernetes hands-on drills as a Web UI mode (kdrill) #53

Open

Description

@brunokktro

Hi Andy!

I found StudyLoop and really liked how it's built: the Socratic mentor, the ADRs, the honesty about what is and isn't ready.

I have a small local tool for Kubernetes certification practice (CKA/CKAD/CKS), called kdrill. It's not published yet. I'd like to bring it into StudyLoop as one more option in the Web UI menu, next to Study Session and Body Double, instead of keeping two separate apps.

Opening this first, as CONTRIBUTING.md asks, to check fit before writing any code.

What kdrill does today

  • Drills defined in YAML: setup, task, a read-only check script and a solution. They run against local kind clusters.
  • Levels L0 to L3: L0 is guided (solution available but collapsed), L3 is exam-like with no help at all.
  • Browser terminal: a PTY over WebSocket, with Origin/Host checked before accept(). Commands are logged only while an attempt is active, with secret redaction.
  • Auto Coach (L0/L1 only): after each learner command it runs a read-only probe of the drill's check and reacts (wrong command, stalled, progress). It never gives an automatic hint; a hint only comes from an explicit click.

How I think it could map onto StudyLoop

  • Setup and check: practice decks with verification.kind: command plus setup_command look like the closest existing seam.
  • Terminal: reuse the live console (xterm/PTY), not a second PTY implementation.
  • Coach: route it through the Socratic mentor, so the coaching voice matches the rest of StudyLoop.

Open questions

  1. Is a new menu mode acceptable, or would you rather this live under practice tasks?
  2. The Auto Coach runs a verification command after every learner command. Today practice verify confirms before running (R-15). Would a per-deck trust model for read-only checks be acceptable, or do you see a better shape?
  3. kind + Docker is a heavy dependency. OK as an optional extra with doctor checks?

Plan

  1. Install and use StudyLoop locally first, as a learner.
  2. Prototype on a fork branch (feat/kubernetes-drills), tests first, just preflight green.
  3. Come back with small PRs, not one big one.

Happy to change direction based on your view, including "this doesn't belong in StudyLoop".

Activity

  1. NetDevAutomate commented on Oct 4, 2026

    @NetDevAutomate
    Owner

    Hi Bruno,

    Many thanks for opening this before writing code, and for the detail.

    I would love to introduce a module capability to facilitate a standardised community module index with hands on tech specific labs.

    StudyLoop was created for the community and my sincere hope is to get the wider community involved to make this a much better community based tool.

    I'm looking into how to add to the repo and to https://www.studyloop.dev/ a more comprehensive contributing section.

    Short version: no objection; kdrill is the first module I want StudyLoop to carry, and I'd like to use it to set the standard every later module follows, so that contributing a topic never requires reviewing core.

    What I did with your proposal
    Rather than answer the three questions in isolation I wrote up a module contract — how any technology-specific drill set plugs into StudyLoop — and had it reviewed by a four-model council before replying (the arbitration sits next to it). It is written for you and has eleven questions, each with a recommended answer, so "yes" or "no, because …" is a complete reply:

    Proposal

    Implementation plan

    • design.md and tasks.md in the same folder.
    • One paragraph: a module is a directory of data - module.yaml, drills in StudyLoop's existing PracticeDeck JSON, a mentor/brief.md, your scripts/ — that core validates, lists under one generic Labs entry, and runs through its own runner, consent and mentor.
      • Modules declare; core executes.
      • Nothing a module ships is imported by core.

    Your three questions

    • Menu mode? Neither a Kubernetes mode nor "under practice tasks": one generic Labs entry, hidden until a module is installed, listing drills by module. Otherwise every technology becomes a menu item. The entry is StudyLoop's; the content is yours.

    • Auto Coach and per-deck trust for read-only checks? Not as a YAML label — "read-only" has to be a capability the runner enforces, not something a deck declares. In v1 every phase (setup / check / cleanup) is consented per execution: the exact argv and the content digest of your script are shown, confirmed, and re-checked at spawn (R-15 extended from the command text to the script). The learner triggers each check explicitly and the result goes to the Socratic mentor, which decides what to say. There is no automatic check after each command in v1. The standing grant Auto Coach needs is v2, together with a view-only credential (an RBAC view ServiceAccount in the injected kubeconfig) that makes it defensible — §5.5 says why they ship together. Expectation-setting: in the MVP the check runs from the CLI (studyloop drill check //) while the drill itself runs in the web terminal; the browser Check progress button is v1.1 because it is a new HTTP consent surface.

    • kind + Docker as an optional extra with doctor checks? Yes. Prerequisites are an enum core owns (docker, kind, kubectl in v1); the probes live in core's doctor/, report only for installed modules, and never create a cluster or switch context. Default tests run with nothing installed; live drills sit behind STUDYLOOP_LIVE=1 (the TF_ACC=1 pattern).

    • Your mapping was right on all three seams — decks with verification.kind: command plus setupCommand, the existing live console, the mentor as the coaching voice.

    What is live for you as of this comment

    • The schema half merged in : PracticeDeck now accepts the six additive fields from §5.3 — id on the deck and on each task, solution, scaffolding (guided / hinted / unaided / exam, your L0–L3), mentorNotes, and verification.cleanupCommand. Until studyloop module check lands (the next lane), validate converted decks from your StudyLoop checkout with:

    uv run python -c 'import sys, pathlib; from studyloop.learning.practice import load_practice_deck; [print(p, "ok:", len(load_practice_deck(pathlib.Path(p)).tasks), "tasks") for p in sys.argv[1:]]' decks/*.json

    • That is the same Pydantic model MC004 will use, extra: forbid included, and it records nothing. The manifest (module.yaml, §5.2) can only be drafted against the proposal for now. Order from here: module check / module add, then the runner and studyloop drill, then the Labs entry; your live proof against a disposable kind cluster (DoD item 7) is the acceptance test of the whole standard — if kdrill needs something the contract lacks, either the need is generic and v1 grows, or kdrill adapts.

    The plan, slightly redirected

    • Install it and use it as a learner first - yes please, and tell me what is wrong.
    • Then: the module lives in your own repository, not on a fork branch — studyloop-module-kubernetes-drills, GitHub topic studyloop-module (the terraform-provider- convention; kdrill can stay the nickname).
    • PRs to core are for gaps in the contract - a prerequisite id, a target kind, a conformance rule - and those should be small, exactly as you planned.
    • Your fork is the right place for those.

    Things I would rather you avoid

    • Teaching core a second drill format: convert kdrill's YAML to PracticeDeck (Q1 — what does not map?).
    • Shell strings in checks: each phase is one executable under scripts/ plus literal arguments, run as argv with no shell; exit 0 passed, 1 task not complete, ≥2 could not run (Q3 — do your checks fit, or need a thin wrapper?).
    • --context, --kubeconfig or use-context in commands: the runner injects a kubeconfig holding exactly one context, a disposable per-attempt cluster that core creates.
    • Any learner-facing hint or solution surface: hint, solution and the brief reach the learner only through the mentor. Checks and facts from the module; teaching from the mentor.
    • Inferring command completion from prompt text, or anything that runs without consent.
    • Two things only you can answer: does any CKA/CKAD/CKS check genuinely need to read Secrets (Q4 — it shapes v2's credential, not v1), and are you happy to rename the repo when you start the conversion (Q9)? Reply to the eleven questions - "yes" to most is fine - and I will adjust the proposal and put dates on the next lanes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions