Skip to content

Commit 294e558

Browse files
phodalcodex
andcommitted
fix(hosts): integrate pi adapter with current main
Resolve PR #25 against the current public-host entrypoint contract while keeping Pi as an analysis-capable source-local host outside the public Quickstart set until an end-to-end interactive report render is observed. The integration review hardens normalized package identity and effective resource filters, session-header and workspace isolation, relative session roots, provider-home propagation, prompt frontmatter, and canonical HTML report routing. It also keeps the six filesystem metadata roots distinct from Pi's package.json manifest. Validated with npm run check (913 tests plus package verification), the documentation link graph, focused Pi provider tests, git diff --check, and pack verification from a materialized staged index. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
2 parents af5a6c6 + ed4219f commit 294e558

35 files changed

Lines changed: 1207 additions & 200 deletions

README.md

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,25 @@
3131
<a href="docs/community.md">Contribute</a>
3232
</p>
3333

34-
## See it in action
34+
## Quick start
3535

36-
Ask `/better-harness` to review the current task and its surrounding project
37-
Harness, then generate a durable report:
36+
Review your coding workflow with: [Claude Code](#claude-code), [Codex Desktop](#codex-desktop), [Codex CLI](#codex-cli), [Qoder Desktop/CLI](#qoder), [Cursor](#cursor), [Qwen Code](#qwen-code), or [GitHub Copilot CLI](#github-copilot).
37+
38+
Once installed, ask Better Harness to generate the host's durable report:
3839

3940
```text
4041
/better-harness review this project's AI coding workflow and generate a report
4142
```
4243

44+
Better Harness scopes behavior claims to relevant Task Episodes and the
45+
surrounding project mechanisms. Qoder produces a Canvas report; Claude Code,
46+
Codex, Cursor, Qwen Code, and GitHub Copilot produce self-contained HTML with
47+
paired Markdown. Missing or partial evidence remains explicit. See the
48+
[Host Adapter Matrix](docs/adapters/README.md) for current coverage and output
49+
differences.
50+
51+
## See it in action
52+
4353
The report keeps missing evidence explicit and turns supported gaps into
4454
prioritized findings with an impact, expected output, scoped repair, and
4555
acceptance checks.
@@ -141,33 +151,6 @@ The architecture keeps the three evidence domains independent until unified
141151
analysis by the lead agent. Every result retains a visible evidence source,
142152
owner, and validation route.
143153

144-
## Quick start
145-
146-
Pick your coding agent — you can be looking at your first report in minutes:
147-
148-
| Coding agent | Setup |
149-
| --- | --- |
150-
| **Claude Code** | Add the repository marketplace, install `better-harness@better-harness`, start a new session, then use the report prompt below. |
151-
| **Codex Desktop** | Add the repository under **Settings > Plugins > + Add > From Marketplace**, install Better Harness, start a new task, then invoke `@better-harness`. |
152-
| **Codex CLI** | Add the Git marketplace, run `codex plugin add better-harness@better-harness`, then invoke `$better-harness:better-harness`. |
153-
| **Qoder Desktop / CLI** | Nothing to install when Qoder Desktop is installed — Better Harness is built in and available to both. Open your repository and use the report prompt below. |
154-
| **GitHub Copilot CLI** | Add the repository marketplace, install `better-harness@better-harness`, start a new session, then use the report prompt below. |
155-
| **Cursor** | Load the plugin from source — see [Installation](#installation). |
156-
| **Pi** | Install the repository as a pi package: `pi install https://github.com/QoderAI/better-harness`, start a new session, then use `/better-harness` or `/skill:better-harness`. |
157-
158-
Once installed, ask Better Harness to generate the host's durable report:
159-
160-
```text
161-
/better-harness review this project's AI coding workflow and generate a report
162-
```
163-
164-
Better Harness scopes behavior claims to relevant Task Episodes and the
165-
surrounding project mechanisms. Qoder produces a Canvas report; Claude Code,
166-
Codex, Cursor, Qwen Code, GitHub Copilot, and Pi produce self-contained HTML
167-
with paired Markdown. Missing or partial evidence remains explicit. See the
168-
[Host Adapter Matrix](docs/adapters/README.md) for current coverage and output
169-
differences.
170-
171154
## Installation
172155

173156
Installation differs by coding agent. Install Better Harness separately for
@@ -210,6 +193,8 @@ stays explicit rather than being inferred.
210193

211194
### Codex
212195

196+
<a id="codex-desktop"></a>
197+
213198
#### Codex Desktop
214199

215200
1. Open **Settings > Plugins**.
@@ -229,6 +214,8 @@ Use `https://github.com/QoderAI/better-harness.git` with Git ref `main`.
229214

230215
![Codex Add plugin marketplace dialog with repository, Git ref, and optional sparse paths](assets/install/codex-add-marketplace.jpg)
231216

217+
<a id="codex-cli"></a>
218+
232219
#### Codex CLI
233220

234221
Add the repository source:
@@ -337,6 +324,25 @@ transcripts under `~/.copilot/session-state/`. Copilot records no per-response
337324
token usage, and VS Code Copilot Chat has no supported durable transcript; both
338325
remain explicit evidence boundaries.
339326

327+
### Qwen Code
328+
329+
Install Better Harness as a Qwen Code extension:
330+
331+
```bash
332+
qwen extensions install QoderAI/better-harness
333+
```
334+
335+
Start a new Qwen Code session in the repository you want to review and run the
336+
report prompt:
337+
338+
```text
339+
/better-harness review this project's AI coding workflow and generate a report
340+
```
341+
342+
Qwen Code produces a self-contained `report.html` with paired `report.md` and
343+
`findings.json`. Session evidence coverage depends on Qwen Code's available
344+
transcript paths; missing or partial evidence remains explicit.
345+
340346
### Pi
341347

342348
Install the repository as a [pi package](https://pi.dev/docs/latest/packages):
@@ -351,7 +357,7 @@ Or try it for a single run without changing settings:
351357
pi -e git:github.com/QoderAI/better-harness
352358
```
353359

354-
Pi discovers the `better-harness` skill and the `/better-harness` prompt
360+
Pi discovers the `better-harness` Skill and the `/better-harness` prompt
355361
template through the `pi` manifest in `package.json`. Start a new Pi session
356362
in the repository you want to review and run the report prompt:
357363

README.zh-CN.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,27 @@
2929
<a href="docs/community.md">参与贡献</a>
3030
</p>
3131

32-
<a id="see-it-in-action"></a>
32+
<a id="quick-start"></a>
3333

34-
## 看看实际效果
34+
## 快速开始
35+
36+
用以下 Coding Agent 审查你的工作流:[Claude Code](#claude-code)[Codex Desktop](#codex-desktop)[Codex CLI](#codex-cli)[Qoder Desktop/CLI](#qoder)[Cursor](#cursor)[Qwen Code](#qwen-code)[GitHub Copilot CLI](#github-copilot)
3537

36-
`/better-harness` 审查当前任务及其所在项目的 Harness,并生成一份可留存的报告
38+
安装完成后,让 Better Harness 生成当前宿主支持的持久化报告
3739

3840
```text
3941
/better-harness 审查此项目的 AI 编码工作流并生成报告
4042
```
4143

44+
Better Harness 会将行为断言限定在相关的任务过程片段(Task Episode)及其周边项目机制内。
45+
Qoder 生成 Canvas 报告;Claude Code、Codex、Cursor、Qwen Code 和 GitHub Copilot 生成自包含的 HTML 报告及配套 Markdown。
46+
缺失或不完整的证据会被明确标注。有关当前覆盖范围和输出差异,请参阅
47+
[宿主适配器矩阵](docs/adapters/README.md)
48+
49+
<a id="see-it-in-action"></a>
50+
51+
## 看看实际效果
52+
4253
报告会明确标注证据缺口,并将有证据支撑的问题整理成按优先级排列的发现;
4354
每项发现都包含影响、预期输出、范围明确的修复方案与验收检查。
4455

@@ -133,33 +144,6 @@ Better Harness 开放了三个相互关联的层次,而不只是一个斜杠
133144
该架构让三个证据域保持独立,直到主智能体进行统一分析。
134145
每个结果都会保留可见的证据来源、责任归属和验证路径。
135146

136-
<a id="quick-start"></a>
137-
138-
## 快速开始
139-
140-
选择你的编码智能体——几分钟内即可看到第一份报告:
141-
142-
| 编码智能体 | 设置方式 |
143-
| --- | --- |
144-
| **Claude Code** | 添加本仓库 Marketplace,安装 `better-harness@better-harness`,启动新会话,然后使用下方的报告提示词。 |
145-
| **Codex Desktop** |**Settings > Plugins > + Add > From Marketplace** 中添加本仓库,安装 Better Harness,启动新任务,然后调用 `@better-harness`|
146-
| **Codex CLI** | 添加 Git Marketplace,运行 `codex plugin add better-harness@better-harness`,然后调用 `$better-harness:better-harness`|
147-
| **Qoder Desktop / CLI** | 安装 Qoder Desktop 后无需额外安装——Better Harness 已内置,并可在桌面端和 CLI 中使用。打开仓库并使用下方的报告提示词。 |
148-
| **GitHub Copilot CLI** | 添加本仓库 Marketplace,安装 `better-harness@better-harness`,启动新会话,然后使用下方的报告提示词。 |
149-
| **Cursor** | 从源码加载插件——参见[安装](#installation)|
150-
| **Pi** | 以 pi package 安装本仓库:`pi install https://github.com/QoderAI/better-harness`,启动新会话,然后使用 `/better-harness``/skill:better-harness`|
151-
152-
安装完成后,让 Better Harness 生成当前宿主支持的持久化报告:
153-
154-
```text
155-
/better-harness 审查此项目的 AI 编码工作流并生成报告
156-
```
157-
158-
Better Harness 会将行为断言限定在相关的任务过程片段(Task Episode)及其周边项目机制内。
159-
Qoder 生成 Canvas 报告;Claude Code、Codex、Cursor、Qwen Code、GitHub Copilot 和 Pi 生成自包含的 HTML 报告及配套 Markdown。
160-
缺失或不完整的证据会被明确标注。有关当前覆盖范围和输出差异,请参阅
161-
[宿主适配器矩阵](docs/adapters/README.md)
162-
163147
<a id="installation"></a>
164148

165149
## 安装
@@ -203,6 +187,8 @@ Claude Code 默认会在仓库的 `.claude/better-harness` 报告根目录下生
203187

204188
### Codex
205189

190+
<a id="codex-desktop"></a>
191+
206192
#### Codex Desktop
207193

208194
1. 打开 **Settings > Plugins**
@@ -219,6 +205,8 @@ Claude Code 默认会在仓库的 `.claude/better-harness` 报告根目录下生
219205

220206
![Codex 添加插件 Marketplace 的对话框,包含仓库、Git ref 和可选的 sparse paths](assets/install/codex-add-marketplace.jpg)
221207

208+
<a id="codex-cli"></a>
209+
222210
#### Codex CLI
223211

224212
添加仓库源:
@@ -320,6 +308,23 @@ Copilot 会话证据来自 `~/.copilot/session-state/` 下与工作区匹配的
320308
Copilot 不记录逐次响应的 token 用量,VS Code Copilot Chat 也没有受支持的持久化会话记录;
321309
两者均作为明确的证据边界保留。
322310

311+
### Qwen Code
312+
313+
将 Better Harness 安装为 Qwen Code 扩展:
314+
315+
```bash
316+
qwen extensions install QoderAI/better-harness
317+
```
318+
319+
在要审查的仓库中启动新的 Qwen Code 会话,然后运行报告提示词:
320+
321+
```text
322+
/better-harness 审查此项目的 AI 编码工作流并生成报告
323+
```
324+
325+
Qwen Code 产出自包含的 `report.html`,并配套 `report.md``findings.json`
326+
会话证据覆盖范围取决于 Qwen Code 可用的会话记录路径;缺失或不完整的证据保持显式标注。
327+
323328
### Pi
324329

325330
将本仓库作为 [pi package](https://pi.dev/docs/latest/packages) 安装:
@@ -334,7 +339,7 @@ pi install https://github.com/QoderAI/better-harness
334339
pi -e git:github.com/QoderAI/better-harness
335340
```
336341

337-
Pi 通过 `package.json` 中的 `pi` manifest 发现 `better-harness` 技能和
342+
Pi 通过 `package.json` 中的 `pi` manifest 发现 `better-harness` Skill 和
338343
`/better-harness` 提示模板。在需要审查的仓库中启动新的 Pi 会话,运行报告提示词:
339344

340345
```text

docs/adapters/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ providers, real session-evidence adapters, and output modes. Canonical product
1616
judgment stays in `skills/`, `models/`, `references/`, `templates/`, and
1717
`scripts/<capability>/`.
1818

19-
The `@qoderai/better-harness` npm package includes the Qoder, Claude Code,
20-
Codex, Cursor, Qwen, Copilot, and Pi plugin metadata roots. The generated
21-
Qoder runtime bundle includes only the Qoder shell, `.qoder-plugin/`; non-Qoder
22-
generated host artifacts remain source-local. Claude Code installs its shell
23-
through the repository's native marketplace manifest. Pi installs the repository
24-
as a pi package through the `pi` manifest in `package.json`.
19+
The `@qoderai/better-harness` npm package includes six filesystem metadata
20+
roots for Qoder, Claude Code, Codex, Cursor, Qwen, and Copilot, plus Pi install
21+
metadata in the existing `package.json`. The generated Qoder runtime bundle
22+
includes only the Qoder shell, `.qoder-plugin/`; non-Qoder generated host
23+
artifacts remain source-local. Claude Code installs its shell through the
24+
repository's native marketplace manifest. Pi installs the repository as a pi
25+
package through the `pi` manifest in `package.json`.
2526

2627
| Host | Positioning | Shell | Configured Assets | Session Evidence | Default Output | Rules / Prompts | Smoke |
2728
| --- | --- | --- | --- | --- | --- | --- | --- |
@@ -31,7 +32,6 @@ as a pi package through the `pi` manifest in `package.json`.
3132
| Cursor | Analysis-capable source-local host | `.cursor-plugin/` | `scripts/agent-customize/providers/cursor.mjs` | `scripts/session-analysis/platforms/cursor.mjs` | self-contained HTML + Markdown | `.cursor` + `.codex` compatibility + `AGENTS.md` | `agent --plugin-dir . --mode ask --print` -> Cursor evidence bundle -> validated `html` render |
3233
| Qwen Code | Analysis-capable source-local host | `qwen-extension.json` | `scripts/agent-customize/providers/qwen.mjs` | `scripts/session-analysis/platforms/qwen.mjs` | self-contained HTML + Markdown | `.qwen` + `QWEN.md` + `AGENTS.md` | `harness prepare --platform qwen` -> finalize with `html-report` validation |
3334
| GitHub Copilot | Analysis-capable source-local host | `.github/plugin/` | `scripts/agent-customize/providers/copilot.mjs` | `scripts/session-analysis/platforms/copilot.mjs` | self-contained HTML + Markdown | `.github` + `AGENTS.md` + `~/.copilot` | `copilot plugin marketplace add .` -> `copilot plugin install better-harness@better-harness` -> configured-asset baseline -> validated `html` render |
34-
3535
| Pi | Analysis-capable source-local host | `pi` manifest in `package.json` | `scripts/agent-customize/providers/pi.mjs` | `scripts/session-analysis/platforms/pi.mjs` | self-contained HTML + Markdown | `.pi` + `.agents` + `AGENTS.md` | `pi install <source>` or `pi -e <source>` -> `/better-harness` prompt template -> validated `html` render |
3636

3737
## Discovery And Evidence

docs/adapters/contributing-new-coding-agent.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ A shell does not prove configured-asset or session support. A session parser doe
3636
not prove the Skill is natively discoverable. Do not register one slice merely
3737
to make another slice appear complete.
3838

39+
### Capability levels
40+
41+
Not every host lands with full end-to-end support. Be explicit about which of
42+
these levels the contribution reaches, and do not promote a host to the next
43+
level until the corresponding evidence exists:
44+
45+
| Level | What it means | Minimum evidence | Public visibility |
46+
| --- | --- | --- | --- |
47+
| Partial adapter | Some slices work (often shell, configured assets, or sessions) while others are partial or unavailable. | Spec names claimed, partial, and unavailable slices; provider/session tests pass for the claimed subset. | Matrix and docs list the host with explicit limitations; do not add to the public Quickstart list. |
48+
| Verified install/discovery | The native install, link, or discovery command is smoke-tested and the Skill loads. | Native CLI smoke in an isolated home/config when possible; fallback is a pinned official doc reference plus a recorded evidence boundary. | README Installation section may list the host; still not Quickstart unless the report loop is validated. |
49+
| Public Quickstart-ready | Full report loop works: install/discovery, configured assets, session evidence (when claimed), output routing, and a validated report render. | End-to-end report generation on a real or representative repository; tests cover the public-entrypoint set. | Host appears in the README Quickstart list, Docusaurus home-page cards, and installation tabs. |
50+
51+
A host can be merged at the partial or verified level and later promoted to
52+
public Quickstart-ready once the report loop evidence is complete.
53+
3954
## 2. Verify the Native Host Contract
4055

4156
Do not derive a new host contract by renaming another adapter. Record the host
@@ -119,7 +134,7 @@ sessions, reports, and packaging have different owners. Search for the existing
119134
host set before editing:
120135

121136
```bash
122-
rg -n "qoder|codex|claude|cursor|qwen" scripts test references templates docs package.json
137+
rg -n "qoder|codex|claude|cursor|qwen|copilot|pi" scripts test references templates docs package.json
123138
```
124139

125140
Use the results as an inventory, not a replacement template. Typical registration

docs/docs/concepts/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ progressive detail you load when a task needs it.
6666
| --- | --- |
6767
| Skill | A repeatable agent workflow defined by `SKILL.md` frontmatter plus a concise workflow. |
6868
| Host adapter | Per-host discovery and evidence-shape glue; keeps the engine host-neutral. |
69-
| Host shell | Thin host metadata (`.claude-plugin/`, `.qoder-plugin/`, `.cursor-plugin/`, `.codex-plugin/`) that exposes canonical behavior without owning product logic. |
69+
| Host shell | Thin host metadata (`.claude-plugin/`, `.qoder-plugin/`, `.cursor-plugin/`, `.codex-plugin/`, `.github/plugin/`, `qwen-extension.json`, or a future lifecycle shell) that exposes canonical behavior without owning product logic; the public npm package ships all six current metadata roots, while the Qoder runtime bundle includes only `.qoder-plugin/`. |
7070
| Canonical owner | The single directory that owns a behavior's product judgment; host shells and mirrors point back to it. |
7171

7272
The full glossary with owner links lives in

docs/docs/hosts/adapter-matrix.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ host-neutral.
1919
| Claude Code | Analysis-capable source-local host | `.claude-plugin/` | Workspace-matching local Claude transcripts when present | Self-contained HTML + Markdown |
2020
| Codex | Analysis-capable source-local host | `.codex-plugin/` | Codex sessions | Self-contained HTML + Markdown |
2121
| Cursor | Analysis-capable source-local host | `.cursor-plugin/` | Workspace-matched transcripts, metadata, and audit logs; partial coverage stays explicit | Self-contained HTML + Markdown |
22-
| Qwen Code | Analysis-capable source-local host | `qwen-extension.json` | Workspace-matching JSONL transcripts under `~/.qwen/projects/<slug>/chats/` | Self-contained HTML + Markdown |
23-
| GitHub Copilot | Analysis-capable source-local host | `.github/plugin/` | Workspace-matching transcripts under `~/.copilot/session-state/<id>/events.jsonl` | Self-contained HTML + Markdown |
24-
| Pi | Analysis-capable source-local host | `pi` manifest in `package.json` | Workspace-matching JSONL transcripts under `~/.pi/agent/sessions/` | Self-contained HTML + Markdown |
22+
| Qwen Code | Analysis-capable source-local host | `qwen-extension.json` | Workspace-matching local Qwen transcripts when present | Self-contained HTML + Markdown |
23+
| GitHub Copilot | Analysis-capable source-local host | `.github/plugin/` | Workspace-matched Copilot CLI transcripts; partial coverage stays explicit | Self-contained HTML + Markdown |
2524

2625
The `@qoderai/better-harness` npm package includes all six plugin metadata
2726
roots. The generated Qoder runtime bundle includes only the Qoder shell;
@@ -31,8 +30,8 @@ non-Qoder generated host artifacts remain source-local.
3130

3231
- **Qoder Canvas** — renderer-owned `findings.json`, Canvas-only
3332
`canvas.json`, and `report.canvas.tsx`.
34-
- **HTML visual** — portable Claude Code/Codex/Cursor/Qwen/Copilot/Pi contract covering
35-
`findings.json`, `report.md`, and a self-contained `report.html`
33+
- **HTML visual** — portable Claude Code/Codex/Cursor/Qwen/Copilot contract
34+
covering `findings.json`, `report.md`, and a self-contained `report.html`
3635
(see the [live demo](pathname:///demo/better-harness-report/)).
3736
- **Markdown-only** — no visual companion.
3837

0 commit comments

Comments
 (0)