You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0ba11e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+56-19Lines changed: 56 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Development Rules
2
2
3
-
Agent-facing rules for working on Coven Code. Mirrors and extends `src-rust/.claude/CLAUDE.md`; when the two disagree, the rule closer to the code wins.
3
+
Agent-facing rules for working on Coven Code. `CLAUDE.md` points here; there is no other rules file.
4
4
5
5
## Conversational Style
6
6
@@ -30,7 +30,7 @@ Agent-facing rules for working on Coven Code. Mirrors and extends `src-rust/.cla
30
30
31
31
## Commands
32
32
33
-
Run from `src-rust/` unless noted.
33
+
Run from `src-rust/` unless noted, using the toolchain CI pins (`rustup run 1.100.0 cargo ...`; see Parallel Worktrees).
34
34
35
35
- After Rust changes (not docs): `cargo check --workspace` — fix every error and warning before committing.
36
36
- Clippy: `cargo clippy --workspace --all-targets -- -D warnings`. Fix lints; do not `#[allow(...)]` without justification.
@@ -49,20 +49,22 @@ The ratatui frontend is sensitive to terminal size and key encoding. For repeata
sleep 2 && tmux -L coven-code-mywt capture-pane -t test -p
58
60
59
61
# Drive input
60
-
tmux send-keys -t coven-code-test "your prompt here" Enter
61
-
tmux send-keys -t coven-code-test Escape
62
-
tmux send-keys -t coven-code-test C-o # ctrl+o
62
+
tmux -L coven-code-mywt send-keys -t test"your prompt here" Enter
63
+
tmux -L coven-code-mywt send-keys -t test Escape
64
+
tmux -L coven-code-mywt send-keys -t test C-o # ctrl+o
63
65
64
-
# Cleanup
65
-
tmux kill-session -t coven-code-test
66
+
# Cleanup: only your own server
67
+
tmux -L coven-code-mywt kill-server
66
68
```
67
69
68
70
On Windows hosts, prefer `cargo run -- --print "..."` against the headless path. The Windows console has known quirks with the kitty keyboard protocol — see `crates/tui` for the push/pop workaround.
@@ -127,11 +129,11 @@ Coven Code uses a **single workspace version** stamped across every surface (Car
127
129
128
130
## **CRITICAL** Git Rules for Parallel Agents
129
131
130
-
This repo runs parallel agents in worktrees under `.claude/worktrees/`. Multiple agents may be modifying different files in the same checkout simultaneously. You MUST follow these rules:
132
+
This repo runs parallel agents in worktrees under `.claude/worktrees/` (see Parallel Worktrees). Several agents work in the same clone at once, and a checkout may still be shared, so you MUST follow these rules:
131
133
132
134
### Committing
133
135
134
-
-**ONLY commit files YOU changed in THIS session.**Never commit unless the user has explicitly asked you to commit (see `src-rust/.claude/CLAUDE.md` — the rule is "NEVER EVER commit").
136
+
-**ONLY commit files YOU changed in THIS session.**Commit only when the user has asked you to.
135
137
- ALWAYS include `fixes #<number>` or `closes #<number>` in the commit message when there is a related issue or PR.
136
138
- NEVER use `git add -A` or `git add .` — these sweep up changes from other agents.
137
139
- ALWAYS use `git add <specific-file-paths>` listing only files you modified.
@@ -149,7 +151,8 @@ These can destroy other agents' work:
149
151
-`git stash` — stashes ALL changes including other agents' work
150
152
-`git add -A` / `git add .` — stages other agents' uncommitted work
151
153
-`git commit --no-verify` — bypasses required checks; never allowed
152
-
- Force-push to `main` — never allowed; the patch-release workflow is the only thing that may force-move tags, and it does so via the workflow runner, not from your shell
154
+
-`git rebase` onto `main` — merge `origin/main` instead; rebasing a pushed branch rewrites history other agents and reviewers have fetched
155
+
- Force-push (`--force`, `--force-with-lease`) to any branch — never allowed; the patch-release workflow is the only thing that may force-move tags, and it does so via the workflow runner, not from your shell
153
156
154
157
### Safe Workflow
155
158
@@ -164,15 +167,16 @@ git add docs/providers.md
164
167
# 3. Commit (only when the user has asked)
165
168
git commit -m "feat(api): add foo provider"
166
169
167
-
# 4. Push (pull --rebase if needed, but NEVER reset/checkout)
168
-
git pull --rebase && git push
170
+
# 4. Bring in main by merging (never rebase), then push
- If a conflict touches a file you didn't modify, abort the rebase and ask the user.
175
-
-NEVER force-push.
178
+
- If a conflict touches a file you didn't modify, run `git merge --abort` and ask the user.
179
+
-Never rebase onto `main`; merge `origin/main` instead. Never force-push.
176
180
177
181
### Contributor Attribution
178
182
@@ -187,6 +191,39 @@ Co-authored-by: Name <ID+username@users.noreply.github.com>
187
191
- When a squash-merge collapses a contributor's PR into an internal branch, preserve their `Co-authored-by:` line in the squash commit message.
188
192
- This applies to human contributors only. Do not add trailers or credit lines naming an AI model, assistant, vendor, or coding harness.
189
193
194
+
## Parallel Worktrees
195
+
196
+
Several agents share one host and one clone. Give each change its own worktree, build directory and processes.
197
+
198
+
- One worktree per change, under `.claude/worktrees/`, from `origin/main`. From the clone's top-level directory: `git fetch origin && git worktree add --no-track -b <branch> .claude/worktrees/<name> origin/main`. Never edit the main checkout; another session may have it on its own branch with staged files.
199
+
- One `CARGO_TARGET_DIR` per worktree; never share one. Cargo's fingerprints for workspace path crates do not include the worktree path, so a shared target directory reuses units another branch built, judged by mtime, and you test code that is not in your tree. Each worktree's default `src-rust/target` is separate; a `CARGO_TARGET_DIR` exported globally is how one gets shared by accident.
200
+
- On a shared host set `CARGO_BUILD_JOBS` (for example `4`) and check `uptime` before a build. When the load is high, run the gates on hosted CI instead (below).
201
+
- Toolchain: CI pins `dtolnay/rust-toolchain@1.100.0` in `rust-ci.yml`, `tui-tests.yml` and `release-build.yml` under `.github/workflows/` (there is no `rust-toolchain` file). Run `rustup run 1.100.0 cargo <command>` from `src-rust/` (install it once with `rustup toolchain install 1.100.0 -c clippy -c rustfmt`), and follow the pin when it changes. With a scratch `HOME`, also set `RUSTUP_HOME` and `CARGO_HOME` to your real ones, or rustup cannot find the toolchain.
202
+
- The binary walks up from its working directory and uses the first `.coven-code/settings.json` (or `.jsonc`) it finds (`Settings::find_project_settings`). It skips only its own config home's `settings.json`, and `COVEN_CODE_HOME`, `COVEN_HOME` or `COVEN_PARENT` override that home. A scratch `HOME` with a working directory inside your real home therefore still picks up your real `~/.coven-code/settings.json`. For manual runs, use a scratch `HOME`, unset those three variables, and work from a directory outside your real home with no `.coven-code` above it.
203
+
-`scripts/tui-tests/run.sh` does this itself: it makes a scratch directory under `TMPDIR`, unsets those variables, gives cases 01-07 a scratch `HOME` and working directory (the other cases make theirs under a `TMPDIR` inside it, except on macOS, where a bare `mktemp -d` ignores `TMPDIR`), and refuses to start (exit `2`) when that directory is inside your home or a directory above it holds a `.coven-code`. If it refuses, set `TMPDIR` to a directory outside your home. See `scripts/tui-tests/README.md`.
204
+
- Kill only process IDs you started and recorded (`$!`, a pid file, a tmux server on a socket you named with `-L`). Never `pkill -f` or `killall` by pattern, and never run `tmux kill-server` or `kill-session` without `-L <your socket>`; that kills other agents' tmux servers and builds.
205
+
- Never edit a shell script while it runs. Bash reads a script as it goes, so the running copy executes your edit. Run long scripts from a copy you leave alone.
206
+
207
+
### Reading Hosted Checks
208
+
209
+
- Count only the latest run for each check name on the head SHA. Cancelled duplicates can appear on the same SHA; a later run of the same name supersedes them.
210
+
-`mergeable` reads `null` (and `mergeable_state``unknown`) for up to about two minutes after the PR or `main` moves. Poll again instead of treating it as a conflict.
211
+
- Which workflows run is set by the `pull_request``paths` filters in `.github/workflows/*.yml`:
212
+
213
+
| A PR that touches | Runs |
214
+
| --- | --- |
215
+
|`src-rust/**`| Rust CI (8 check runs) and TUI Tests (2); also Version stamp tests for the workspace `Cargo.toml`/`Cargo.lock`, Viewer tests for `crates/core/src/share_export/**`, Version stamp tests and Release candidate for `crates/acp/registry-template/agent.json`|
216
+
|`scripts/tui-tests/**`| TUI Tests |
217
+
|`install.sh`, `install.ps1`, `scripts/*checksums*`, `scripts/package-release.py`, `patch-release.yml`, `release.yml`, `release-build.yml`| Rust CI, plus the installer or release test workflows that name those files |
218
+
|`.github/workflows/<name>.yml`| that workflow if it has a `pull_request` trigger, plus any other whose `paths` names the file |
219
+
| files under `npm/`, `session/**`, `marketplace/**`| the npm, Viewer or Marketplace tests whose `paths` name them (`npm/package.json` also runs Version stamp tests) |
220
+
|`README.md`, `docs/index.md`, `docs/installation.md`| Version stamp tests |
221
+
| any other `scripts/` file | the workflows whose `paths` name it (several `scripts/*.py` trigger Rust CI); check with `grep -l <file> .github/workflows/*.yml`, and the glob entries such as `scripts/*checksums*`|
222
+
| other docs, `AGENTS.md`, `CLAUDE.md`| none |
223
+
224
+
- Every PR also gets CodeQL code scanning (four `Analyze (...)` jobs and `CodeQL`) and a Vercel status. A `src-rust/` PR therefore shows at least 15 check runs, plus the Vercel status. Recount from the workflow files when they change.
225
+
- Rust CI and TUI Tests also run on `workflow_dispatch`, so `gh workflow run rust-ci.yml --ref <branch>` (or `tui-tests.yml`) runs them on a pushed branch without a PR. Use that for hosted fail-first evidence, or when the local host is too loaded to build.
226
+
190
227
## User Override
191
228
192
229
If the user's instructions conflict with the rules above, ask for confirmation that they want to override the rules. Only then execute their instructions.
Copy file name to clipboardExpand all lines: docs/familiars.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ access = "read-only"
169
169
170
170
`~/.coven/familiars.toml` is **owned by the Coven daemon** when it is running. In that mode coven-code treats the roster as read-only and directs all edits to the daemon.
171
171
172
-
**Standalone mode** (no daemon socket at `~/.coven/coven.sock`) is different: coven-code owns the file and can write it directly.
172
+
**Standalone mode** (no daemon socket at `$COVEN_HOME/coven.sock`, default `~/.coven/coven.sock`) is different: coven-code owns the file and can write it directly.
173
173
174
174
-**First-run bootstrap.** Press **F2** with no familiars configured and coven-code writes a starter `~/.coven/familiars.toml` (a `read-only` guide and a `full`-access builder) and opens the switcher so you have something to pick and a template to edit.
0 commit comments