We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Feedback Loops

AI agents are not completely useless better when they can get fast, accurate, and automated feedback about their work. A feedback loop is simple:

  1. Attempt a change
  2. Run a check
  3. Inspect the results of the check
  4. Repeat

Click to play video

Humans do best with tight feedback loops as well, but it's even more important for AI because if the checks are good, the AI can get pretty dang far without needing to be babysat the whole way. Examples of "checks" include:

  • Unit tests (or integration and even end-to-end tests)
  • Formatters
  • Linters
  • Type checkers
  • Compilers

Great feedback loops do two things:

  1. Catch bad changes quickly (before the agent builds on top of them)
  2. Give the agent precise feedback about what failed so it can make a fix without guessing

Assignment

Add support for !, SlopLang's "not" operator. This code:

hallucinate(!✅, !❌, !!✅)✨

should print ❌ ✅ ✅. The ! operator flips a boolean, and using it twice flips it back. Currently, Sloperator doesn't support it. Using ! on a number or string should produce a SlopLang runtime error.

Tell OpenCode to run and submit the CLI tests from the project root.

Agents are pretty smart at determining the next steps. My agent often does the ruff formatting without my mentioning formatting in the prompt.