throughline 0.4.10 → 0.4.11

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,19 @@ shipped to npm but were not individually tagged on GitHub.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ### Changed
14
+
15
+ - Disabled Codex automatic current-thread refresh from `UserPromptSubmit`,
16
+ `PostToolUse`, and `Stop` hooks. The hooks now capture rollout memory and
17
+ monitor state, then return `codex_auto_refresh_disabled` without injecting
18
+ `$throughline` or sending rollback/inject. The lower-level auto-refresh helper
19
+ is also default-disabled.
20
+ - Changed the Codex `$throughline` skill back to a new-thread handoff flow:
21
+ bare `$throughline` now runs `throughline codex-handoff-start --execute`,
22
+ which creates a new Codex app-server thread, injects developer handoff memory,
23
+ and opens the selected host. Explicit `throughline trim --execute --host codex`
24
+ remains available as a diagnostic current-thread rollback / inject command.
25
+
13
26
  ## [0.4.10] — 2026-05-09
14
27
 
15
28
  ### Fixed
@@ -139,10 +152,13 @@ shipped to npm but were not individually tagged on GitHub.
139
152
 
140
153
  - Changed the installed Codex `$throughline` skill so bare `$throughline` runs
141
154
  the scripted current-thread refresh directly:
142
- `throughline trim --execute --host codex --all --json`. Doctor, dry-run,
155
+ `throughline trim --execute --host codex --all`. Doctor, dry-run,
143
156
  preflight, restore-safety analysis, host primitive audit, and fresh-thread
144
157
  handoff remain available only when explicitly requested instead of being the
145
158
  normal skill path.
159
+ - Changed Codex auto-refresh hook instructions to avoid `--json` on execute so
160
+ the full trim plan / memory preview is not reintroduced as tool output after
161
+ rollback.
146
162
 
147
163
  ## [0.4.2] — 2026-05-09
148
164
 
@@ -296,12 +312,14 @@ shipped to npm but were not individually tagged on GitHub.
296
312
  `--print-prompt` can include the combined prompt for audit. Live model smoke
297
313
  requires `THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1` and does not
298
314
  mutate the current Codex thread.
299
- - `throughline codex-handoff-start`, a guided read-only fresh-thread start plan
315
+ - `throughline codex-handoff-start`, a guided fresh-thread start plan
300
316
  for Codex handoff. It reports the structural smoke command, model-smoke dry-run
301
317
  boundary, handoff render command, optional live model smoke command, and can
302
318
  include the handoff prompt with `--print-prompt`. When `--memo-stdin` is used,
303
319
  the replay commands include `--memo-stdin` and the output reminds callers to
304
- pipe the same memo.
320
+ pipe the same memo. With `--execute`, it starts a new app-server thread,
321
+ injects developer handoff memory with `thread/inject_items`, and opens it
322
+ through `--open-host auto|vscode|cli|none`.
305
323
  - `throughline doctor --codex`, a read-only Codex-primary diagnostic that shows
306
324
  current thread env identity, rollout candidates for the cwd, captured
307
325
  `codex:<thread_id>` DB sessions, context refresh blockage, new-thread
package/README.ja.md CHANGED
@@ -26,11 +26,16 @@ throughline install # hook / Codex skill / VS Code monitor task を登録
26
26
  `/clear` を打てば新セッションはゼロからではなく、**思考の途中から再開** される。
27
27
  `/clear` を経由しない新規 chat / VS Code 再起動では `/tl` で前任を指名できる。
28
28
 
29
+ <details>
30
+ <summary><b>Codex も併用する場合</b> Codex hooks も登録される — クリックで詳細</summary>
31
+
29
32
  Codex では `UserPromptSubmit` / `PostToolUse` / `Stop` hook と `$throughline`
30
33
  skill も登録する。75% 自動発火は token-monitor 依存ではなく、当該 Codex
31
34
  セッションの rollout `token_count` を hook が読み、prompt 送信時または tool loop
32
35
  途中の閾値到達時に同じセッションへ `$throughline` 実行指示を注入する。
33
36
 
37
+ </details>
38
+
34
39
  ## 他の手段との比較
35
40
 
36
41
  | | Throughline | MemGPT / SummaryBufferMemory | 素の Claude Code |
@@ -137,6 +142,28 @@ Throughline 0.4.1+ の引き継ぎは 2 経路です。主経路は typed `/clea
137
142
  `/tl` が書く baton で、`source='clear'` の auto path は `/clear` が
138
143
  UserPromptSubmit hook に届かない場合の補助です。
139
144
 
145
+ ```mermaid
146
+ flowchart LR
147
+ U["ユーザーが入力<br/>/clear または /tl"] -->|UserPromptSubmit| W["writeBaton<br/>(session_id + TTL 1h)"]
148
+ W --> B[("handoff_batons<br/>SQLite")]
149
+ M["VS Code メニュー<br/>clear"] -->|UserPromptSubmit に届かない| X["baton 無し"]
150
+ NS["次の SessionStart"] --> C{"baton<br/>あり?"}
151
+ B -.-> C
152
+ X -.-> C
153
+ C -->|あり| P1["baton path<br/>(主経路)<br/>指名された前任を merge"]
154
+ C -->|無し / source='clear'| P2["auto path<br/>(補助)<br/>findLatestClaudePredecessor"]
155
+ C -->|無し / source!='clear'| P3["新規セッション<br/>merge 無し"]
156
+ P1 --> INJ["L1 + L2 + L3 references を注入"]
157
+ P2 --> INJ
158
+
159
+ classDef primary fill:#7c5cff,stroke:#1a1f2e,color:#fff
160
+ classDef fallback fill:#3aa0ff,stroke:#1a1f2e,color:#fff
161
+ classDef neutral fill:#4a5568,stroke:#1a1f2e,color:#fff
162
+ class P1 primary
163
+ class P2 fallback
164
+ class P3,INJ neutral
165
+ ```
166
+
140
167
  ### baton path (primary): typed `/clear` または `/tl`
141
168
 
142
169
  ユーザーが prompt に `/clear` または `/tl` を打つと、UserPromptSubmit hook が
package/README.md CHANGED
@@ -27,6 +27,9 @@ type `/clear` — the new session resumes mid-thought instead of starting from
27
27
  zero. (For non-`/clear` boundaries such as a brand-new chat or a VSCode
28
28
  restart, type `/tl` first to mark the predecessor.)
29
29
 
30
+ <details>
31
+ <summary><b>Also using Codex?</b> Global install registers Codex hooks too — click for details.</summary>
32
+
30
33
  Global install also registers Codex `UserPromptSubmit`, `PostToolUse`, and
31
34
  `Stop` hooks in `~/.codex/hooks.json` and enables both
32
35
  `[features].codex_hooks = true` and `[features].hooks = true` in
@@ -34,13 +37,16 @@ Global install also registers Codex `UserPromptSubmit`, `PostToolUse`, and
34
37
  `bin/throughline.mjs` through an absolute Node path, so Codex App Server PATH
35
38
  differences do not hide the command. They are registered synchronously
36
39
  (`async: false`), matching the Codex hook behavior verified in Caveat. Existing
37
- non-Throughline Codex hooks are preserved. The prompt and tool-loop hooks read
38
- the current rollout `token_count` themselves and inject `$throughline` at the
39
- verified 75% threshold; token-monitor is display-only and is never the trigger
40
- source. It also installs a global `$throughline` Codex skill. Bare
41
- `$throughline` runs the scripted current-thread rollback + Throughline DB memory
42
- injection directly; ask explicitly for status, resume, summarize, diagnostics,
43
- or fresh-thread handoff when you want those read-only surfaces instead.
40
+ non-Throughline Codex hooks are preserved. The prompt and tool-loop hooks capture
41
+ rollout memory and write monitor state, but they do not inject `$throughline` at
42
+ usage thresholds; token-monitor is display-only and is never an auto-refresh
43
+ trigger. It also installs a global `$throughline` Codex skill. Bare
44
+ `$throughline` starts a new Codex thread through app-server, injects Throughline
45
+ DB handoff memory as a developer item, and opens that thread in the selected
46
+ host; ask explicitly for current-thread rollback diagnostics when you want the
47
+ guarded `trim --execute --host codex` surface.
48
+
49
+ </details>
44
50
 
45
51
  ## How it compares
46
52
 
@@ -154,6 +160,28 @@ primary route**; the source-`clear` auto path is the fallback for cases where
154
160
  the user's `/clear` does not reach the `UserPromptSubmit` hook (for example
155
161
  the VSCode extension's menu-driven `/clear`).
156
162
 
163
+ ```mermaid
164
+ flowchart LR
165
+ U["User types<br/>/clear or /tl"] -->|UserPromptSubmit| W["writeBaton<br/>(session_id + TTL 1h)"]
166
+ W --> B[("handoff_batons<br/>SQLite")]
167
+ M["VSCode menu<br/>clear"] -->|no UserPromptSubmit| X["no baton"]
168
+ NS["Next SessionStart"] --> C{"baton<br/>present?"}
169
+ B -.-> C
170
+ X -.-> C
171
+ C -->|yes| P1["baton path<br/>(primary)<br/>merge that exact predecessor"]
172
+ C -->|no, source='clear'| P2["auto path<br/>(fallback)<br/>findLatestClaudePredecessor"]
173
+ C -->|no, source!='clear'| P3["fresh session<br/>no merge"]
174
+ P1 --> INJ["inject L1 + L2 + L3 refs"]
175
+ P2 --> INJ
176
+
177
+ classDef primary fill:#7c5cff,stroke:#1a1f2e,color:#fff
178
+ classDef fallback fill:#3aa0ff,stroke:#1a1f2e,color:#fff
179
+ classDef neutral fill:#4a5568,stroke:#1a1f2e,color:#fff
180
+ class P1 primary
181
+ class P2 fallback
182
+ class P3,INJ neutral
183
+ ```
184
+
157
185
  ### baton path (primary): typed `/clear` or `/tl` → deterministic inheritance
158
186
 
159
187
  When the user types `/clear` or `/tl` in the prompt, the `UserPromptSubmit`
@@ -223,6 +251,7 @@ throughline codex-summarize --session codex:<thread-id> --json
223
251
  throughline codex-resume --session codex:<thread-id>
224
252
  throughline codex-resume --session codex:<thread-id> --format handoff
225
253
  throughline codex-handoff-start --session codex:<thread-id>
254
+ throughline codex-handoff-start --session codex:<thread-id> --execute --open-host vscode
226
255
  throughline codex-handoff-smoke --session codex:<thread-id>
227
256
  throughline codex-handoff-model-smoke --session codex:<thread-id> --dry-run --json
228
257
  THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1 \
@@ -248,20 +277,14 @@ summarization. When `codex-sidecar` is configured for `summarize-l1`,
248
277
  Throughline can use it for that step; otherwise it keeps the existing Claude
249
278
  Haiku path. This is an explicit compatibility mode, not silent auto-detection.
250
279
 
251
- **Codex rollback / inject is enabled.** The 2026-05-06 incident initially
252
- looked like a rolled-back user prompt could reappear after VS Code restart /
253
- reconnect, but controlled model-visible rollback smokes did not reproduce that
254
- path. `throughline trim --execute --host codex` now sends the guarded
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
260
- token-monitor feature: the Codex `UserPromptSubmit` hook reads the current
261
- rollout `token_count` and, at the verified 75% threshold, injects a same-session
262
- instruction to run the installed `$throughline` workflow before answering. The
263
- Codex Stop hook still attempts the guarded live refresh when it naturally fires,
264
- so non-monitor users get the same threshold behavior.
280
+ **Codex current-thread rollback / inject is explicit-only.** The 2026-05-06
281
+ incident initially looked like a rolled-back user prompt could reappear after
282
+ VS Code restart / reconnect, and later live experiments showed token usage can
283
+ drop briefly and then return in the same thread. For that reason, Codex hooks do
284
+ not perform automatic current-thread refresh. `throughline trim --execute --host
285
+ codex` remains available as an explicit diagnostic current-thread path when
286
+ injectable DB memory is available. Bare `$throughline` instead starts a new
287
+ thread with the handoff prompt, matching the safer Claude-style handoff model.
265
288
 
266
289
  `throughline codex-host-primitive-audit` can inspect the installed Codex
267
290
  app-server schema read-only. On the current tested Codex CLI, it finds
@@ -344,6 +367,7 @@ throughline codex-capture --codex-thread-id <id> --json
344
367
  throughline codex-summarize --session codex:<id> --json
345
368
  throughline codex-resume --session codex:<id> --format handoff
346
369
  throughline codex-handoff-start --session codex:<id>
370
+ throughline codex-handoff-start --session codex:<id> --print-prompt
347
371
  throughline codex-handoff-smoke --session codex:<id> --json
348
372
  throughline codex-handoff-model-smoke --session codex:<id> --dry-run --json
349
373
  # optional model smoke; uses codex exec --ephemeral --sandbox read-only:
@@ -357,7 +381,7 @@ throughline trim --dry-run --host codex --codex-thread-id <id>
357
381
  throughline trim --dry-run --host codex --codex-thread-id <id> --preview-max-chars 4000
358
382
  throughline trim --preflight --host codex --codex-thread-id <id>
359
383
  CODEX_THREAD_ID=<id> throughline trim --preflight --host codex
360
- throughline trim --execute --host codex --all --json
384
+ throughline trim --execute --host codex --all
361
385
  # read-only app-server process restart smoke; not full VS Code restart-safe proof:
362
386
  # THROUGHLINE_EXPERIMENTAL_CODEX_RESTORE_SMOKE=1 throughline codex-restore-smoke --codex-thread-id <id> --json
363
387
  # read-only local restore source inventory; not full VS Code restart-safe proof:
@@ -487,7 +511,9 @@ trim. The guided entrypoint is
487
511
  structural smoke, model-smoke dry-run boundary, handoff render command, optional
488
512
  live model smoke, and can include the prompt with `--print-prompt`. With
489
513
  `--memo-stdin`, it also propagates `--memo-stdin` into the replay commands and
490
- reminds you to pipe the same memo when using them separately. The
514
+ reminds you to pipe the same memo when using them separately. Add `--execute`
515
+ to create a new Codex app-server thread, inject the handoff memory as a
516
+ developer item, and open it with `--open-host auto|vscode|cli|none`. The
491
517
  individual commands remain available: validate the fresh-thread handoff with
492
518
  `throughline codex-handoff-smoke --session codex:<thread-id>`, optionally audit
493
519
  the model-smoke boundary with
@@ -496,7 +522,7 @@ render it with `throughline codex-resume --session codex:<thread-id> --format ha
496
522
  then start a new Codex thread with that context. This does not mutate the current
497
523
  thread. `trim --execute --host codex` is the current-thread mutation path and
498
524
  still requires explicit execution, injectable Throughline DB memory, and
499
- rollout/app-server turn-count agreement.
525
+ explicit Codex thread identity.
500
526
  Human-readable dry-run output truncates the inline memory preview for scanability;
501
527
  the full text remains in `--json` as `memoryPreview.text`, and for Codex the
502
528
  fresh-thread continuation can be guided with `codex-handoff-start` or rendered
@@ -538,13 +564,11 @@ Example output:
538
564
  Codex rollout has no token-count event, Throughline can show an explicit
539
565
  estimate with `estimated: true` and the monitor marks it with `est`; it is not
540
566
  presented as exact usage.
541
- - **Codex auto-refresh is driven by the current Codex session, not the monitor.**
542
- The Codex `UserPromptSubmit` and `PostToolUse` hooks capture rollout memory
543
- and, when verified usage reaches 75%, inject a current-session `$throughline`
544
- instruction before the assistant answers or continues a tool loop. The Codex
545
- Stop hook also captures DB memory, writes monitor state, and attempts guarded
546
- rollback + Throughline DB memory injection when it naturally fires above the
547
- threshold.
567
+ - **Codex auto-refresh is disabled.** The Codex `UserPromptSubmit` and
568
+ `PostToolUse` hooks capture rollout memory and write monitor state, but they
569
+ do not inject `$throughline` instructions. The Codex Stop hook also captures
570
+ DB memory, writes monitor state, and stays quiet instead of sending rollback +
571
+ injection above a threshold.
548
572
  - **1M-context detection** is automatic. It checks the `[1m]` suffix in the
549
573
  transcript, falls back to string matching on `1M context`, and finally
550
574
  promotes to 1M if observed usage exceeds 200k.
@@ -685,7 +709,7 @@ entry to the `tasks` array yourself:
685
709
  | `throughline codex-summarize --session codex:<id>` | Summarize captured Codex L2 into L1 with the Codex CLI backend |
686
710
  | `throughline codex-resume --session codex:<id>` | Render Codex active-work context from a captured Codex session |
687
711
  | `throughline codex-resume --session codex:<id> --format handoff` | Render a concise fresh-thread handoff prompt without mutating the current thread |
688
- | `throughline codex-handoff-start --session codex:<id>` | Guided read-only start plan for moving the handoff prompt into a new Codex thread; use `--print-prompt` to include the prompt and `--memo-stdin` to carry a current-work memo |
712
+ | `throughline codex-handoff-start --session codex:<id>` | Guided start plan for moving handoff memory into a new Codex thread; add `--execute` to create the thread through app-server, inject developer memory, and open it with `--open-host auto\|vscode\|cli\|none`; use `--print-prompt` to include the prompt and `--memo-stdin` to carry a current-work memo |
689
713
  | `throughline codex-handoff-smoke --session codex:<id>` | Read-only validation that the fresh-thread handoff prompt is pasteable before starting a new thread |
690
714
  | `throughline codex-handoff-model-smoke --session codex:<id>` | Experimental marker smoke for the handoff prompt. `--dry-run` checks readiness / command boundary without starting Codex exec; `--memo-stdin` carries a current-work memo; live `codex exec --ephemeral --sandbox read-only` requires explicit env opt-in |
691
715
  | `throughline codex-visibility-smoke --session codex:<id>` | Experimental Codex app-server marker smoke; injects memory and starts a model turn |
@@ -699,7 +723,7 @@ entry to the `tasks` array yourself:
699
723
  | `throughline codex-sidecar-dry-run` | Print a normalized read-only sidecar request without running the app server |
700
724
  | `throughline trim --dry-run --host codex` | Preview Codex same-thread context trim memory and host boundary; does not rollback automatically |
701
725
  | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and preview any app-server-count rollback adjustment without rollback/inject |
702
- | `throughline trim --execute --host codex` | Scripted Codex current-thread rollback + Throughline DB memory inject; this is what bare `$throughline` runs in Codex |
726
+ | `throughline trim --execute --host codex` | Explicit diagnostic Codex current-thread rollback + Throughline DB memory inject; bare `$throughline` does not run this automatically |
703
727
  | `throughline status` | Print DB statistics (sessions, skeletons, bodies, details) |
704
728
  | `throughline --version` | Print the installed version |
705
729
 
@@ -182,10 +182,12 @@ Usage:
182
182
  Use --memo-stdin to prepend current-work memo.
183
183
  Live smoke requires THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1
184
184
  throughline codex-handoff-start
185
- Guided read-only fresh-thread handoff start plan:
185
+ Fresh-thread Codex handoff start plan:
186
186
  structural smoke, model-smoke dry-run boundary,
187
187
  render command, optional --print-prompt, and
188
- --memo-stdin replay guidance
188
+ --memo-stdin replay guidance. Use --execute to
189
+ create a new app-server thread, inject handoff
190
+ memory, and open it with --open-host auto|vscode|cli|none
189
191
  throughline codex-visibility-smoke
190
192
  Experimental: inject Codex active-work memory and
191
193
  start a marker-check model turn. Requires
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: throughline
3
- description: Use when the user asks to use Throughline from Codex, continue or restore Throughline memory, run Codex trim/rewind/rollback, inject remembered context, summarize a captured Codex session, or check whether the Throughline Codex Stop hook captured the current session. Hide long Throughline command details behind this workflow.
3
+ description: Use when the user asks to use Throughline from Codex, continue or restore Throughline memory, prepare a new Codex thread handoff, summarize a captured Codex session, or check whether the Throughline Codex Stop hook captured the current session. Hide long Throughline command details behind this workflow.
4
4
  ---
5
5
 
6
6
  # Throughline
@@ -8,10 +8,11 @@ description: Use when the user asks to use Throughline from Codex, continue or r
8
8
  Use this skill to operate Throughline from Codex without making the user type long
9
9
  commands.
10
10
 
11
- If the user invokes `$throughline` by itself, treat that as a request to run the
12
- scripted current-thread refresh now. The normal path is not an AI planning
13
- exercise: it rolls back the current Codex thread and injects Throughline DB
14
- memory using the original `/tl` contract.
11
+ If the user invokes `$throughline` by itself, treat that as a request to prepare
12
+ a fresh Codex thread handoff from the current Throughline memory. The normal
13
+ path is not a current-thread trim/rollback path: it starts a new Codex thread
14
+ through app-server, injects the handoff memory as a developer item, and opens
15
+ that thread in the selected host.
15
16
 
16
17
  ## Core Rule
17
18
 
@@ -19,10 +20,10 @@ Do not ask the user for a Codex thread id when the current environment can
19
20
  provide it. Prefer the current `CODEX_THREAD_ID` / `THROUGHLINE_CODEX_THREAD_ID`
20
21
  identity.
21
22
 
22
- For bare `$throughline`, do not run doctor / dry-run / handoff / preflight first
23
- and do not ask for confirmation. Execute the script command directly. If it
23
+ For bare `$throughline`, do not run doctor / dry-run / preflight first and do
24
+ not ask for confirmation. Execute the handoff-start command directly. If it
24
25
  fails, report the error plainly instead of silently falling back to another
25
- memory source or a fresh-thread handoff.
26
+ memory source or current-thread rollback.
26
27
 
27
28
  ## Common Requests
28
29
 
@@ -31,13 +32,12 @@ memory source or a fresh-thread handoff.
31
32
  Run:
32
33
 
33
34
  ```bash
34
- throughline trim --execute --host codex --all --json
35
+ throughline codex-handoff-start --execute
35
36
  ```
36
37
 
37
- This is the scripted Codex context-refresh flow. It mutates the current Codex
38
- thread by sending rollback + Throughline DB memory injection. Report only the
39
- execution status, whether rollback / inject were sent, whether durable evidence
40
- was observed, and the selected memory session.
38
+ This is the Codex new-thread continuation flow. It does not mutate the current
39
+ Codex thread. Report the new thread id, open status, and any manual resume
40
+ command if the host could not be opened automatically.
41
41
 
42
42
  The injected memory must preserve the original `/tl` memory contract:
43
43
 
@@ -80,11 +80,11 @@ If the user wants to continue in a fresh Codex thread instead of mutating the
80
80
  current thread, use:
81
81
 
82
82
  ```bash
83
- throughline codex-handoff-start --session codex:<current-thread-id> --print-prompt
83
+ throughline codex-handoff-start --session codex:<current-thread-id> --execute
84
84
  ```
85
85
 
86
- If the user gave a current-work memo, pipe it with `--memo-stdin`. This is
87
- read-only and does not mutate the current thread.
86
+ If the user gave a current-work memo, pipe it with `--memo-stdin`. This starts a
87
+ new thread and does not mutate the current thread.
88
88
 
89
89
  ### "summarize"
90
90
 
@@ -99,18 +99,17 @@ back to Claude Haiku.
99
99
 
100
100
  ### "trim" / "rewind" / "rollback" / "context cleanup"
101
101
 
102
- Default to the same scripted execute flow as bare `$throughline` when the user
103
- asks to trim, rewind, rollback, clean up context, or use Throughline memory.
102
+ Default to the same fresh-thread handoff flow as bare `$throughline` when the
103
+ user asks to trim, rewind, rollback, clean up context, or use Throughline
104
+ memory, unless they explicitly ask to mutate the current Codex thread.
104
105
 
105
106
  Execute:
106
107
 
107
108
  ```bash
108
- throughline trim --execute --host codex --all --json
109
+ throughline codex-handoff-start --execute
109
110
  ```
110
111
 
111
- Report only the essential outcome. Do not introduce fresh-thread handoff,
112
- restore-safety analysis, host primitive audit, or dry-run planning unless the
113
- user explicitly asks for those diagnostics.
112
+ Report only the essential outcome, especially the new thread id and open status.
114
113
 
115
114
  Preview:
116
115
 
@@ -121,7 +120,7 @@ throughline trim --dry-run --host codex
121
120
  Safe new-thread continuation:
122
121
 
123
122
  ```bash
124
- throughline codex-handoff-start --session codex:<current-thread-id> --json
123
+ throughline codex-handoff-start --session codex:<current-thread-id> --execute --json
125
124
  ```
126
125
 
127
126
  Report the context reduction estimate from the dry-run when present:
@@ -146,17 +145,19 @@ Execute path:
146
145
  throughline trim --execute --host codex --all
147
146
  ```
148
147
 
149
- This is the same command used by bare `$throughline`.
148
+ This is an explicit current-thread rollback / inject diagnostic path. Do not use
149
+ it for bare `$throughline`.
150
150
 
151
151
  ## User-Facing Explanation
152
152
 
153
153
  Explain the behavior simply:
154
154
 
155
155
  - normal Codex turn end: Stop hook captures DB memory and writes monitor state
156
- - `$throughline` / context refresh: one script command mutates the current Codex
157
- thread by rollback + memory inject
158
- - injected memory is L2 latest 20 full bodies + older L1 summaries + L3
156
+ - `$throughline` / context handoff: one script command builds new-thread
157
+ handoff memory from Throughline DB, injects it into a new Codex thread as a
158
+ developer item, and opens that thread
159
+ - handoff memory is L2 latest 20 full bodies + older L1 summaries + L3
159
160
  references only
160
- - diagnostics such as doctor, dry-run, preflight, fresh-thread handoff, restore
161
- safety, and host primitive audit are optional tools, not the normal
161
+ - diagnostics such as doctor, dry-run, preflight, current-thread rollback,
162
+ restore safety, and host primitive audit are optional tools, not the normal
162
163
  `$throughline` path
@@ -1,7 +1,7 @@
1
1
  interface:
2
2
  display_name: "Throughline"
3
- short_description: "Operate Throughline memory, Codex capture, resume, and trim"
4
- default_prompt: "Use $throughline to run the scripted current-thread rollback + Throughline memory inject, or explicitly ask for status, resume, summarize, diagnostics, or fresh-thread handoff."
3
+ short_description: "Operate Throughline memory, Codex capture, resume, and handoff"
4
+ default_prompt: "Use $throughline to start a new Codex thread with Throughline handoff memory, or explicitly ask for status, resume, summarize, diagnostics, or current-thread rollback."
5
5
 
6
6
  policy:
7
7
  allow_implicit_invocation: true
@@ -28,11 +28,11 @@
28
28
  - Claude-primary の現行 L2 -> L1 要約は `codex-sidecar` が configured の場合に sidecar を優先し、使えない場合は Claude Haiku 経路に戻る。Codex-primary は Codex CLI backend 失敗を明示 error にし、Claude Haiku / raw L2 へ fallback しない。
29
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 は再有効化済み。`75%` verified usage threshold rollback / Throughline DB memory inject を試行し、estimate usage では実行しない。Codex native auto-compact より先に Throughline refresh を走らせつつ、70% warning よりは mutation を遅らせる。
31
+ - 2026-05-10 update: Codex automatic current-thread refresh mutation は無効化する。live rollback / injecttoken_count が一時的に落ちても同一 thread で戻る実測があるため、`UserPromptSubmit` / `PostToolUse` / `Stop` hooks capture / monitor state write のみ行い、`codex_auto_refresh_disabled` で quiet にする。bare `$throughline` は `codex-handoff-start --execute` による app-server 新スレッド handoff とし、明示 `trim --execute --host codex` だけを診断用 current-thread rollback / inject path として残す。
32
32
 
33
33
  ## 新セッション引き継ぎ
34
34
 
35
- 2026-05-08 時点では、Codex primary の capture / summarize / resume は実装・実測済み。Codex trim execute / auto-refresh は、controlled rollback model-visible smoke の clean result を受けて blocker を解除した。[THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) の Phase 0-3 は実装済み。Phase 4 では Codex app-server の protocol / local store 調査、read-only app-server process restart smoke、local restore source audit、manual VS Code restart smoke protocol、実 VS Code reload / reconnect 後の hidden developer memory marker proof、rollback 非復活 verifier、controlled rollback model-visible smoke surface まで進んだ。incident-shaped live rollback run では `compacted.replacement_history` retention を診断したが、後続の risky restore inspection では app-server response 上の retained text は `aggregatedOutput` など quoted/tool-output field に限定され、direct user message / `replacement_history` の復活とは分離された。`throughline codex-host-primitive-audit` は diagnostic-only として残す。
35
+ 2026-05-08 時点では、Codex primary の capture / summarize / resume は実装・実測済み。Codex trim execute / auto-refresh は、controlled rollback model-visible smoke の clean result を受けて blocker を解除した。[THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md](THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md) の Phase 0-3 は実装済み。Phase 4 では Codex app-server の protocol / local store 調査、read-only app-server process restart smoke、local restore source audit、manual VS Code restart smoke protocol、実 VS Code reload / reconnect 後の hidden developer memory marker proof、rollback 非復活 verifier、controlled rollback model-visible smoke surface まで進んだ。incident-shaped live rollback run では `compacted.replacement_history` retention を診断したが、後続の risky restore inspection では app-server response 上の retained text は `aggregatedOutput` など quoted/tool-output field に限定され、direct user message / `replacement_history` の復活とは分離された。2026-05-10 の live token_count 実験では同一 thread refresh が持続削減にならない可能性が濃くなったため、auto-refresh は disabled、通常 `$throughline` は新スレッド handoff とする。`throughline codex-host-primitive-audit` は diagnostic-only として残す。
36
36
 
37
37
  Codex 側で実装済み / 診断可能なもの:
38
38
 
@@ -41,7 +41,7 @@ Codex 側で実装済み / 診断可能なもの:
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
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` を補正する。
44
+ - `trim --execute --host codex`: explicit diagnostic current-thread path として、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` を補正する。bare `$throughline` と hooks からは呼ばない。
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 証明ではない。
@@ -271,7 +271,7 @@ Phase 3 implementation result (2026-05-06):
271
271
  - [x] `throughline codex-resume --format handoff` は current thread を mutate せず、新規 Codex thread に貼る短い handoff prompt を返す。handoff view は L2 件数 / 本文長 / detail refs を cap し、full active-work context は通常 text renderer に残す。
272
272
  - [x] `throughline codex-handoff-smoke --session codex:<thread_id>` は新規 thread handoff prompt を read-only に検査し、prompt size / required sections / mutation boundary / detail command dedupe を固定する。
273
273
  - [x] `throughline codex-handoff-model-smoke --session codex:<thread_id>` は明示 opt-in 時だけ `codex exec --ephemeral --ignore-user-config --ignore-rules --sandbox read-only` で handoff prompt の marker model smoke を行う。`--dry-run` は env なしで readiness / command boundary を監査し、`--print-prompt` で結合 prompt を出せる。`--memo-stdin` で Codex-primary current-work memo も同じ prompt に含める。structural handoff smoke が ready でなければ拒否し、current thread は mutate しない。
274
- - [x] `throughline codex-handoff-start --session codex:<thread_id>` は safe continuation の guided entrypoint として、structural smoke / model smoke dry-run / handoff render / optional live smoke / `--print-prompt` read-only にまとめて表示する。`--memo-stdin` 時は replay 用コマンドにも `--memo-stdin` を伝播し、same memo を pipe する注意を出す。
274
+ - [x] `throughline codex-handoff-start --session codex:<thread_id>` は safe continuation の guided entrypoint として、structural smoke / model smoke dry-run / handoff render / optional live smoke / `--print-prompt` をまとめて表示する。`--execute` では app-server `thread/start` + `thread/inject_items` で新 thread に developer memory を注入し、`--open-host auto|vscode|cli|none` で表示を開く。`--memo-stdin` 時は replay 用コマンドにも `--memo-stdin` を伝播し、same memo を pipe する注意を出す。
275
275
  - [x] `throughline codex-resume --format item-json` は Codex developer message item JSON を返す。
276
276
  - [x] `codex-resume` は explicit session を受け取れる。省略時は cwd の最新 `codex:%` session だけを対象にし、Claude session を混ぜない。
277
277
  - [x] `src/codex-handoff.test.mjs` / `src/codex-resume.test.mjs` で renderer と CLI shape を固定した。
@@ -440,7 +440,7 @@ Phase 5 implementation status (2026-05-06):
440
440
  - [x] `doctor --codex` は Claude settings を変更しない。Codex primary entrypoint の診断に限定する。
441
441
  - [x] 実セッションで `doctor --codex` -> `codex-capture` -> `codex-resume --format item-json` -> `doctor --codex` の local smoke を実施した。`codex-resume` は developer message item JSON を描画し、再診断で captured DB session が 1 件として表示された。
442
442
  - [x] 実セッションで `codex-visibility-smoke` を実施した。`THROUGHLINE_EXPERIMENTAL_CODEX_MODEL_VISIBLE_SMOKE=1` を必須にし、長い model turn に備えて `--request-timeout-ms 150000` / `--timeout-ms 180000` を使えるようにした。
443
- - [x] Codex primary の setup / install 手順は README に記録した。global install は Codex Stop hook と `$throughline` skill を自動登録する。2026-05-09 以降、bare `$throughline` は AI による診断 flow ではなく `trim --execute --host codex --all --json` を直接走らせる scripted current-thread refresh とする。diagnostics / dry-run / preflight / fresh-thread handoff は明示要求時だけ使う。
443
+ - [x] Codex primary の setup / install 手順は README に記録した。global install は Codex hooks と `$throughline` skill を自動登録する。2026-05-10 以降、bare `$throughline` は `throughline codex-handoff-start --execute` による app-server 新スレッド handoff とする。hooks capture / monitor state write だけを行い、current-thread rollback / inject は明示 `trim --execute --host codex` を要求された時だけ使う。
444
444
  - [x] `codex-summarize` を明示診断・運用 flow に追加した。Codex CLI backend を使い、Claude Haiku へ fallback しない。
445
445
  - [x] Codex primary の summarize / guarded execute まで含む end-to-end smoke を実施した。2026-05-07 correction では guarded execute を live app-server smoke としてのみ扱った。2026-05-08 unblock 後は、controlled rollback model-visible smoke の `not-reproduced` と current-thread live run の `execute-durable-verified` を合わせて、Codex current-thread trim 完了条件に含める。
446
446
  - `codex-capture`: `capturedTurns = 41`, `capturedRows = 75`, `capturedDetails = 2424`
@@ -460,7 +460,7 @@ Phase 5 implementation status (2026-05-06):
460
460
  - 追加確認: current VSCode-origin parent thread `019dfd38-c530-71c3-b7b8-180bdd3054bc` は hook shape 変更前に開始していたため、変更後の自然 Stop smoke としては不適格。assistant final 後に rollout は `task_complete` まで進んだが latest DB session は exec child のままだった。次に VSCode-origin を見る場合は、hook shape 変更後に新しく開始した Codex session で確認する。
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
- - 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 は明示要求時だけ使う。
463
+ - 2026-05-10 UX 修正: bare `$throughline` は `doctor --codex` / `trim --dry-run --all` / `trim --preflight --all` を AI に順番実行させる説明 surface でも、`trim --execute --host codex --all` を直接実行する current-thread refresh でもなく、`throughline codex-handoff-start --execute` による app-server 新スレッド handoff とする。current-thread rollback / inject は明示要求時だけ使う。
464
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 で削減できない」という意味ではない。
@@ -468,8 +468,8 @@ Phase 5 implementation status (2026-05-06):
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 `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 は表示専用で、自動発火の判定元にしない。
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 以降は verified usage `75%` 以上を既定閾値にした。2026-05-10 live token_count 実験後は、automatic refresh mutation を再び無効化する。
472
+ - current-session trigger 修正: Codex `UserPromptSubmit` / `PostToolUse` hooks は当該 session の rollout capture / monitor state write だけを行う。verified 75% 以上でも `$throughline` workflow 実行指示を `additionalContext` として注入しない。monitor は表示専用で、自動発火の判定元にしない。
473
473
 
474
474
  ## Phase 6: Claude Side Finalization
475
475
 
@@ -515,11 +515,11 @@ TODO:
515
515
 
516
516
  ## 次の作業
517
517
 
518
- Codex primary の capture / summarize / resume は完了扱い。Codex trim execute / auto-refresh 2026-05-08controlled 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` 補正に使う。
518
+ Codex primary の capture / summarize / resume は完了扱い。Codex trim execute は明示診断用 current-thread path として残すが、auto-refresh 2026-05-10live token_count 実験後に無効化済み。[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 は見つかっていない。通常 `$throughline` は新スレッド handoff prompt とし、current-thread rollback / inject は自動化しない。
519
519
 
520
520
  再開時は次を実施する:
521
521
 
522
- 1. Codex trim execute / Stop hook auto-refresh の実運用 telemetry を見て、`execute-sent-live-only` / `execute-unverified` / `execute-durable-verified` の分類が期待どおりか確認する。
522
+ 1. Codex 新スレッド handoff UX を通常 `$throughline` surface として磨き、必要な場合だけ明示 `trim --execute --host codex` telemetry を見る。
523
523
  2. VS Code restore path の追加実測を行い、`compacted.replacement_history` が rollback 済み user text の復元元として残る経路をさらに特定する。
524
524
  3. restore-safety / host primitive audit を blocker として再導入する場合は、controlled smoke で再現した具体的 evidence を先に記録する。
525
525
  4. その後に Claude `/rewind conversation only` の手動 UX 確認へ戻る。
@@ -18,10 +18,15 @@ 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 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 では実行しません。
21
+ Codex thread identity を条件にした診断用 path として残します。rollout/app-server
22
+ turn-count mismatch は診断に残し、app-server `thread/read` / `thread/resume` が同じ
23
+ count を返す場合は、その差分で rollback `numTurns` を補正します。
24
+ 2026-05-10 update: live token_count 実験で、rollback / inject 後に token count
25
+ 一時的に下がっても同一 thread で戻る挙動を確認したため、Codex automatic
26
+ current-thread refresh は無効化します。`UserPromptSubmit` / `PostToolUse` / `Stop`
27
+ hooks は capture / monitor state write のみ行い、`codex_auto_refresh_disabled` で
28
+ quiet にします。bare `$throughline` は `codex-handoff-start --execute` による
29
+ app-server 新スレッド handoff とします。
25
30
 
26
31
  最初のインシデント仮説に対する重要な訂正:
27
32
 
@@ -648,13 +653,11 @@ TODO:
648
653
  という記述を訂正する。
649
654
  - [x] hypothesis を compacted replacement-history restore に言及する形へ更新する。
650
655
  - [x] Codex Rewind-equivalent trim が complete だという roadmap claim を格下げする。
651
- - [x] Codex auto-refresh verified usage 75% 以上で guarded rollback / inject を
652
- 実行する。estimate usage では実行しない。
653
- - [x] Codex 75% trigger は token-monitor 依存にしない。Codex `UserPromptSubmit`
654
- / `PostToolUse` hooks が当該 session rollout `token_count` を直接読み、
655
- verified 75% 以上なら current session へ `$throughline` workflow 実行指示を
656
- 注入する。`PostToolUse` により、tool loop 中に閾値を超えた場合も次の継続前に
657
- 同じ判定を走らせる。
656
+ - [x] Codex auto-refresh は無効化する。明示 `trim --execute --host codex`
657
+ diagnostic current-thread rollback / inject として残す。
658
+ - [x] Codex `UserPromptSubmit` / `PostToolUse` hooks は token-monitor 依存にせず
659
+ rollout capture / monitor state write だけを行う。verified 75% 以上でも current
660
+ session へ `$throughline` workflow 実行指示を注入しない。
658
661
  - [x] 新セッションが古い「Codex side complete」claim ではなく、この fix plan から
659
662
  再開できるように `CLAUDE.md` を更新する。
660
663
 
@@ -674,11 +677,11 @@ TODO:
674
677
  5. フェーズ 4: durable host behavior を調査し、製品仕様を決める。
675
678
  6. フェーズ 5: 挙動修正後に広範な docs を更新する。
676
679
 
677
- 作業量や複雑さを理由に目標を下げない。2026-05-08 時点の製品仕様は、
678
- 同一 Codex thread guarded rollback + Throughline DB memory inject を実行し、
679
- rollout 上の新 rollback event injected active-work memory で durable evidence を確認すること。
680
- restore-safety / host primitive audit / rollout-app-server turn-count mismatch は diagnostics として残すが、単独では execute / auto-refresh の blocker にしない。
681
- mutation refusalthread identity と Throughline DB injectable memory に限定する。
680
+ 作業量や複雑さを理由に目標を下げない。2026-05-10 時点の製品仕様は、
681
+ 通常 `$throughline` を新スレッド handoff prompt とし、Codex hooks automatic
682
+ current-thread mutation を行わないこと。明示 `trim --execute --host codex` は診断用
683
+ current-thread rollback / inject として残す。restore-safety / host primitive audit /
684
+ rollout-app-server turn-count mismatchdiagnostics として残す。
682
685
  2026-05-09 update: rollout/app-server turn-count mismatch は mutation 前 refusal から外した。
683
686
  app-server `thread/read` / `thread/resume` が同じ count を返す場合、planned rollback turns に
684
687
  `readTurns - expectedTurns` を足して `thread/rollback.numTurns` を送る。例: