Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

refactor(memory): rename project memory files from JIUWENCLAW.md to JIUWENSWARM.md

ldstyle8123c6bf82ee5
diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.md
index 6b372f777f..ae1a512403 100644
--- a/docs/en/SlashCommands.md
+++ b/docs/en/SlashCommands.md
@@ -167,10 +167,10 @@ Manages directories AI can access for file read, edit, and execute operations.
### `/init` (Project Initialization)
- Usage: `/init` (no parameters).
-- Function: Initialize project AI collaboration config, generates `JIUWENCLAW.md` and optionally `JIUWENCLAW.local.md`.
+- Function: Initialize project AI collaboration config, generates `JIUWENSWARM.md` and optionally `JIUWENSWARM.local.md`.
- Scope: Only runs in `code` mode.
- Flow:
- 1. Select scope: `Team-shared` (JIUWENCLAW.md), `Personal` (JIUWENCLAW.local.md), or `Both`.
+ 1. Select scope: `Team-shared` (JIUWENSWARM.md), `Personal` (JIUWENSWARM.local.md), or `Both`.
2. Detect existing configs: Auto-detect `CLAUDE.md`, `.cursorrules`, `copilot-instructions.md` etc.
3. Generate configs: Create project config files based on selection.
- Auto mode switch: If in `code.plan`, auto-switches to `code.normal` for write permission.
diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
index 74e37e55f6..d4261e41d0 100644
--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
@@ -167,10 +167,10 @@
### `/init`(项目初始化)
- 用法:`/init`(无参数)。
-- 功能:初始化项目 AI 协作配置,生成 `JIUWENCLAW.md` 和可选的 `JIUWENCLAW.local.md`。
+- 功能:初始化项目 AI 协作配置,生成 `JIUWENSWARM.md` 和可选的 `JIUWENSWARM.local.md`。
- 适用范围:仅在 `code` 模式下运行。
- 流程:
- 1. 选择范围:`团队共享`(JIUWENCLAW.md)、`个人私有`(JIUWENCLAW.local.md)或 `都要`。
+ 1. 选择范围:`团队共享`(JIUWENSWARM.md)、`个人私有`(JIUWENSWARM.local.md)或 `都要`。
2. 检测已有配置:自动检测 `CLAUDE.md`、`.cursorrules`、`copilot-instructions.md` 等文件。
3. 生成配置:根据选择生成项目配置文件。
- 自动模式切换:若当前处于 `code.plan` 模式,会自动切换到 `code.normal` 以便写入文件。
diff --git "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"
index 5b8dd5402a..4afb379649 100644
--- "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"
+++ "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"
@@ -70,7 +70,7 @@
| `/evolve_list` | - | 列出某技能的演进条目 | `/evolve_list myskill --sort score` | `agent.plan` / `team` |
| `/evolve_rebuild` | - | 从归档与演进记录重建 SKILL.md | `/evolve_rebuild myskill 强化错误处理` | `agent.plan` / `team` |
| `/evolve_simplify` | - | 整理、合并某技能的演进经验 | `/evolve_simplify myskill 合并重复经验` | `agent.plan` / `team` |
-| `/init` | - | 在 **Code 模式** 下初始化 `JIUWENCLAW.md` / `JIUWENCLAW.local.md` | `/init` | **仅 `code.*`** |
+| `/init` | - | 在 **Code 模式** 下初始化 `JIUWENSWARM.md` / `JIUWENSWARM.local.md` | `/init` | **仅 `code.*`** |
| `/mcp` | - | 管理 MCP 服务 | `/mcp list`、`/mcp add ...` | 全部 |
| `/mode` | - | 切换或查看模式 | `/mode`、`/mode code` | 全部 |
| `/permissions` | - | 设置 `permissions.tools` 中单工具的 allow/ask/deny | `/permissions ask write_file` | 全部 |
@@ -117,7 +117,7 @@
- 必须在 `code.*` 下执行;否则提示先 `/mode code`。
- 若当前为 `code.plan`,会自动切到 `code.normal` 以便写文件。
- 需能解析工作目录:优先 `trustedDirs[0]`,否则 `process.cwd()`;无法解析时提示先 `/workspace set <path>`。
-- 交互选择范围:团队共享 `JIUWENCLAW.md`、个人 `JIUWENCLAW.local.md` 或两者;然后向后端发送编排提示(`logAsUser: false`)。
+- 交互选择范围:团队共享 `JIUWENSWARM.md`、个人 `JIUWENSWARM.local.md` 或两者;然后向后端发送编排提示(`logAsUser: false`)。
- 详见 [Slash命令表.md](Slash命令表.md) 与源码 `init.ts`。
#### `/diff` 与 `/compact`
@@ -373,7 +373,7 @@
2. **划定可信目录**
` /workspace add .` 或 ` /workspace set /path/to/repo`,确保 Agent 文件工具允许访问你的工程树。
3. **(可选)项目级说明文件**
- 在 `code.*` 下执行 ` /init`,按提示选择团队/个人/两者,生成 `JIUWENCLAW.md` 等;若从 `code.plan` 开始,命令会自动切到 `code.normal` 以便写入。
+ 在 `code.*` 下执行 ` /init`,按提示选择团队/个人/两者,生成 `JIUWENSWARM.md` 等;若从 `code.plan` 开始,命令会自动切到 `code.normal` 以便写入。
4. **日常编码对话**
直接描述需求;模型会通过白名单工具与编码记忆完成任务。
5. **查看本轮改动**
diff --git a/jiuwenswarm/agents/harness/common/memory_rpc.py b/jiuwenswarm/agents/harness/common/memory_rpc.py
index f8cccf625f..5d6c5cc5a1 100644
--- a/jiuwenswarm/agents/harness/common/memory_rpc.py
+++ b/jiuwenswarm/agents/harness/common/memory_rpc.py
@@ -76,7 +76,7 @@ def _validate_edit_path(raw_path: str, workspace: str, project_dir: str | None =
return (True, abs_path)
basename = os.path.basename(abs_path)
- if basename in ("JIUWENCLAW.md", "JIUWENCLAW.local.md"):
+ if basename in ("JIUWENSWARM.md", "JIUWENSWARM.local.md"):
parent = os.path.dirname(abs_path)
workspace_norm = os.path.normpath(workspace)
if parent == workspace_norm:
diff --git a/jiuwenswarm/agents/harness/common/rails/project_memory/files.py b/jiuwenswarm/agents/harness/common/rails/project_memory/files.py
index 2502be9350..d2ecb6d90e 100644
--- a/jiuwenswarm/agents/harness/common/rails/project_memory/files.py
+++ b/jiuwenswarm/agents/harness/common/rails/project_memory/files.py
@@ -57,12 +57,12 @@ PROJECT_ROOT_MARKERS: tuple[str, ...] = (
)
PROJECT_MEMORY_FILES: tuple[tuple[str, str], ...] = (
- ("JIUWENCLAW.md", "project"),
- (".jiuwen/JIUWENCLAW.md", "project"),
+ ("JIUWENSWARM.md", "project"),
+ (".jiuwen/JIUWENSWARM.md", "project"),
)
LOCAL_MEMORY_FILES: tuple[tuple[str, str], ...] = (
- ("JIUWENCLAW.local.md", "local"),
+ ("JIUWENSWARM.local.md", "local"),
)
PROJECT_MEMORY_GLOBS: tuple[str, ...] = (
@@ -70,7 +70,7 @@ PROJECT_MEMORY_GLOBS: tuple[str, ...] = (
)
USER_MEMORY_FILES: tuple[str, ...] = (
- "~/.jiuwen/JIUWENCLAW.md",
+ "~/.jiuwen/JIUWENSWARM.md",
)
USER_MEMORY_GLOBS: tuple[str, ...] = (
@@ -78,7 +78,7 @@ USER_MEMORY_GLOBS: tuple[str, ...] = (
)
MANAGED_MEMORY_FILES: tuple[str, ...] = (
- "/etc/jiuwen/JIUWENCLAW.md",
+ "/etc/jiuwen/JIUWENSWARM.md",
)
MANAGED_MEMORY_GLOBS: tuple[str, ...] = (
diff --git a/jiuwenswarm/agents/harness/common/rails/project_memory_rail.py b/jiuwenswarm/agents/harness/common/rails/project_memory_rail.py
index 35d9925f55..ab5d17abb3 100644
--- a/jiuwenswarm/agents/harness/common/rails/project_memory_rail.py
+++ b/jiuwenswarm/agents/harness/common/rails/project_memory_rail.py
@@ -36,13 +36,13 @@ if TYPE_CHECKING:
class ProjectMemoryRail(DeepAgentRail):
"""Auto-load project memory files and inject them into the system prompt.
- Loaded sources (all read-only; only ``JIUWENCLAW.md`` and
- ``JIUWENCLAW.local.md`` are written by ``/init``):
+ Loaded sources (all read-only; only ``JIUWENSWARM.md`` and
+ ``JIUWENSWARM.local.md`` are written by ``/init``):
- * **Project root**: ``JIUWENCLAW.md``, ``JIUWENCLAW.local.md``,
- ``.jiuwen/JIUWENCLAW.md``, ``.jiuwen/rules/*.md``
- * **User level**: ``~/.jiuwen/JIUWENCLAW.md``, ``~/.jiuwen/rules/*.md``
- * **Managed**: ``/etc/jiuwen/JIUWENCLAW.md``, ``/etc/jiuwen/rules/*.md``
+ * **Project root**: ``JIUWENSWARM.md``, ``JIUWENSWARM.local.md``,
+ ``.jiuwen/JIUWENSWARM.md``, ``.jiuwen/rules/*.md``
+ * **User level**: ``~/.jiuwen/JIUWENSWARM.md``, ``~/.jiuwen/rules/*.md``
+ * **Managed**: ``/etc/jiuwen/JIUWENSWARM.md``, ``/etc/jiuwen/rules/*.md``
* **Additional dirs**: explicit project-memory directories passed to the rail
Priority (low -> high): ``managed < user < project (root -> cwd) < local``.
@@ -128,7 +128,7 @@ class ProjectMemoryRail(DeepAgentRail):
Called by the adapter when ``trusted_dirs`` arrives from the client,
ensuring the rail always searches the directory where /init wrote
- JIUWENCLAW.md (typically the CLI process's cwd, which differs from
+ JIUWENSWARM.md (typically the CLI process's cwd, which differs from
the AgentServer process cwd).
"""
extra = tuple(dirs or ())
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.prompts.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.prompts.ts
index 11caa77a07..529631b675 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.prompts.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.prompts.ts
@@ -3,8 +3,8 @@ import type { CommandContext } from "../types.js";
export type ScopeKey = "project" | "personal" | "both";
export interface ExistingFiles {
- jiuwenclawMd: boolean;
- jiuwenclawLocalMd: boolean;
+ jiuwenswarmMd: boolean;
+ jiuwenswarmLocalMd: boolean;
claudeMd: boolean;
claudeLocalMd: boolean;
agentsMd: boolean;
@@ -45,7 +45,7 @@ export function buildInitPrompt(args: BuildInitPromptArgs): string {
function buildInitPromptEn({ rootDir, scopeKey, existing }: BuildInitPromptArgs): string {
const scopeLine = SCOPE_DESCRIPTION_EN[scopeKey];
- return `Set up a minimal JIUWENCLAW.md (team-shared) and optionally JIUWENCLAW.local.md (personal) for this repository.
+ return `Set up a minimal JIUWENSWARM.md (team-shared) and optionally JIUWENSWARM.local.md (personal) for this repository.
These files are auto-loaded into every coding-mode session by ProjectMemoryRail, so they must be CONCISE — only include what the assistant would get wrong without them.
@@ -55,8 +55,8 @@ These files are auto-loaded into every coding-mode session by ProjectMemoryRail,
Never use relative paths. When writing or editing, always construct \`${rootDir}/<filename>\`.
2. **Do NOT use the \`coding_memory_read\` / \`coding_memory_write\` / \`coding_memory_edit\` tools in this command.** Those are for session-level auto-memory, a different system. /init produces static project documents via the file write tools only.
3. **Existing files pre-detected in workspace root**:
- - JIUWENCLAW.md: ${yesNo(existing.jiuwenclawMd)} ${existing.jiuwenclawMd ? "— you MUST read it first, propose a diff, then use `ask_user` with `questions` to ask the user whether to apply. Example: `ask_user(query='Update JIUWENCLAW.md?', questions=[{question: 'JIUWENCLAW.md already exists. What would you like to do?', header: 'Update', options: [{label: 'Apply update', description: 'Merge the proposed changes into the existing file'}, {label: 'Skip (keep current)', description: 'Leave the file unchanged and continue'}], multi_select: false}])`. If user chooses 'Apply update', use Edit to apply the diff; if 'Skip', leave the file unchanged and continue. NEVER silently overwrite." : ""}
- - JIUWENCLAW.local.md: ${yesNo(existing.jiuwenclawLocalMd)} ${existing.jiuwenclawLocalMd ? "— propose additions via Edit only, never overwrite." : ""}
+ - JIUWENSWARM.md: ${yesNo(existing.jiuwenswarmMd)} ${existing.jiuwenswarmMd ? "— you MUST read it first, propose a diff, then use `ask_user` with `questions` to ask the user whether to apply. Example: `ask_user(query='Update JIUWENSWARM.md?', questions=[{question: 'JIUWENSWARM.md already exists. What would you like to do?', header: 'Update', options: [{label: 'Apply update', description: 'Merge the proposed changes into the existing file'}, {label: 'Skip (keep current)', description: 'Leave the file unchanged and continue'}], multi_select: false}])`. If user chooses 'Apply update', use Edit to apply the diff; if 'Skip', leave the file unchanged and continue. NEVER silently overwrite." : ""}
+ - JIUWENSWARM.local.md: ${yesNo(existing.jiuwenswarmLocalMd)} ${existing.jiuwenswarmLocalMd ? "— propose additions via Edit only, never overwrite." : ""}
- Legacy reference files (do NOT delete or rewrite; you may link to them): CLAUDE.md=${yesNo(existing.claudeMd)}, CLAUDE.local.md=${yesNo(existing.claudeLocalMd)}, AGENTS.md=${yesNo(existing.agentsMd)}, OPENJIUWEN.md=${yesNo(existing.openjiuwenMd)}, .cursorrules=${yesNo(existing.cursorRules)}, .github/copilot-instructions.md=${yesNo(existing.copilotInstructions)}
4. **When the explore sub-agent runs bash commands**, always prefix with \`cd ${rootDir} && ...\` or use \`git -C ${rootDir}\` — sub-agent CWD is not guaranteed to equal \`${rootDir}\`.
5. **Always prefer \`task_tool\` with \`subagent_type: "explore_agent"\` when it is available.** If \`task_tool\` is unavailable for this turn, silently FALL BACK to \`glob\` / \`grep\` / \`read_file\` / \`bash\` yourself.
@@ -77,7 +77,7 @@ task_description: |
- Manifests: package.json, Cargo.toml, pyproject.toml, go.mod, pom.xml, build.gradle*, setup.py
- Docs: README.*, CONTRIBUTING.*, ARCHITECTURE.*, docs/
- Build/CI: Makefile, justfile, .github/workflows/*, .gitlab-ci.yml, azure-pipelines.yml
- - AI tool configs: JIUWENCLAW.md, CLAUDE.md, AGENTS.md, OPENJIUWEN.md,
+ - AI tool configs: JIUWENSWARM.md, CLAUDE.md, AGENTS.md, OPENJIUWEN.md,
.jiuwen/rules/*, .claude/rules/*, .cursor/rules/*,
.cursorrules, .github/copilot-instructions.md,
.windsurfrules, .clinerules, .mcp.json
@@ -126,19 +126,19 @@ For scope \`project\` / \`both\`: ask about team practices —
For scope \`personal\` / \`both\`: ask about the user —
role, familiarity with this codebase, sandbox URLs / accounts, communication preferences, specific tooling setup on their machine.
-**Synthesize a proposal** combining Step 2 findings and Step 3 answers. Because skills and hooks are outside the current scope, ALL items become JIUWENCLAW.md notes (team) or JIUWENCLAW.local.md notes (personal). Present as a plain-text list, one line per item, grouped by target file. Ask for confirmation before proceeding.
+**Synthesize a proposal** combining Step 2 findings and Step 3 answers. Because skills and hooks are outside the current scope, ALL items become JIUWENSWARM.md notes (team) or JIUWENSWARM.local.md notes (personal). Present as a plain-text list, one line per item, grouped by target file. Ask for confirmation before proceeding.
**Build the preference queue** from the accepted proposal:
-\`[{type: "note", target: "JIUWENCLAW.md" | "JIUWENCLAW.local.md", content: "..."}]\`
+\`[{type: "note", target: "JIUWENSWARM.md" | "JIUWENSWARM.local.md", content: "..."}]\`
Steps 4–5 consume this queue.
-## Step 4: Write JIUWENCLAW.md (if scope is project or both)
+## Step 4: Write JIUWENSWARM.md (if scope is project or both)
-Target: \`${rootDir}/JIUWENCLAW.md\`
+Target: \`${rootDir}/JIUWENSWARM.md\`
-${existing.jiuwenclawMd ? "File EXISTS — read it, propose a merged diff, use `ask_user` with `questions` to get user confirmation (options: 'Apply update' / 'Skip (keep current)'), then apply via Edit if confirmed. DO NOT use Write to overwrite silently." : "File is absent — use Write to create it."}
+${existing.jiuwenswarmMd ? "File EXISTS — read it, propose a merged diff, use `ask_user` with `questions` to get user confirmation (options: 'Apply update' / 'Skip (keep current)'), then apply via Edit if confirmed. DO NOT use Write to overwrite silently." : "File is absent — use Write to create it."}
-Consume queue entries whose \`target == "JIUWENCLAW.md"\`.
+Consume queue entries whose \`target == "JIUWENSWARM.md"\`.
**Content test**: for each candidate line, ask "Would removing this cause the assistant to make mistakes?" If no, cut.
@@ -168,22 +168,22 @@ Consume queue entries whose \`target == "JIUWENCLAW.md"\`.
**Prefix** the file with:
\`\`\`
-# JIUWENCLAW.md
+# JIUWENSWARM.md
-This file provides guidance to JiuwenClaw (and any compatible AI coding assistant) when working with code in this repository.
+This file provides guidance to JiuwenSwarm (and any compatible AI coding assistant) when working with code in this repository.
\`\`\`
-For monorepos: mention that subdirectory \`JIUWENCLAW.md\` is supported — ProjectMemoryRail walks up from cwd, so per-package docs are welcome.
+For monorepos: mention that subdirectory \`JIUWENSWARM.md\` is supported — ProjectMemoryRail walks up from cwd, so per-package docs are welcome.
For rule organization at team scale: suggest creating \`.jiuwen/rules/<topic>.md\` — these are auto-scanned, and may use frontmatter \`paths:\` to scope rules by the current working subtree / workspace.
-## Step 5: Write JIUWENCLAW.local.md (if scope is personal or both)
+## Step 5: Write JIUWENSWARM.local.md (if scope is personal or both)
-Target: \`${rootDir}/JIUWENCLAW.local.md\`
+Target: \`${rootDir}/JIUWENSWARM.local.md\`
-${existing.jiuwenclawLocalMd ? "File EXISTS — propose additions via Edit, never overwrite." : "File is absent — use Write to create it."}
+${existing.jiuwenswarmLocalMd ? "File EXISTS — propose additions via Edit, never overwrite." : "File is absent — use Write to create it."}
-Consume queue entries whose \`target == "JIUWENCLAW.local.md"\`.
+Consume queue entries whose \`target == "JIUWENSWARM.local.md"\`.
Include: user's role, familiarity, personal URLs / accounts, communication preferences, tool setup specific to the user's machine.
@@ -191,7 +191,7 @@ Include: user's role, familiarity, personal URLs / accounts, communication prefe
1. Read \`.gitignore\` if it exists (use absolute path).
2. Check whether each of the two lines below is already present (exact line match).
3. Append only the missing ones:
- - \`JIUWENCLAW.local.md\`
+ - \`JIUWENSWARM.local.md\`
- \`.jiuwen/settings.local.json\`
4. If \`.gitignore\` does not exist, create it with those two lines.
@@ -207,7 +207,7 @@ Remind the user:
Then suggest optimizations as a short checklist, only those relevant to this repo:
- If tests are missing / sparse: suggest setting up a framework so the assistant can verify its own changes.
- If no formatter / lint config was found: suggest adding one with a one-line reason.
-- If Step 2 found legacy AI config files (CLAUDE.md, AGENTS.md, etc.) not referenced in JIUWENCLAW.md: suggest consolidating via plain links or follow-up cleanup.
+- If Step 2 found legacy AI config files (CLAUDE.md, AGENTS.md, etc.) not referenced in JIUWENSWARM.md: suggest consolidating via plain links or follow-up cleanup.
- **Always include**: "Run \`/compact\` after reviewing to trim this init session from history."
`;
}
@@ -218,7 +218,7 @@ Then suggest optimizations as a short checklist, only those relevant to this rep
function buildInitPromptZh({ rootDir, scopeKey, existing }: BuildInitPromptArgs): string {
const scopeLine = SCOPE_DESCRIPTION_ZH[scopeKey];
- return `为本仓库生成一份最小可用的 JIUWENCLAW.md(团队共享)与可选的 JIUWENCLAW.local.md(个人私有)。
+ return `为本仓库生成一份最小可用的 JIUWENSWARM.md(团队共享)与可选的 JIUWENSWARM.local.md(个人私有)。
这些文件会被 ProjectMemoryRail 自动注入到每一轮 coding 模式会话的 system prompt,因此必须**精简** —— 只写"不写就会出错"的信息。
## 关键约束(必读,不可违反)
@@ -227,8 +227,8 @@ function buildInitPromptZh({ rootDir, scopeKey, existing }: BuildInitPromptArgs)
永远不要用相对路径。写入或编辑时总是构造 \`${rootDir}/<文件名>\`。
2. **禁止使用 \`coding_memory_read\` / \`coding_memory_write\` / \`coding_memory_edit\` 工具。** 那是会话级自动记忆,和 /init 是两套系统。/init 只通过文件写入工具产出静态项目文档。
3. **工作区根目录现有文件(已预探测)**:
- - JIUWENCLAW.md:${yesNoZh(existing.jiuwenclawMd)} ${existing.jiuwenclawMd ? "—— 必须先读取、生成 diff,然后用 \`ask_user\` 的 \`questions\` 参数让用户选择。示例:\`ask_user(query='更新 JIUWENCLAW.md?', questions=[{question: 'JIUWENCLAW.md 已存在,你想怎么处理?', header: '更新', options: [{label: '应用更新', description: '把提议的变更合并到现有文件'}, {label: '跳过(保留当前)', description: '保持文件不变,继续后续步骤'}], multi_select: false}])\`。若用户选「应用更新」,用 Edit 执行 diff;若选「跳过」,保持文件不变继续。严禁静默覆盖。" : ""}
- - JIUWENCLAW.local.md:${yesNoZh(existing.jiuwenclawLocalMd)} ${existing.jiuwenclawLocalMd ? "— 只能通过 Edit 追加,不要覆盖。" : ""}
+ - JIUWENSWARM.md:${yesNoZh(existing.jiuwenswarmMd)} ${existing.jiuwenswarmMd ? "—— 必须先读取、生成 diff,然后用 \`ask_user\` 的 \`questions\` 参数让用户选择。示例:\`ask_user(query='更新 JIUWENSWARM.md?', questions=[{question: 'JIUWENSWARM.md 已存在,你想怎么处理?', header: '更新', options: [{label: '应用更新', description: '把提议的变更合并到现有文件'}, {label: '跳过(保留当前)', description: '保持文件不变,继续后续步骤'}], multi_select: false}])\`。若用户选「应用更新」,用 Edit 执行 diff;若选「跳过」,保持文件不变继续。严禁静默覆盖。" : ""}
+ - JIUWENSWARM.local.md:${yesNoZh(existing.jiuwenswarmLocalMd)} ${existing.jiuwenswarmLocalMd ? "— 只能通过 Edit 追加,不要覆盖。" : ""}
- 遗留参考文件(不要删改,可用 markdown 链接引用):CLAUDE.md=${yesNoZh(existing.claudeMd)}, CLAUDE.local.md=${yesNoZh(existing.claudeLocalMd)}, AGENTS.md=${yesNoZh(existing.agentsMd)}, OPENJIUWEN.md=${yesNoZh(existing.openjiuwenMd)}, .cursorrules=${yesNoZh(existing.cursorRules)}, .github/copilot-instructions.md=${yesNoZh(existing.copilotInstructions)}
4. **子代理 bash 命令必须加前缀**:\`cd ${rootDir} && ...\` 或用 \`git -C ${rootDir}\`,因为子代理的 CWD 不保证等于 \`${rootDir}\`。
5. **只要可用,始终优先使用 \`task_tool\` 且 \`subagent_type: "explore_agent"\`。** 若本轮工具列表里没有 \`task_tool\`,就静默降级为用 \`glob\` / \`grep\` / \`read_file\` / \`bash\` 自行探索。
@@ -249,7 +249,7 @@ task_description: |
- 清单:package.json, Cargo.toml, pyproject.toml, go.mod, pom.xml, build.gradle*, setup.py
- 文档:README.*, CONTRIBUTING.*, ARCHITECTURE.*, docs/
- 构建/CI:Makefile, justfile, .github/workflows/*, .gitlab-ci.yml, azure-pipelines.yml
- - AI 配置:JIUWENCLAW.md, CLAUDE.md, AGENTS.md, OPENJIUWEN.md,
+ - AI 配置:JIUWENSWARM.md, CLAUDE.md, AGENTS.md, OPENJIUWEN.md,
.jiuwen/rules/*, .claude/rules/*, .cursor/rules/*,
.cursorrules, .github/copilot-instructions.md,
.windsurfrules, .clinerules, .mcp.json
@@ -297,19 +297,19 @@ ask_user(
对 \`personal\` / \`both\` 范围:询问用户 —
角色、对本仓库的熟悉度、沙箱 URL / 账号、沟通偏好、本机工具链特殊设置。
-**合成提案**:把步骤 2 的发现和步骤 3 的回答整合。当前方案不支持 Skills 和 Hooks,所有条目一律归为 JIUWENCLAW.md(团队)或 JIUWENCLAW.local.md(个人)的记录项。用纯文本列表呈现,按目标文件分组。请求用户确认后再写文件。
+**合成提案**:把步骤 2 的发现和步骤 3 的回答整合。当前方案不支持 Skills 和 Hooks,所有条目一律归为 JIUWENSWARM.md(团队)或 JIUWENSWARM.local.md(个人)的记录项。用纯文本列表呈现,按目标文件分组。请求用户确认后再写文件。
**构造偏好队列**:
-\`[{type: "note", target: "JIUWENCLAW.md" | "JIUWENCLAW.local.md", content: "..."}]\`
+\`[{type: "note", target: "JIUWENSWARM.md" | "JIUWENSWARM.local.md", content: "..."}]\`
后续写文件步骤会消费此队列。
-## 步骤 4:写 JIUWENCLAW.md(当范围是 project 或 both)
+## 步骤 4:写 JIUWENSWARM.md(当范围是 project 或 both)
-目标:\`${rootDir}/JIUWENCLAW.md\`
+目标:\`${rootDir}/JIUWENSWARM.md\`
-${existing.jiuwenclawMd ? "文件已存在 —— 先读取,生成合并 diff,用 \`ask_user\` 的 \`questions\` 参数获取用户确认(选项:「应用更新」 / 「跳过(保留当前)」),确认后用 Edit 应用。绝不要用 Write 静默覆盖。" : "文件不存在 —— 用 Write 创建。"}
+${existing.jiuwenswarmMd ? "文件已存在 —— 先读取,生成合并 diff,用 \`ask_user\` 的 \`questions\` 参数获取用户确认(选项:「应用更新」 / 「跳过(保留当前)」),确认后用 Edit 应用。绝不要用 Write 静默覆盖。" : "文件不存在 —— 用 Write 创建。"}
-消费队列中 \`target == "JIUWENCLAW.md"\` 的条目。
+消费队列中 \`target == "JIUWENSWARM.md"\` 的条目。
**内容筛选测试**:对每行候选,自问"去掉这行会不会让助手犯错?" 不会就删掉。
@@ -339,22 +339,22 @@ ${existing.jiuwenclawMd ? "文件已存在 —— 先读取,生成合并 diff
**文件开头**统一加:
\`\`\`
-# JIUWENCLAW.md
+# JIUWENSWARM.md
-This file provides guidance to JiuwenClaw (and any compatible AI coding assistant) when working with code in this repository.
+This file provides guidance to JiuwenSwarm (and any compatible AI coding assistant) when working with code in this repository.
\`\`\`
-对 monorepo:说明支持子目录放独立的 \`JIUWENCLAW.md\` —— ProjectMemoryRail 从 cwd 向上遍历加载。
+对 monorepo:说明支持子目录放独立的 \`JIUWENSWARM.md\` —— ProjectMemoryRail 从 cwd 向上遍历加载。
对团队规模较大的项目:建议把按主题拆分的规则放到 \`.jiuwen/rules/<topic>.md\` —— 当前运行时会自动加载这些规则,并支持用 \`paths:\` frontmatter 按当前工作目录 / workspace 所在子树限定作用域。
-## 步骤 5:写 JIUWENCLAW.local.md(当范围是 personal 或 both)
+## 步骤 5:写 JIUWENSWARM.local.md(当范围是 personal 或 both)
-目标:\`${rootDir}/JIUWENCLAW.local.md\`
+目标:\`${rootDir}/JIUWENSWARM.local.md\`
-${existing.jiuwenclawLocalMd ? "文件已存在 —— 通过 Edit 追加内容,不要覆盖。" : "文件不存在 —— 用 Write 创建。"}
+${existing.jiuwenswarmLocalMd ? "文件已存在 —— 通过 Edit 追加内容,不要覆盖。" : "文件不存在 —— 用 Write 创建。"}
-消费队列中 \`target == "JIUWENCLAW.local.md"\` 的条目。
+消费队列中 \`target == "JIUWENSWARM.local.md"\` 的条目。
包含:用户的角色、对仓库的熟悉程度、个人 URL / 账号、沟通偏好、本机特有工具链配置。
@@ -362,7 +362,7 @@ ${existing.jiuwenclawLocalMd ? "文件已存在 —— 通过 Edit 追加内容
1. 若 \`.gitignore\` 存在先读取(用绝对路径);
2. 检查下面两行是否已存在(整行精确匹配);
3. 仅追加缺失的:
- - \`JIUWENCLAW.local.md\`
+ - \`JIUWENSWARM.local.md\`
- \`.jiuwen/settings.local.json\`
4. 若 \`.gitignore\` 不存在,就创建并写入这两行。
@@ -378,7 +378,7 @@ ${existing.jiuwenclawLocalMd ? "文件已存在 —— 通过 Edit 追加内容
然后给一个短清单(只写与当前仓库相关的):
- 若测试缺失 / 稀疏:建议引入测试框架,助手才能自证修改。
- 若没有 formatter / lint 配置:建议添加,并说明一行理由。
-- 若步骤 2 发现了 JIUWENCLAW.md 中未引用的遗留 AI 配置文件(CLAUDE.md、AGENTS.md 等):建议以普通链接方式提示用户后续合并。
+- 若步骤 2 发现了 JIUWENSWARM.md 中未引用的遗留 AI 配置文件(CLAUDE.md、AGENTS.md 等):建议以普通链接方式提示用户后续合并。
- **总是包含**:"检查完后运行 \`/compact\` 可把这段初始化会话从历史中精简掉。"
`;
}
@@ -388,14 +388,14 @@ ${existing.jiuwenclawLocalMd ? "文件已存在 —— 通过 Edit 追加内容
// ---------------------------------------------------------------------------
const SCOPE_DESCRIPTION_EN: Record<ScopeKey, string> = {
- project: "write only JIUWENCLAW.md (run Step 4).",
- personal: "write only JIUWENCLAW.local.md (run Step 5).",
+ project: "write only JIUWENSWARM.md (run Step 4).",
+ personal: "write only JIUWENSWARM.local.md (run Step 5).",
both: "write both files (run Step 4 and Step 5).",
};
const SCOPE_DESCRIPTION_ZH: Record<ScopeKey, string> = {
- project: "只写 JIUWENCLAW.md(执行步骤 4)。",
- personal: "只写 JIUWENCLAW.local.md(执行步骤 5)。",
+ project: "只写 JIUWENSWARM.md(执行步骤 4)。",
+ personal: "只写 JIUWENSWARM.local.md(执行步骤 5)。",
both: "两份都写(步骤 4 和步骤 5 都执行)。",
};
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.ts
index 99ad994d86..afaf6539ae 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/init.ts
@@ -25,13 +25,13 @@ function getScopeOptions(lang: "zh" | "en"): ScopeOption[] {
return [
{
key: "project",
- label: "团队共享 (JIUWENCLAW.md)",
+ label: "团队共享 (JIUWENSWARM.md)",
description:
"签入版本库,供团队共用 —— 架构说明、编码规范、常用命令、CI 约定等。",
},
{
key: "personal",
- label: "个人私有 (JIUWENCLAW.local.md)",
+ label: "个人私有 (JIUWENSWARM.local.md)",
description:
"只属于你自己,加入 .gitignore —— 个人偏好、沙箱地址、私有凭据、工作习惯。",
},
@@ -45,13 +45,13 @@ function getScopeOptions(lang: "zh" | "en"): ScopeOption[] {
return [
{
key: "project",
- label: "Team-shared (JIUWENCLAW.md)",
+ label: "Team-shared (JIUWENSWARM.md)",
description:
"Checked into source control — architecture, coding standards, common commands, CI conventions.",
},
{
key: "personal",
- label: "Personal (JIUWENCLAW.local.md)",
+ label: "Personal (JIUWENSWARM.local.md)",
description:
"Private to you, gitignored — preferences, sandbox URLs, credentials, workflow quirks.",
},
@@ -71,7 +71,7 @@ export function createInitCommand(): SlashCommand {
return {
name: "init",
description:
- "Initialize project AI collaboration config (generates JIUWENCLAW.md, optionally JIUWENCLAW.local.md)",
+ "Initialize project AI collaboration config (generates JIUWENSWARM.md, optionally JIUWENSWARM.local.md)",
usage: "/init",
example: "/init",
kind: CommandKind.BUILT_IN,
@@ -139,8 +139,8 @@ export function createInitCommand(): SlashCommand {
header: language === "zh" ? "范围" : "Scope",
question:
language === "zh"
- ? "要设置哪些 JIUWENCLAW 文件?"
- : "Which JIUWENCLAW files would you like to set up?",
+ ? "要设置哪些 JIUWENSWARM 文件?"
+ : "Which JIUWENSWARM files would you like to set up?",
options: scopeOptions.map((o) => ({
label: o.label,
description: o.description,
@@ -178,8 +178,8 @@ export function createInitCommand(): SlashCommand {
// ---- Pre-detect existing memory / legacy AI config files ----
const existing: ExistingFiles = {
- jiuwenclawMd: existsSync(join(rootDir, "JIUWENCLAW.md")),
- jiuwenclawLocalMd: existsSync(join(rootDir, "JIUWENCLAW.local.md")),
+ jiuwenswarmMd: existsSync(join(rootDir, "JIUWENSWARM.md")),
+ jiuwenswarmLocalMd: existsSync(join(rootDir, "JIUWENSWARM.local.md")),
claudeMd: existsSync(join(rootDir, "CLAUDE.md")),
claudeLocalMd: existsSync(join(rootDir, "CLAUDE.local.md")),
agentsMd: existsSync(join(rootDir, "AGENTS.md")),
diff --git a/jiuwenswarm/server/agent_ws_server.py b/jiuwenswarm/server/agent_ws_server.py
index bf1a8e2daf..ce94a25d6e 100644
--- a/jiuwenswarm/server/agent_ws_server.py
+++ b/jiuwenswarm/server/agent_ws_server.py
@@ -3303,7 +3303,7 @@ class AgentWebSocketServer:
settings_sources.append(config_path)
# Memory diagnostics — use the actual workspace dir (trusted_dir or cwd),
- # same as ProjectMemoryRail, so we detect JIUWENCLAW.md where /init creates it.
+ # same as ProjectMemoryRail, so we detect JIUWESWARM.md where /init creates it.
params = request.params or {}
workspace_dir = str(params.get("cwd", "") or os.getcwd())
trusted_dirs = params.get("trusted_dirs")
diff --git a/jiuwenswarm/server/runtime/agent_adapter/interface_code.py b/jiuwenswarm/server/runtime/agent_adapter/interface_code.py
index bd82301448..c9b12e8f9b 100644
--- a/jiuwenswarm/server/runtime/agent_adapter/interface_code.py
+++ b/jiuwenswarm/server/runtime/agent_adapter/interface_code.py
@@ -466,10 +466,10 @@ class JiuwenClawCodeAdapter(JiuWenClawDeepAdapter):
return None
def _build_project_memory_rail(self) -> ProjectMemoryRail | None:
- """Build ProjectMemoryRail to auto-load JIUWENCLAW.md / CLAUDE.md etc.
+ """Build ProjectMemoryRail to auto-load JIUWENSWARM.md / CLAUDE.md etc.
Code 模式专属 — 始终挂载。
- 确保能检索到 /init 命令创建 JIUWENCLAW.md 的目录(当前工作目录)。
+ 确保能检索到 /init 命令创建 JIUWENSWARM.md 的目录(当前工作目录)。
"""
try:
workspace = self._project_dir or self._workspace_dir or "./"
@@ -762,7 +762,7 @@ class JiuwenClawCodeAdapter(JiuWenClawDeepAdapter):
if self._project_memory_rail is not None:
self._project_memory_rail.set_language(resolved_language)
# trusted_dirs 来自 CLI 端的 trusted_dirs / workspace-dir,
- # 包含用户项目目录(即 /init 写 JIUWENCLAW.md 的目录)
+ # 包含用户项目目录(即 /init 写 JIUWENSWARM.md 的目录)
if runtime_config.trusted_dirs:
self._project_memory_rail.set_additional_directories(
runtime_config.trusted_dirs,
diff --git a/tests/system_tests/test_project_memory.py b/tests/system_tests/test_project_memory.py
index aae223c426..100d968273 100644
--- a/tests/system_tests/test_project_memory.py
+++ b/tests/system_tests/test_project_memory.py
@@ -81,7 +81,7 @@ class TestProjectMemoryRailEndToEnd:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "# test\nPROJECT-RULE-1\n")
+ _touch(root, "JIUWENSWARM.md", "# test\nPROJECT-RULE-1\n")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -100,7 +100,7 @@ class TestProjectMemoryRailEndToEnd:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "VERSION-1")
+ _touch(root, "JIUWENSWARM.md", "VERSION-1")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -109,7 +109,7 @@ class TestProjectMemoryRailEndToEnd:
body1 = agent.system_prompt_builder.added_sections[-1].content["en"]
assert "VERSION-1" in body1
- _touch(root, "JIUWENCLAW.md", "VERSION-2")
+ _touch(root, "JIUWENSWARM.md", "VERSION-2")
clear_project_memory_cache(str(root))
await rail.before_model_call(ctx=MagicMock())
body2 = agent.system_prompt_builder.added_sections[-1].content["en"]
@@ -121,7 +121,7 @@ class TestProjectMemoryRailEndToEnd:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "BEFORE-UNINIT")
+ _touch(root, "JIUWENSWARM.md", "BEFORE-UNINIT")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -161,7 +161,7 @@ class TestProjectMemoryRailEndToEnd:
root = Path(td)
extra = Path(extra_td)
_touch(root, ".git/HEAD", "")
- _touch(extra, "JIUWENCLAW.md", "EXTRA-PROJECT-RULE")
+ _touch(extra, "JIUWENSWARM.md", "EXTRA-PROJECT-RULE")
monkeypatch.setenv("JIUWENSWARM_ADDITIONAL_DIRECTORIES", str(extra))
clear_project_memory_cache()
@@ -190,7 +190,7 @@ class TestProjectMemoryFileDiscovery:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "DISCOVERY-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "DISCOVERY-CONTENT")
files = discover_and_load_memory_files(workspace=str(root))
assert any("DISCOVERY-CONTENT" in f.content for f in files)
@@ -199,7 +199,7 @@ class TestProjectMemoryFileDiscovery:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "ROOT-RULE")
+ _touch(root, "JIUWENSWARM.md", "ROOT-RULE")
sub = root / "src" / "feature"
sub.mkdir(parents=True)
@@ -213,8 +213,8 @@ class TestProjectMemoryFileDiscovery:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "PROJECT-LINE")
- _touch(root, "JIUWENCLAW.local.md", "LOCAL-LINE")
+ _touch(root, "JIUWENSWARM.md", "PROJECT-LINE")
+ _touch(root, "JIUWENSWARM.local.md", "LOCAL-LINE")
files = discover_and_load_memory_files(workspace=str(root))
merged = merge_memory_content(files)
@@ -239,7 +239,7 @@ class TestProjectMemoryFileDiscovery:
_touch(root, ".jiuwen/rules/shared.md", "SHARED-RULE")
_touch(
root,
- "JIUWENCLAW.md",
+ "JIUWENSWARM.md",
"ROOT-LINE\n@include .jiuwen/rules/shared.md\nTAIL-LINE\n",
)
@@ -534,11 +534,11 @@ class TestProjectMemoryMergeContent:
# it appends per-file headers. Two different paths produce two sections.
files = [
LoadedMemoryFile(
- path="/a/JIUWENCLAW.md", kind="project", content="SAME-CONTENT",
+ path="/a/JIUWENSWARM.md", kind="project", content="SAME-CONTENT",
priority=PRIORITY["project"],
),
LoadedMemoryFile(
- path="/b/JIUWENCLAW.md", kind="project", content="SAME-CONTENT",
+ path="/b/JIUWENSWARM.md", kind="project", content="SAME-CONTENT",
priority=PRIORITY["project"],
),
]
@@ -546,8 +546,8 @@ class TestProjectMemoryMergeContent:
merged = merge_memory_content(files)
# Both files appear in merge with their own headers
assert "SAME-CONTENT" in merged
- assert "/a/JIUWENCLAW.md" in merged
- assert "/b/JIUWENCLAW.md" in merged
+ assert "/a/JIUWENSWARM.md" in merged
+ assert "/b/JIUWENSWARM.md" in merged
# =====================================================================
@@ -603,7 +603,7 @@ class TestProjectMemoryRailCacheInvalidation:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "ORIGINAL-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "ORIGINAL-CONTENT")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -621,7 +621,7 @@ class TestProjectMemoryRailCacheInvalidation:
await rail.after_tool_call(ctx)
# Modify file on disk
- _touch(root, "JIUWENCLAW.md", "UPDATED-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "UPDATED-CONTENT")
# Reload after invalidation
await rail.before_model_call(ctx=MagicMock())
@@ -634,7 +634,7 @@ class TestProjectMemoryRailCacheInvalidation:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "STABLE-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "STABLE-CONTENT")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -652,7 +652,7 @@ class TestProjectMemoryRailCacheInvalidation:
await rail.after_tool_call(ctx)
# Modify file on disk (this happens outside the tool call)
- _touch(root, "JIUWENCLAW.md", "CHANGED-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "CHANGED-CONTENT")
# The cache snapshot check may still pick up the change,
# but the explicit after_tool_call for read_file should not have
@@ -679,7 +679,7 @@ class TestProjectMemoryRailLanguagePropagation:
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "BODY-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "BODY-CONTENT")
# Start with Chinese
rail = ProjectMemoryRail(workspace=str(root), language="cn")
diff --git a/tests/unit_tests/agentserver/rails/test_project_memory_rail.py b/tests/unit_tests/agentserver/rails/test_project_memory_rail.py
index 240e6a863c..00d4407a17 100644
--- a/tests/unit_tests/agentserver/rails/test_project_memory_rail.py
+++ b/tests/unit_tests/agentserver/rails/test_project_memory_rail.py
@@ -66,7 +66,7 @@ async def test_loads_jiuwenswarm_md_from_root():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "# test\nPROJECT RULE 1\n")
+ _touch(root, "JIUWENSWARM.md", "# test\nPROJECT RULE 1\n")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -86,7 +86,7 @@ async def test_section_is_bilingual_with_localized_headers():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "BODY")
+ _touch(root, "JIUWENSWARM.md", "BODY")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -103,8 +103,8 @@ async def test_merges_nested_project_memory_files():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "JIUWEN-CONTENT")
- _touch(root, ".jiuwen/JIUWENCLAW.md", "NESTED-JIUWEN-CONTENT")
+ _touch(root, "JIUWENSWARM.md", "JIUWEN-CONTENT")
+ _touch(root, ".jiuwen/JIUWENSWARM.md", "NESTED-JIUWEN-CONTENT")
rail = ProjectMemoryRail(workspace=str(root), language="cn")
agent = _make_agent_with_builder()
@@ -121,8 +121,8 @@ async def test_local_takes_highest_priority_position():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "PROJECT-LINE")
- _touch(root, "JIUWENCLAW.local.md", "LOCAL-LINE")
+ _touch(root, "JIUWENSWARM.md", "PROJECT-LINE")
+ _touch(root, "JIUWENSWARM.local.md", "LOCAL-LINE")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -156,7 +156,7 @@ async def test_walk_up_from_subdir():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "ROOT-RULE")
+ _touch(root, "JIUWENSWARM.md", "ROOT-RULE")
sub = root / "src" / "feature"
sub.mkdir(parents=True)
@@ -174,7 +174,7 @@ async def test_refreshes_after_file_change():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "VERSION-1")
+ _touch(root, "JIUWENSWARM.md", "VERSION-1")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -183,7 +183,7 @@ async def test_refreshes_after_file_change():
body1 = agent.system_prompt_builder.added_sections[-1].content["en"]
assert "VERSION-1" in body1
- _touch(root, "JIUWENCLAW.md", "VERSION-2")
+ _touch(root, "JIUWENSWARM.md", "VERSION-2")
await rail.before_model_call(ctx=MagicMock())
body2 = agent.system_prompt_builder.added_sections[-1].content["en"]
assert "VERSION-2" in body2
@@ -236,7 +236,7 @@ async def test_supports_include_directives():
_touch(root, ".jiuwen/rules/shared.md", "SHARED-RULE")
_touch(
root,
- "JIUWENCLAW.md",
+ "JIUWENSWARM.md",
"ROOT-LINE\n@include .jiuwen/rules/shared.md\nTAIL-LINE\n",
)
@@ -328,7 +328,7 @@ async def test_frontmatter_stripped():
_touch(root, ".git/HEAD", "")
_touch(
root,
- "JIUWENCLAW.md",
+ "JIUWENSWARM.md",
"---\npaths: 'src/**'\nversion: 1\n---\nBODY-ONLY\n",
)
@@ -348,7 +348,7 @@ async def test_frontmatter_at_end_of_file_stripped():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "---\nkey: v\n---")
+ _touch(root, "JIUWENSWARM.md", "---\nkey: v\n---")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -367,7 +367,7 @@ async def test_uninit_clears_section():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "BEFORE-UNINIT")
+ _touch(root, "JIUWENSWARM.md", "BEFORE-UNINIT")
rail = ProjectMemoryRail(workspace=str(root), language="en")
agent = _make_agent_with_builder()
@@ -396,7 +396,7 @@ async def test_set_language_switches_active_language():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "BODY")
+ _touch(root, "JIUWENSWARM.md", "BODY")
rail = ProjectMemoryRail(workspace=str(root), language="cn")
rail.set_language("en")
@@ -418,14 +418,14 @@ async def test_loads_user_and_managed_rules(monkeypatch):
user_root = Path(user_td)
managed_root = Path(managed_td)
_touch(root, ".git/HEAD", "")
- _touch(user_root, "JIUWENCLAW.md", "USER-MEMORY")
+ _touch(user_root, "JIUWENSWARM.md", "USER-MEMORY")
_touch(user_root, "rules/user_rule.md", "USER-RULE")
- _touch(managed_root, "JIUWENCLAW.md", "MANAGED-MEMORY")
+ _touch(managed_root, "JIUWENSWARM.md", "MANAGED-MEMORY")
_touch(managed_root, "rules/managed_rule.md", "MANAGED-RULE")
- monkeypatch.setattr(_files_mod, "USER_MEMORY_FILES", (str(user_root / "JIUWENCLAW.md"),))
+ monkeypatch.setattr(_files_mod, "USER_MEMORY_FILES", (str(user_root / "JIUWENSWARM.md"),))
monkeypatch.setattr(_files_mod, "USER_MEMORY_GLOBS", (str(user_root / "rules" / "*.md"),))
- monkeypatch.setattr(_files_mod, "MANAGED_MEMORY_FILES", (str(managed_root / "JIUWENCLAW.md"),))
+ monkeypatch.setattr(_files_mod, "MANAGED_MEMORY_FILES", (str(managed_root / "JIUWENSWARM.md"),))
monkeypatch.setattr(_files_mod, "MANAGED_MEMORY_GLOBS", (str(managed_root / "rules" / "*.md"),))
_files_mod.clear_project_memory_cache()
@@ -447,7 +447,7 @@ async def test_additional_directories_load_project_memory():
root = Path(td)
extra = Path(extra_td)
_touch(root, ".git/HEAD", "")
- _touch(extra, "JIUWENCLAW.md", "EXTRA-PROJECT-RULE")
+ _touch(extra, "JIUWENSWARM.md", "EXTRA-PROJECT-RULE")
rail = ProjectMemoryRail(
workspace=str(root),
@@ -474,7 +474,7 @@ async def test_additional_directories_relative_to_workspace():
root = base / "repo"
extra = base / "shared-memory"
_touch(root, ".git/HEAD", "")
- _touch(extra, "JIUWENCLAW.md", "RELATIVE-EXTRA-RULE")
+ _touch(extra, "JIUWENSWARM.md", "RELATIVE-EXTRA-RULE")
rail = ProjectMemoryRail(
workspace=str(root),
@@ -494,7 +494,7 @@ async def test_b1_parent_set_workspace_does_not_break_path_resolution():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "STILL-WORKING")
+ _touch(root, "JIUWENSWARM.md", "STILL-WORKING")
rail = ProjectMemoryRail(workspace="/nonexistent-stub-path", language="en")
rail.set_workspace(_FakeWorkspace(root_path=str(root))) # type: ignore[arg-type]
@@ -516,7 +516,7 @@ async def test_b1_no_workspace_falls_back_to_constructor_path():
with tempfile.TemporaryDirectory() as td:
root = Path(td)
_touch(root, ".git/HEAD", "")
- _touch(root, "JIUWENCLAW.md", "FROM-CTOR-PATH")
+ _touch(root, "JIUWENSWARM.md", "FROM-CTOR-PATH")
rail = ProjectMemoryRail(workspace=str(root), language="en")
assert rail.workspace is None
@@ -536,9 +536,9 @@ async def test_nested_worktree_skips_canonical_project_but_keeps_local(monkeypat
worktree = canonical / ".jiuwen" / "worktrees" / "feature"
_touch(canonical, ".git/HEAD", "")
_touch(worktree, ".git/HEAD", "")
- _touch(canonical, "JIUWENCLAW.md", "CANONICAL-PROJECT")
- _touch(canonical, "JIUWENCLAW.local.md", "CANONICAL-LOCAL")
- _touch(worktree, "JIUWENCLAW.md", "WORKTREE-PROJECT")
+ _touch(canonical, "JIUWENSWARM.md", "CANONICAL-PROJECT")
+ _touch(canonical, "JIUWENSWARM.local.md", "CANONICAL-LOCAL")
+ _touch(worktree, "JIUWENSWARM.md", "WORKTREE-PROJECT")
monkeypatch.setattr(
_files_mod,