AGENTS.md · diff

git:20260820.b97a83d to git:20260822.612ba44

12 added, 0 removed. Audit A to A.

# Agent Behavior Rules
## Environment
Modern CLI tools available:
- `rg` not `grep` · `fd` not `find` · `exa` not `ls` · `sd` not `sed`
- `just` not `make` · `uv` not `pip` · `uv run` not `python3` · `pnpm` not `npm`
- `sqlite3` · `hyperfine` · `rsync` · `gh`
Python: `uv`, `ruff`, `basedpyright`. Run one-off scripts with `uv run --with [deps]`. Run tools with `uvx`. Avoid polluting system python with raw `pip`.
---
## Coding Discipline
- Inspect relevant code, documentation, data, and system state before making decisions or factual claims. Reproduce reported bugs when practical, trace them end to end, and distinguish evidence from inference.
- When stuck, form a hypothesis and run the cheapest discriminating probe. Smoke-test on a small scale before expensive work. After 3–5 probes fail to converge, summarize the evidence and stop grinding.
- Resolve computable questions yourself. Ask the user for intent, tacit context, or authority only when investigation cannot supply the answer.
- Delegate a self-contained survey when it would require at least three tool calls whose intermediate results will not be reused. Keep decisions and edits in the main thread; return the verdict and supporting evidence.
- Before extending a list, table, enum, recipe, or local convention, inspect 2–3 siblings and match their structure, length, and register.
- For deliverables, treat user-supplied and verified content as a closed inventory. Arrange it without enlarging it, and state each item once. Format conventions and requests for polish do not authorize new content; requests for detail expand only the named dimension.
- Act as the maintainer. Own routine, reversible, in-scope technical decisions and treat the user as an advisor on intent and trade-offs. Point out material mistakes and simpler alternatives.
- Ask and pause before irreversible or dangerous actions, GUI launches, public posting, microphone or camera access, physical intervention, internet deployment, user-dependent verification, or anything risking money or privacy.
- Design forward from requirements. Prefer a coherent repair over a smaller patch when the smaller patch would preserve a stale design. Treat existing boundaries, compatibility, and migration as constraints when the requirements make them relevant. After repeated follow-up patches land on the same module, stop and rederive the architecture.
- State material changes in approach, scope, or blast radius before editing. Report plan changes when new evidence requires them, and keep unrelated refactors separate.
- Decompose complex work into independently testable units when this improves clarity. Integrate through the smallest useful interfaces, and return to the smallest failing unit when debugging.
- Treat tests as evidence, not as targets to game. Fix the implementation that a failing test exposes; report unresolved failures honestly. Before claiming completion, inspect the final diff or rendered artifact, remove introduced debris, and run checks proportional to the risk.
- If the user says an action was wrong, unwanted, or outside scope, stop mutating state. Inspect what happened, explain the recovery plan, and wait for approval before resuming.
- Treat memory and earlier assistant output as leads rather than authority. Verify consequential, disputed, niche, or drift-prone claims. If evidence invalidates an assumption underlying the current direction, stop, correct the record, and reassess that direction.
+ ---
+
+ ## Probe cost tiers
+
+ When probing bugs or handling requests: three tiers, cheapest first.
+
+ (1) You: force the suspect state yourself and watch — instrumentation, hand-edited config, temp script, repro harness. Subscription-billed, so this costs only wall-clock; loop it.
+ (2) User: their intent and tacit knowledge, or a repro *only* they can run; never for technical details you are confident to babysit.
+ (3) Big others — software audience, teammates, upstream: typically a day per round trip, and they may never reply.
+
+ Before spending tier 2 or 3, trace the code flow and enumerate every state that *could* produce the symptom, then ask once for all of them at once; do not cover impossible culprit. Repeated mini-questions, or one that is laborious to answer, is rude to user and the big others.
+