uart1 is a UART is not the same
as knowing it’s the DUT’s debug CLI. DUT context is the narrative you author
once so agents reason about your bench at the level of systems, not loose
wires.
DUT context lives in /etc/lager/bench.json and is surfaced to agents through
the MCP resources lager://dut/overview.md and lager://dut/context, and the
discover_dut() and cite_schematic() tools.
The two things to author
1. Per-net purpose
Each net carries a single-sentence purpose plus optional notes. Set them in the Net Manager TUI:- Purpose — “DUT debug CLI over UART; primary command/response channel.”
- Notes (optional) — gotchas, jumper positions, scope probe points.
- Tags (optional) — short keywords the planning tools match on, e.g.
flash,boot-critical.
purpose and notes are prose for the agent to read; tags are keywords the
planning tools score against (a tag matching a test goal is the strongest
relevance signal). You can also set these without the TUI:2. DUT-wide context
The DUT context describes the board as a whole: its purpose, MCU, key peripherals, subsystems, and references to documents. Author it with thelager box dut command group.
bench.json:
Attaching schematics and datasheets
The Lager Box is not a document store. It records pointers to your documents; the agent fetches and analyses them with its own (vision-capable) tools. This keeps the box lean and lets the agent use the best tool for reading a PDF or board image. Attach a pointer without hand-editing JSON:DocRef) has:
| Field | Meaning |
|---|---|
title | Human label. |
kind | schematic, layout, datasheet, firmware, manual, errata, or other. |
url | External URL (any URL the agent can fetch). |
repo_path | Path relative to your test project (synced to the box on lager python). |
pages | Optional page/sheet hint, e.g. "3-5" or "POWER sheet". |
notes | Optional free-form note. |
--url or --repo-path.
URL vs. repo-path: which to use
| Situation | Recommended | Why |
|---|---|---|
| Automated / CI / headless agent | --repo-path | The file is synced with your project; no network, no auth, fully deterministic. |
| Publicly fetchable doc | --url | Any agent with a web-fetch tool can pull it. |
| Private doc (Google Doc, Confluence, SSO) | --repo-path or a Drive connector | The box never authenticates; a login-walled URL returns an auth page, not content. |
How the agent uses it
Once authored, the context drives the whole agent loop:-
The agent reads
lager://dut/overview.mdand learns: “power-regression rig, STM32H7, flash + power-tree subsystems, schematic atdocs/sch.pdf.” -
plan_firmware_test("flash driver", "exercise QSPI")returns a plan already scoped to the flash subsystem, with a pointer to schematic page 3. -
cite_schematic("flash_cs")returns just the refs for that net:The agent opensdocs/sch.pdfat page 3 with its own file tools — no scanning the whole PDF.
Applying changes
The MCP server watches/etc/lager/bench.json, /etc/lager/saved_nets.json,
and /etc/lager/box_id and auto-reloads when any of them changes on disk.
So after lager box dut edit, lager box dut add-doc, or lager nets describe,
agents see the new context on their next discover_dut(), discover_bench(), or
lager://dut/overview.md request — no manual step required.
If you want to force a reload immediately (e.g. to confirm a change took), a
connected agent can still call the box_manage tool with action="reload", or
you can restart the box service.
