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

fix(auto-harness): auto-harness 特性文档 & tui 子指令提示

ray_led2499d780edc
diff --git a/docs/assets/images/auto-harness-package-tab-en.png b/docs/assets/images/auto-harness-package-tab-en.png
new file mode 100644
index 0000000000..1ba41c4be3
Binary files /dev/null and b/docs/assets/images/auto-harness-package-tab-en.png differ
diff --git a/docs/assets/images/auto-harness-package-tab.png b/docs/assets/images/auto-harness-package-tab.png
new file mode 100644
index 0000000000..51511250d8
Binary files /dev/null and b/docs/assets/images/auto-harness-package-tab.png differ
diff --git a/docs/assets/images/auto_harness_arch.png b/docs/assets/images/auto_harness_arch.png
new file mode 100644
index 0000000000..6be6575918
Binary files /dev/null and b/docs/assets/images/auto_harness_arch.png differ
diff --git a/docs/assets/images/auto_harness_two_layer_architecture.png b/docs/assets/images/auto_harness_two_layer_architecture.png
new file mode 100644
index 0000000000..35f0d35127
Binary files /dev/null and b/docs/assets/images/auto_harness_two_layer_architecture.png differ
diff --git a/docs/en/AutoHarness.md b/docs/en/AutoHarness.md
new file mode 100644
index 0000000000..ed9d707a31
--- /dev/null
+++ b/docs/en/AutoHarness.md
@@ -0,0 +1,303 @@
+# Auto Harness
+
+## Introduction
+
+Auto Harness is an agent self-optimization solution built on openJiuwen Agent Core, provided by the JiuwenSwarm platform. It brings "post-training" to the Harness layer — enabling agents to autonomously analyze gaps in their own Harness, generate improvement plans, implement and verify changes, and deliver results as PRs or runtime packages.
+
+> **Agent = Model + Harness**: The LLM provides model capability, but the Harness (prompts, tools, rails, skills, and orchestration logic) determines how the agent actually performs. Auto Harness automates the optimization of the Harness itself.
+
+---
+
+## Features
+
+### 1.1 Background & Motivation
+
+Harness is the "body" of an Agent — the LLM provides model capability, but the Harness (prompts, tools, rails, skills, and orchestration logic) determines how the agent actually performs. If the LLM is the brain, the Harness is the torso and limbs that execute capabilities in practice.
+
+![](../assets/images/auto_harness_arch.png)
+
+Key Harness components that need optimization:
+
+| Component | Description |
+|-----------|-------------|
+| **Prompts** | System prompts defining behavior patterns and role |
+| **Tools** | Available tool set affecting capability boundaries |
+| **Rails** | Runtime safety guards controlling behavior boundaries |
+| **Skills** | Reusable skill templates encapsulating domain capabilities |
+
+Traditional tuning has been a manual, experience-driven process — adjusting prompts, swapping tools, and adding rails requires repeated trial and error. Hard-won tuning knowledge rarely transfers across scenarios; changing a domain or client often means starting over.
+
+Auto Harness automates this: agents generate their own benchmarks, run evaluations, identify weaknesses, implement fixes, and verify results — forming a complete autonomous optimization loop.
+
+### 1.2 Two-Layer Architecture
+
+openJiuwen designs the Harness as two layers, with Auto Harness optimizing both:
+
+| Layer | Role | Contents | Optimization Method |
+|-------|------|----------|-------------------|
+| **Meta Harness** | Common foundation, shared by all agents | Prompts, tools, rails, skills | Modify source → Submit PR → Merge |
+| **Expert Harness** | Pluggable domain extensions, loaded on demand | Office, compliance, content production expertise | Generate Package → Hot-load → Use immediately |
+
+Safety boundary between layers: Meta layer changes require PR review before merging; Expert layer packages take effect immediately via hot-loading with no service restart.
+
+### 1.3 Two Pipelines
+
+#### Meta Evolve Pipeline (Base Layer)
+
+Benchmarks against industry best practices, automatically analyzes gaps and improves underlying Harness capabilities.
+
+```
+Research → Assess current state → Create optimization plan → Implement in isolated worktree → CI verification (auto-fix on failure) → Commit → Publish PR → Extract learnings
+```
+
+Typical scenario: Benchmarking Claude Code's context compression features, automatically absorbing implementation approaches and submitting a PR.
+
+#### Extended Evolve Pipeline (Extension Layer)
+
+Injects new domain capabilities into agents, generating hot-loadable runtime extension packages.
+
+```
+Assess extension gaps → Design extension plan → Parallel build/verify (with dependency wave orchestration) → Merge multiple extensions → User confirmation → Hot-load activation
+```
+
+Typical scenario: Enhancing an agent's office productivity (PPT/Word/Excel processing, sensitive info detection). Multiple extension packages can be stacked and mounted on the same agent simultaneously.
+
+![](../assets/images/auto_harness_two_layer_architecture.png)
+
+### 1.4 Core Mechanism: Evaluation-Driven Closed-Loop
+
+Both pipelines share the same core mechanism:
+
+```
+Evaluate → Identify gaps → Plan improvements → Implement changes → Re-evaluate
+```
+
+Key capabilities:
+
+- **Worktree isolation**: Each task executes in an isolated Git Worktree, separate from the main workspace; the Assess phase uses a read-only snapshot
+- **Auto-fix loop**: Automatically enters a fix cycle on CI failure until passing
+- **Scheduled runs**: Configure scheduled tasks (e.g., every 48 hours) to automatically benchmark competitors, evaluate, improve, and submit PRs
+- **Experience accumulation**: Insights and lessons from optimization are stored for future reference
+
+---
+
+## Interactive Usage
+
+### 2.1 TUI Commands
+
+Manage Auto-Harness task creation, execution, and monitoring via the `/auto-harness` command in the JiuwenSwarm TUI.
+
+#### Command Overview
+
+| Command | Usage | Description |
+|---------|-------|-------------|
+| **run** | `run [--pipeline <pipeline>] <query>` | Execute a one-time optimization task |
+| **schedule** | `schedule start --interval <hours> [--pipeline <pipeline>] <query>` | Create a scheduled optimization task |
+| | `schedule list` | List all scheduled tasks |
+| | `schedule status <task_id>` | View task details |
+| | `schedule logs <task_id> [--history <n>]` | View task execution logs |
+| | `schedule cancel <task_id>` | Cancel a scheduled task |
+| | `schedule delete <task_id>` | Delete a scheduled task |
+| **issue** | `issue fix <issue_numbers>` | Create a fix task for specified GitCode issues |
+| | `issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]` | Scan repository GitCode issues |
+| | `issue status` | View issue processing status |
+| | `issue delete <issue_numbers>` | Delete issue processing records |
+
+#### Pipeline Types
+
+| Parameter Value | Description |
+|----------------|-------------|
+| `optimize_expert_harness` | Expert Harness optimization (generate local extension package, hot-load activation) |
+| `optimize_meta_harness` | Meta Harness optimization (modify source code → submit PR, requires git configuration) |
+
+During pipeline execution, extension packages are **automatically activated by default** — no manual confirmation needed.
+
+#### Configuration Requirements
+
+The `optimize_meta_harness` pipeline requires the following fields (configure via `/config edit` or `/status config`):
+
+| Field | Required | Description |
+|-------|----------|-------------|
+| `git.user_name` | Yes | Git commit username |
+| `git.user_email` | Yes | Git commit email |
+| `gitcode.access_token` | No | GitCode API Token (can also be provided via `GITCODE_ACCESS_TOKEN` environment variable) |
+
+If configuration is incomplete, the system will prompt for missing fields when creating a task.
+
+---
+
+#### `/auto-harness run` — One-Time Execution
+
+Execute a single Auto-Harness optimization task.
+
+**Usage:**
+
+```
+/auto-harness run [--pipeline <pipeline>] <query>
+```
+
+**Flow:**
+
+1. If `--pipeline` is not specified, interactively select the pipeline type
+2. If `optimize_meta_harness` is selected, automatically check git configuration completeness
+3. Create and execute a one-time task
+4. Automatically enter real-time log tailing mode (similar to `tail -f`)
+
+**Examples:**
+
+```
+/auto-harness run Optimize database query performance
+/auto-harness run --pipeline optimize_expert_harness Improve context compression capabilities
+```
+
+---
+
+#### `/auto-harness schedule` — Scheduled Task Management
+
+Manage scheduled Auto-Harness optimization tasks.
+
+**Subcommands:**
+
+| Command | Description |
+|---------|-------------|
+| `schedule start --interval <hours> [--pipeline <pipeline>] <query>` | Create a scheduled task |
+| `schedule list` | List all tasks |
+| `schedule status <task_id>` | View task details |
+| `schedule logs <task_id> [--history <n>]` | View task execution logs |
+| `schedule cancel <task_id>` | Cancel a task |
+| `schedule delete <task_id>` | Delete a task |
+
+##### schedule start — Create Scheduled Task
+
+```
+/auto-harness schedule start --interval <hours> [--pipeline <pipeline>] <query>
+```
+
+| Parameter | Required | Description |
+|-----------|----------|-------------|
+| `--interval` / `-i` | Yes | Execution interval (hours), options: 1, 2, 4, 8, 12, 24 |
+| `--pipeline` / `-p` | No | Pipeline type, interactively selected if not specified |
+| `<query>` | Yes | Optimization goal description |
+
+Flow:
+1. If pipeline is not specified, interactively select
+2. If `optimize_meta_harness` is selected, check git configuration
+3. Interactively confirm whether to execute immediately once
+4. Create the scheduled task
+
+Examples:
+
+```
+/auto-harness schedule start --interval 4 Improve context compression capabilities
+/auto-harness schedule start -i 2 -p optimize_meta_harness Submit database optimization PR
+```
+
+##### schedule logs — View Execution Logs
+
+```
+/auto-harness schedule logs <task_id> [--history <n>]
+```
+
+| Mode | Description |
+|------|-------------|
+| Default | Real-time log tailing of current run (`tail -f` mode), supports Ctrl+C to interrupt |
+| `--history <n>` | View historical execution logs, `n` is the history index (0 = most recent) |
+
+---
+
+#### `/auto-harness issue` — GitCode Issue Auto-Processing
+
+Manage automatic GitCode issue processing: scan issue trackers, create fix tasks, view processing status, and clean up records.
+
+Requires `git.user_name`, `git.user_email` and `gitcode.access_token` (or `GITCODE_ACCESS_TOKEN` environment variable).
+
+**Subcommands:**
+
+| Command | Description |
+|---------|-------------|
+| `issue fix <issue_numbers>` | Create fix tasks for specified GitCode issues |
+| `issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]` | Scan repository GitCode issues |
+| `issue status` | View issue processing status |
+| `issue delete <issue_numbers>` | Delete issue processing records |
+
+##### issue fix — Create Fix Task
+
+```
+/auto-harness issue fix <issue_numbers>
+```
+
+| Parameter | Description |
+|-----------|-------------|
+| `<issue_numbers>` | Issue numbers, comma-separated for multiple (e.g., `1272,1271,1270`) |
+| `--repo <repo>` | Target repository, supports `jiuwenswarm` / `agent_core`, interactively selected if not specified |
+
+Issues already associated with an open or merged PR are automatically skipped.
+
+Examples: `/auto-harness issue fix 1286`, `/auto-harness issue fix 1272,1271,1270`
+
+##### issue scan — Scan Issues
+
+```
+/auto-harness issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]
+```
+
+| Parameter | Description |
+|-----------|-------------|
+| `--repo <repo>` | Target repository, interactively selected if not specified |
+| `--page <n>` | Page number, default 1 |
+| `--labels <labels>` | Label filter, comma-separated, defaults to bug-type labels only |
+| `--force-refresh` | Force refresh from GitCode API (uses cache by default) |
+
+Displays: issue number, title, labels, difficulty assessment, last updated time.
+
+##### issue status / delete
+
+```
+/auto-harness issue status
+/auto-harness issue delete <issue_numbers>
+```
+
+- `issue status`: Displays all issue processing records in a table (number, status, stage, progress, details)
+- `issue delete`: Deletes processing records for specified issues
+
+### 2.2 Web-based Package Management
+
+Extension artifacts generated by the Extended Evolve Pipeline are managed as **Harness Packages** through a visual Web interface for import, export, and hot-load activation.
+
+#### What is a Package
+
+A Harness Package is a hot-loadable extension component that can inject Tools, Skills, and Rails into a running agent **without service restart**.
+
+#### Key Operations
+
+| Operation | Description |
+|-----------|-------------|
+| **Activate** | Activate manually from the package list; multiple packages can be active simultaneously with all injected capabilities stacking together |
+| **Deactivate** | Disable a specific package; its injected capabilities are immediately removed from the agent |
+| **Deactivate All** | One-click to disable all active packages, restoring the agent to its original state |
+| **Delete** | Permanently remove a specific package from the system |
+| **Export** | Export a package to a file for backup or installation on another agent/environment |
+| **Import** | Import a package from a file, enabling capability sharing and cross-environment migration |
+
+#### Activation Flow
+
+```
+Extension verified → Preview component manifest → Dynamically injected → Takes effect immediately
+```
+
+![](../assets/images/auto-harness-package-tab-en.png)
+
+---
+
+## FAQ
+
+### Q1: How to choose between Meta Harness and Expert Harness?
+
+- **Meta Harness**: For improving foundational capabilities — optimizing prompts, adjusting tool config, refining rails. Changes require PR review.
+- **Expert Harness**: For introducing new domain capabilities — injecting new tools, skills, and rails. Packages are hot-loaded immediately after generation.
+
+### Q2: How is a Harness Package different from a regular Python package?
+
+Harness Packages are hot-loadable component packages injected at runtime via the `runtime_extension_loader` — no service restart needed.
+
+---
diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.md
index b4df340070..d144685328 100644
--- a/docs/en/SUMMARY.md
+++ b/docs/en/SUMMARY.md
@@ -10,6 +10,7 @@
- [Configuration](Configuration.md)
- [Distributed Team](DistributedTeam.md)
- [Multi-Instance](MultiInstance.md)
+- [Auto Harness Feature Overview](AutoHarness.md)
- [User guide](README.md)
- [Channels](Channels.md)
- [Discord](Discord.md)
diff --git a/docs/zh/AutoHarness.md b/docs/zh/AutoHarness.md
new file mode 100644
index 0000000000..34cd69f7f8
--- /dev/null
+++ b/docs/zh/AutoHarness.md
@@ -0,0 +1,305 @@
+# Auto Harness
+
+## 简介
+
+Auto Harness 是 JiuwenSwarm 平台基于 openJiuwen Agent Core 的 Agent 自主优化方案,目标是对 Harness 层实现"后训练"——让 Agent 能够自主分析自身 Harness 的不足、生成改进方案、实现并验证修改,最终将优化成果以 Package 或 PR 的形式沉淀。
+
+> **Agent = Model + Harness**:模型能力由 LLM 提供,但 Harness(提示词、工具、Rails、技能等编排逻辑)决定了 Agent 的实际表现。Auto Harness 让优化 Harness 这件事本身自动化。
+
+---
+
+## 一、特性介绍
+
+### 1.1 背景与动机
+
+Harness 是 Agent 的"后半身"——模型能力由 LLM 提供,但 Harness(提示词、工具、Rails、技能等编排逻辑)决定了 Agent 的实际表现。如果把 LLM 比作大脑,Harness 就是躯干和四肢,负责把大脑的能力落地执行。
+
+![](../assets/images/auto_harness_arch.png)
+
+Harness 需要优化的核心组件包括:
+
+| 组件 | 说明 |
+|------|------|
+| **Prompts** | Agent 的系统提示词,决定行为模式和角色定位 |
+| **Tools** | Agent 可调用的工具集,影响能力边界 |
+| **Rails** | 运行时安全护栏,控制行为边界 |
+| **Skills** | 可复用的技能模版,封装特定场景的完整能力 |
+
+传统调优依赖人工经验:调整 prompt、替换工具、增加 Rail 需要反复试错,且调优手感难以跨场景复用,换一个领域或客户基本推倒重来。
+
+Auto Harness 将这一过程自动化:Agent 为自己生成评测、执行评测、定位短板、实施修改、验证效果,形成完整的自主优化闭环。
+
+### 1.2 两层架构
+
+openJiuwen 将 Harness 设计为两层结构,Auto Harness 分别对这两层提供优化能力:
+
+| 层面 | 定位 | 包含内容 | 优化方式 |
+|------|------|---------|---------|
+| **Meta Harness** | 通用底座,所有 Agent 共享 | prompts、tools、rails、skills 等基础组件 | 修改源码 → 提 PR 审查 → 合入主干 |
+| **Expert Harness** | 领域扩展包,按需加载 | 办公、合规、内容生产等专家能力 | 生成 Package → 热加载 → 即插即用 |
+
+两层之间的安全边界:Meta 层的每次改动需要提 PR 由人审查合入;Expert 层生成优化包后可直接热加载生效,无需重启服务。
+
+### 1.3 两条 Pipeline
+
+#### Meta Evolve Pipeline(基座层优化)
+
+对标业界最佳实践,自动分析差距并改进 Harness 底层能力。
+
+```
+调研阶段 → 评估现状 → 制定优化计划 → 独立 worktree 实现 → CI 验证(失败自动修复)→ 提交变更 → 发布 PR → 总结经验
+```
+
+典型场景:对标 Claude Code 的上下文压缩特性,自动吸收实现方案并提交 PR。
+
+#### Extended Evolve Pipeline(扩展层优化)
+
+为 Agent 注入新的领域能力,生成可热加载的运行时扩展包。
+
+```
+评估扩展缺口 → 设计扩展方案 → 并行开发验证(支持依赖波次编排)→ 合并多个扩展 → 用户确认 → 热加载激活
+```
+
+典型场景:为 Agent 提升办公能力(PPT/WORD/Excel 处理、敏感信息检查),多个扩展包可叠加挂载到同一 Agent。
+
+![](../assets/images/auto_harness_two_layer_architecture.png)
+
+### 1.4 核心机制:评测驱动的闭环优化
+
+两条 Pipeline 共享同一核心机制:
+
+```
+评测 → 识别差距 → 规划方案 → 实施修改 → 再评测
+```
+
+关键能力:
+
+- **Worktree 隔离**:每个任务在独立 Git Worktree 中执行,与主工作区隔离;Assess 阶段使用只读快照
+- **自动修复循环**:CI 验证失败时自动进入修复循环,直到通过为止
+- **定时运行**:可配置定时任务自动对标竞品更新、评测、改进并提 PR
+- **经验沉淀**:优化过程中的经验和教训自动入库,后续优化可参考历史记录
+
+---
+
+## 二、交互使用
+
+### 2.1 TUI 指令使用
+
+在 JiuwenSwarm TUI 中通过 `/auto-harness` 命令管理 Auto-Harness 任务的创建、执行与监控。
+
+#### 命令总览
+
+| 指令 | 命令 | 说明 |
+|------|------|------|
+| **run** | `run [--pipeline <pipeline>] <query>` | 执行一次性优化任务 |
+| **schedule** | `schedule start --interval <hours> [--pipeline <pipeline>] <query>` | 创建定时优化任务 |
+| | `schedule list` | 列出所有定时任务 |
+| | `schedule status <task_id>` | 查看任务详情 |
+| | `schedule logs <task_id> [--history <n>]` | 查看任务执行日志 |
+| | `schedule cancel <task_id>` | 取消定时任务 |
+| | `schedule delete <task_id>` | 删除定时任务 |
+| **issue** | `issue fix <issue_numbers>` | 为指定 GitCode issue 创建修复任务 |
+| | `issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]` | 扫描仓库 GitCode issue |
+| | `issue status` | 查看 issue 处理状态列表 |
+| | `issue delete <issue_numbers>` | 删除 issue 处理记录 |
+
+#### Pipeline 类型
+
+| 参数值 | 说明 |
+|--------|------|
+| `optimize_expert_harness` | Expert Harness 优化(生成本地扩展包,热加载生效) |
+| `optimize_meta_harness` | Meta Harness 优化(修改源码 → 提 PR,需配置 git) |
+
+Pipeline 执行过程中,扩展包**默认自动激活生效**,无需用户手动确认。
+
+#### 配置要求
+
+`optimize_meta_harness` Pipeline 需配置以下字段(通过 `/config edit` 或 `/status config` 编辑):
+
+| 字段 | 必填 | 说明 |
+|------|------|------|
+| `git.user_name` | 是 | Git commit 用户名 |
+| `git.user_email` | 是 | Git commit 邮箱 |
+| `gitcode.access_token` | 否 | GitCode API Token(也可通过环境变量 `GITCODE_ACCESS_TOKEN` 提供) |
+
+若配置不完整,创建任务时系统会提示缺失字段。
+
+---
+
+#### `/auto-harness run` — 一次性执行
+
+执行单次 Auto-Harness 优化任务。
+
+**用法:**
+
+```
+/auto-harness run [--pipeline <pipeline>] <query>
+```
+
+**流程:**
+
+1. 若未指定 `--pipeline`,交互式选择 Pipeline 类型
+2. 若选择 `optimize_meta_harness`,自动检查 git 配置是否完整
+3. 创建并执行一次性任务
+4. 自动进入实时日志跟踪模式(类似 `tail -f`)
+
+**示例:**
+
+```
+/auto-harness run 优化数据库查询性能
+/auto-harness run --pipeline optimize_expert_harness 优化上下文压缩能力
+```
+
+---
+
+#### `/auto-harness schedule` — 定时任务管理
+
+管理定时执行的 Auto-Harness 任务。
+
+**子命令:**
+
+| 命令 | 说明 |
+|------|------|
+| `schedule start --interval <hours> [--pipeline <pipeline>] <query>` | 创建定时任务 |
+| `schedule list` | 列出所有任务 |
+| `schedule status <task_id>` | 查看任务详情 |
+| `schedule logs <task_id> [--history <n>]` | 查看任务执行日志 |
+| `schedule cancel <task_id>` | 取消任务 |
+| `schedule delete <task_id>` | 删除任务 |
+
+##### schedule start — 创建定时任务
+
+```
+/auto-harness schedule start --interval <hours> [--pipeline <pipeline>] <query>
+```
+
+| 参数 | 必填 | 说明 |
+|------|------|------|
+| `--interval` / `-i` | 是 | 执行间隔(小时),可选值 1、2、4、8、12、24 |
+| `--pipeline` / `-p` | 否 | Pipeline 类型,未指定时交互选择 |
+| `<query>` | 是 | 优化目标描述 |
+
+流程:
+1. 若未指定 pipeline,交互式选择
+2. 若选择 `optimize_meta_harness`,检查 git 配置
+3. 交互确认是否立即执行一次
+4. 创建定时任务
+
+示例:
+
+```
+/auto-harness schedule start --interval 4 优化上下文压缩能力
+/auto-harness schedule start -i 2 -p optimize_meta_harness 提交数据库优化PR
+```
+
+##### schedule logs — 查看执行日志
+
+```
+/auto-harness schedule logs <task_id> [--history <n>]
+```
+
+| 模式 | 说明 |
+|------|------|
+| 默认 | 实时跟踪当前运行日志(`tail -f` 模式),支持 Ctrl+C 中断 |
+| `--history <n>` | 查看历史执行日志,`n` 为历史索引(0 为最近一次) |
+
+---
+
+#### `/auto-harness issue` — GitCode Issue 自动处理
+
+管理 GitCode issue 的自动处理:扫描 issue 矩阵、创建修复任务、查看处理状态、清理记录。
+
+需要先配置 `git.user_name`、`git.user_email` 和 `gitcode.access_token`(或 `GITCODE_ACCESS_TOKEN` 环境变量)。
+
+**子命令:**
+
+| 命令 | 说明 |
+|------|------|
+| `issue fix <issue_numbers>` | 为指定 GitCode issue 创建修复任务 |
+| `issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]` | 扫描仓库 GitCode issue |
+| `issue status` | 查看 issue 处理状态 |
+| `issue delete <issue_numbers>` | 删除 issue 处理记录 |
+
+##### issue fix — 创建修复任务
+
+```
+/auto-harness issue fix <issue_numbers>
+```
+
+| 参数 | 说明 |
+|------|------|
+| `<issue_numbers>` | issue 编号,多个用逗号分隔,如 `1272,1271,1270` |
+| `--repo <repo>` | 目标仓库,支持 `jiuwenswarm` / `agent_core`,未指定时交互选择 |
+
+已关联 PR(open 或 merged)的 issue 自动跳过,不会创建重复任务。
+
+示例:`/auto-harness issue fix 1286`、`/auto-harness issue fix 1272,1271,1270`
+
+##### issue scan — 扫描 Issue
+
+```
+/auto-harness issue scan [--repo <repo>] [--page <n>] [--labels <labels>] [--force-refresh]
+```
+
+| 参数 | 说明 |
+|------|------|
+| `--repo <repo>` | 目标仓库,未指定时交互选择 |
+| `--page <n>` | 页码,默认 1 |
+| `--labels <labels>` | 标签过滤,逗号分隔,默认只显示 bug 类型 |
+| `--force-refresh` | 强制从 GitCode API 刷新数据(默认使用缓存) |
+
+展示内容:issue 编号、标题、标签、难度评估、更新时间。
+
+##### issue status / delete
+
+```
+/auto-harness issue status
+/auto-harness issue delete <issue_numbers>
+```
+
+- `issue status`:以表格列出所有 issue 处理记录(编号、状态、阶段、进度、详情)
+- `issue delete`:删除指定 issue 的处理记录
+
+---
+
+### 2.2 Web 端 Package 管理及使用
+
+Expert Harness Pipeline 生成的扩展成果以 **Harness Package** 形式管理,通过 Web 端可视化界面进行导入、导出和热生效管理。
+
+#### 什么是 Package
+
+Harness Package 是可热加载的扩展组件包,包含 Tools(工具)、Skills(技能)、Rails(安全护栏)三类能力,**无需重启服务**即可注入到运行中的 Agent。
+
+#### 核心操作
+
+| 操作 | 说明 |
+|------|------|
+| **激活** | 在 Package 列表中手动激活,多个 Package 可同时处于激活状态,各自注入的能力叠加生效 |
+| **取消激活** | 关闭指定 Package,该包注入的能力立即从 Agent 移除 |
+| **全部取消激活** | 一键关闭所有已激活的 Package,Agent 恢复到原始状态 |
+| **删除** | 从系统中移除指定 Package,不可恢复 |
+| **导出** | 将 Package 导出为文件,用于备份或在其他 Agent/环境安装 |
+| **导入** | 从文件导入 Package,实现能力分享和跨环境迁移 |
+
+#### 热激活流程
+
+```
+扩展验证通过 → 预览组件清单 → 动态注入运行时 → 即时生效
+```
+
+![](../assets/images/auto-harness-package-tab.png)
+
+---
+
+## 常见问题
+
+### Q1:Meta Harness 和 Expert Harness 怎么选择?
+
+- **Meta Harness**:适合改进底层通用能力——优化 prompt、调整工具配置、完善 Rails,改动需要提 PR 审查
+- **Expert Harness**:适合引入新的领域能力——注入新工具、新技能、新 Rails,生成 Package 后热加载即可
+
+### Q2:Harness Package 和普通 Python 包有什么区别?
+
+Harness Package 是可热加载的组件包,通过 `runtime_extension_loader` 在运行时动态注入,无需重启服务即可生效。
+
+---
diff --git a/docs/zh/SUMMARY.md b/docs/zh/SUMMARY.md
index 025792ce65..8f63529457 100644
--- a/docs/zh/SUMMARY.md
+++ b/docs/zh/SUMMARY.md
@@ -11,6 +11,7 @@
- [配置说明](配置信息.md)
- [分布式 Team](分布式Team.md)
- [Agent Team 使用指南](AgentTeam.md)
+- [Auto Harness 特性说明](AutoHarness.md)
- [单机多实例运行](单机多实例运行.md)
- [使用指南](README.md)
- [频道](频道.md)
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
index 5cac5fd331..daa358269f 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
@@ -2153,6 +2153,13 @@ const scheduleCommand: SlashCommand = {
ctx.addItem(
addError(ctx.sessionId, "用法: /auto-harness schedule <子命令> [参数]\n子命令:\n start 创建定时任务\n list 列出所有任务\n status 查看任务详情\n logs 查看执行日志(实时跟踪或历史)\n cancel 取消任务\n delete 删除任务\n示例:\n /auto-harness schedule list\n /auto-harness schedule logs sch_abc123")
);
+ return;
+ }
+ const validSubs = ["start", "list", "status", "logs", "cancel", "delete"];
+ if (!validSubs.includes(subcommand)) {
+ ctx.addItem(
+ addError(ctx.sessionId, `未知子命令 "${subcommand}"\n用法: /auto-harness schedule <start|list|status|logs|cancel|delete>`)
+ );
}
},
};
@@ -2585,8 +2592,17 @@ const issueCommand: SlashCommand = {
return subNames.filter((n) => n.startsWith(prefix));
},
action: (ctx, args) => {
- if (!args.trim()) {
+ const text = args.trim();
+ if (!text) {
ctx.addItem(addError(ctx.sessionId, "用法: /auto-harness issue <fix|scan|status|delete>\n示例:\n /auto-harness issue fix 1272,1271\n /auto-harness issue scan --repo jiuwenswarm\n /auto-harness issue status\n /auto-harness issue delete 123"));
+ return;
+ }
+ const subcommand = text.split(/\s+/)[0];
+ const validSubs = ["scan", "fix", "status", "delete"];
+ if (!validSubs.includes(subcommand)) {
+ ctx.addItem(
+ addError(ctx.sessionId, `未知子命令 "${subcommand}"\n用法: /auto-harness issue <scan|fix|status|delete>`)
+ );
}
},
};
@@ -2613,6 +2629,14 @@ export function createAutoHarnessCommand(): SlashCommand {
ctx.addItem(
addError(ctx.sessionId, "用法: /auto-harness <run|schedule|issue> [参数]\n子命令:\n run 创建并执行一次性任务\n schedule 管理定时任务\n issue 处理 GitCode issue\n示例:\n /auto-harness run 优化上下文压缩能力\n /auto-harness schedule list\n /auto-harness issue fix 1272,1271")
);
+ return;
+ }
+ const subcommand = text.split(/\s+/)[0];
+ const validSubs = ["run", "schedule", "issue"];
+ if (!validSubs.includes(subcommand)) {
+ ctx.addItem(
+ addError(ctx.sessionId, `未知子命令 "${subcommand}"\n用法: /auto-harness <run|schedule|issue>\n示例:\n /auto-harness run 优化上下文压缩能力\n /auto-harness schedule list`)
+ );
}
},
};