The session example distinguishes missing request headers from a real request without a session cookie, showing the API boundary that validation must preserve.
AGENTS.mdL59
Source excerpt starting at line 59.
59- Distinguish invalid usage from valid empty state. Example: a server session check without request headers is invalid usage; a server session check with headers but no session cookie is a valid request that returns `null`.
Prefer behavioral relationships over changing catalog values
The test guidance contrasts assertions about fixed model names and counts with contracts between data structures. It explains how snapshot-like checks can turn expected catalog updates into maintenance failures.
AGENTS.mdL385–394
Source excerpt starting at line 385.
385A change-detector fails whenever data *expected to change* is updated — model catalogs,386`_config_version`, enumeration counts, hardcoded model lists. It adds no coverage and taxes387every routine update. Don't: `assert "gemini-2.5-pro" in _PROVIDER_MODELS["gemini"]`,388`assert DEFAULT_CONFIG["_config_version"] == 21`, `assert len(models) == 8`. Do: `assert389"gemini" in _PROVIDER_MODELS and len(_PROVIDER_MODELS["gemini"]) >= 1` (plumbing works);390`assert raw["_config_version"] == DEFAULT_CONFIG["_config_version"]` (migration reaches391latest); `assert not (set(moonshot_models) & coding_plan_only_models)` (no leak); every392catalog model has a context-length entry (relationship). If it reads like a snapshot, delete393it; if it reads like a contract between two pieces of data, keep it. Reviewers reject new394change-detectors; authors convert them before re-review.
A parent-node lookup needs an inverted connection map; a child lookup uses the original map. The worked code ties the shared helper to the data structure's indexing direction.
AGENTS.mdL201–202
Source excerpt starting at line 201.
201**Key concept:** `workflow.connections` is indexed by **source node**.202To find parent nodes, use `mapConnectionsByDestination()` to invert it first.