throughline 0.4.8 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,70 @@ shipped to npm but were not individually tagged on GitHub.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.4.10] — 2026-05-09
14
+
15
+ ### Fixed
16
+
17
+ - Codex current-thread trim no longer refuses execution solely because the
18
+ rollout active turn count differs from the Codex app-server count. When
19
+ `thread/read` and `thread/resume` agree, Throughline now treats the mismatch
20
+ as diagnostics and adjusts `thread/rollback.numTurns` by the app-server delta.
21
+ For example, `expectedTurns = 6` and `readTurns = resumedTurns = 7` under
22
+ `--all` now sends `numTurns: 7`.
23
+ - `trim --preflight --host codex` now reports the same rollback adjustment
24
+ preview instead of returning `preflight-refused` for this recoverable
25
+ mismatch.
26
+
27
+ ## [0.4.9] — 2026-05-09
28
+
29
+ ### Changed
30
+
31
+ - **Resume context overhaul.** The Claude `/clear` resume injection no longer
32
+ carries a verbose meta-instruction ("respond with: I have inherited the prior
33
+ task..."). The header now contains only a one-line natural-continuation cue
34
+ and the `Bash` invocation contract for `throughline detail HH:MM:SS`. The L2
35
+ active-work thread is anchored at the very bottom of the injected context so
36
+ Claude's attention falls on the most recent turn instead of on a recap line.
37
+ Older L1 summaries are now timestamped with the original turn body time
38
+ (`bodies.created_at` MIN) instead of the skeleton row's summarization time,
39
+ so detail commands derived from L1 lines actually resolve.
40
+ - **L3 references collapsed into per-line `(詳細:…)` suffixes.** Both the
41
+ Claude resume context and the Codex active-work / new-thread handoff
42
+ renderers no longer print a standalone `### L3 詳細参照` /
43
+ `### Detail References` section. Instead, every L1 / L2 line ends with a
44
+ compact `(詳細:…)` suffix that aggregates the L3 evidence belonging to that
45
+ turn (`本文`, tool name, `思考`, `画像`, etc.), with `×N` only when count > 1.
46
+ The same-turn user / assistant pair only emits the suffix on the last role to
47
+ avoid duplicating the per-turn L3 hint. MCP tool names are shortened to the
48
+ trailing function name (`mcp__plugin_..._playwright__browser_navigate` →
49
+ `browser_navigate`) so namespace noise does not dominate the suffix.
50
+ - Codex auto-refresh and current-session `$throughline` trigger now use a 75%
51
+ verified-usage threshold instead of 80%, so Throughline can fire before Codex
52
+ native auto-compact wins the race.
53
+ - `throughline doctor --codex` now reads the Codex hook trust gate from
54
+ `~/.codex/config.toml` (`[hooks.state."<hooks.json>:event:i:j"].trusted_hash`)
55
+ and reports a top-level `Codex hook trust:` summary plus per-hook
56
+ `trusted: yes/no`. A registered hook that is not yet trusted in the Codex
57
+ hook acceptance menu may not actually run.
58
+
59
+ ### Added
60
+
61
+ - `src/l3-summary.mjs`: shared helpers (`shortenMcpToolName`, `localizeL3Part`,
62
+ `groupL3ByTurn`, `buildPartsSummary`) used by both the Claude resume context
63
+ and the Codex handoff renderers to build the per-line `(詳細:…)` suffix.
64
+
65
+ ### Notes
66
+
67
+ - The Codex `--max-detail-refs` CLI flag is preserved for backwards
68
+ compatibility but is now a validated no-op: the new per-line suffix
69
+ aggregates L3 references at turn granularity, so a separate cap on a
70
+ standalone Detail References list is no longer meaningful.
71
+ - `codex-handoff-smoke` now reports `renderedDetailSuffixes` instead of
72
+ `renderedDetailCommands` / `uniqueRenderedDetailCommands`. The
73
+ `detail_commands_deduplicated` check has been retired because the new
74
+ rendering aggregates L3 by turn structurally and cannot emit duplicate
75
+ detail commands for the same turn.
76
+
13
77
  ## [0.4.8] — 2026-05-09
14
78
 
15
79
  ### Changed
package/README.ja.md CHANGED
@@ -27,7 +27,7 @@ throughline install # hook / Codex skill / VS Code monitor task を登録
27
27
  `/clear` を経由しない新規 chat / VS Code 再起動では `/tl` で前任を指名できる。
28
28
 
29
29
  Codex では `UserPromptSubmit` / `PostToolUse` / `Stop` hook と `$throughline`
30
- skill も登録する。80% 自動発火は token-monitor 依存ではなく、当該 Codex
30
+ skill も登録する。75% 自動発火は token-monitor 依存ではなく、当該 Codex
31
31
  セッションの rollout `token_count` を hook が読み、prompt 送信時または tool loop
32
32
  途中の閾値到達時に同じセッションへ `$throughline` 実行指示を注入する。
33
33
 
package/README.md CHANGED
@@ -36,7 +36,7 @@ differences do not hide the command. They are registered synchronously
36
36
  (`async: false`), matching the Codex hook behavior verified in Caveat. Existing
37
37
  non-Throughline Codex hooks are preserved. The prompt and tool-loop hooks read
38
38
  the current rollout `token_count` themselves and inject `$throughline` at the
39
- verified 80% threshold; token-monitor is display-only and is never the trigger
39
+ verified 75% threshold; token-monitor is display-only and is never the trigger
40
40
  source. It also installs a global `$throughline` Codex skill. Bare
41
41
  `$throughline` runs the scripted current-thread rollback + Throughline DB memory
42
42
  injection directly; ask explicitly for status, resume, summarize, diagnostics,
@@ -252,10 +252,13 @@ Haiku path. This is an explicit compatibility mode, not silent auto-detection.
252
252
  looked like a rolled-back user prompt could reappear after VS Code restart /
253
253
  reconnect, but controlled model-visible rollback smokes did not reproduce that
254
254
  path. `throughline trim --execute --host codex` now sends the guarded
255
- rollback + Throughline DB memory injection when app-server turn-count guards and
256
- injectable DB memory are available. Codex current-session auto-refresh is not a
255
+ rollback + Throughline DB memory injection when injectable DB memory is
256
+ available. If the Codex rollout and app-server turn counts differ, Throughline
257
+ keeps the mismatch as diagnostics and, when `thread/read` and `thread/resume`
258
+ agree, adjusts `thread/rollback.numTurns` from the app-server count. Codex
259
+ current-session auto-refresh is not a
257
260
  token-monitor feature: the Codex `UserPromptSubmit` hook reads the current
258
- rollout `token_count` and, at the verified 80% threshold, injects a same-session
261
+ rollout `token_count` and, at the verified 75% threshold, injects a same-session
259
262
  instruction to run the installed `$throughline` workflow before answering. The
260
263
  Codex Stop hook still attempts the guarded live refresh when it naturally fires,
261
264
  so non-monitor users get the same threshold behavior.
@@ -537,7 +540,7 @@ Example output:
537
540
  presented as exact usage.
538
541
  - **Codex auto-refresh is driven by the current Codex session, not the monitor.**
539
542
  The Codex `UserPromptSubmit` and `PostToolUse` hooks capture rollout memory
540
- and, when verified usage reaches 80%, inject a current-session `$throughline`
543
+ and, when verified usage reaches 75%, inject a current-session `$throughline`
541
544
  instruction before the assistant answers or continues a tool loop. The Codex
542
545
  Stop hook also captures DB memory, writes monitor state, and attempts guarded
543
546
  rollback + Throughline DB memory injection when it naturally fires above the
@@ -695,7 +698,7 @@ entry to the `tasks` array yourself:
695
698
  | `throughline codex-sidecar-diagnostics` | Check `codex-sidecar` diagnostics status for this project |
696
699
  | `throughline codex-sidecar-dry-run` | Print a normalized read-only sidecar request without running the app server |
697
700
  | `throughline trim --dry-run --host codex` | Preview Codex same-thread context trim memory and host boundary; does not rollback automatically |
698
- | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and verify turn-count guards without rollback/inject |
701
+ | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and preview any app-server-count rollback adjustment without rollback/inject |
699
702
  | `throughline trim --execute --host codex` | Scripted Codex current-thread rollback + Throughline DB memory inject; this is what bare `$throughline` runs in Codex |
700
703
  | `throughline status` | Print DB statistics (sessions, skeletons, bodies, details) |
701
704
  | `throughline --version` | Print the installed version |
@@ -153,15 +153,15 @@ Usage:
153
153
  (requires --codex-thread-id or env thread id)
154
154
  throughline codex-hook user-prompt-submit
155
155
  Codex UserPromptSubmit hook: capture rollout and,
156
- at 80%, inject current-session $throughline
156
+ at 75%, inject current-session $throughline
157
157
  instruction from verified rollout token_count
158
158
  throughline codex-hook post-tool-use
159
159
  Codex PostToolUse hook: during tool loops, capture
160
- rollout and inject the same 80% $throughline
160
+ rollout and inject the same 75% $throughline
161
161
  instruction from verified rollout token_count
162
162
  throughline codex-hook stop Codex native Stop hook: capture rollout,
163
163
  summarize old L2 turns into L1, and run guarded
164
- auto-refresh when verified usage reaches 80%
164
+ auto-refresh when verified usage reaches 75%
165
165
  throughline codex-summarize Summarize captured Codex L2 into L1 via Codex CLI
166
166
  (requires a codex:<thread-id> session)
167
167
  throughline codex-resume Render Codex active-work context from DB
@@ -119,7 +119,7 @@ schema v4 で PostToolUse (`capture-tool`) は廃止、L2/L3 は Stop 内で一
119
119
  | **npm 公開 (v0.3.24)** | 2026-05-02 v0.3.23 の補完: `.vscode/tasks.json` には現環境の絶対パスが書き込まれるため、**そもそも commit すべきではない**。`shouldRecommendGitignore` を [src/vscode-task.mjs](../src/vscode-task.mjs) に追加し、`ensureMonitorTaskFile` が created / merged / repaired を返すタイミングで「git リポジトリ内かつ `.gitignore` に `.vscode/tasks.json` 系エントリが無い」を判定。該当時に `<system-reminder>` で `.gitignore` 追加推奨を 1 度だけ stdout 通知 (`.throughline-gitignore-noted` marker で抑止)。否定パターン (`!.vscode/tasks.json`) はスキップ判定 = 推奨を出す。README Troubleshooting にも明示。配布物 (npm tarball) には絶対パスは入っていない (`files` フィールドが `.vscode/` を含まない、ソースに hard-coded path 無し) ことを再確認 |
120
120
  | **npm 公開 (v0.3.25): Claude-primary / Codex-sidecar groundwork** | `HandoffRecord` projection、`throughline handoff-preview`、`throughline_handoff` example、`codex-sidecar-diagnostics` / `codex-sidecar-dry-run` を追加。Claude Code hooks / slash command / transcript / baton / resume behavior は正本として維持し、Codex 対応は adapter / projection として足す |
121
121
  | **npm 公開 (v0.3.25): optional Codex-sidecar L1 summarization** | Claude primary の L2→L1 要約は、`codex-sidecar` が `summarize-l1` preset で configured の場合だけ sidecar を使う。disabled / unavailable / run failure では、ユーザー許可済み互換経路として既存 Claude Haiku 要約を維持する。Codex primary の L2→L1 backend は次フェーズ計画で Codex CLI 本線として扱う。Claude CLI smoke / test で Claude を呼ぶ場合は Haiku を使う |
122
- | **npm 公開 (v0.3.25): `/tl-trim` dry-run** | `throughline trim --dry-run`、`--preflight`、guarded `--execute`、`--host`、`--keep-recent`、`--all`、`--memo-stdin`、`--preview-max-chars`、`--codex-thread-id`、`THROUGHLINE_CODEX_THREAD_ID` / `CODEX_THREAD_ID`、`throughline codex-threads`、`throughline doctor --trim`、Claude slash command `/tl-trim` を追加。Codex app-server の rollback / inject primitive は live app-server 上で実測済み。2026-05-06 incident 後は一時 blocked としたが、2026-05-08 の controlled rollback model-visible smoke が app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だったため、過剰 blocker は解除済み。`trim --execute --host codex` は明示実行で current-thread rollback + Throughline DB memory inject を送り、Codex Stop hook auto-refresh は verified usage 80% 以上で同じ guarded path を試行する。DB memory 不在、Codex thread identity 不在、rollout/app-server turn-count 不一致は mutation 前に拒否する。restore-safety / planned restore-safety / host primitive audit は diagnostics として表示する |
122
+ | **npm 公開 (v0.3.25): `/tl-trim` dry-run** | `throughline trim --dry-run`、`--preflight`、guarded `--execute`、`--host`、`--keep-recent`、`--all`、`--memo-stdin`、`--preview-max-chars`、`--codex-thread-id`、`THROUGHLINE_CODEX_THREAD_ID` / `CODEX_THREAD_ID`、`throughline codex-threads`、`throughline doctor --trim`、Claude slash command `/tl-trim` を追加。Codex app-server の rollback / inject primitive は live app-server 上で実測済み。2026-05-06 incident 後は一時 blocked としたが、2026-05-08 の controlled rollback model-visible smoke が app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だったため、過剰 blocker は解除済み。`trim --execute --host codex` は明示実行で current-thread rollback + Throughline DB memory inject を送り、Codex Stop hook auto-refresh は verified usage 75% 以上で同じ guarded path を試行する。DB memory 不在、Codex thread identity 不在、rollout/app-server turn-count 不一致は mutation 前に拒否する。restore-safety / planned restore-safety / host primitive audit は diagnostics として表示する |
123
123
  | **npm 公開 (v0.3.25): Codex primary capture** | `throughline codex-capture --codex-thread-id <id>` を追加。Codex rollout JSONL の active turns を `codex:<thread_id>` session として DB `bodies` に保存し、`function_call` / `function_call_output` を DB `details` の L3 tool input / output として保存する。`thread_rolled_back` 適用後の active thread だけを再構成し、rollback 済み tail は current L2/L3 に残さない。Codex thread id は明示指定または env 指定のみで、自動推測しない |
124
124
  | **npm 公開 (v0.3.25): Codex-primary L1 backend** | `summarizeToL1` に `hostMode` 分岐を追加。Claude primary は既存の `codex-sidecar` / Claude Haiku 互換経路を維持し、Codex primary は Codex CLI backend を使う。Codex CLI failure は `source = codex-cli` / `reason` 付き explicit error とし、Claude Haiku / `raw_l2` に silent fallback しない |
125
125
  | **npm 公開 (v0.3.25): Codex-primary L1 CLI** | `throughline codex-summarize --session codex:<thread_id>` を追加。captured Codex L2 が L2 window を超えた場合、最古の未要約 turn を Codex CLI backend で L1 skeleton に書く。Codex CLI failure は explicit error |
@@ -131,13 +131,13 @@ schema v4 で PostToolUse (`capture-tool`) は廃止、L2/L3 は Stop 内で一
131
131
  | **npm 公開 (v0.3.25): Codex VS Code restore smoke protocol** | `throughline codex-vscode-restore-smoke --prepare/--verify --codex-thread-id <id>` を追加。`--prepare` は hidden active-work marker memory を app-server へ注入し、VS Code reload / reconnect 後に marker を含まない prompt を送る二段階手順を出す。`--verify` は rollout を読み、prepare 後の marker-free smoke prompt、assistant の marker-only answer、user prompt への marker leak 不在を確認する。prepare は `THROUGHLINE_EXPERIMENTAL_CODEX_VSCODE_RESTORE_SMOKE=1` 必須。実 VS Code reload / reconnect marker proof は `TL_CODEX_VSCODE_RESTORE_46888202` で成功済み。ただしこれは hidden developer memory visibility 証明であり、rollback 済み user turn の非復活証明ではない |
132
132
  | **npm 公開 (v0.3.25): Codex VS Code rollback smoke verifier** | `throughline codex-vscode-rollback-smoke --verify --codex-thread-id <id>` を追加。rollout を read-only で読み、rollback event、rollback 済み user text、rollback 後 user turn、`restoreSafety.status = ok` を必須条件にする。`--after-vscode-restart` がある場合だけ `restartSafe: true` を返す。実 incident-shaped live rollback run では `thread_rolled_back` と injected memory は記録されたが、rollback 対象 user text が `compacted.replacement_history` に残り、後続 verifier では rollback 済み user text の再出現も観測した。後続分類で app-server response 上の retained text は `aggregatedOutput` に限定され、controlled rollback model-visible smoke は再現しなかったため、これは現在は diagnostic evidence として扱う |
133
133
  | **npm 公開 (v0.3.25): Codex primary doctor** | `throughline doctor --codex` を追加。現在 project の Codex thread env identity、rollout candidates、captured `codex:<thread_id>` DB sessions、context-refresh memory contract、new-thread handoff readiness、safe continuation status、host primitive audit status、次に使う capture / handoff / resume / audit command を表示する。doctor 自体は read-only で、Codex thread / DB / Claude settings を変更しない。`doctor --trim --host codex` も host primitive audit status を表示する |
134
- | **npm 公開 (v0.3.25): Codex global Stop hook / skill install** | `throughline install` が Claude hooks / slash commands に加えて `~/.codex/hooks.json` に絶対 node + installed `bin/throughline.mjs codex-hook stop` を `async: false` で登録し、`~/.codex/config.toml` の `[features].codex_hooks = true` を有効化し、`~/.codex/skills/throughline` に `$throughline` skill を配置する。Codex App Server / VSCode host の PATH 差分で bare `throughline` が見えない可能性があるため、hook は Caveat と同じ絶対パス型に寄せる。既存 Caveat / Spotter などの Codex hooks は保持し、`throughline uninstall` は Throughline 管理の Codex hook / skill だけを削除する。既に bare command または `async: true` で登録済みの Throughline Codex Stop hook は次回 install で更新する。実環境では `codex exec --json` child thread `019dfd4f-93ff-7522-8f89-bd1e1996c8d7` が Stop hook で自然 capture され、`doctor --codex` の latest DB session が `codex:019dfd4f-93ff-7522-8f89-bd1e1996c8d7` に進むことを確認した。さらに絶対パス型へ更新後、child thread `019dfd5e-1248-7c11-8ddc-97e1b0701e10` でも latest DB session が `codex:019dfd5e-1248-7c11-8ddc-97e1b0701e10` に進むことを確認した。hook shape 変更後に新規開始した VSCode-origin thread `019dfd62-9a9d-7211-bf91-89d8e3fc908e` でも `doctor --codex` の current thread と latest DB session が一致し、自然 Stop hook capture を確認済み。hook shape 変更前から開いていた VSCode-origin parent thread は、変更後の自然 Stop smoke としては扱わない。Caveat 側にも `async: false` Stop hook が動く実測があるため、Codex 側は Caveat と同じ同期 hook 方針に寄せる。`codex-capture` / `codex-summarize` / `codex-resume --memo-stdin` は診断・明示操作 surface として維持し、model-visible smoke は明示 opt-in。2026-05-08 以降、Stop hook auto-refresh は verified usage 80% 以上で guarded rollback / inject を試行し、estimate usage では mutation しない。2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせつつ、70% warning よりは mutation を遅らせる |
134
+ | **npm 公開 (v0.3.25): Codex global Stop hook / skill install** | `throughline install` が Claude hooks / slash commands に加えて `~/.codex/hooks.json` に絶対 node + installed `bin/throughline.mjs codex-hook stop` を `async: false` で登録し、`~/.codex/config.toml` の `[features].codex_hooks = true` を有効化し、`~/.codex/skills/throughline` に `$throughline` skill を配置する。Codex App Server / VSCode host の PATH 差分で bare `throughline` が見えない可能性があるため、hook は Caveat と同じ絶対パス型に寄せる。既存 Caveat / Spotter などの Codex hooks は保持し、`throughline uninstall` は Throughline 管理の Codex hook / skill だけを削除する。既に bare command または `async: true` で登録済みの Throughline Codex Stop hook は次回 install で更新する。実環境では `codex exec --json` child thread `019dfd4f-93ff-7522-8f89-bd1e1996c8d7` が Stop hook で自然 capture され、`doctor --codex` の latest DB session が `codex:019dfd4f-93ff-7522-8f89-bd1e1996c8d7` に進むことを確認した。さらに絶対パス型へ更新後、child thread `019dfd5e-1248-7c11-8ddc-97e1b0701e10` でも latest DB session が `codex:019dfd5e-1248-7c11-8ddc-97e1b0701e10` に進むことを確認した。hook shape 変更後に新規開始した VSCode-origin thread `019dfd62-9a9d-7211-bf91-89d8e3fc908e` でも `doctor --codex` の current thread と latest DB session が一致し、自然 Stop hook capture を確認済み。hook shape 変更前から開いていた VSCode-origin parent thread は、変更後の自然 Stop smoke としては扱わない。Caveat 側にも `async: false` Stop hook が動く実測があるため、Codex 側は Caveat と同じ同期 hook 方針に寄せる。`codex-capture` / `codex-summarize` / `codex-resume --memo-stdin` は診断・明示操作 surface として維持し、model-visible smoke は明示 opt-in。2026-05-08 以降、Stop hook auto-refresh は verified usage 75% 以上で guarded rollback / inject を試行し、estimate usage では mutation しない。2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせつつ、70% warning よりは mutation を遅らせる |
135
135
  | **npm 公開 (v0.3.25): Codex-first roadmap** | [THROUGHLINE_CODEX_FIRST_ROADMAP.md](THROUGHLINE_CODEX_FIRST_ROADMAP.md) を追加。次フェーズは Codex primary 実用化、Codex Rewind 互換、Claude 側 finalization の順で進める。Codex primary の L2→L1 backend は Codex CLI を本線とし、`codex-sidecar` は Claude primary からの review / risk-check / second opinion / 互換 L2→L1 経路として整理する |
136
136
  | **npm 公開 (v0.3.25): npm docs packaging** | README から参照する `docs/` と `CHANGELOG.md` を npm `files` に追加。`docs/throughline-handoff-context.example.json` を含め、README の sidecar dry-run 例が tarball 内でも成立するようにする |
137
137
  | **npm 公開 (v0.4.0): /clear auto-handoff + memo / save-inflight / /tl-trim retire** | 2026-05-08 Claude Code 2.1.128 で `source='clear'` が reliable になったため、`/clear` で自動引継ぎがデフォルト ON になる auto path を追加。`THROUGHLINE_DISABLE_AUTO_HANDOFF=1` で OFF にできる。`/tl` slash command は明示意思マーカーへ簡素化 (memo 4 項目入力廃止、`save-inflight` CLI 削除、`/tl-trim` slash command 廃止、`updateBatonMemo` 関数削除、`handoff_batons.memo_text` を schema v8 で drop)。注入は L1 + L2 + L3 references のみに簡素化し、memo / 中断直前 thinking セクションを削除。Codex 側 trim path は維持。詳細は [CHANGELOG.md](../CHANGELOG.md) と [THROUGHLINE_CLEAR_AUTO_HANDOFF_PLAN.md](THROUGHLINE_CLEAR_AUTO_HANDOFF_PLAN.md) |
138
138
  | **npm 公開 (v0.4.1): typed `/clear` も baton を書く + 2 経路の優先順位入れ替え** | 2026-05-09 `/clear` を UserPromptSubmit hook で検出した時点で当該セッションの `session_id` を `handoff_batons` に書き込み、次 SessionStart が確定的にそのセッションを引き継ぐ。これで multi-window で「最新更新セッション ≠ /clear したセッション」になるシナリオで `findLatestClaudePredecessor` heuristic が誤った前任を選ぶ問題を解消。2 経路の優先順位を **baton path = primary、auto path = fallback** に変更 (auto path は VSCode 拡張メニュー由来など UserPromptSubmit に届かない経路のフォールバック)。`THROUGHLINE_DISABLE_AUTO_HANDOFF=1` は fallback path のみに作用するようになった (typed `/clear` / `/tl` は env と無関係に発火する)。あわせて `.vscode/tasks.json` を git 追跡から外し (gitignore)、`ensureMonitorTaskFile` が hook 発火ごとに絶対パスを書き換える挙動による別環境での dirty diff を解消。`src/prompt-submit.test.mjs` を新設し、`isClearCommand` / `isBatonCommand` 判定 14 件と subprocess+DB 実体テスト 3 件を追加。詳細は [CHANGELOG.md](../CHANGELOG.md) |
139
139
  | **npm 公開 (v0.4.7): Codex monitor direct discovery + 80% auto-refresh** | 2026-05-09 Codex Stop hook auto-refresh の verified usage threshold を 90% から 80% に変更し、Codex native auto-compact より先に Throughline DB memory refresh を試行する。estimate usage / estimated context window では mutation しない。`throughline monitor` は `~/.throughline/state` に加えて `~/.codex/sessions/**/rollout-*.jsonl` を直接 discovery し、Throughline state が未生成の現在 Codex thread も表示する。既存 state がある場合は state の usage snapshot を保持しつつ discovered rollout path / mtime を合流する。Codex 表示 ID は `codex:01` ではなく raw thread id 先頭 8 桁 (`019e085c`) にした。Codex open turn の transient `output_tokens` は token count に overlay するが、モデル欄の `live+<tokens>` marker は表示しない |
140
- | **未リリース: Codex current-session 80% trigger** | Codex 自動発火を token-monitor に依存させず、global install が Codex `UserPromptSubmit` / `PostToolUse` hooks も登録する。hook は当該 Codex session の rollout `token_count` を直接読み、verified 80% 以上なら同じ user turn または tool loop 継続前に `$throughline` workflow 実行指示を `additionalContext` で注入する。Stop hook の guarded auto-refresh は残す。`~/.codex/config.toml` は旧 `codex_hooks = true` に加えて現行 `hooks = true` も有効化する |
140
+ | **未リリース: Codex current-session 75% trigger** | Codex 自動発火を token-monitor に依存させず、global install が Codex `UserPromptSubmit` / `PostToolUse` hooks も登録する。hook は当該 Codex session の rollout `token_count` を直接読み、verified 75% 以上なら同じ user turn または tool loop 継続前に `$throughline` workflow 実行指示を `additionalContext` で注入する。Stop hook の guarded auto-refresh は残す。`~/.codex/config.toml` は旧 `codex_hooks = true` に加えて現行 `hooks = true` も有効化する |
141
141
  | **グローバル E2E 検証** | 2026-04-17 別ディレクトリから `throughline doctor` 全緑を確認 |
142
142
 
143
143
  ### ❌ 未完タスク
@@ -149,7 +149,7 @@ schema v4 で PostToolUse (`capture-tool`) は廃止、L2/L3 は Stop 内で一
149
149
  | **GitHub Actions 自動 publish** | `release` タグ push をトリガー(Phase 3+、Trusted Publishing 使用) |
150
150
  | **Claude Code プラグインマーケットプレース登録** | npm 公開の後継ステップ(Phase 3+) |
151
151
  | **turn-processor.test.mjs の 10 秒タイムアウト解消** | `main()` が stdin を待ち続けるためテストファイルがハングする既存の問題。実装動作は無影響、テスト個別 9/9 は pass |
152
- | **automatic context rollback / inject** | Codex Stop hook auto-refresh は verified usage 80% 以上で guarded rollback + Throughline DB memory inject を試行する。controlled rollback model-visible smoke で復活が未再現となったため、2026-05-06 incident 後の overbroad blocker は解除済み。estimate usage では実行しない |
152
+ | **automatic context rollback / inject** | Codex Stop hook auto-refresh は verified usage 75% 以上で guarded rollback + Throughline DB memory inject を試行する。controlled rollback model-visible smoke で復活が未再現となったため、2026-05-06 incident 後の overbroad blocker は解除済み。estimate usage では実行しない |
153
153
 
154
154
  ---
155
155
 
@@ -278,7 +278,7 @@ Codex 側 v0.3.25 の以下は本計画で **完全に無変更**:
278
278
  - `codex-capture` / `codex-summarize` / `codex-resume` (Codex primary L1/L2/L3 path)
279
279
  - `codex-resume --format handoff` (新規 Codex thread 用 prompt)
280
280
  - `trim --execute --host codex` / `--preflight --host codex` (app-server `thread/rollback` + `thread/inject_items`)
281
- - Codex Stop hook 80% auto-refresh
281
+ - Codex Stop hook 75% auto-refresh
282
282
  - restore-safety / host primitive audit diagnostics
283
283
  - Codex skill ([codex/skills/throughline](../codex/skills/throughline)) の trim 機能 (= 機能自体は無変更、SKILL.md 内の `/tl-trim` 言及があれば 4 TODO で update)
284
284
  - [src/codex-app-server.mjs](../src/codex-app-server.mjs), [src/codex-rollout-memory.mjs](../src/codex-rollout-memory.mjs)
@@ -33,7 +33,7 @@ Claude Code transcript と handoff behavior は守りつつ、Codex primary brid
33
33
  ## 優先順位
34
34
 
35
35
  1. Throughline を Codex primary で使えるようにする。Codex primary の L2 -> L1 backend は Codex CLI を本線にする。
36
- 2. Codex で Claude Rewind 相当の context trim を完成させる。2026-05-08 時点では Codex current-thread trim execute / auto-refresh は再有効化済みで、DB memory と turn-count guard を必須にする。
36
+ 2. Codex で Claude Rewind 相当の context trim を完成させる。2026-05-09 時点では Codex current-thread trim execute / auto-refresh は再有効化済みで、DB memory を必須にし、turn-count mismatch は diagnostics app-server count 由来の rollback `numTurns` 補正に使う。
37
37
  3. そのあと Claude 側の `/rewind` UX / 自動化 surface を詰める。
38
38
 
39
39
  Claude transcript handling の置き換えから始めないでください。Codex 対応は adapter / bridge / Codex primary entrypoint として追加します。
@@ -26,9 +26,9 @@
26
26
  - 現行 Claude path は、Claude hooks、slash command、handoff baton、DB、resume context、L1 / L2 / L3 persistence で成立している。
27
27
  - 外部モデル的に呼ぶ主要箇所は L2 -> L1 要約。
28
28
  - Claude-primary の現行 L2 -> L1 要約は `codex-sidecar` が configured の場合に sidecar を優先し、使えない場合は Claude Haiku 経路に戻る。Codex-primary は Codex CLI backend 失敗を明示 error にし、Claude Haiku / raw L2 へ fallback しない。
29
- - Codex guarded trim は、Codex app-server の `thread/read` / `thread/resume` / `thread/rollback` / `thread/inject_items` を使う。明示 thread identityrollout/app-server turn count guard、injectable memory がない場合は mutation 前に拒否する。
29
+ - Codex guarded trim は、Codex app-server の `thread/read` / `thread/resume` / `thread/rollback` / `thread/inject_items` を使う。明示 thread identity と injectable memory がない場合は mutation 前に拒否する。rollout/app-server turn count mismatch は診断に残し、`thread/read` / `thread/resume` が同じ count を返す場合は app-server 側の差分で rollback `numTurns` を補正する。
30
30
  - Claude `/rewind` 自動化はまだ有効化しない。
31
- - Codex automatic refresh mutation は再有効化済み。`80%` の verified usage threshold で rollback / Throughline DB memory inject を試行し、estimate usage では実行しない。Codex native auto-compact より先に Throughline refresh を走らせつつ、70% warning よりは mutation を遅らせる。
31
+ - Codex automatic refresh mutation は再有効化済み。`75%` の verified usage threshold で rollback / Throughline DB memory inject を試行し、estimate usage では実行しない。Codex native auto-compact より先に Throughline refresh を走らせつつ、70% warning よりは mutation を遅らせる。
32
32
 
33
33
  ## 新セッション引き継ぎ
34
34
 
@@ -40,8 +40,8 @@ Codex 側で実装済み / 診断可能なもの:
40
40
  - `codex-summarize`: Codex CLI backend で L2 -> L1 を書ける。Claude Haiku / raw L2 へ fallback しない。
41
41
  - `codex-resume`: L1 summary と active L2 context を Codex active-work context / fresh-thread handoff / developer message item として描画できる。
42
42
  - `trim --dry-run --host codex` / `doctor --trim --host codex`: rollback / inject plan、memory contract、context reduction estimate、diagnostics を表示する。fresh-thread handoff は代替継続 surface として残すが、current thread trim の代替ではない。
43
- - `trim --preflight --host codex`: rollout / app-server turn count guard を確認する。restore-safety diagnostics と planned rollback risk は報告するが、拒否条件ではない。
44
- - `trim --execute --host codex`: live app-server へ guarded rollback + Throughline DB memory inject を送る。env gate や host primitive audit gate は不要。DB memory が無い場合、または rollout/app-server turn count がずれる場合は mutation 前に拒否する。
43
+ - `trim --preflight --host codex`: rollout / app-server turn count を診断し、必要なら app-server count 由来の rollback 数補正 preview を表示する。restore-safety diagnostics と planned rollback risk は報告するが、拒否条件ではない。
44
+ - `trim --execute --host codex`: live app-server へ guarded rollback + Throughline DB memory inject を送る。env gate や host primitive audit gate は不要。DB memory が無い場合は mutation 前に拒否する。rollout/app-server turn count がずれる場合は、`thread/read` / `thread/resume` が一致していれば app-server count を正として rollback `numTurns` を補正する。
45
45
  - `codex-visibility-smoke`: injected active-work memory が次 model turn で model-visible になることを確認済み。
46
46
  - `codex-rollback-model-visible-smoke`: controlled two-phase smoke。`--prepare` は unique marker を含む user turn を開始して 1 turn rollback し、`--verify` は full marker を含まない prefix-only prompt で rollback 済み marker が model-visible かを測る。これは実 current thread を mutate するため明示 env 必須。live run では `--marker-file` を使い、full marker を同一 thread の chat/tool output に出さない。
47
47
  - `codex-restore-smoke`: fresh app-server process を複数回起動し、`thread/read` / `thread/resume` / paginated `thread/turns/list` turn count が rollout active turn count と一致し続けるかを read-only で確認できる。ただし proof scope は `app_server_process_restart_only` で、VS Code restart-safe 証明ではない。
@@ -318,7 +318,7 @@ TODO:
318
318
  - post-inject visibility check
319
319
  - [x] execute env gate を外せる条件を再検討した。
320
320
  - 2026-05-07 correction: live app-server smoke / post-inject visibility / worktree 非破壊性だけでは不十分だったため、一時的に `THROUGHLINE_EXPERIMENTAL_CODEX_TRIM_EXECUTE=1` gate を戻した。
321
- - 2026-05-08 unblock: controlled rollback model-visible smoke が app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だったため、env gate / host primitive audit gate / restore-safety-only blocker を解除した。現行 blocker は thread identity、Throughline DB injectable memory、rollout/app-server turn-count mismatch
321
+ - 2026-05-08 unblock: controlled rollback model-visible smoke が app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だったため、env gate / host primitive audit gate / restore-safety-only blocker を解除した。2026-05-09 update: rollout/app-server turn-count mismatch も blocker から外し、app-server `thread/read` / `thread/resume` が一致する場合は差分補正で rollback `numTurns` を決める。
322
322
  - [x] partial rollback の multi-turn harness を作る。
323
323
  - [x] rollback marker / injected memory が live `thread/resume` 後も効くか確認する。
324
324
  - [x] ローカルファイル変更が戻らないことを、実ファイル付き smoke で確認する。
@@ -328,7 +328,7 @@ TODO:
328
328
  - `throughline codex-restore-smoke --codex-thread-id <id>` は fresh app-server process を複数回起動し、rollout active turn count と `thread/read` / `thread/resume` / paginated `thread/turns/list` の一致を確認する。
329
329
  - proof scope は `app_server_process_restart_only`。VS Code restart / reconnect 越しの rollback / inject durability はまだ証明しない。
330
330
  - [x] failure mode を固定する。
331
- - turn count mismatch
331
+ - turn count mismatch diagnostic / app-server-count rollback adjustment
332
332
  - inject visibility timeout
333
333
  - app-server unavailable
334
334
  - thread not found
@@ -344,10 +344,10 @@ TODO:
344
344
  Phase 4 implementation status (2026-05-07):
345
345
 
346
346
  - [x] `throughline trim --preflight --host codex --codex-thread-id <id>` は `thread/read` / `thread/resume` まで実行し、rollback / inject は送らない。
347
- - [x] historical: `throughline trim --execute --host codex --codex-thread-id <id>` は guarded execute を行う実装だった。2026-05-07 correction では env gate と host primitive audit gate を戻して一時 blocked にした。2026-05-08 unblock では controlled rollback model-visible smoke が再現しなかったため、env gate / host primitive audit gate / restore-safety-only blocker を外し、DB memory と rollout/app-server turn-count guard を残した。
348
- - [x] rollout source を使う場合、rollback 前に rollout active turn count と app-server `thread/read` / `thread/resume` turn count を照合する。不一致なら rollback / inject を送らず refuse する。
347
+ - [x] historical: `throughline trim --execute --host codex --codex-thread-id <id>` は guarded execute を行う実装だった。2026-05-07 correction では env gate と host primitive audit gate を戻して一時 blocked にした。2026-05-08 unblock では controlled rollback model-visible smoke が再現しなかったため、env gate / host primitive audit gate / restore-safety-only blocker を外し、DB memory と rollout/app-server turn-count diagnostics を残した。
348
+ - [x] rollout source を使う場合、rollback 前に rollout active turn count と app-server `thread/read` / `thread/resume` turn count を照合する。不一致でも refuse せず診断に残す。`readTurns === resumedTurns` なら planned rollback turns `readTurns - expectedTurns` を足して `thread/rollback.numTurns` を送る。
349
349
  - [x] guarded execute は `thread/rollback` -> `thread/inject_items` -> post-inject `thread/read` polling の順に進む。`turn/start` は呼ばない。
350
- - [x] fake app-server harness で partial rollback、delayed inject visibility、mismatch refusal、mutation not sent preflight を固定した。
350
+ - [x] fake app-server harness で partial rollback、delayed inject visibility、mismatch adjustment、mutation not sent preflight を固定した。
351
351
  - [x] `thread/resume` 後に injected memory が維持されることを、実 Codex host smoke として確認済み。
352
352
  - [x] 実 Codex host での next model turn visibility smoke は Phase 3 の `codex-visibility-smoke` で確認済み。active-work developer message が次の model turn の agent delta に反映された。
353
353
  - [x] 実 Codex host で `trim --preflight --host codex --codex-thread-id 019dfa40-1cc8-7d13-a110-16b09364fa6a --json` を実行し、guard が mutation 前に read / resume count を照合することを確認した。
@@ -419,7 +419,7 @@ TODO:
419
419
  - [x] Codex trim / setup まで含む command surface を決める。
420
420
  - `throughline trim --host codex`
421
421
  - `throughline trim --preflight --host codex --codex-thread-id <id>`
422
- - `throughline trim --execute --host codex --codex-thread-id <id>` (DB memory rollout/app-server turn-count guard がそろう場合に current-thread rollback / inject を実行)
422
+ - `throughline trim --execute --host codex --codex-thread-id <id>` (DB memory がある場合に current-thread rollback / inject を実行し、rollout/app-server turn-count mismatch は診断と `numTurns` 補正に使う)
423
423
  - `doctor --codex` / `codex-capture` / `codex-summarize` / `codex-resume --memo-stdin` / `codex-visibility-smoke`
424
424
  - [x] Codex primary の doctor を追加または拡張する。
425
425
  - [x] Codex primary の setup / install 手順を追加する。
@@ -461,15 +461,15 @@ Phase 5 implementation status (2026-05-06):
461
461
  - 最終確認: hook shape 変更後に新しく開始した VSCode-origin Codex session で 1 turn 完了後、`throughline doctor --codex` を実行した。`current Codex thread` は `019dfd62-9a9d-7211-bf91-89d8e3fc908e`、`latest DB session` は `codex:019dfd62-9a9d-7211-bf91-89d8e3fc908e` で一致し、`Codex hooks feature: enabled`、`Codex Stop hook: registered`、command は `/usr/bin/node /home/kite/projects/Throughline/bin/throughline.mjs codex-hook stop`、`async: false`、`timeoutSec: 300` だった。VSCode-origin の自然 Stop hook による DB capture も解決済みとして扱う。
462
462
  - historical 2026-05-07 correction: 以下の Codex trim smoke は live app-server primitive の履歴として残す。ただし 2026-05-06 incident 後、restart / reconnect 越しの durable context trim 成功とは一時的に扱わず、`$throughline` / Codex Stop hook の automatic mutation を止めていた。
463
463
  - 2026-05-09 UX 修正: bare `$throughline` は `doctor --codex` / `trim --dry-run --all` / `trim --preflight --all` を AI に順番実行させる説明 surface ではなく、`throughline trim --execute --host codex --all --json` を直接実行する scripted current-thread refresh に戻す。注入 memory は L2 最新 20 full bodies + L1 older summaries + L3 references only。diagnostics / dry-run / preflight / fresh-thread handoff は明示要求時だけ使う。
464
- - memory contract 修正: Codex guarded trim でも注入 memory は元の `/tl` 思想を正とする。古い turn は L1 summaries、直近 20 turn は L2 full bodies、L3 は reference only で、L3 bodies / tool payloads は注入しない。rollout source は rollback candidate / app-server turn count guard の根拠であり、Throughline DB memory がある場合に rollout active work preview を注入 memory として使わない。DB memory が無い execute は rollout preview を注入せず、mutation 前に拒否する。
464
+ - memory contract 修正: Codex guarded trim でも注入 memory は元の `/tl` 思想を正とする。古い turn は L1 summaries、直近 20 turn は L2 full bodies、L3 は reference only で、L3 bodies / tool payloads は注入しない。rollout source は rollback candidate app-server turn-count 補正の根拠であり、Throughline DB memory がある場合に rollout active work preview を注入 memory として使わない。DB memory が無い execute は rollout preview を注入せず、mutation 前に拒否する。
465
465
  - doctor visibility 修正: `doctor --codex` は旧 context refresh readiness として rollback source、inject memory source、memory contract、L1 summaries / recent L2 bodies / L3 references-only count、heuristic reduction estimate を表示していた。実 thread `019dfd62-9a9d-7211-bf91-89d8e3fc908e` では live readiness として `context refresh: ready`、`rollback source: codex-rollout`、`inject memory source: throughline-db`、`memory contract: older L1 + latest 20 L2 full bodies + L3 references only` を確認した。ただし incident 後は restart-safe readiness ではない。
466
466
  - 削減量の記録: `trim --dry-run --host codex` は rollout text がある場合に `contextReductionEstimate` を返す。2026-05-06 の現在 thread `019dfd62-9a9d-7211-bf91-89d8e3fc908e` では通常 keep-recent preview だと `capturedTurns = 14` / `keepRecent = 20` のため `rollbackTurns = 0`、推定削減量も 0 だった。旧 bare `$throughline` context refresh は `--all` を使っていたため、この keep-recent preview の 0 は「Codex で削減できない」という意味ではない。
467
467
  - historical live-only `$throughline` context refresh smoke: 同じ VSCode-origin thread `019dfd62-9a9d-7211-bf91-89d8e3fc908e` で `trim --dry-run --host codex --all --json` -> `trim --preflight --host codex --all --json` -> `trim --execute --host codex --all` を実行した。preflight は rollout/app-server turn count `20 / 20` match、execute は `rollbackSent = true`、`injectSent = true`、`injectedItems = 1`、`rollback candidate turns = 20`。直前見積もりは `rollbackEstimatedTokens = 179780`、`injectedMemoryEstimatedTokens = 2009`、`netEstimatedTokens = 177771`、`reductionPct = 99` (`chars / 4` heuristic)。これは live app-server smoke であり、restart-safe durability の証明ではない。
468
468
  - post-refresh confirmation: execute 後の次 user turn で `doctor --codex` は current thread と latest DB session の一致を維持し、latest DB session は `2026-05-06 22:41:10` へ更新された。`trim --dry-run --host codex --all --json` は `activeTurns = 2`、`rollbackEvents = 1`、`rolledBackTurns = 20` を返し、`codex-resume` は rollback 後の短い active work context を L2 として描画した。
469
469
  - monitor adapter 修正: `throughline monitor` は Claude / Codex host-aware state を読む。Codex Stop hook は `codex:<thread_id>` monitor state を書き、Codex rollout path は Claude transcript 用 `transcriptPath` ではなく `rolloutPath` に保存する。2026-05-09 以降、monitor は `~/.throughline/state` だけでなく `~/.codex/sessions/**/rollout-*.jsonl` も直接 discovery するため、state 未生成の現在 Codex thread も表示できる。既存 state がある場合は usage snapshot を保持しつつ discovered rollout path / mtime を合流する。rollout に `event_msg` / `token_count` がある場合は verified usage として表示し、無い場合だけ `estimated: true` / `source = codex-rollout-chars-div-4` の明示 estimate を使う。state filename は URL encode し、`codex:` session id を Windows でも保存可能にした。表示 ID は `codex:` prefix を外した raw thread id 先頭 8 桁。
470
470
  - monitor doctor 修正: Codex Stop hook stdout は VSCode chat に必ず見えるとは限らないため、`doctor --codex` に `.vscode/tasks.json` の Throughline Monitor task 診断を追加した。登録済み / 未登録 / JSONC / parse error / broken absolute path と `runOn`、および初回作成後は `Developer: Reload Window` が必要という note を read-only で表示する。
471
- - historical automatic refresh 実装: Codex Stop hook は capture / L1 summarize / monitor state 書き込み後、verified usage が verified context window の `90%` 以上なら automatic refresh を試行する経路を持っていた。2026-05-06 incident 後、この経路は blocker として扱い、monitor state / warning / diagnostics は残しても rollback + inject は送らない状態にした。2026-05-08 unblock 後は guarded rollback / inject を再有効化し、2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせるため verified usage `80%` 以上を既定閾値にする。
472
- - current-session trigger 修正: Codex auto-refresh を token-monitor の描画ループに置かず、Codex `UserPromptSubmit` / `PostToolUse` hooks が当該 session の rollout `token_count` を直接読んで verified 80% 以上なら `$throughline` workflow 実行指示を同じ user turn または tool loop 継続前の `additionalContext` として注入する。monitor は表示専用で、自動発火の判定元にしない。
471
+ - historical automatic refresh 実装: Codex Stop hook は capture / L1 summarize / monitor state 書き込み後、verified usage が verified context window の `90%` 以上なら automatic refresh を試行する経路を持っていた。2026-05-06 incident 後、この経路は blocker として扱い、monitor state / warning / diagnostics は残しても rollback + inject は送らない状態にした。2026-05-08 unblock 後は guarded rollback / inject を再有効化し、2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせるため verified usage `75%` 以上を既定閾値にする。
472
+ - current-session trigger 修正: Codex auto-refresh を token-monitor の描画ループに置かず、Codex `UserPromptSubmit` / `PostToolUse` hooks が当該 session の rollout `token_count` を直接読んで verified 75% 以上なら `$throughline` workflow 実行指示を同じ user turn または tool loop 継続前の `additionalContext` として注入する。monitor は表示専用で、自動発火の判定元にしない。
473
473
 
474
474
  ## Phase 6: Claude Side Finalization
475
475
 
@@ -515,7 +515,7 @@ TODO:
515
515
 
516
516
  ## 次の作業
517
517
 
518
- Codex primary の capture / summarize / resume は完了扱い。Codex trim execute / auto-refresh も 2026-05-08 の controlled rollback model-visible smoke 後に再有効化済み。[THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) の Phase 0-4、read-only app-server process restart smoke、local restore source audit、host primitive audit、manual VS Code restore smoke protocol、実 VS Code reload / reconnect marker proof、rollback 非復活 verifier、controlled rollback model-visible smoke surface は実装済み。incident-shaped live rollback run は `restoreSafety.status = risk` で、`compacted.replacement_history` retention と rollback 済み text match を診断上は観測した。後続の app-server response 分類では retained text が `aggregatedOutput` の引用に限定され、direct user message / model-visible reproduction とは分けて扱う。host primitive audit でも current-thread rollback non-resurrection primitive は見つかっていないが、これは diagnostic-only で、DB memory rollout/app-server turn-count guard がそろう `trim --execute` を塞がない。
518
+ Codex primary の capture / summarize / resume は完了扱い。Codex trim execute / auto-refresh も 2026-05-08 の controlled rollback model-visible smoke 後に再有効化済み。[THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) の Phase 0-4、read-only app-server process restart smoke、local restore source audit、host primitive audit、manual VS Code restore smoke protocol、実 VS Code reload / reconnect marker proof、rollback 非復活 verifier、controlled rollback model-visible smoke surface は実装済み。incident-shaped live rollback run は `restoreSafety.status = risk` で、`compacted.replacement_history` retention と rollback 済み text match を診断上は観測した。後続の app-server response 分類では retained text が `aggregatedOutput` の引用に限定され、direct user message / model-visible reproduction とは分けて扱う。host primitive audit でも current-thread rollback non-resurrection primitive は見つかっていないが、これは diagnostic-only で、DB memory がある `trim --execute` を塞がない。rollout/app-server turn-count mismatch は診断と app-server-count `numTurns` 補正に使う。
519
519
 
520
520
  再開時は次を実施する:
521
521
 
@@ -45,7 +45,7 @@ rollback trim は最終的な理想に近いが、host primitive の実測が必
45
45
  - Claude hooks、slash command、transcript parsing、handoff baton、SessionStart resume behavior を Codex 用に置き換えない。
46
46
  - Claude-facing field / command / DB semantics を rename しない。
47
47
  - Codex 対応は adapter / projection として足す。
48
- - `thread/rollback` / `thread/inject_items` は live host primitive として実測済み。2026-05-06 incident 後に Codex guarded execute / auto-refresh は一時停止したが、2026-05-08 の controlled rollback model-visible smoke が再現しなかったため、過剰 blocker は解除済み。現在は [THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) を優先し、DB memory rollout/app-server turn-count guard を必須にする。Claude `/rewind` 自動化はまだ有効化しない。
48
+ - `thread/rollback` / `thread/inject_items` は live host primitive として実測済み。2026-05-06 incident 後に Codex guarded execute / auto-refresh は一時停止したが、2026-05-08 の controlled rollback model-visible smoke が再現しなかったため、過剰 blocker は解除済み。現在は [THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) を優先し、DB memory を必須にする。rollout/app-server turn-count mismatch は診断と app-server count 由来の rollback `numTurns` 補正に使う。Claude `/rewind` 自動化はまだ有効化しない。
49
49
  - fallback や silent recovery で失敗を隠さない。互換モードは条件と理由を明示する。
50
50
 
51
51
  ## 運用ルール
@@ -372,13 +372,13 @@ Phase 6 result (2026-05-06):
372
372
  - `thread/inject_items` に raw Responses API item `{ type: "message", role: "developer", content: [{ type: "input_text", text: "..." }] }` を渡し、次の `turn/start` で injected memory が model-visible になることを確認した。marker `TL_PHASE6_INJECT_OK` を正しく返した。
373
373
  - その後の Codex primary 実装で、`codex-resume` が描画する active-work developer message も実 Codex host で model-visible になることを確認した。marker `TL_CODEX_VISIBLE_REAL_20260506_C` が `item/agentMessage/delta` に出た。詳細な実測値は [THROUGHLINE_CODEX_FIRST_ROADMAP.md](THROUGHLINE_CODEX_FIRST_ROADMAP.md) の Phase 3 result を正とする。
374
374
  - さらに `thread/inject_items` 後にもう一度 `thread/resume` してから `turn/start` を呼ぶ smoke も追加し、実 Codex host で marker `TL_CODEX_RESUME_AFTER_INJECT_REAL_20260506` が `item/agentMessage/delta` に出ることを確認した。
375
- - Codex host primitive は live app-server 上では実測済み。ただし restart-safe durability は未証明。現在は明示 `--codex-thread-id` または env thread identity と rollout/app-server turn count guard live mutation の最低条件であり、durable success は別分類で扱う。2026-05-06 incident 後はいったん Codex Stop hook 後の automatic refresh mutation を blocked としたが、2026-05-08 unblock 後は guarded rollback / inject を試行する。2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせるため、verified usage 80% 以上を既定閾値にする。
375
+ - Codex host primitive は live app-server 上では実測済み。ただし restart-safe durability は未証明。現在は明示 `--codex-thread-id` または env thread identity と Throughline DB memory が live mutation の最低条件であり、rollout/app-server turn-count mismatch は診断と rollback `numTurns` 補正に使う。durable success は別分類で扱う。2026-05-06 incident 後はいったん Codex Stop hook 後の automatic refresh mutation を blocked としたが、2026-05-08 unblock 後は guarded rollback / inject を試行する。2026-05-09 以降は Codex native auto-compact より先に Throughline refresh を走らせるため、verified usage 75% 以上を既定閾値にする。
376
376
  - Claude `/rewind conversation only` は手動 UX として扱う。外部ツールからの自動化 surface は未確認。Claude host の automatic rollback / inject は `manual-only`。
377
377
  - Phase 8 では dry-run / preflight を本線にしつつ、Codex だけ guarded execute を追加した。Claude は manual-only のまま扱う。
378
378
 
379
379
  完了条件:
380
380
 
381
- - [x] rollback trim を自動実装してよい host と、手動案内に留める host が判断できる。Codex は 2026-05-08 unblock 後、Stop hook auto-refresh と明示 execute を許可する。2026-05-09 以降の auto-refresh 既定閾値は verified usage 80%。Claude は manual-only。
381
+ - [x] rollback trim を自動実装してよい host と、手動案内に留める host が判断できる。Codex は 2026-05-08 unblock 後、Stop hook auto-refresh と明示 execute を許可する。2026-05-09 以降の auto-refresh 既定閾値は verified usage 75%。Claude は manual-only。
382
382
 
383
383
  ## Phase 7: Trim Handoff Model
384
384
 
@@ -386,7 +386,7 @@ Phase 6 result (2026-05-06):
386
386
 
387
387
  TODO:
388
388
 
389
- - [x] host identity model を整理する。Claude `session_id`、Codex `thread_id`、`project_path`、origin session / thread references の対応表を作る。Codex は `thread_id` と rollout JSONL を app-server で扱い、明示 identity と turn count guard がある場合だけ guarded execute へ進む。
389
+ - [x] host identity model を整理する。Claude `session_id`、Codex `thread_id`、`project_path`、origin session / thread references の対応表を作る。Codex は `thread_id` と rollout JSONL を app-server で扱い、明示 identity と Throughline DB memory がある場合に guarded execute へ進む。turn count mismatch は診断と app-server count 由来の rollback `numTurns` 補正に使う。
390
390
  - [x] current session / thread の captured turn count を記録または導出する方法を決める。
391
391
  - [x] rollback 可能な最大 turn 数を計算する。
392
392
  - [x] keep-recent の既定値を決める。
@@ -428,7 +428,7 @@ TODO:
428
428
  - [x] 実行前に captured turns / keep turns / injected memory summary を表示する。
429
429
  - [x] Codex dry-run では `--codex-thread-id` を受け取り、Claude / Throughline の `session_id` と Codex `thread_id` を混同しない形で plan に残す。
430
430
  - [x] Codex non-dry-run の最初の統合として `--preflight` を追加する。これは app-server の initialize / read / resume だけを実行し、rollback / inject は送らない。
431
- - [x] Codex の guarded execution として `--execute` を追加する。ただし `--host codex`、明示または env の Codex thread identity、rollout/app-server turn count guard を必須にし、実行後に model turn は開始しない。
431
+ - [x] Codex の guarded execution として `--execute` を追加する。ただし `--host codex`、明示または env の Codex thread identity、Throughline DB memory を必須にし、実行後に model turn は開始しない。rollout/app-server turn-count mismatch は診断と rollback `numTurns` 補正に使う。
432
432
  - [ ] 自動 rollback 対応 host では、実行後に resume / injected memory が restart / reconnect 後も有効か検証する。Codex は Phase 6 spike、2026-05-06 guarded execute smoke、post-inject resume visibility smoke で live app-server 上の rollback/inject と injected memory visibility だけを確認した。2026-05-06 incident 後、これは restart-safe durability の完了条件を満たさない。
433
433
  - [x] `doctor` に trim 関連診断を追加する。
434
434
 
@@ -436,11 +436,11 @@ Phase 8 partial implementation result (2026-05-06):
436
436
 
437
437
  - `throughline trim --dry-run [--host claude|codex|unknown] [--keep-recent N] [--all] [--session <id>] [--codex-thread-id <id>] [--json]` を追加。
438
438
  - `throughline trim --dry-run --memo-stdin` を追加。`/tl` が解決した「L1/L2 はあるが今やっている作業として認識されない」問題を `/tl-trim` でも再発させないため、current-work memo を curated memory preview の先頭に入れる。
439
- - non-dry-run `throughline trim` は Claude / unknown host では automatic rollback / inject 未対応として exit 1 で明示拒否する。Codex host には `--execute` 経路が実装済み。2026-05-06 incident 後はいったん拒否したが、2026-05-08 unblock 後は明示 `--execute`、Codex thread identity、Throughline DB memoryrollout/app-server turn-count guard がそろえば mutation へ進む。
439
+ - non-dry-run `throughline trim` は Claude / unknown host では automatic rollback / inject 未対応として exit 1 で明示拒否する。Codex host には `--execute` 経路が実装済み。2026-05-06 incident 後はいったん拒否したが、2026-05-08 unblock 後は明示 `--execute`、Codex thread identity、Throughline DB memory がそろえば mutation へ進む。2026-05-09 以降は rollout/app-server turn-count mismatch refuse せず、app-server count 由来で rollback `numTurns` を補正する。
440
440
  - `src/codex-app-server.mjs` を追加し、newline JSON framing、initialize / read / resume / rollback / inject / turn-start request builder、server line parser をテストで固定した。Codex guarded execute はこの helper を通り、model turn は開始しない。
441
441
  - `--codex-thread-id` の明示入力を最優先で信頼する。明示入力が無い場合のみ、`THROUGHLINE_CODEX_THREAD_ID` / `CODEX_THREAD_ID` を current-thread identity signal として使う。最新 rollout 推測による automatic trim は行わない。
442
442
  - `throughline trim --preflight --host codex --codex-thread-id <id> [--json]` を追加した。これは `thread/read` と `thread/resume` が対象 thread に届くことを確認し、`rollbackRequestPreview` を返すが、`thread/rollback` / `thread/inject_items` は送らない。
443
- - `codex-rollout` source の場合、preflight は rollout 側 active turn count と app-server `thread/read` / `thread/resume` の turn count を突き合わせる。不一致または app-server count 不明なら `preflight-refused` として止まり、rollback / inject は送らない。
443
+ - `codex-rollout` source の場合、preflight は rollout 側 active turn count と app-server `thread/read` / `thread/resume` の turn count を突き合わせる。不一致でも `preflight-refused` にはせず、`readTurns === resumedTurns` なら app-server count 由来の rollback `numTurns` 補正 preview を返す。preflight なので rollback / inject は送らない。
444
444
  - 同日、検証 thread `019dfaba-f87e-7f41-a144-d5ca7c6dd7f9` に実 app-server preflight を当て、`readTurns: 1` / `resumedTurns: 1` / `rollbackSent: false` / `injectSent: false` を確認した。
445
445
  - `throughline trim --execute --host codex --codex-thread-id <id> [--json]` を追加した。2026-05-06 incident 後は既定で拒否し、2026-05-07 追加修正では host primitive audit gate も置いた。2026-05-08 unblock 後はこの env gate / host primitive audit gate を外し、app-server の `thread/read`、`thread/resume`、`thread/rollback`、`thread/inject_items`、確認用 `thread/read` へ進む。host primitive audit と restore-safety は diagnostic-only。
446
446
  - 実 app-server smoke では `thread/inject_items` の直後に返る turn 配列が、注入 item の可視化より早い場合があると分かった。その後の current-thread live run で、現行 Codex host の developer memory injection は item-level で、即時 `thread/read` の turn count を増やさない場合があることも確認した。そのため `--execute` は `thread/inject_items` の応答に turn list があればその turn count を期待値とし、応答に turn list がなければ rollback 後 turn count を期待値として post-inject `thread/read` を短く poll する。`postInjectVisibilityCheck` は `match` / `timeout` / `unchecked` を記録する。CLI 外側の status は `executed` ではなく、live mutation だけなら `execute-sent-live-only`、timeout や durable evidence 不足なら `execute-unverified`、rollout に新 rollback marker と active-work memory injection が観測された場合は `execute-durable-verified` とする。restore-safety は durable mutation evidence とは別の diagnostic として表示する。exit 0 は `execute-durable-verified` に限る。
@@ -18,8 +18,10 @@ quoted/tool-output field に残り得ることは確認済みですが、それ
18
18
  model-visible input に入ることは controlled smoke で再現していません。incident-shaped
19
19
  run の retained text は risk evidence として残す一方、単独では mutation 前 blocker にしません。
20
20
  Codex current-thread trim は、明示 `--execute`、Throughline DB injectable memory、
21
- Codex thread identityrollout/app-server turn-count guard を条件に実行します。Codex Stop hook
22
- auto-refresh verified usage 80% 以上で同じ guarded path を試行し、estimate usage では実行しません。
21
+ Codex thread identity を条件に実行します。rollout/app-server turn-count mismatch は診断に残し、
22
+ app-server `thread/read` / `thread/resume` が同じ count を返す場合は、その差分で rollback `numTurns`
23
+ を補正します。Codex Stop hook
24
+ auto-refresh は verified usage 75% 以上で同じ guarded path を試行し、estimate usage では実行しません。
23
25
 
24
26
  最初のインシデント仮説に対する重要な訂正:
25
27
 
@@ -293,7 +295,8 @@ TODO:
293
295
  repair contract が blocked の場合は拒否していた。
294
296
  - 2026-05-08 unblock: host primitive audit は diagnostic-only に変更した。
295
297
  現行 Codex CLI に same-thread repair primitive が無い事実は表示するが、
296
- DB memory rollout/app-server turn-count guard がそろう execute を塞がない。
298
+ DB memory がある execute を塞がない。rollout/app-server turn-count mismatch
299
+ 診断と app-server count 由来の rollback `numTurns` 補正に使う。
297
300
  - `~/.codex/state_5.sqlite` の `threads` table は rollout path / metadata を持つが、
298
301
  turn bodies は持たない。turn body の主根拠は rollout JSONL 側である可能性が
299
302
  高いが、VS Code extension restore source は別途未確定。
@@ -624,8 +627,9 @@ TODO:
624
627
  mutation 前 blocker にはしない。
625
628
  - [x] 明示 `trim --execute --host codex` の製品判断を固定する。
626
629
  - 判断: 明示 `--execute` で実行する。env opt-in と host primitive audit gate は外す。
627
- DB memory が無い場合、または rollout/app-server turn count guard が合わない場合は
628
- mutation 前に拒否する。実行後は `execute-sent-live-only` /
630
+ DB memory が無い場合は mutation 前に拒否する。rollout/app-server turn count がずれる場合は
631
+ refusal ではなく診断に残し、app-server count を正として rollback `numTurns` を補正する。
632
+ 実行後は `execute-sent-live-only` /
629
633
  `execute-unverified` / `execute-durable-verified` で結果を分ける。
630
634
 
631
635
  受け入れ条件:
@@ -644,11 +648,11 @@ TODO:
644
648
  という記述を訂正する。
645
649
  - [x] hypothesis を compacted replacement-history restore に言及する形へ更新する。
646
650
  - [x] Codex Rewind-equivalent trim が complete だという roadmap claim を格下げする。
647
- - [x] Codex auto-refresh は verified usage 80% 以上で guarded rollback / inject を
651
+ - [x] Codex auto-refresh は verified usage 75% 以上で guarded rollback / inject を
648
652
  実行する。estimate usage では実行しない。
649
- - [x] Codex 80% trigger は token-monitor 依存にしない。Codex `UserPromptSubmit`
653
+ - [x] Codex 75% trigger は token-monitor 依存にしない。Codex `UserPromptSubmit`
650
654
  / `PostToolUse` hooks が当該 session の rollout `token_count` を直接読み、
651
- verified 80% 以上なら current session へ `$throughline` workflow 実行指示を
655
+ verified 75% 以上なら current session へ `$throughline` workflow 実行指示を
652
656
  注入する。`PostToolUse` により、tool loop 中に閾値を超えた場合も次の継続前に
653
657
  同じ判定を走らせる。
654
658
  - [x] 新セッションが古い「Codex side complete」claim ではなく、この fix plan から
@@ -673,5 +677,9 @@ TODO:
673
677
  作業量や複雑さを理由に目標を下げない。2026-05-08 時点の製品仕様は、
674
678
  同一 Codex thread で guarded rollback + Throughline DB memory inject を実行し、
675
679
  rollout 上の新 rollback event と injected active-work memory で durable evidence を確認すること。
676
- restore-safety / host primitive audit は diagnostics として残すが、単独では execute / auto-refresh の blocker にしない。
677
- mutation 前 refusal は thread identityThroughline DB injectable memory、rollout/app-server turn-count mismatch に限定する。
680
+ restore-safety / host primitive audit / rollout-app-server turn-count mismatch は diagnostics として残すが、単独では execute / auto-refresh の blocker にしない。
681
+ mutation 前 refusal は thread identityThroughline DB injectable memory に限定する。
682
+ 2026-05-09 update: rollout/app-server turn-count mismatch は mutation 前 refusal から外した。
683
+ app-server `thread/read` / `thread/resume` が同じ count を返す場合、planned rollback turns に
684
+ `readTurns - expectedTurns` を足して `thread/rollback.numTurns` を送る。例:
685
+ `expectedTurns = 6` / `readTurns = resumedTurns = 7` / `--all` なら `numTurns = 7`。
@@ -15,11 +15,13 @@
15
15
 
16
16
  この文書は「rollback は欠けていた delete primitive かもしれない」という洞察を残すもの。実装時は、未検証の host primitive を本線仕様にせず、次フェーズ計画 [THROUGHLINE_CODEX_FIRST_ROADMAP.md](THROUGHLINE_CODEX_FIRST_ROADMAP.md) の Codex Rewind 互換 Phase で実測してから本線 UX に進む。
17
17
 
18
- 2026-05-06 update: Codex app-server の `thread/rollback` / `thread/inject_items` は live host primitive として実測済み。Throughline CLI には明示 `--codex-thread-id` または `THROUGHLINE_CODEX_THREAD_ID` / `CODEX_THREAD_ID` による current-thread identity、rollout/app-server turn count guard、guarded execute が入った。
18
+ 2026-05-06 update: Codex app-server の `thread/rollback` / `thread/inject_items` は live host primitive として実測済み。Throughline CLI には明示 `--codex-thread-id` または `THROUGHLINE_CODEX_THREAD_ID` / `CODEX_THREAD_ID` による current-thread identity、rollout/app-server turn count diagnostics、guarded execute が入った。
19
19
 
20
20
  2026-05-07 correction: VS Code restart / reconnect 後に rollback 済み user prompt が復活したように見える incident が起きたため、Codex rollback / inject は restart-safe な context trim primitive としていったん未証明へ戻した。特に `compacted.replacement_history` など、live app-server read/resume 以外の restore source を検証するまで、`$throughline` と Codex Stop hook auto-refresh は mutation を自動実行しない方針にした。Claude `/rewind` 自動化はまだ有効化しない。
21
21
 
22
- 2026-05-08 unblock: その後の切り分けで、incident thread の retained text は app-server response 上では `aggregatedOutput` など quoted/tool-output field に分類され、controlled rollback model-visible smoke は app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だった。これを受け、Codex `trim --execute --host codex` と Stop hook auto-refresh の過剰 blocker は解除する。`compacted.replacement_history` retention、restore-safety risk、host primitive audit は引き続き diagnostics だが、単独では mutation 前 refusal にしない。DB memory 不在と rollout/app-server turn-count 不一致は引き続き mutation 前 blocker。
22
+ 2026-05-08 unblock: その後の切り分けで、incident thread の retained text は app-server response 上では `aggregatedOutput` など quoted/tool-output field に分類され、controlled rollback model-visible smoke は app-server restart 境界と VS Code reload/reconnect 境界の両方で `not-reproduced` だった。これを受け、Codex `trim --execute --host codex` と Stop hook auto-refresh の過剰 blocker は解除する。`compacted.replacement_history` retention、restore-safety risk、host primitive audit は引き続き diagnostics だが、単独では mutation 前 refusal にしない。DB memory 不在は引き続き mutation 前 blocker。
23
+
24
+ 2026-05-09 update: rollout/app-server turn-count 不一致も mutation 前 blocker から外した。app-server `thread/read` / `thread/resume` が同じ count を返す場合、planned rollback turns に `readTurns - expectedTurns` を足して `thread/rollback.numTurns` を送る。`expectedTurns = 6` / `readTurns = resumedTurns = 7` / `--all` なら `numTurns = 7`。
23
25
 
24
26
  2026-05-09 skill UX: bare `$throughline` は diagnostics / dry-run / preflight を AI に順番実行させる surface ではなく、`throughline trim --execute --host codex --all --json` を直接走らせる scripted current-thread refresh とする。目的は rollback と、Throughline DB の L2 最新 20 full bodies + older L1 summaries + L3 references-only memory injection のみ。doctor / dry-run / preflight / fresh-thread handoff / restore-safety / host primitive audit は明示診断用であり、通常 `$throughline` の前段にはしない。
25
27
 
@@ -263,10 +265,10 @@ Codex で考えられる流れ:
263
265
  9. ユーザーは同じ Codex thread で続行する。
264
266
  ```
265
267
 
266
- 現行実装では、Codex Stop hook 後の 80% automatic refresh は guarded rollback / inject
268
+ 現行実装では、Codex Stop hook 後の 75% automatic refresh は guarded rollback / inject
267
269
  mutation を試行する。明示 CLI の `throughline trim --execute --host codex --codex-thread-id <id>`
268
- も env gate なしで実行する。明示 Codex thread identityinjectable Throughline DB memory
269
- rollout/app-server turn count guard live mutation の最低条件であり、durable success は
270
+ も env gate なしで実行する。明示 Codex thread identityinjectable Throughline DB memory
271
+ は live mutation の最低条件であり、rollout/app-server turn-count mismatch は診断と app-server count 由来の rollback `numTurns` 補正に使う。durable success は
270
272
  post-execute rollout evidence で `execute-durable-verified` として別判定する。
271
273
 
272
274
  重要な考え:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "throughline",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "type": "module",
5
5
  "description": "Claude Code hooks plugin for structured context compression (/clear-safe persistent memory)",
6
6
  "keywords": [
@@ -101,7 +101,7 @@ function renderTextResult(result) {
101
101
  lines.push(` L1 summaries: ${result.l1Summaries}`);
102
102
  lines.push(` recent L2 bodies: ${result.recentBodies}`);
103
103
  lines.push(` L3 references: ${result.l3References}`);
104
- lines.push(` rendered detail cmds: ${result.renderedDetailCommands}`);
104
+ lines.push(` rendered detail suffixes: ${result.renderedDetailSuffixes}`);
105
105
  lines.push('');
106
106
  lines.push(' checks:');
107
107
  for (const check of result.checks) {
@@ -126,7 +126,7 @@ test('codex-hook stop captures rollout using Codex stdin payload fields', async
126
126
  }
127
127
  });
128
128
 
129
- test('codex-hook stop runs auto refresh when verified usage reaches 80%', async () => {
129
+ test('codex-hook stop runs auto refresh when verified usage reaches 75%', async () => {
130
130
  const codexHome = mkdtempSync(join(tmpdir(), 'tl-codex-hook-home-'));
131
131
  const project = mkdtempSync(join(tmpdir(), 'tl-codex-hook-project-'));
132
132
  const threadId = '019dfaba-f87e-7f41-a144-d5ca7c6dd7f9';
@@ -187,7 +187,7 @@ test('codex-hook stop runs auto refresh when verified usage reaches 80%', async
187
187
  }
188
188
  });
189
189
 
190
- test('codex-hook user-prompt-submit injects current-session throughline instruction at 80%', async () => {
190
+ test('codex-hook user-prompt-submit injects current-session throughline instruction at 75%', async () => {
191
191
  const codexHome = mkdtempSync(join(tmpdir(), 'tl-codex-hook-home-'));
192
192
  const project = mkdtempSync(join(tmpdir(), 'tl-codex-hook-project-'));
193
193
  const threadId = '019dfaba-f87e-7f41-a144-d5ca7c6dd7f9';
@@ -244,7 +244,7 @@ test('codex-hook user-prompt-submit injects current-session throughline instruct
244
244
  }
245
245
  });
246
246
 
247
- test('codex-hook user-prompt-submit stays quiet below 80%', async () => {
247
+ test('codex-hook user-prompt-submit stays quiet below 75%', async () => {
248
248
  const codexHome = mkdtempSync(join(tmpdir(), 'tl-codex-hook-home-'));
249
249
  const project = mkdtempSync(join(tmpdir(), 'tl-codex-hook-project-'));
250
250
  const threadId = '019dfaba-f87e-7f41-a144-d5ca7c6dd7f9';
@@ -290,7 +290,7 @@ test('codex-hook user-prompt-submit stays quiet below 80%', async () => {
290
290
  }
291
291
  });
292
292
 
293
- test('codex-hook post-tool-use injects current-session throughline instruction at 80%', async () => {
293
+ test('codex-hook post-tool-use injects current-session throughline instruction at 75%', async () => {
294
294
  const codexHome = mkdtempSync(join(tmpdir(), 'tl-codex-hook-home-'));
295
295
  const project = mkdtempSync(join(tmpdir(), 'tl-codex-hook-project-'));
296
296
  const threadId = '019dfaba-f87e-7f41-a144-d5ca7c6dd7f9';