ID ↗
CS 319 · text: pangmandorin.kamil.web.id

CS 319 · Meeting 6 of 10 · lab

First Loop Lab
+ Human Gates

A loop you can run today beats a perfect loop you'll run next quarter.

Lab rules

  • Bring a laptop. 60 minutes of building, not watching.
  • Anything may be built by agents; you review and gate.
  • Safety: your loop runs draft-only this week — nothing lands in the world without your click.

Reading: chapters 12–13

Core concept · ch 12

Rollout discipline: four phases, in order

1 · BASELINE
monitor the manual process, don't fix it
2 · VERIFICATION
automated checks before automation
3 · BREAKER
stagnation cutoff wired in
4 · OPTIMIZE
only now tune prompts/model

The classic mistake is jumping from idea straight to phase 4 — tuning prompts for a loop that has no baseline, no verifier, and no breaker. That's automation theater with better vocabulary.

Worksheet · step 1 of the scaffold

Pick a low-risk workload

The four filters

  • Painful — you wince doing it
  • Manual — repeated ≥3×/week
  • Low-risk — worst case is a wasted draft, not a deleted database
  • Measurable "done" — you can write pass/fail criteria tonight

Good first loops (from the field)

  • issue triage: label + route new tickets
  • daily digest: summarize merges + incidents
  • dependency updates (Kirana's pick)
  • meeting notes → action items + owners
  • inbound support: draft replies, never send

Bad first loops: anything touching money, credentials, or production deploys.

Worksheet · the full scaffold

90 minutes, eight steps

 1 name the workflow (one line)                       10'
 2 define DONE in ≤4 numbered pass/fail criteria        15'  ← the real work
 3 build the context bundle (spec + 2 examples)         15'
 4 pick the trigger: cron / webhook / you-run-it         5'
 5 write the executor prompt (roles out, boundary in)    10'
 6 write the verifier: deterministic checks first         15'
 7 add the breaker (identical-output-x2 → escalate)      10'
 8 run once. under your approval. log everything.        10'

Steps 2, 6, 7 are the course so far in miniature. Steps 1, 3, 4, 5, 8 are tonight's lab.

Core concept · ch 13

Checkpoints vs gates — where the human goes

Checkpoint

A pause. The loop surfaces state so a human can look. Cheap. Can be many.

Gate

A decision. The loop cannot proceed without human judgment. Expensive. Should be few.

The four high-leverage gates

after clarifications
before synthesis
before merge
before deploy

Rule: human review at every stage, human approval only at the gates. Interrupt too often and you kill throughput; too rarely and you ship garbage.

The standing rule · from fleet operations

When the queue jams

The binding constraint on a loop fleet is never production — it's the human gate. When 40 drafts are waiting on you, the answer is:

KILL
the loop that's queuing
DEFER
the cadence, not the standard
SHIP
what exists, imperfectly

Never: add another producer.

If your instinct when output stalls is to stand up one more loop, you are doing the thing the skeptics correctly mock.

Case study · part 6 of 10

Kirana's triage loop, day one — the pause log

PauseTypeChanged the outcome?
ticket #482 labeled wrongcheckpointyes — relabel blocked a wrong auto-route
"review 12 drafts"checkpointno — theater; all 12 passed every check twice
refund over Rp 5Mgateyes — policy ambiguity only a human could settle
"confirm schedule"checkpointno — deleted; the cron doesn't need permission

Result: 4 pauses → 1 gate + 1 useful checkpoint. Kirana learned the vocabulary of theater: pauses that exist so the human feels in control, not because judgment was needed.

Lab · 60 minutes · build now

Your first loop, end to end

  1. Run the eight-step scaffold on your chosen workload (worksheet on the table).
  2. Any chat LLM + any language counts. A shell script + cron + a checklist file is a legitimate loop.
  3. Gate: before your loop "lands" anything, show your verifier to the pair next to you — they try to sneak a bad output through it.
  4. Log: trigger, state location, exits, gate count. One run minimum before you leave.

Instructors circulate. The most common stall is step 2 — your criteria aren't binary yet. Make them binary.

Assignment A6 · due before Meeting 8 (two weeks)

Run it for five days. Log every pause.

Task
Run your lab loop for 5 working days, draft-only. Every run: log date, trigger, checks passed, and every pause. Classify each pause: gate / useful checkpoint / theater. Track landed outcomes separately from produced ones.

Deliverables
Run log (5 days) · pause classification table (à la Kirana) · landed-vs-produced column · one paragraph: what you'd kill, defer, or ship.

Rubric
Log completeness 30% · honest theater-finding 40% · landed/produced separation 30%.

Next week: observability and hardening — what to do when your loop misbehaves at 3am and you weren't there. Read ch 14–15.