fix(warp): fold non-root rules into root AGENTS.md instead of inert .warp/memories - #1870
Merged
Merged
Conversation
…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.
Owner
Author
|
@dyoshikawa Thank you! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Follow-up from #1825 (Warp upstream updates).
Warp reads project rules only from
AGENTS.md(or the back-compatWARP.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 viaAGENTS.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
WarpRuleis now root-only, mirroring the existingDeepagentsRulemodel:getSettablePathsexposes only the root./AGENTS.md(nonRootisundefined), and both root and non-root rules target that single file.fromFilealways reads the rootAGENTS.md.foldDeepagentsNonRootRules→foldNonRootRulesIntoRootRule) and applied it towarp, so non-root rule bodies are merged into the rootAGENTS.mdrather than dropped..warp/rules gitignore entry (Warp rules now live under the shared**/AGENTS.mdentry; the mcp/skills**/.warp/*entries are unchanged) and regenerated.gitignoreviapnpm dev gitignore.WarpRuleunit tests for the root-only behavior.Fact-check notes (other gaps in #1825)
[agents.profiles]) — already implemented inwarp-permissions.ts(added after the issue was filed) and documented infile-formats.md; no action needed..agents/.mcp.jsonMCP location — the canonical.warp/.mcp.jsonremains 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