From b9a5a5ea2a425eff1e508f2353e4ac957a213f19 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 31 Jul 2026 11:05:35 +0300 Subject: [PATCH] clarify agent process discipline --- ai/shared.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/ai/shared.md b/ai/shared.md index 97f3e33..00a1273 100644 --- a/ai/shared.md +++ b/ai/shared.md @@ -39,14 +39,39 @@ Use judgment for changes that cannot meaningfully be test-driven, such as documentation-only edits or declarative environment configuration. Validate those changes with the most relevant parser, formatter, dry run, or check. +## Approval discipline + +- Treat dependency installation, tests, static analysis, formatting, linting, + type checking, and builds as routine project operations. Run them without + asking for advance approval when they stay within the requested scope and + sandbox boundaries. +- If an essential operation is blocked by sandbox or network policy, batch the + necessary provisioning or validation into one narrowly scoped approval + request. Prefer a reusable command prefix when it can be safely limited to + the required tool and operation. +- Do not request repeated approvals for commands that fit a previously + approved scope. +- Do not prefix routine commands with per-command cache environment overrides. + Configure cache locations once in Codex, direnv, or the project environment. + Use temporary overrides only to diagnose a cache-specific problem. +- Truly destructive actions, external writes, main-stack control, and + operations outside the workspace still require explicit approval. + ## Running processes - The main checkout owns the canonical stack on the default ports. Assume it is the user's stack. Do not start, restart, or stop it unless the user asks. - A worktree owns its own isolated stack. The flake shell hook assigns a deterministic port offset and creates worktree-local PostgreSQL state. -- Start a worktree stack from its root. For non-interactive use, start it - detached and stop it when finished, as shown below. +- Start a worktree stack only when runtime or integration validation requires + it. Start it once from the worktree root, reuse it throughout validation, + and stop it once when finished. +- Do not start any service for PHPUnit, frontend formatting, linting, type + checking, or production builds. +- When authorized worktree stack control is necessary, operate it directly. + Do not ask the user to start or stop worktree services. +- For non-interactive use, start the stack detached and stop it when finished, + as shown below. - Do not use `process-compose -t=false` for a detached stack. It can leave an orphaned PostgreSQL process holding the data directory. - Non-interactive agent shells do not automatically load direnv. Bare project