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
23 changes: 22 additions & 1 deletion .agents/skills/euthyna-en/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ facts from the producers decide where the manual reading must be directed.
In particular: every suspected finding reported by Stage B must go through Stage C one by
one — never write it straight into the report as a conclusion.

### Modes (slash commands)

When a user arrives through a slash command, map the mode to the stage and the first
command using this table. **The table is maintained only here**; the host command files
(Cursor / OpenCode / Copilot / Hermes) point at this section instead of each keeping their
own copy.

| You type | Which branch | First command |
|---|---|---|
| `/euthyna pr` | Stage B, the change surface | `euthyna audit` (omit `--base` and the fork point is inferred and declared) |
| `/euthyna graph` | Stage B, the provenance view | `euthyna audit --graph` (`--base` may be omitted here too) |
| `/euthyna repo` | Stage A, the dependency surface | `euthyna deps --all` |
| `/euthyna claim <assertion>` | Stage C, the claim surface | `euthyna coverage --symbol <name>` |
| `/euthyna gate <report>` | Validating a written report | `euthyna gate <report>` |
| `/euthyna help` | Print this table only | run nothing, change no state |

`/euthyna graph` is not a new measurement: `--graph` only draws the attribution `history`
already emits, as Mermaid. **A missing second edge does not mean the content never moved** —
the boundaries are in references/fact-producers.md.

---

## The two deterministic measurements this skill ships
Expand All @@ -117,7 +137,8 @@ reliably — are shipped by this skill as a zero-dependency CLI:
| `coverage` | Was this symbol **ever actually invoked** by a test run? | when the report claims "tested / not tested" (Stage B / C) |

```powershell
# the only required argument is --base (pre-change revision / PR fork point):
# --base may be omitted: then the fork point is inferred as merge-base(HEAD, origin/main) and
# declared as range-inferred in the report. When given, it is used exactly as given:
node <euthyna repo>/bin/euthyna.js audit --base <pre-change revision> --repo <audited repo>

# history / coverage run alone when needed:
Expand Down
5 changes: 5 additions & 0 deletions .agents/skills/euthyna-en/references/fact-producers.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ node <euthyna repo>/bin/euthyna.js history --base <pre-change revision> --no-ori
```

`--base` is the **pre-change revision** (the PR's fork point); `--head` defaults to `HEAD`.
Omitting `--base` infers it as `merge-base(<the audited head>, origin/main)`, marks the range line as inferred
and adds a `range-inferred` entry to the criteria not evaluated. An inferred range reaches **the
fork point only** — nothing earlier; when neither ref resolves the run stops with a usage error
instead of guessing `HEAD~1`. This is what lets a slash command arrive with no arguments, so
**the first thing to do with `range-inferred` is check the fork point**, not accept it.
When the fork point is uncertain, use the result of `git merge-base <target branch> HEAD`.

### Attribution semantics (two inherent approximations; established ≠ exact)
Expand Down
19 changes: 18 additions & 1 deletion .agents/skills/euthyna/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@ license: Apache-2.0
**可以做多个阶段,但阶段之间不许互相替代。**
特别是:**阶段 B 报出的疑似发现,必须逐个走阶段 C 验证**,不许直接写进报告当结论。

### 模式词(斜杠命令)

用户用斜杠命令进来时,按下表把模式映射到阶段与第一条命令。**词表只在这里维护**,
各宿主命令文件(Cursor / OpenCode / Copilot / Hermes)指向本节,不各自重抄一份。

| 你打 | 走哪条支路 | 第一条命令 |
|---|---|---|
| `/euthyna pr` | 阶段 B 变更面 | `euthyna audit`(省略 `--base` 即按分叉点推断并声明) |
| `/euthyna graph` | 阶段 B 的来源谱系视图 | `euthyna audit --graph`(同样可省略 `--base`) |
| `/euthyna repo` | 阶段 A 依赖面 | `euthyna deps --all` |
| `/euthyna claim <结论>` | 阶段 C 结论面 | `euthyna coverage --symbol <名>` |
| `/euthyna gate <报告>` | 校验一份已写的报告 | `euthyna gate <报告>` |
| `/euthyna help` | 只打印这张表 | 不跑命令,不改变状态 |

`/euthyna graph` 不是新测量:`--graph` 只是把 `history` 已经给出的归属画成 Mermaid。
**图上没有第二条边不等于内容没被移过**,边界见 references/fact-producers.md。

---

## 本技能自带的两个确定性测量
Expand All @@ -106,7 +123,7 @@ license: Apache-2.0
| `coverage` | 某个符号在测试运行中**到底有没有被调用过**? | 报告里要说「测过 / 没测过」时(阶段 B / C) |

```powershell
# 唯一必需的参数是 --base(改前版本 / PR 分叉点):
# --base 可以省略:省略时按 merge-base(HEAD, origin/main) 推断,并在报告里声明为 range-inferred
node <euthyna 仓库>/bin/euthyna.js audit --base <改前版本> --repo <被审计的仓库>

# history / coverage 按需单独跑:
Expand Down
4 changes: 4 additions & 0 deletions .agents/skills/euthyna/references/fact-producers.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ node <euthyna 仓库>/bin/euthyna.js history --base <改前版本> --no-origins
```

`--base` 是**改前版本**(PR 的分叉点),`--head` 默认 `HEAD`。
省略 `--base` 时按 `merge-base(<被审的 head>, origin/main)` 推断,并在「范围」那一行标出「推断」、在
「未评估的判据」里加一条 `range-inferred`。推断出的范围**只到分叉点**,看不到更早的历史;
两个引用都解析不出来时报用法错误,不猜 `HEAD~1`。斜杠命令免参数进来靠的就是这条,所以
**看到 `range-inferred` 第一步是确认分叉点对不对**,而不是接受它。
分叉点不确定时用 `git merge-base <目标分支> HEAD` 的结果。

### 归属语义(两个固有近似,已确证≠精确)
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/euthyna.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: 代码安全审计:按 euthyna 纪律审一段代码、一次变更或一条漏洞结论,产出带证据的报告
argument-hint: "<路径 或 diff 范围>"
argument-hint: "<模式词 或 路径 / diff 范围>"
allowed-tools: Read, Grep, Glob, Bash, Task
---

Expand All @@ -11,7 +11,7 @@ allowed-tools: Read, Grep, Glob, Bash, Task
按 euthyna 技能执行一次完整审计:

1. **先加载纪律**:找到 euthyna 技能目录(`~/.claude/skills/euthyna/`、项目 `.claude/skills/euthyna/` 或 `.agents/skills/euthyna/`),读 `SKILL.md`,需要时再读 `references/`。找不到就明说「技能缺失」,不要凭印象执行。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。**模式词优先于下面全部步骤**:参数命中 `SKILL.md`「模式词(斜杠命令)」表里的模式时,只执行该模式映射的那一条命令并按其结果收口——`help` 只打印那张表,不跑任何命令、不做审计、不写报告;未命中模式词时,才走下面的通用审计步骤,其余文字按审计目标处理。
3. **先测量再读码**:diff 有删除行先跑 `history`;谈测试覆盖先跑 `coverage`;依赖声明先跑 `deps`(操作手册在 `references/fact-producers.md`)。
4. **每条结论过六道门禁**:证据到 `文件:行号`、可复现命令、影响说明;拿不出证据的降级为「观察」。
5. **三态裁定**:`BUG #N TRUE POSITIVE / FALSE POSITIVE / INCONCLUSIVE`。
Expand Down
2 changes: 1 addition & 1 deletion .cursor/commands/euthyna.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
按 euthyna 技能执行一次完整审计:

1. **先加载纪律**:找到 euthyna 技能目录(`~/.cursor/skills/euthyna/`、项目 `.cursor/skills/euthyna/`,或 npm 全局包内的 `.agents/skills/euthyna/`),读 `SKILL.md`,需要时再读 `references/`。找不到就明说「技能缺失」,不要凭印象执行。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。**模式词优先于下面全部步骤**:参数命中 `SKILL.md`「模式词(斜杠命令)」表里的模式时,只执行该模式映射的那一条命令并按其结果收口——`help` 只打印那张表,不跑任何命令、不做审计、不写报告;未命中模式词时,才走下面的通用审计步骤,其余文字按审计目标处理。
3. **先测量再读码**:第一条命令跑 `euthyna audit --base <分叉点> --repo <被审计仓库>`(history + deps 一次跑完);谈测试覆盖再跑 `coverage`(操作手册在 `references/fact-producers.md`)。
4. **每条结论过六道门禁**:证据到 `文件:行号`、可复现命令、影响说明;拿不出证据的降级为「观察」。
5. **三态裁定**:`BUG #N TRUE POSITIVE / FALSE POSITIVE / INCONCLUSIVE`。
Expand Down
2 changes: 1 addition & 1 deletion .github/prompts/euthyna.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 代码安全审计:按 euthyna 纪律审一段代码、一次变
按 euthyna 技能执行一次完整审计:

1. **先加载纪律**:找到 euthyna 技能目录(项目 `.github/skills/euthyna/` 或 `.agents/skills/euthyna/`,个人 `~/.copilot/skills/euthyna/`),读 `SKILL.md`,需要时再读 `references/`。找不到就明说「技能缺失」,不要凭印象执行。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。
2. **按入口决策树走**:单条漏洞结论 → 阶段 C;一次变更 → 阶段 B;依赖面 → 阶段 A;整体审计 → 阶段 B 为主。**模式词优先于下面全部步骤**:参数命中 `SKILL.md`「模式词(斜杠命令)」表里的模式时,只执行该模式映射的那一条命令并按其结果收口——`help` 只打印那张表,不跑任何命令、不做审计、不写报告;未命中模式词时,才走下面的通用审计步骤,其余文字按审计目标处理。
3. **先测量再读码**:第一条命令跑 `euthyna audit --base <分叉点> --repo <被审计仓库>`(history + deps 一次跑完);谈测试覆盖再跑 `coverage`(操作手册在 `references/fact-producers.md`)。
4. **每条结论过六道门禁**:证据到 `文件:行号`、可复现命令、影响说明;拿不出证据的降级为「观察」。复现命令执行前须向用户报备(见技能「执行纪律」节)。
5. **三态裁定**:`BUG #N TRUE POSITIVE / FALSE POSITIVE / INCONCLUSIVE`。
Expand Down
6 changes: 4 additions & 2 deletions .opencode/commands/euthyna.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
description: Run the euthyna code security audit CLI
---
Run the euthyna CLI with these arguments and report the measured result:
If the arguments match a mode word in the euthyna skill’s "Modes (slash commands)" table,
translate them per that table and run the mapped command; the table is maintained in the
skill, not here. Otherwise run the CLI with the arguments as given:
Comment thread
coderabbitai[bot] marked this conversation as resolved.

euthyna $ARGUMENTS

If `euthyna` is not installed, use `npx -y euthyna $ARGUMENTS` instead. Quote the command's output verbatim, exit code included — never estimate or re-derive numbers. If the euthyna skill is installed (`.agents/skills/euthyna/` or `~/.agents/skills/euthyna/`), read its SKILL.md and interpret the output under the six-gate adjudication format; claims without evidence are downgraded to observations.
If `euthyna` is not installed, run the **same mapped arguments** through `npx -y euthyna …` — a mode word resolves through the table first, so the fallback never executes `euthyna <mode>` literally, and `help` still runs nothing. Quote the command's output verbatim, exit code included — never estimate or re-derive numbers. If the euthyna skill is installed (`.agents/skills/euthyna/` or `~/.agents/skills/euthyna/`), read its SKILL.md and interpret the output under the six-gate adjudication format; claims without evidence are downgraded to observations.
Loading
Loading