diff --git a/AGENTS.md b/AGENTS.md index a56e0a2d28..7c460820fa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,9 +3,19 @@ `agent-device` is a CLI and daemon that automates devices and web targets. The daemon owns sessions. Registry declarations route commands to platform runtimes. +## Worker handoff + +For a delegated task, CI owns validation. +Do not run local gates, check scripts, coverage, or project-wide tests. +If you write a test, run only that test file. +If the task asks you to publish a change, push it. +Report the head SHA with checks pending. +Do not wait for CI. + ## Task routing -Read each applicable row. Follow other links only as needed. +If the task names the owning file, start there. +For each question that remains, use the matching row. | When the task involves | Read | | --- | --- | @@ -13,7 +23,7 @@ Read each applicable row. Follow other links only as needed. | Architecture decisions | `docs/adr/README.md` | | Write or amend an ADR | `docs/adr/FORMAT.md` | | Source, package boundaries, routing, diagnostics, CI | `docs/agents/code-ownership.md` | -| Checks or a failed gate | `docs/agents/testing.md` | +| A CI failure to fix or local validation for maintainers | `docs/agents/testing.md` | | New or changed tests | `docs/agents/test-authoring.md` | | Test audits or deletions | `docs/agents/test-audit.md` | | Mutation experiments or base comparisons | `docs/agents/test-experiments.md` | @@ -23,12 +33,11 @@ Read each applicable row. Follow other links only as needed. | A PR to open or update | `docs/agents/pull-requests.md` | | A change to review | `docs/agents/review.md` | | Trust boundaries, untrusted paths, security review | `docs/agents/security.md` | -| Device-facing changes or manual device verification | `docs/agents/device-verification.md` | +| Apple runner or device-facing changes | `docs/agents/device-verification.md` | | Issues, PRDs, or triage labels | `docs/agents/issue-tracker.md`, `docs/agents/triage-labels.md` | | Web backend setup or diagnostics | `docs/agents/web-backend.md` | -A device-facing change affects live device behavior: dispatch, capture, interaction, app lifecycle, or native execution. -A daemon edit that changes none of these needs no device run. +A device-facing change affects dispatch, capture, interaction, app lifecycle, or native execution. The versioned CLI help owns command semantics. To drive an app, start with the skill's routing card. @@ -45,17 +54,14 @@ The versioned CLI help owns command semantics. To drive an app, start with the s ## Worktree setup -- Use `pnpm`. Use OXC to lint and format. Run `pnpm format` on the full repository. -- In a new worktree, run `pnpm install --frozen-lockfile && pnpm build` before testing. +- Use `pnpm`. Use OXC to format the files you change. +- If a requested reproduction or a permitted test needs setup, prepare only what it needs. - Do not change other worktrees, devices, sessions, dirty files, or experiments. Do not use `git stash`; all worktrees share it. - Do not copy `.env` into a worktree. For host credentials, source the main checkout's file by absolute path. -- Give each parallel worker different files and devices. `pnpm check:affected --run`, `pnpm check`, and heavy `pnpm gate` ids share one lock. +- Give each parallel worker different files and devices. - The layering scan reads only tracked files. Stage new modules before you trust its result. - When you rename a file, move its Fallow baseline entry. Do not regenerate unrelated baselines. -The validation lock reclaims provably dead owners. An unknown owner blocks. -If the wait times out, report the printed owner and lock state. Do not remove the lock manually. - ## Agent docs Write agent docs in ASD-STE100. Write one instruction per sentence. diff --git a/docs/agents/testing.md b/docs/agents/testing.md index 485e2667a9..76e29d6057 100644 --- a/docs/agents/testing.md +++ b/docs/agents/testing.md @@ -1,27 +1,28 @@ # Validate a change +If the task is delegated, follow the worker handoff in AGENTS.md. + ## Run checks 1. During edits, run the focused test or `pnpm check:quick`. -2. Before you push, commit the change. - Run `pnpm check:affected --run --head `. -3. For a broad refactor or an explicitly requested full gate, run `pnpm check`. +2. If the task is not delegated, commit before you push. + Then run `pnpm check:affected --run --head `. +3. For a broad refactor or a requested full gate, run `pnpm check`. Serialized validation requires macOS or Linux. On Windows, use plan mode or focused checks. -Wait for the owner to finish. -Do not add lock wrappers. +Wait for a live owner to finish. +An unknown owner blocks; report it. +Do not add lock wrappers. Do not remove the lock manually. A wait ends after two hours. Focused tests do not lock. Avoid subprocess-heavy tests beside a broad gate. -The runner stops at failure. -Its receipt records refs, checkout state, commands, exits, skips, and results. +The runner stops at failure and writes a receipt. For a plan, run `pnpm check:affected`. For reasons, add `--verbose`. For JSON, run `pnpm --silent check:affected --json`. -With `--run --json`, stdout contains the receipt and stderr contains progress. When head is `HEAD`, planning and execution include working-tree changes. `pnpm check` runs every `localRunnable` catalog check except `vitest-related`. @@ -55,8 +56,8 @@ Never call a failing gate passed. | Evidence | Required action | | --- | --- | -| Failure caused by this change | Fix its owner and rerun. Until a run passes, report failed validation. | -| Suspected host or infrastructure fault | Save the log; compare the same command on the unchanged base without competing tests. Until compared, report cause unproven. | +| Failure from this change | Fix its owner and rerun. Until a run passes, report failed validation. | +| Suspected infrastructure fault | Save the log; compare the same command on the unchanged base without competing tests. Until compared, report cause unproven. | | Matching failure on unchanged base | Report Base-blocked with SHAs, command, and logs. Name the blocker and owner or issue. For authorized publication, use a draft with remaining checks. Do not mark merge-ready. | | Unavailable or inconclusive base comparison | Record the missing evidence and next action. Report blocked with cause unproven. | | Repaired fault or upstream fix | Rerun the failed check and affected gate at head. Require new evidence to change blocked status. |