Lab 0 — Setup, dual API, and scorecard
← Back to labs index

Lab 0 — Setup, dual API, and the scorecard

Lab 0 establishes the reusable boundary between Foundry-hosted Claude Messages and GPT Responses models. It also supplies an offline ScriptedModel, a provider usage ledger, and the deterministic local store simulator used by Labs 0–8.

Concept

Every later lab measures a harness capability against a fixed, known target — so before any agent behavior can be built, the substrate has to be stable: one Entra-only identity path (no API keys, ever), one interface over two different provider APIs, and one deterministic “world” (the store simulator) to run tasks against and grade honestly. Lab 0 has no agent behavior yet; it is the plumbing everything else stands on.

Key ideas

Added in this lab

Learner steps

  1. Create and activate a virtual environment, install the lab, configure a Foundry deployment in .env, and sign in with Azure CLI:
python -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
cp .env.example .env
az login
pytest checks/

Set only non-secret values in .env. Authentication is acquired at runtime through DefaultAzureCredential; do not add API keys.

  1. Open the interactive prompt, ask multiple questions, and leave the prompt:

    harness ask
    

    Enter a question at You>; each Assistant> response and its token counts remain visible above the next prompt. Enter /exit to return to your shell. You can also pass one question directly, such as harness ask "What is 17 multiplied by 23?". Each turn is a fresh model call without tools or conversation history. pytest checks/ remains the offline regression check; it does not replace this learner-facing Foundry call.

  2. Create the practice app, once for the whole course. Later labs use their harness on this app. It is its own git repository and is gitignored by the course repo (see the track guide):

    mkdir ../app && cd ../app
    git init -b main
    printf '# Pet store practice app\n\nSynthetic data only. Built with my own harness during the labs.\n' > README.md
    printf '.env\n.env.*\n__pycache__/\n.pytest_cache/\n*.log\n' > .gitignore
    git add . && git commit -m "chore: start practice app"
    git tag lab00-done
    

    On Windows PowerShell:

    New-Item -ItemType Directory ..\app | Out-Null; cd ..\app
    git init -b main
    "# Pet store practice app`n`nSynthetic data only. Built with my own harness during the labs." | Set-Content README.md
    ".env`n.env.*`n__pycache__/`n.pytest_cache/`n*.log" | Set-Content .gitignore
    git add . ; git commit -m "chore: start practice app"
    git tag lab00-done
    

    With the Lab 0 virtual environment still active, run harness ask "Reply with OK if you can read this." from app/. The harness command reads the .env file from the lab folder, so a reply confirms that Foundry works from the app. Lab 0 has no tools, so it cannot read the app’s files yet. Lab 2A adds that.

Start the simulator in a separate terminal before inspecting or resetting it:

harness sim start
harness sim status

Commands

Done when: git tag in app/ lists lab00-done and a question was answered through Foundry. The next snapshot adds the first bare model call.