diff --git a/quest/m0/README.md b/quest/m0/README.md index c6f66c69..b5aeddeb 100644 --- a/quest/m0/README.md +++ b/quest/m0/README.md @@ -81,8 +81,7 @@ ownership-manifest design: 2026-11-01 (user, /quest-plan): `quest init` also rewrites a Quest-written stub nobody edited when its text is out of date. Amended 2026-11-03 (maintainer, /quest-unblock): `quest init` writes no Claude hook entries; - Quest's worktree hooks are a user-level opt-in, see - [user-dev-shell](/quest/m0/user-dev-shell/README.md).) + Quest's worktree hooks are a user-level opt-in.) - The repository's own tool manager pins the version: mise (release binaries) or a nix flake input (any rev, built from source). Quest ships no launcher and no pin file; an install outside either is simply unpinned. diff --git a/quest/m0/user-dev-shell/README.md b/quest/m0/user-dev-shell/README.md deleted file mode 100644 index 360d8d0e..00000000 --- a/quest/m0/user-dev-shell/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# Agents get the dev shell from user settings, not repository config - -## Goal - -Agents in moq-dev's repositories run tools without caring about Nix: each -maintainer's own Claude Code and Codex settings load the repository's dev -shell into every session's commands, so no repository forces direnv, Nix, or -`quest` on its contributors through checked-in hooks. No repository carries a -dev-shell `SessionStart` hook, a Quest worktree hook, or AGENTS.md -instructions to wrap commands in `nix develop`, and `quest init` writes no -hook entries. - -## Plan - -Decided 2026-11-03 (maintainer, /quest-unblock of -[moq-dev/quest#423](https://github.com/moq-dev/quest/pull/423)'s wait to -install `quest` on Claude's `PATH`): - -- Install `quest` on the `PATH` Claude Code starts with? ✅ No (rejected: - `nix profile add github:moq-dev/quest` on every host). -- How should sessions reach a pinned `quest` and the rest of the dev shell? - ✅ A dev-shell hook in the maintainer's own Claude settings (rejected: hook - entries that `nix run` the repository's pinned input, as moq-dev/moq does; - dropping the hooks with no replacement). Reason: "We don't want to force - direnv+nix for other users"; repository config applies to every - contributor. -- Repository-level direnv `SessionStart` hooks in quest, moq, moq.pro, rind, - and rust2? ✅ Remove them from all five once the user-level hook loads the - dev shell (rejected: keep them). -- Quest's worktree hooks? ✅ Drop them from repositories, and `quest init` - stops writing hook entries; the hooks become an opt-in user-level setup - (rejected: this repository and moq only; this repository only; moving them - into the maintainer's settings). - [moq-dev/quest#423](https://github.com/moq-dev/quest/pull/423) is closed. -- Codex? ✅ A user-level Codex `SessionStart` hook does the same capture, and - the repositories' `.codex/` dev-shell hooks go (rejected: Claude only). -- A fresh worktree needs `direnv allow`: direnv keys each approval by the - SHA-256 of the `.envrc`'s absolute path and contents - (`~/.local/share/direnv/allow/`, 1,706 entries on the maintainer's host on - 2026-11-03), so nothing carries over from the main checkout. ✅ The - user-level hook allows a checkout itself when its `.envrc`, `flake.nix`, - and `flake.lock` match the remote's default branch (rejected: whitelisting - `~/work` and `~/worktrees` in `direnv.toml`, which would also evaluate a - fork PR's dev shell; keeping manual allows). A branch that changes them - still needs a manual allow. Amended 2026-11-03 (review of - [moq-dev/quest#458](https://github.com/moq-dev/quest/pull/458)): those - three files alone don't make a checkout reviewed. Any repository's fresh - clone matches its own default branch. A fork PR head can change another - file the dev shell runs, such as moq.pro's `dev/mbx-shim.sh`. Both were - auto-allowed in a reproduction against the merged hook. - Decided 2026-11-03 (maintainer, /quest-complete), after weighing the - risk as narrow: a session rooted at an outside contributor's fork head, - which the guide already says never to run, since agents check untrusted - heads out under `.tmp/` rather than as a session root, and an agent - session in any checkout runs its code anyway. ✅ One cheap guard: the - hook also requires `HEAD` to be on some `origin` branch - (`git for-each-ref --contains HEAD refs/remotes/origin/`), so a fork PR - head is never auto-allowed (rejected: an owner allowlist, a clean tree, - and a tracked `.envrc` on top; matching the whole tree to the merge base; - an owner allowlist alone; leaving it as is). Shipped in - [kixelated/dotfiles#35](https://github.com/kixelated/dotfiles/pull/35) - and live on `desktop` and `nixos2`, where a fresh worktree of moq-dev/moq - still loads and one on an unpushed commit is refused. -- AGENTS.md instructions to run tools through `nix develop`? ✅ Remove them in - all five repositories once the user-level hooks are on every host the - maintainer runs agents on (rejected: this repository only; keeping them as - a fallback). - -The user-level hooks live in [kixelated/dotfiles](https://github.com/kixelated/dotfiles), -installed into each Claude profile's `settings.json` and Codex's user -config, and generalize this repository's `.claude/hooks/direnv.sh` and -moq-dev/moq's `.codex/hooks/direnv.sh`. diff --git a/quest/m0/user-dev-shell/repo-config.md b/quest/m0/user-dev-shell/repo-config.md deleted file mode 100644 index 65e570fc..00000000 --- a/quest/m0/user-dev-shell/repo-config.md +++ /dev/null @@ -1,35 +0,0 @@ -# [S] moq.pro drops its Codex dev-shell config - -## Goal - -moq-dev/moq.pro drops its repo-level Codex dev-shell config, the same as -quest, moq, rind, and rust2 did: `.codex/hooks.json`'s `nix-devshell.sh` -`SessionStart` hook and `pretooluse-devshell.py` `PreToolUse` hook, -`.codex/config.toml`'s repo-local `BASH_ENV`/`ENV`/`ZDOTDIR`, the -`.codex/shell/` files, and their tests and `check.sh` routes. Codex there -still runs the pinned tools, through the maintainer's user-level hooks. - -## Plan - -Decided 2026-11-07 (maintainer): moq.pro drops all of its dev-shell config. -Its Claude direnv hook is already gone. Its Codex config stays until the -Goal's check passes. - -- Keep `.claude/hooks/submodule.sh`, `worktree.sh`, `tofu-secrets.py`, and - `.codex/environments/environment.toml`'s submodule setup. -- Check: in a fresh moq.pro clone with `.codex/` removed and a clean - environment, `codex exec` resolves `which just`. - -Decided 2026-11-08 (maintainer, /quest-unblock): a fresh headless Codex -session in moq.pro couldn't load the dev shell without the repo hooks, since -the flake takes `path:./moq` and nothing initialized that submodule for -`codex exec`. ✅ (a) the user-level `dev-shell-hook` runs -`git submodule update --init` when `.gitmodules` lists an uninitialized path -the flake needs (rejected: (b) keep moq.pro's Codex config for good; (c) -accept a manual submodule init in fresh clones). It also fixes a cold first -Claude session, where the user-level hook ran before moq.pro's -`submodule.sh` and printed no `just`. - -- The hook lives in kixelated/dotfiles (`bin/dev-shell-hook`, documented in - `docs/dev-shell.md`), so this quest's work opens a PR there first, then - the moq.pro PR that drops the Codex config once the Goal's check passes.