Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
id: version
attributes:
label: Trellis Version
description: Output of `trellis --version`
description: Output of `research-trellis --version`
validations:
required: true
- type: input
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: pnpm build

- name: Hermes preflight
run: pnpm --filter trellis-hermes hermes:preflight
run: pnpm --filter research-trellis hermes:preflight

- name: Pack publish artifacts
run: node packages/cli/scripts/release-preflight.js pack-publish-artifacts
Expand Down Expand Up @@ -83,26 +83,28 @@ jobs:
cd "${smoke_dir}"
npm install --ignore-scripts "${tarballs[@]}"

expected_version="$(node -p "require('./node_modules/trellis-hermes/package.json').version")"
core_version="$(node -p "require('./node_modules/trellis-hermes-core/package.json').version")"
expected_version="$(node -p "require('./node_modules/research-trellis/package.json').version")"
core_version="$(node -p "require('./node_modules/research-trellis-core/package.json').version")"
test "${core_version}" = "${expected_version}"
test "$(./node_modules/.bin/research-trellis --version)" = "${expected_version}"
test "$(./node_modules/.bin/trellis --version)" = "${expected_version}"
test "$(./node_modules/.bin/tl --version)" = "${expected_version}"
./node_modules/.bin/research-trellis --help >/dev/null
./node_modules/.bin/trellis --help >/dev/null
./node_modules/.bin/tl --help >/dev/null

node --input-type=module <<'NODE'
import fs from "node:fs";
import path from "node:path";

const cliRoot = path.join(process.cwd(), "node_modules/trellis-hermes");
const cliRoot = path.join(process.cwd(), "node_modules/research-trellis");
const cliPackage = JSON.parse(
fs.readFileSync(path.join(cliRoot, "package.json"), "utf8"),
);
const coreDependency = cliPackage.dependencies?.["trellis-hermes-core"];
const coreDependency = cliPackage.dependencies?.["research-trellis-core"];
if (coreDependency !== cliPackage.version) {
throw new Error(
`trellis-hermes depends on trellis-hermes-core@${coreDependency}, expected exact ${cliPackage.version}`,
`research-trellis depends on research-trellis-core@${coreDependency}, expected exact ${cliPackage.version}`,
);
}

Expand All @@ -123,12 +125,12 @@ jobs:
}

const specifiers = [
"trellis-hermes",
"trellis-hermes-core",
"trellis-hermes-core/channel",
"trellis-hermes-core/mem",
"trellis-hermes-core/task",
"trellis-hermes-core/testing",
"research-trellis",
"research-trellis-core",
"research-trellis-core/channel",
"research-trellis-core/mem",
"research-trellis-core/task",
"research-trellis-core/testing",
];
await Promise.all(specifiers.map((specifier) => import(specifier)));
NODE
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:
id-token: write

concurrency:
group: pages
group: pages-${{ github.event_name == 'push' && 'deploy' || github.ref }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
pnpm lint
pnpm test
pnpm build
pnpm --filter trellis-hermes hermes:preflight
pnpm --filter research-trellis hermes:preflight
node packages/cli/scripts/release-preflight.js check-versions --require-tag
node packages/cli/scripts/release-preflight.js verify-packed-cli

Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"packages/cli/src/**/*.ts": ["pnpm --filter trellis-hgl exec eslint --fix", "pnpm --filter trellis-hgl exec prettier --write"]
"packages/cli/src/**/*.ts": ["pnpm --filter research-trellis exec eslint --fix", "pnpm --filter research-trellis exec prettier --write"]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thanks for your interest in contributing to Trellis! This document provides guid
Before creating a bug report, please check [existing issues](https://github.com/mindfold-ai/Trellis/issues) to avoid duplicates.

When reporting a bug, include:
- Trellis version (`trellis --version`)
- Research Trellis version (`research-trellis --version`)
- Node.js version (`node --version`)
- Operating system
- Steps to reproduce
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
提交 Bug 前,请先查看 [已有 Issues](https://github.com/mindfold-ai/Trellis/issues) 避免重复。

报告 Bug 时请包含:
- Trellis 版本 (`trellis --version`)
- Research Trellis 版本 (`research-trellis --version`)
- Node.js 版本 (`node --version`)
- 操作系统
- 复现步骤
Expand Down
52 changes: 31 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Trellis-Hermes
# Research Trellis

面向科研项目的 `Trellis`(原版 Trellis)实验性改造分支。

[![CI](https://github.com/Explero/Trellis-Hermes/actions/workflows/ci.yml/badge.svg)](https://github.com/Explero/Trellis-Hermes/actions/workflows/ci.yml)
[![CI](https://github.com/Explero/research-trellis/actions/workflows/ci.yml/badge.svg)](https://github.com/Explero/research-trellis/actions/workflows/ci.yml)
[![License: AGPL-3.0-or-later](https://img.shields.io/badge/license-AGPL--3.0--or--later-16a34a.svg?style=flat-square)](LICENSE)

这个仓库是在原版 `Trellis`(原版项目)基础上改造出来的科研实验分支,不是上游官方版本,也不代表上游项目立场。它更接近一个科研项目里的工作流工具实验:在原版 Trellis 的任务、规范、平台接入基础上,加入更强的 `Hermes`(科研工作流)记录、门禁和子代理协作约束。

当前状态:可以放进低风险真实科研项目里试部署;不建议直接用于不可回滚的关键项目。

当前 npm 发布包为 `trellis-hermes`(CLI 包)和 `trellis-hermes-core`(核心包)。
从 `0.6.0-beta.31`(测试版)开始,项目使用 `research-trellis`(CLI 包)和 `research-trellis-core`(核心包),与上游原版名称明确区分。旧包 `trellis-hermes` 和 `trellis-hermes-core` 停留在 `0.6.0-beta.30`(旧测试版),仅用于已有安装迁移。

## 上游来源与修改声明

本项目基于 `mindfold-ai/Trellis`(上游 Trellis 项目)继续修改,原项目地址为 `https://github.com/mindfold-ai/Trellis`(上游仓库)。

为了避免混淆,这里先说明几个边界:

- `Trellis-Hermes`(科研改造版)不是上游 `Trellis`(原版项目)的官方发布版本;
- `Research Trellis`(科研改造版)不是上游 `Trellis`(原版项目)的官方发布版本;
- 仓库中的原始 Trellis 代码、模板、文档结构和许可证声明应继续归属于其原始作者和贡献者;
- 本仓库新增和改动的部分主要围绕 `Hermes`(科研工作流)、记录门禁、子代理治理、科研计划变更记录和发布前预检;
- 如果后续公开发布到 `npm`(包平台)或 `GitHub`(代码托管平台),应继续保留上游来源、许可证和修改说明。

## 这是什么

`Trellis-Hermes`(科研改造版)是一个本地开发工具,用来把 AI 协作开发过程里的关键动作落到仓库文件中:
`Research Trellis`(科研改造版)是一个本地开发工具,用来把 AI 协作开发过程里的关键动作落到仓库文件中:

- 需求、设计、实现计划和检查记录放进 `.trellis/tasks/`;
- 项目规范和工作流规则放进 `.trellis/spec/` 与 `.trellis/workflow.md`;
Expand All @@ -42,7 +42,7 @@ pnpm install --frozen-lockfile
pnpm lint
pnpm test
pnpm build
pnpm --filter trellis-hermes hermes:preflight
pnpm --filter research-trellis hermes:preflight
```

这些检查覆盖:
Expand All @@ -64,18 +64,18 @@ pnpm --filter trellis-hermes hermes:preflight
pnpm lint
pnpm test
pnpm build
pnpm --filter trellis-hermes hermes:preflight
pnpm --filter research-trellis hermes:preflight
node packages/cli/scripts/release-preflight.js check-versions --require-tag
node packages/cli/scripts/release-preflight.js verify-packed-cli
```

检查通过后,它会先发布 `trellis-hermes-core`(核心包),再发布 `trellis-hermes`(CLI 包),最后从 npm registry 验证两个包是否可见。
检查通过后,它会先发布 `research-trellis-core`(核心包),再发布 `research-trellis`(CLI 包),最后从 npm registry 验证两个包是否可见。

发布前还需要在 `npm`(包平台)侧完成:

- 创建或认领 `trellis-hermes-core` 与 `trellis-hermes` 两个包;
- 创建或认领 `research-trellis-core` 与 `research-trellis` 两个包;
- 给两个包配置 `trusted publishing`(可信发布);
- `Owner`(所有者)填写 `Explero`,`Repository`(仓库)填写 `Trellis-Hermes`;
- `Owner`(所有者)填写 `Explero`,`Repository`(仓库)填写 `research-trellis`;
- `Workflow filename`(流程文件名)填写 `publish.yml`;
- `Environment`(环境)填写 `npm-production`。

Expand All @@ -94,18 +94,28 @@ node packages/cli/scripts/release-preflight.js verify-packed-cli

## 从源码试用

普通试用可安装已发布的测试版:
新包发布后,可固定安装本次测试版:

```bash
npm install -g trellis-hermes@0.6.0-beta.30
trellis --version
npm install -g research-trellis@0.6.0-beta.31
research-trellis --version
```

原有 `trellis` 与 `tl` 命令继续可用,便于已有脚本迁移;新文档统一使用 `research-trellis` 作为主命令。

已经安装旧包时,发布后按下面的方式迁移:

```bash
npm uninstall -g trellis-hermes
npm install -g research-trellis@0.6.0-beta.31
research-trellis --version
```

需要修改或审阅实现时,再从 GitHub 源码运行:

```bash
git clone git@github.com:Explero/Trellis-Hermes.git
cd Trellis-Hermes
git clone git@github.com:Explero/research-trellis.git
cd research-trellis
corepack enable
pnpm install --frozen-lockfile
pnpm build
Expand All @@ -117,14 +127,14 @@ pnpm build
cd /path/to/your/research-project
git status
git add .
git commit -m "chore: checkpoint before Trellis-Hermes trial"
node /path/to/Trellis-Hermes/packages/cli/bin/trellis.js init -u your-name --claude
git commit -m "chore: checkpoint before Research Trellis trial"
node /path/to/research-trellis/packages/cli/bin/trellis.js init -u your-name --claude
```

如果项目里已经有 Trellis,可以先用 `update`(更新)而不是重新初始化:

```bash
node /path/to/Trellis-Hermes/packages/cli/bin/trellis.js update
node /path/to/research-trellis/packages/cli/bin/trellis.js update
```

执行前请先看清楚提示,涉及覆盖文件时不要盲目确认。
Expand All @@ -135,7 +145,7 @@ node /path/to/Trellis-Hermes/packages/cli/bin/trellis.js update

```text
准备一个干净 git checkpoint
→ 初始化或更新 Trellis-Hermes
→ 初始化或更新 Research Trellis
→ 用自然语言提出一个小任务
→ 让 AI 创建任务并补齐 planning
→ 检查 .trellis/tasks/ 下的 prd/design/implement 产物
Expand Down Expand Up @@ -187,7 +197,7 @@ node /path/to/Trellis-Hermes/packages/cli/bin/trellis.js update

这个项目基于原版 `Trellis`(原版 AI coding 工作流工具)继续改造,仍然保留:

- `trellis init` / `trellis update`;
- `research-trellis init` / `research-trellis update`;
- `.trellis/spec/` 项目规范;
- `.trellis/tasks/` 任务系统;
- 多平台接入模板;
Expand Down Expand Up @@ -239,7 +249,7 @@ node /path/to/Trellis-Hermes/packages/cli/bin/trellis.js update
pnpm lint
pnpm test
pnpm build
pnpm --filter trellis-hermes hermes:preflight
pnpm --filter research-trellis hermes:preflight
```

如果改动涉及 Hermes 模板、hook 或任务流,优先补充对应测试,再看 GitHub Actions 结果。
Expand Down
10 changes: 5 additions & 5 deletions docs/hermes_deployment_preflight.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
1. 先运行 quick gate:

```bash
pnpm --filter trellis-hermes hermes:preflight -- --quick
pnpm --filter research-trellis hermes:preflight -- --quick
```

2. 发布前补跑完整验证:

```bash
pnpm --filter trellis-hermes exec vitest run test/templates/hermes-runtime.test.ts test/templates/trellis.test.ts test/templates/claude.test.ts test/templates/codex.test.ts test/templates/shared-hooks.test.ts
PYTHONPYCACHEPREFIX=/tmp/trellis-hermes-pycache python3 -m py_compile packages/cli/src/templates/trellis/scripts/hermes/*.py packages/cli/src/templates/shared-hooks/hermes-runtime-guard.py
pnpm --filter trellis-hermes typecheck
pnpm --filter trellis-hermes build
pnpm --filter research-trellis exec vitest run test/templates/hermes-runtime.test.ts test/templates/trellis.test.ts test/templates/claude.test.ts test/templates/codex.test.ts test/templates/shared-hooks.test.ts
PYTHONPYCACHEPREFIX=/tmp/research-trellis-pycache python3 -m py_compile packages/cli/src/templates/trellis/scripts/hermes/*.py packages/cli/src/templates/shared-hooks/hermes-runtime-guard.py
pnpm --filter research-trellis typecheck
pnpm --filter research-trellis build
```

3. 若 Python 编译后出现 `__pycache__` 或 `.pyc` 在模板目录内,不能发布;用 `gio trash` 或 `trash` 清理后重跑 preflight。
Expand Down
10 changes: 5 additions & 5 deletions docs/hermes_trellis_research_transformation_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ P6 部署前安全 gate:

最终验证记录:

- [x] `pnpm --filter trellis-hermes exec vitest run test/templates/hermes-runtime.test.ts test/templates/trellis.test.ts test/templates/claude.test.ts test/templates/codex.test.ts test/templates/shared-hooks.test.ts`:5 个文件、135 个测试通过。
- [x] `PYTHONPYCACHEPREFIX=/tmp/trellis-hermes-final-pycache python3 -m py_compile packages/cli/src/templates/trellis/scripts/hermes/*.py packages/cli/src/templates/shared-hooks/hermes-runtime-guard.py`:通过。
- [x] `pnpm --filter trellis-hermes test`:44 个文件、1259 个测试通过。
- [x] `pnpm --filter trellis-hermes typecheck`:通过。
- [x] `pnpm --filter trellis-hermes build`:通过。
- [x] `pnpm --filter research-trellis exec vitest run test/templates/hermes-runtime.test.ts test/templates/trellis.test.ts test/templates/claude.test.ts test/templates/codex.test.ts test/templates/shared-hooks.test.ts`:5 个文件、135 个测试通过。
- [x] `PYTHONPYCACHEPREFIX=/tmp/research-trellis-final-pycache python3 -m py_compile packages/cli/src/templates/trellis/scripts/hermes/*.py packages/cli/src/templates/shared-hooks/hermes-runtime-guard.py`:通过。
- [x] `pnpm --filter research-trellis test`:44 个文件、1259 个测试通过。
- [x] `pnpm --filter research-trellis typecheck`:通过。
- [x] `pnpm --filter research-trellis build`:通过。
- [x] 模板目录无 `__pycache__` / `.pyc` 缓存污染。

## 6. 完成定义
Expand Down
10 changes: 5 additions & 5 deletions docs/manual/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 目标

理解 `Trellis-Hermes`(科研改造版)解决什么问题、与上游的关系,以及当前版本不能提供什么。
理解 `Research Trellis`(科研改造版)解决什么问题、与上游的关系,以及当前版本不能提供什么。

## 适用范围

Expand All @@ -11,7 +11,7 @@
## 前置条件

- 能管理目标项目中的文件和提交。
- 接受当前版本为 `0.6.0-beta.30`(测试版)。
- 接受当前版本为 `0.6.0-beta.31`(测试版)。
- 不把它当作安全隔离工具或自动科研结论系统。

## 操作步骤
Expand Down Expand Up @@ -43,9 +43,9 @@

## 验证记录

- 日期:2026-07-14。
- 版本:`0.6.0-beta.30`(测试版)。
- 基准提交:`9f7dc8497b4782878d6fa7ac3b63eba5bde507df`(当前基准)。
- 日期:2026-07-15。
- 版本:`0.6.0-beta.31`(测试版)。
- 更名前基准提交:`9f7dc8497b4782878d6fa7ac3b63eba5bde507df`。
- 命令:`rg -n "AGPL|Hermes|未实现" README.md docs/manual/appendix-f-feature-status.md`(静态核对)。
- 结果:项目定位、上游归属、实验性与未实现边界已对齐。
- 未验证项:生产环境安全性和长期真实科研负载。
Expand Down
Loading