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 .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "commitlore",
"displayName": "CommitLore",
"version": "1.2.2",
"version": "1.2.3",
"description": "Recorded decisions from git history, delivered to the agent before it edits. Constraints, alternatives already ruled out, and warnings left by whoever was here last.",
"author": {
"name": "MongLong0214",
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitlore",
"version": "1.2.2",
"version": "1.2.3",
"description": "Decision memory from Git history, with verified capture for coding sessions.",
"author": {
"name": "MongLong0214",
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,59 @@ Release notes for 1.0.0, 1.0.1 and 1.0.2 are on the
[GitHub releases page](https://github.com/MongLong0214/commitlore/releases); they
were not written here.

## 1.2.3

The capture prompt was the session, so on a long session there was no prompt.

**`capture` embedded the whole transcript in its prompt (#873).** Measured by the
reporter: a 67,981,436-byte transcript produced a 67,468,122-byte prompt — 99.3%
of the file, and larger than any model can consume, so the pipeline could not be
completed and no record was ever written. The pipeline itself was fine, which is
how they proved it: `tail -n 400` on the same transcript gave 537,250 bytes and
the same command in the same repository worked.

**The failure was silent, which is why it reads as the reason capture is not
used.** Prompt-only mode reports `outcome: "empty"`, `staged: false`, exit 0. An
operator who tried capture once on a real session got a prompt they could not
use and no statement that anything was wrong, and did not try again. In the
repository where this was measured, `stale` reported 1 record in 1000 commits
while roughly twenty commits in one recent session carried real decision context
and produced none — with `{"mode":"auto","unattended":true}` already set, so
permission was never the obstacle.

**The prompt now carries the end of the transcript within a byte budget**, 256
KiB by default and `COMMITLORE_TRANSCRIPT_BUDGET_BYTES` to change it. The end
rather than the beginning: a decision is taken near the end of the session that
implements it, and the diff being captured is that end.

**Three things the bound deliberately does not do.** It does not renumber — the
window keeps the line numbers it has in the whole transcript, because
verification reads the whole transcript and a window renumbered from 1 would
have every `L<start>-L<end>` locator name a different line of the file it is
checked against. It does not reach the hash — `source_hashes` and every quote
check are still over the whole transcript, so a quote from outside the window
still verifies and a caller passing the session it actually had is never told
the transcript was substituted. And it does not stay quiet — the prompt says
which lines it shows and how many were left out, and `transcript_window` says
the same to `capture --json` and to `commitlore_prepare_capture`. A bounded
prompt that did not say so would be the old silence in a smaller package.

**One line can outrun the budget by itself.** A JSONL transcript line can hold an
entire tool result. That line is shown from its end rather than dropped, and the
window marks it partial, because a window of no lines is worse than a window of
one partial line. The byte slice never leaves a split codepoint at the front: a
replacement character inside a quotable line is a character nobody can copy back.

**Not claimed.** Where the useful boundary is. 256 KiB is comfortably readable by
current models and carries far more than the ~537 KB slice measured to work; the
reporter said they had not measured where a good record stops needing context,
and neither has this. Also unchanged, and worth stating because automation is
built on it: `outcome` is `staged`, `empty` or `rejected`, and all three exit 0
— anything driving capture must read `--json`, because an exit-code check reads
a rejected record as a success.

**Not reviewed.** No cross-provider review was run on this change.

## 1.2.2

One line of configuration, and the plugin's MCP server had never started for
Expand Down
12 changes: 6 additions & 6 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@
</p>

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

<details>
<summary>先にインストーラーを読みたいですか?</summary>

```bash
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh
sh install.sh v1.2.2
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh
sh install.sh v1.2.3

# あるいはスクリプトを使わずに。スクリプトが作るチェックアウトは自分でも作れます。
git clone --depth 1 --branch v1.2.2 https://github.com/MongLong0214/commitlore
git clone --depth 1 --branch v1.2.3 https://github.com/MongLong0214/commitlore
node commitlore/dist/commitlore.mjs --version
```

Expand Down Expand Up @@ -107,13 +107,13 @@ CommitLore はその判断をコードのそばに残します。
macOS と Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

Windows:

```powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1))) v1.2.2
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1))) v1.2.3
```

Node.js 22.23.2+ と Git が必要です。スクリプトは何かを書き込む前に両方を確認します。
Expand Down
12 changes: 6 additions & 6 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@
</p>

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

<details>
<summary>먼저 설치기를 읽어 보고 싶나요?</summary>

```bash
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh
sh install.sh v1.2.2
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh
sh install.sh v1.2.3

# 또는 스크립트를 건너뜁니다. 스크립트가 만드는 체크아웃은 직접 만들 수 있습니다.
git clone --depth 1 --branch v1.2.2 https://github.com/MongLong0214/commitlore
git clone --depth 1 --branch v1.2.3 https://github.com/MongLong0214/commitlore
node commitlore/dist/commitlore.mjs --version
```

Expand Down Expand Up @@ -107,13 +107,13 @@ CommitLore는 그 판단을 코드 곁에 보관합니다.
macOS와 Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

Windows:

```powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1))) v1.2.2
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1))) v1.2.3
```

Node.js 22.23.2+와 Git이 필요합니다. 스크립트는 무엇이든 쓰기 전에 둘을 확인합니다.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
</p>

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

<details>
<summary>Prefer to read the installer first?</summary>

```bash
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh
sh install.sh v1.2.2
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh
sh install.sh v1.2.3

# Or skip the script: the checkout it makes is one you can make yourself.
git clone --depth 1 --branch v1.2.2 https://github.com/MongLong0214/commitlore
git clone --depth 1 --branch v1.2.3 https://github.com/MongLong0214/commitlore
node commitlore/dist/commitlore.mjs --version
```

Expand Down Expand Up @@ -109,13 +109,13 @@ preserve, not for narrating every change.
macOS and Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

Windows:

```powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1))) v1.2.2
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1))) v1.2.3
```

Requires Node.js 22.23.2+ and Git. The script checks both before it writes anything.
Expand Down
12 changes: 6 additions & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@
</p>

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

<details>
<summary>想先阅读安装器吗?</summary>

```bash
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh
sh install.sh v1.2.2
curl -fsSLO https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh
sh install.sh v1.2.3

# 或者跳过脚本:它创建的检出,你自己也能创建。
git clone --depth 1 --branch v1.2.2 https://github.com/MongLong0214/commitlore
git clone --depth 1 --branch v1.2.3 https://github.com/MongLong0214/commitlore
node commitlore/dist/commitlore.mjs --version
```

Expand Down Expand Up @@ -105,13 +105,13 @@ CommitLore 把那份判断留在代码旁边。
macOS 和 Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
```

Windows:

```powershell
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1))) v1.2.2
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1))) v1.2.3
```

需要 Node.js 22.23.2+ 和 Git。脚本会在写入任何内容前检查两者。
Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<#
Installs commitlore from source on Windows, for any agent that is not Claude Code.

irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1 | iex
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.ps1))) v1.2.2
irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1 | iex
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.ps1))) v1.2.3

Claude Code users do not need this script. The repository is itself a plugin
marketplace (ADR-0011), so two /plugin commands register the MCP server, the
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
# Installs commitlore from source, for any agent that is not Claude Code.
#
# curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh
# curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2
# curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh
# curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3
#
# **Claude Code users do not need this script.** The repository is itself a
# plugin marketplace (ADR-0011), so two `/plugin` commands register the MCP
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitlore",
"version": "1.2.2",
"version": "1.2.3",
"description": "Git-native, lifecycle-aware decision memory for coding agents",
"license": "MIT",
"private": true,
Expand Down
6 changes: 3 additions & 3 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": "github"
},
"websiteUrl": "https://github.com/MongLong0214/commitlore#readme",
"version": "1.2.2",
"version": "1.2.3",
"_meta": {
"io.modelcontextprotocol.registry/publisher-provided": {
"registryFit": "Distribution is a tagged git checkout plus a Claude Code plugin marketplace (ADR-0011 registry-free git distribution, ADR-0026 no compiled executables and no uploaded release asset), so no official package type applies and this record relies on websiteUrl plus publisher metadata.",
Expand All @@ -18,8 +18,8 @@
"/plugin marketplace add MongLong0214/commitlore",
"/plugin install commitlore@commitlore"
],
"installer": "curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.2/install.sh | sh -s v1.2.2",
"release": "https://github.com/MongLong0214/commitlore/releases/tag/v1.2.2"
"installer": "curl -fsSL https://raw.githubusercontent.com/MongLong0214/commitlore/v1.2.3/install.sh | sh -s v1.2.3",
"release": "https://github.com/MongLong0214/commitlore/releases/tag/v1.2.3"
},
"runtime": {
"transport": "stdio",
Expand Down
16 changes: 14 additions & 2 deletions src/commands/capture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
configuredTrustedSignerFingerprints,
configuredTrustedAuthors,
} from '../core/trusted-authors.js';
import { parseDraft } from '../core/harvest.js';
import { parseDraft, type TranscriptWindow } from '../core/harvest.js';
import { gcPending } from '../core/pending-gc.js';
import type { GuardAdvisory } from '../core/pending.js';

Expand Down Expand Up @@ -80,6 +80,13 @@ export interface CaptureResult {
nonce: string | null;
staged: boolean;
prompt?: string;
/**
* What of the transcript `prompt` carries, present whenever `prompt` is
* (#873). The prompt is bounded; verification is not — it reads the whole
* transcript. Without this a caller could not tell a slice from the session,
* and the prompt was previously the session, at whatever size that was.
*/
transcript_window?: TranscriptWindow;
guard_advisory?: GuardAdvisory | null;
/**
* Every reason a record was refused (#309). Both sources are included: the
Expand Down Expand Up @@ -238,6 +245,7 @@ const runCapturePipeline = (opts: {
nonce: null,
staged: false,
prompt: prepareResult.prompt,
transcript_window: prepareResult.transcript_window,
guard_advisory: prepareResult.guard_advisory,
};
}
Expand Down Expand Up @@ -383,7 +391,11 @@ export const register = (program: Command): void => {
// when a subcommand was invoked, so `capture gc` — which needs no transcript
// — would fail before its own action ran. The requirement is enforced in the
// action below instead, where it applies only to the capture flow itself.
.option('--transcript <path>', 'path to the session transcript file')
.option(
'--transcript <path>',
'path to the session transcript file (the prompt carries its last 256 KiB; ' +
'COMMITLORE_TRANSCRIPT_BUDGET_BYTES changes that, and verification always reads all of it)',
)
.option('--diff <path>', 'path to the diff file (defaults to the staged diff)')
.option('--draft <path>', 'path to the draft JSON file (omit for prompt-only mode)')
.option('--out <path>', 'write the pending nonce to a file')
Expand Down
Loading
Loading