Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to @rpamis/comet will be documented in this file.

## What's Changed [0.4.0-beta.9] - 2026-07-23

### Added

- **`comet native evidence format`**: New command that serializes acceptance evidence entries into the exact canonical Markdown block `verification.md` requires, so evidence blocks no longer need to be hand-formatted to match byte-for-byte and no longer trigger spurious "canonical serialization" rejections during Verify.

### Fixed

- **Plugin marketplace superpowers detection**: `comet init` no longer crashes with an `ENOTDIR` error when `~/.claude/plugins/cache/` (or the Codex equivalent) contains a stray file where a marketplace directory was expected.

### Security

- **Race-safe file reads**: Reading `.comet/current-change.json` (used on every Hook Router call, `comet doctor`, and `comet resume-probe`), Native lock files, and `comet native evidence format --entries` input could previously be tricked mid-read: swapping the file for a symlink between the check and the read leaked the link target's content, and a FIFO at the lock path hung the process. These reads now reject non-regular files before opening and verify the file is still the same one after opening and after reading, so a swapped file fails the read instead of being silently accepted. Windows, which lacks `O_NOFOLLOW`, gets the same protection through the identity checks.

## What's Changed [0.4.0-beta.8] - 2026-07-22

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.4.0-beta.8",
"version": "0.4.0-beta.9",
"skills": [
"comet/SKILL.md",
"comet-classic/SKILL.md",
Expand Down
2 changes: 1 addition & 1 deletion assets/skills-zh/comet-native/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Runtime 无法证明 scope 完整时会停在 Build,返回 partial scope hash

根据 Acceptance examples、完整目标规格和风险运行验证。记录实际命令、结果、跳过项、规格一致性、已知限制和结论;未运行的检查不能写成通过。

在 `verification.md` 的固定 acceptance evidence 块中逐项使用 Runtime 返回的 `acceptance_id`。每项只能记录项目相对 evidence refs,或记录诚实的 `skipped_reason`。格式见产物参考。
在 `verification.md` 的固定 acceptance evidence 块中逐项使用 Runtime 返回的 `acceptance_id`。每项只能记录项目相对 evidence refs,或记录诚实的 `skipped_reason`。用 `comet native evidence format` 把条目序列化成规范文本再粘贴,不要手工排版这段 JSON——手写几乎不可能逐字节匹配规范序列化规则。格式见产物参考。

需要一份可重建的文本卫生证据时,可运行内置只读检查:

Expand Down
8 changes: 7 additions & 1 deletion assets/skills-zh/comet-native/reference/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Sequential 模式的 Open questions 同时保存一个最上游阻塞问题。Ba

Runtime 最多从 brief 与拟议规格合计派生 1024 个验收项,超出就拒绝继续,不会先构造无界列表再截断。`acceptancePage` 每页最多 16 项;单项文字最多 512 UTF-8 字节、context 最多 4 项且每项最多 256 字节,整页最多 32 KiB。文字或 context 截断会显式标记,验收 ID 不会因分页或截断而丢失;cursor 绑定当前 acceptance hash,契约变化后旧 cursor 会失效。

`# Acceptance evidence` 下必须恰好有一个固定机器块。ID 由 Runtime 从 brief/spec 派生,通过 Build 结果或 `status --details` 返回;不要自行计算或改写:
`# Acceptance evidence` 下必须恰好有一个固定机器块。ID 由 Runtime 从 brief/spec 派生,通过 Build 结果或 `status --details` 返回;不要自行计算或改写。生成这个块时用 `comet native evidence format` 把条目序列化成规范文本再粘贴进去,不要手工排版 JSON——手写几乎不可能逐字节匹配规范序列化规则,会被拒绝并报 "canonical serialization" 错误

```text
<!-- comet-native:acceptance-evidence:start -->
Expand All @@ -177,6 +177,12 @@ Runtime 最多从 brief 与拟议规格合计派生 1024 个验收项,超出

数组按 `acceptance_id` 排序,`evidence_refs` 也排序。每项只能二选一:至少一个项目相对 evidence ref,或空数组加非空 `skipped_reason`。不能同时给证据和跳过理由,也不能引用绝对路径、Native 外部路径、`.git` 或 `.env*`。

```text
comet native evidence format [--entries <path>]
```

把上面这份条目数组(不带 markers)以 JSON 通过 stdin 传入,或用 `--entries <path>` 指定一个 JSON 文件;命令输出的文本已经包含 start/end markers 和规范排序、缩进,原样粘贴到 verification.md 的 `# Acceptance evidence` 一节即可。

## 内容寻址证据

- `baseline-manifest.json`:change 创建时的有界项目快照。它只记录项目相对路径、size、hash、capture provider 和省略事实,不保存文件内容。Git provider 纳入 tracked 和未被 ignore 的 untracked 文件,并把 submodule/gitlink 作为原子条目;非 Git 项目使用带前后枚举围栏的有界物理树 provider。创建时若项目所有范围内仍有省略项,`new` 会失败并清理未完成 change。
Expand Down
6 changes: 6 additions & 0 deletions assets/skills-zh/comet-native/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ comet native check <change-name>

`checkpoint` 只保存同阶段摘要、下一动作和内容寻址的产物 manifest;它通过 revision/CAS 防止覆盖,不改变 phase。`check` 只允许在 Verify 且已有 implementation scope 时运行 Comet 内置的有界只读文本扫描。它不调用 Git、shell、项目脚本、外部 Skill 或任何外部进程,不接受任意命令、路径、环境或超时参数,也不修改项目文件或 change/Run/trajectory;结果、issue 计数和 scope 新鲜度会写入独立的内容寻址 receipt。检查发现问题或 stale 返回 1,但 receipt 仍会落盘。

```text
comet native evidence format [--entries <path>]
```

写 verification.md 的 `# Acceptance evidence` 机器块前,用这个命令把条目数组序列化成规范 Markdown 文本再粘贴,不要手工排版 JSON。默认从 stdin 读取条目 JSON,也可用 `--entries <path>` 指定文件;输出已包含 start/end markers、固定排序与缩进,原样粘贴即可通过 `next --result` 的规范序列化校验。

## 阶段推进

```text
Expand Down
2 changes: 1 addition & 1 deletion assets/skills/comet-native/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Never edit snapshots or evidence, guess unenumerated paths, or present partial s

Run verification appropriate to the Acceptance examples, complete target specifications, and risk. Record actual commands, results, skipped checks, specification consistency, known limitations, and the conclusion. Never record an unrun check as passed.

In the fixed acceptance evidence block of `verification.md`, use every Runtime-provided `acceptance_id`. Each item must contain either project-relative evidence refs or an honest `skipped_reason`. See the artifact reference for the exact format.
In the fixed acceptance evidence block of `verification.md`, use every Runtime-provided `acceptance_id`. Each item must contain either project-relative evidence refs or an honest `skipped_reason`. Serialize the entries with `comet native evidence format` and paste the result; never hand-format this JSON — a hand-typed block can almost never match the canonical serialization byte-for-byte. See the artifact reference for the exact format.

When you need reproducible text-hygiene evidence, run the built-in read-only check:

Expand Down
8 changes: 7 additions & 1 deletion assets/skills/comet-native/reference/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Persist reviewable facts, not hidden reasoning. Put unrun checks under Skipped c

The runtime derives at most 1024 acceptance items from the brief and proposed specifications. It rejects overflow rather than first creating an unbounded list and truncating it. Each `acceptancePage` contains at most 16 items. Text is capped at 512 UTF-8 bytes, context at four entries of at most 256 bytes each, and a full page at 32 KiB. Text or context truncation is marked explicitly, while acceptance IDs are never lost to paging or truncation. Cursors bind to the current acceptance hash and fail after the contract changes.

`# Acceptance evidence` must contain exactly one fixed machine block. The runtime derives IDs from the brief/specifications and returns them through Build or `status --details`; never calculate or rewrite them yourself:
`# Acceptance evidence` must contain exactly one fixed machine block. The runtime derives IDs from the brief/specifications and returns them through Build or `status --details`; never calculate or rewrite them yourself. Generate this block with `comet native evidence format` and paste the result; never hand-format the JSON — a hand-typed block can almost never match the canonical serialization byte-for-byte and will be rejected with a "canonical serialization" error:

```text
<!-- comet-native:acceptance-evidence:start -->
Expand All @@ -177,6 +177,12 @@ The runtime derives at most 1024 acceptance items from the brief and proposed sp

The array is sorted by `acceptance_id`, and every `evidence_refs` list is sorted. Each item chooses exactly one path: at least one project-relative evidence ref, or an empty array plus a non-empty `skipped_reason`. Never provide both evidence and a skip reason, and never reference an absolute path, a path outside Native, `.git`, or `.env*`.

```text
comet native evidence format [--entries <path>]
```

Pass the entry array above (without the markers) as JSON on stdin, or point `--entries <path>` at a JSON file. The command's output already includes the start/end markers plus the canonical order and indentation, so paste it as-is into the `# Acceptance evidence` section of verification.md.

## Content-addressed evidence

- `baseline-manifest.json`: a bounded project snapshot captured when the change is created. It records only project-relative paths, sizes, hashes, the capture provider, and omission facts, never file contents. The Git provider includes tracked and non-ignored untracked files and treats each submodule/gitlink as an atomic entry; non-Git projects use a bounded physical-tree provider with before/after enumeration fences. If project-owned entries are still omitted, `new` fails and removes the unfinished change.
Expand Down
6 changes: 6 additions & 0 deletions assets/skills/comet-native/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ comet native check <change-name>

`checkpoint` stores only an in-phase summary, next action, and content-addressed artifact manifest. It uses revision/CAS to prevent overwrites and does not change the phase. `check` is available only in Verify after an implementation scope exists. It runs Comet's built-in bounded, read-only text scan. It does not invoke Git, a shell, project scripts, external Skills, or any external process; it accepts no arbitrary command, path, environment, or timeout options and does not modify project files, the change, Run, or trajectory. Results, issue counts, and scope freshness are written to an independent content-addressed receipt. A check that finds issues or becomes stale exits with 1, but still writes the receipt.

```text
comet native evidence format [--entries <path>]
```

Before writing the `# Acceptance evidence` machine block in verification.md, use this command to serialize the entry array into the canonical Markdown text and paste that, rather than hand-formatting the JSON yourself. It reads entries JSON from stdin by default, or from a file with `--entries <path>`; the output already includes the start/end markers plus the fixed order and indentation, so pasting it as-is satisfies `next --result`'s canonical-serialization check.

## Phase progression

```text
Expand Down
Loading
Loading