Skip to content

fix(warp): fold non-root rules into root AGENTS.md instead of inert .warp/memories - #1870

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1825-warp-rules-nonroot
Jun 15, 2026
Merged

fix(warp): fold non-root rules into root AGENTS.md instead of inert .warp/memories#1870
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1825-warp-rules-nonroot

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Background

Follow-up from #1825 (Warp upstream updates).

Warp reads project rules only from AGENTS.md (or the back-compat WARP.md) at the repository root and in project subdirectories — it does not scan a .warp/memories/ directory (confirmed against the current Warp rules docs: precedence is current subdir > root > global, all via AGENTS.md/WARP.md). rulesync was routing every non-root Warp rule to .warp/memories/<name>.md, a path Warp never reads, so that rule content was silently inert.

Changes

  • WarpRule is now root-only, mirroring the existing DeepagentsRule model: getSettablePaths exposes only the root ./AGENTS.md (nonRoot is undefined), and both root and non-root rules target that single file. fromFile always reads the root AGENTS.md.
  • Generalized the RulesProcessor fold helper (foldDeepagentsNonRootRulesfoldNonRootRulesIntoRootRule) and applied it to warp, so non-root rule bodies are merged into the root AGENTS.md rather than dropped.
  • Removed the stale .warp/ rules gitignore entry (Warp rules now live under the shared **/AGENTS.md entry; the mcp/skills **/.warp/* entries are unchanged) and regenerated .gitignore via pnpm dev gitignore.
  • Updated WarpRule unit tests for the root-only behavior.

Fact-check notes (other gaps in #1825)

  • Permissions (settings.toml [agents.profiles]) — already implemented in warp-permissions.ts (added after the issue was filed) and documented in file-formats.md; no action needed.
  • Additional .agents/.mcp.json MCP location — the canonical .warp/.mcp.json remains fully valid, so emitting the extra location stays an explicit low-priority follow-up rather than part of this PR.

All checks pass via pnpm cicheck.

Closes #1825

…warp/memories

Follow-up from #1825 (Warp upstream updates).

Warp reads project rules only from `AGENTS.md` (or back-compat `WARP.md`) at the
repo root and in project subdirectories — it never scans a `.warp/memories/`
directory (verified against Warp's current rules docs). rulesync was routing all
non-root Warp rules to `.warp/memories/<name>.md`, a path Warp does not read, so
that content was silently inert.

- `WarpRule` now mirrors the deepagents model: `getSettablePaths` exposes only the
  root `./AGENTS.md` (no `nonRoot` location), and both root and non-root rules
  target that single file. `fromFile` always reads the root `AGENTS.md`.
- Generalize the RulesProcessor fold helper (`foldNonRootRulesIntoRootRule`,
  formerly deepagents-specific) and apply it to `warp` so non-root rule bodies are
  merged into the root `AGENTS.md` rather than dropped.
- Drop the now-stale `.warp/` rules gitignore entry (warp rules live in the shared
  `AGENTS.md` entry; mcp/skills keep their own `.warp/*` entries) and regenerate
  `.gitignore`.
- Update WarpRule unit tests for the root-only behavior.

Out of scope for this PR:
- Agent permissions (settings.toml `[agents.profiles]`) — already implemented in
  `warp-permissions.ts` after the issue was filed; no action needed.
- Emitting the additional `.agents/.mcp.json` MCP location — the canonical
  `.warp/.mcp.json` remains fully valid, so this stays a low-priority follow-up.

Closes #1825
…sertion

Address review findings on PR #1870:
- Remove the orphaned `**/.warp/` line that the gitignore regenerator left in the
  manually-curated section. Because the entry was dropped from the registry, the
  cleanup pass no longer recognized it as a rulesync entry and preserved it as a
  user line; delete it once so regeneration stays idempotent (verified).
- Replace the `toContain("**/.warp/")` assertion in gitignore.test.ts, which was a
  false positive matching the `**/.warp/.mcp.json` prefix, with line-wise checks
  that the bare rules entry is absent while the mcp/skills entries remain.
@dyoshikawa
dyoshikawa merged commit fcf68d9 into main Jun 15, 2026
8 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1825-warp-rules-nonroot branch June 15, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up Warp upstream updates: agent permissions (settings.toml profiles) and non-standard .warp/memories rules path

2 participants