throughline 0.10.3 → 0.10.6
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 +82 -29
- package/README.ja.md +79 -47
- package/README.md +103 -78
- package/bin/throughline.mjs +32 -13
- package/docs/00_overview.md +56 -43
- package/docs/01_l1_l2_l3_redesign.md +1 -1
- package/docs/02_clear_auto_handoff_plan.md +39 -333
- package/docs/04_public_release_plan.md +77 -190
- package/docs/05_codex_first_roadmap.md +4 -4
- package/docs/06_codex_trim_rollback_fix_plan.md +1 -1
- package/docs/08_codex_dual_support.md +1 -1
- package/docs/09_rollback_context_trim_insight.md +1 -1
- package/docs/12_desktop_clear_handoff_plan.md +6 -213
- package/docs/15_windows_ci_release_latency_plan.md +6 -87
- package/docs/16_readonly_handoff_context_plan.md +7 -38
- package/docs/adr/0005-observer-read-pagination.md +1 -1
- package/docs/adr/0014-two-phase-handoff-ghost-baton.md +1 -1
- package/docs/adr/0019-product-owned-database-migration-acceptance.md +1 -1
- package/docs/adr/0021-grok-host-capture.md +1 -1
- package/docs/archive/02_clear_auto_handoff_plan.md +350 -0
- package/docs/{03_inheritance_on_clear_only.md → archive/03_inheritance_on_clear_only.md} +22 -22
- package/docs/{07_codex_trim_implementation_plan.md → archive/07_codex_trim_implementation_plan.md} +8 -8
- package/docs/{10_transcript_injection_plan.md → archive/10_transcript_injection_plan.md} +12 -12
- package/docs/archive/12_desktop_clear_handoff_plan.md +218 -0
- package/docs/{14_observer_completed_turn_feed_plan.md → archive/14_observer_completed_turn_feed_plan.md} +7 -7
- package/docs/archive/15_windows_ci_release_latency_plan.md +89 -0
- package/docs/archive/16_readonly_handoff_context_plan.md +40 -0
- package/docs/archive/README.md +28 -15
- package/docs/archive/plan_grok-successor-launch.md +99 -0
- package/docs/archive/room-log_throughline_20260830-155052.md +285 -0
- package/docs/plan_grok-successor-launch.md +6 -97
- package/package.json +11 -4
- package/rag/INDEX.md +2 -2
- package/src/baton.mjs +11 -9
- package/src/cli/handoff-context.test.mjs +36 -0
- package/src/cli/help.test.mjs +5 -0
- package/src/cli/runtime-errors.mjs +9 -3
- package/src/cli/runtime-errors.test.mjs +13 -13
- package/src/cli/self-update.mjs +402 -0
- package/src/cli/self-update.test.mjs +525 -0
- package/src/db.mjs +1 -1
- package/src/docs-contract.test.mjs +153 -0
- package/src/product-ci-contract.test.mjs +14 -0
- package/src/prompt-submit.mjs +8 -10
- package/src/resume-context.mjs +4 -4
- package/src/runtime-error-hook.test.mjs +4 -6
- package/src/runtime-error-store.mjs +40 -18
- package/src/runtime-error-store.test.mjs +53 -26
- package/src/session-merger.mjs +16 -7
- package/src/session-merger.test.mjs +27 -0
- package/src/spike-transcript-writer.mjs +1 -1
- /package/docs/{11_codex_monitor_implementation_plan.md → archive/11_codex_monitor_implementation_plan.md} +0 -0
- /package/docs/{13_native_factory_diagnostics_plan.md → archive/13_native_factory_diagnostics_plan.md} +0 -0
- /package/docs/{BUGHUB_RUNTIME_ERROR_STORE_PLAN.md → archive/BUGHUB_RUNTIME_ERROR_STORE_PLAN.md} +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src=".github/og.png" alt="Throughline — a whale family carrying direction and memory across changing boundaries" width="100%">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/kitepon/Throughline/main/.github/og.png" alt="Throughline — a whale family carrying direction and memory across changing boundaries" width="100%">
|
|
3
3
|
<br>
|
|
4
4
|
<sub><em>This image represents continuity that preserves relationships, direction, and memory even as environments and boundaries change.</em></sub>
|
|
5
5
|
</p>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/throughline)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
|
-
[](https://github.com/kitepon/Throughline/actions/workflows/test.yml)
|
|
13
13
|
|
|
14
14
|
**English** · [日本語](README.ja.md)
|
|
15
15
|
|
|
@@ -20,10 +20,12 @@ Built and maintained by [Quo](https://x.com/QLyun35332) at [kitepon.dev](https:/
|
|
|
20
20
|
|
|
21
21
|
## Ownership boundary
|
|
22
22
|
|
|
23
|
-
This repository owns
|
|
24
|
-
diagnostics
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
This repository owns installation, configuration, state, schema and migrations,
|
|
24
|
+
diagnostics, recovery, updates, and release decisions. Throughline works on its
|
|
25
|
+
own through the documented CLI and does not require a factory controller.
|
|
26
|
+
[dotagents](https://github.com/kitepon/dotagents) may wire Throughline into the
|
|
27
|
+
kitepon.dev development factory, but it integrates the product rather than
|
|
28
|
+
owning its state or controlling its lifecycle.
|
|
27
29
|
MarkItDown is a separately managed third-party CLI.
|
|
28
30
|
|
|
29
31
|
## In 30 seconds
|
|
@@ -34,10 +36,11 @@ throughline install # registers hooks/skills and provisions the VS Code moni
|
|
|
34
36
|
```
|
|
35
37
|
|
|
36
38
|
That's it. Open any Claude Code session and your turns flow into
|
|
37
|
-
`~/.throughline/throughline.db` automatically.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
`~/.throughline/throughline.db` automatically. In VS Code, `/clear` resumes
|
|
40
|
+
through the `SessionStart source='clear'` auto path. Claude Desktop does not
|
|
41
|
+
emit that source, so type `/tl` before `/clear` there. Use `/tl` before any
|
|
42
|
+
other boundary, such as a brand-new chat or a VS Code restart, when you want
|
|
43
|
+
to name the predecessor exactly.
|
|
41
44
|
|
|
42
45
|
Grok Desktop is also a first-class host. `throughline install` writes
|
|
43
46
|
`~/.grok/hooks/throughline.json`. On Grok, `/tl` does not inject into the
|
|
@@ -114,7 +117,7 @@ one or two turns, then `/tl`.
|
|
|
114
117
|
| **Memory after the boundary** | ✅ recent turns verbatim (whole, budget-packed) + everything older via `recall` pull + L3 on demand | ❌ zero | △ lossy single summary | △ lossy summary |
|
|
115
118
|
| **Tool I/O handling** | retired to L3, retrievable by `/sc-detail HH:MM:SS` | gone | folded into summary, unreadable | folded into summary |
|
|
116
119
|
| **Coding-assistant fit** | high — tool I/O is the heavy 80% | low — you lose the thread | medium — but irreversible | medium |
|
|
117
|
-
| **Auto-inheritance risk** | low (
|
|
120
|
+
| **Auto-inheritance risk** | low (`/tl` names the predecessor; VS Code `/clear` freezes one transcript-backed candidate) | n/a | n/a | high |
|
|
118
121
|
| **Runtime deps** | **zero** (Node 22.13+ built-in `node:sqlite`) | n/a | n/a | many |
|
|
119
122
|
| **Multi-session token monitor** | ✅ real `message.usage` / Codex rollout `token_count` | — | — | — |
|
|
120
123
|
|
|
@@ -231,18 +234,19 @@ of tool inputs, tool outputs, and hook output captured at L3 for that turn.
|
|
|
231
234
|
|
|
232
235
|
---
|
|
233
236
|
|
|
234
|
-
## Inheritance:
|
|
237
|
+
## Inheritance: `/tl` writes a baton; VS Code `/clear` uses `source='clear'`
|
|
235
238
|
|
|
236
|
-
Throughline
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
Throughline supports two inheritance paths. A `/tl` baton names one predecessor
|
|
240
|
+
exactly. If no eligible baton exists, the VS Code `/clear` path can use the
|
|
241
|
+
`SessionStart source='clear'` signal to freeze one transcript-backed predecessor.
|
|
242
|
+
The baton is checked first.
|
|
240
243
|
|
|
241
244
|
```mermaid
|
|
242
245
|
flowchart LR
|
|
243
|
-
U["User types<br/>/
|
|
246
|
+
U["User types<br/>/tl"] -->|UserPromptSubmit| W["writeBaton<br/>(session_id + TTL 1h)"]
|
|
244
247
|
W --> B[("handoff_batons<br/>SQLite")]
|
|
245
|
-
M["
|
|
248
|
+
M["VS Code<br/>/clear"] -->|SessionStart source='clear'| X["freeze predecessor<br/>no baton"]
|
|
249
|
+
D["Claude Desktop<br/>/clear"] -->|source='startup'| N["no automatic handoff<br/>use /tl first"]
|
|
246
250
|
NS["Next SessionStart<br/>(registers intent only)"] --> FP["First user prompt<br/>(proof the session is real)"]
|
|
247
251
|
FP --> C{"baton<br/>present?"}
|
|
248
252
|
B -.-> C
|
|
@@ -261,10 +265,10 @@ flowchart LR
|
|
|
261
265
|
class P3,INJ neutral
|
|
262
266
|
```
|
|
263
267
|
|
|
264
|
-
### baton path
|
|
268
|
+
### baton path: `/tl` → deterministic inheritance
|
|
265
269
|
|
|
266
|
-
When the user types `/
|
|
267
|
-
|
|
270
|
+
When the user types `/tl`, the `UserPromptSubmit` hook writes a handoff baton
|
|
271
|
+
with **that session's `session_id`** into the
|
|
268
272
|
`handoff_batons` table. The next new session consumes the baton **at its
|
|
269
273
|
first user prompt** (eligibility: the session must have been born within the
|
|
270
274
|
1-hour TTL after the baton was written) and merges that exact predecessor's
|
|
@@ -281,28 +285,29 @@ started empty. Deferring consumption to the first user prompt closes this:
|
|
|
281
285
|
a ghost never submits a prompt, so it can never take the baton (ADR 0014).
|
|
282
286
|
|
|
283
287
|
This path is deterministic: it names the predecessor by id rather than
|
|
284
|
-
guessing, so multi-window
|
|
285
|
-
|
|
288
|
+
guessing, so it is the explicit path for multi-window work and for hosts that
|
|
289
|
+
do not emit `source='clear'`.
|
|
286
290
|
|
|
287
291
|
```
|
|
288
|
-
|
|
289
|
-
typed /tl: Session A → /tl → (new chat / restart) → Session B (consumes baton, merges A)
|
|
292
|
+
/tl: Session A → /tl → (/clear, new chat, or restart) → Session B (consumes A's baton)
|
|
290
293
|
```
|
|
291
294
|
|
|
292
|
-
### auto path
|
|
295
|
+
### auto path: VS Code `source='clear'` → frozen predecessor
|
|
293
296
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
`UserPromptSubmit`), Throughline resolves the most recent unmerged session
|
|
297
|
+
The built-in `/clear` command does **not** reach `UserPromptSubmit` on the
|
|
298
|
+
tested Claude Code clients. VS Code instead sends `SessionStart source='clear'`.
|
|
299
|
+
When no baton is present, Throughline resolves the most recent unmerged session
|
|
298
300
|
for the same project **at `SessionStart` time** (freezing that choice, and
|
|
299
301
|
skipping candidates that have no transcript — i.e. ghosts) and performs the
|
|
300
302
|
merge + injection at the session's first user prompt.
|
|
301
303
|
|
|
302
304
|
Set `THROUGHLINE_DISABLE_AUTO_HANDOFF=1` in your environment to opt out of
|
|
303
|
-
this
|
|
304
|
-
|
|
305
|
-
|
|
305
|
+
this path. The env var does not disable explicit `/tl` batons.
|
|
306
|
+
|
|
307
|
+
Claude Desktop neither forwards built-in `/clear` to `UserPromptSubmit` nor
|
|
308
|
+
emits `SessionStart source='clear'`; use `/tl` before `/clear` there. The
|
|
309
|
+
cross-client measurements and upstream report are recorded in the archived
|
|
310
|
+
[`docs/12_desktop_clear_handoff_plan.md`](docs/archive/12_desktop_clear_handoff_plan.md).
|
|
306
311
|
|
|
307
312
|
### What gets injected
|
|
308
313
|
|
|
@@ -335,7 +340,8 @@ pinning the latest exchange at the top of the injection prevents that drift.
|
|
|
335
340
|
Each merged row keeps its `origin_session_id`, so repeated handoffs
|
|
336
341
|
accumulate memory through chains:
|
|
337
342
|
|
|
338
|
-
```
|
|
343
|
+
```text
|
|
344
|
+
VS Code:
|
|
339
345
|
S1 (4 turns) --/clear--> S2 (auto-merges S1, adds 3 turns) --/clear--> S3 (auto-merges S2, adds 5 turns)
|
|
340
346
|
origin=S1×4 origin=S1×4, S2×3, S3×5
|
|
341
347
|
```
|
|
@@ -454,9 +460,10 @@ rollout text, not an exact host tokenizer measurement. If rollback candidate
|
|
|
454
460
|
turns are `0`, there is no current trim saving under the active keep-recent
|
|
455
461
|
setting.
|
|
456
462
|
|
|
457
|
-
Claude-side rewind UI itself is not driven by Throughline.
|
|
458
|
-
flow is `/clear` → new session → automatic injection of curated
|
|
459
|
-
session's first user prompt.
|
|
463
|
+
Claude-side rewind UI itself is not driven by Throughline. In VS Code, the
|
|
464
|
+
auto-handoff flow is `/clear` → new session → automatic injection of curated
|
|
465
|
+
memory at the session's first user prompt. Claude Desktop requires `/tl`
|
|
466
|
+
before `/clear`.
|
|
460
467
|
Throughline does not invoke `/rewind` or any Claude Code internal command.
|
|
461
468
|
|
|
462
469
|
Codex-primary setup has an installed Stop hook after global
|
|
@@ -810,18 +817,23 @@ entry to the `tasks` array yourself:
|
|
|
810
817
|
|
|
811
818
|
## Commands
|
|
812
819
|
|
|
813
|
-
**
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
normal handoff behavior remain available
|
|
818
|
-
local-only contracts.
|
|
820
|
+
**The current release is v0.10.6.** Throughline supports Claude Code, Codex,
|
|
821
|
+
Grok, and Cursor as documented host adapters. The versioned, read-only
|
|
822
|
+
`handoff-context` boundary opens only an existing database and leaves baton
|
|
823
|
+
state, session ownership, and memory rows unchanged. Factory diagnostics,
|
|
824
|
+
Observer, runtime-error, capture, and normal handoff behavior remain available
|
|
825
|
+
under the same explicit-failure and local-only contracts.
|
|
819
826
|
|
|
820
827
|
| Command | What it does |
|
|
821
828
|
| ---------------------------------------------- | ------------------------------------------------------------ |
|
|
822
829
|
| `throughline install` | Register Claude user hooks/slash commands, the global Codex UserPromptSubmit/PostToolUse/Stop hooks, the global `$throughline` Codex skill, `~/.grok/hooks/throughline.json`, and the current VS Code monitor task when applicable |
|
|
823
830
|
| `throughline install --project` | Register Claude hooks/slash commands in this repo only |
|
|
831
|
+
| `throughline self-update [--json]` | Update the official npm package, verify that public PATH resolves to that new CLI/version, reapply product-owned integrations, migrate an existing database, and verify public diagnostics in one call |
|
|
824
832
|
| `throughline uninstall` | Remove Throughline-managed Claude hooks/slash commands, only the Throughline-managed Codex hook, and the `$throughline` Codex skill |
|
|
833
|
+
|
|
834
|
+
Versions before v0.10.5 do not contain `self-update`. Upgrade those versions
|
|
835
|
+
once with `npm install --global throughline@latest`, then run
|
|
836
|
+
`throughline self-update`. Later updates use `throughline self-update` alone.
|
|
825
837
|
| `throughline monitor [--all] [--session <id>]` | Run the multi-session token monitor |
|
|
826
838
|
| `throughline monitor --diag` | Dump TTY/columns/env diagnostics (for debugging monitor render bugs) |
|
|
827
839
|
| `throughline detail <time>` | Retrieve L2 body text and L3 tool I/O for a turn (see below) |
|
|
@@ -834,7 +846,9 @@ local-only contracts.
|
|
|
834
846
|
| `throughline doctor --codex` | Diagnose Codex primary entry state, captured DB sessions, context-refresh memory contract, new-thread handoff readiness, safe continuation status, and host primitive audit |
|
|
835
847
|
| `throughline factory-diagnostics --json` | Versioned read-only native factory readiness JSON for database schema/migration, connector hooks, and representative capture/restore/handoff; does not emit bodies, secrets, absolute paths, or raw state |
|
|
836
848
|
| `throughline migrate --json` | Migrate only an existing Throughline database to the current schema and emit a versioned bounded result; a missing database is not created, while future schemas and migration failures exit non-zero |
|
|
837
|
-
| `throughline runtime-errors
|
|
849
|
+
| `throughline runtime-errors enable --json` | Enable product-owned local runtime error collection in Throughline's own config; default is disabled |
|
|
850
|
+
| `throughline runtime-errors disable --json` | Disable product-owned local runtime error collection |
|
|
851
|
+
| `throughline runtime-errors snapshot --json` | Read the bounded product-owned runtime error aggregate; this command performs no network I/O |
|
|
838
852
|
| `throughline runtime-errors diagnostics --json` | Read bounded collection/store status without exposing the state path or raw errors |
|
|
839
853
|
| `throughline runtime-errors ack <cursor> --json` | Explicitly acknowledge records through a monotonic cursor; unacknowledged records are never compacted |
|
|
840
854
|
| `throughline runtime-errors resolve <fingerprint> --json` | Explicitly resolve an aggregate; observing the same fingerprint again reopens it |
|
|
@@ -865,6 +879,24 @@ local-only contracts.
|
|
|
865
879
|
| `throughline status` | Print DB statistics (sessions, skeletons, bodies, details) |
|
|
866
880
|
| `throughline --version` | Print the installed version |
|
|
867
881
|
|
|
882
|
+
### Product-owned runtime error collection
|
|
883
|
+
|
|
884
|
+
Collection is off by default. Enable it through Throughline's own CLI:
|
|
885
|
+
|
|
886
|
+
```bash
|
|
887
|
+
throughline runtime-errors enable --json
|
|
888
|
+
throughline runtime-errors diagnostics --json
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
The product-owned config is
|
|
892
|
+
`$XDG_CONFIG_HOME/throughline/runtime-errors.config.json` on macOS/Linux
|
|
893
|
+
(`~/.config/throughline/...` when `XDG_CONFIG_HOME` is unset) and
|
|
894
|
+
`%LOCALAPPDATA%\throughline\runtime-errors.config.json` on Windows. The CLI
|
|
895
|
+
writes the versioned `throughline.runtime_error_config.v1` shape with private
|
|
896
|
+
permissions. `disable --json` changes only this product config. Throughline
|
|
897
|
+
does not read dotagents configuration; factory integration consumes the public
|
|
898
|
+
`runtime-errors ... --json` contract.
|
|
899
|
+
|
|
868
900
|
### Read-only handoff context for local launchers
|
|
869
901
|
|
|
870
902
|
Use this boundary when a local launcher needs Throughline memory without
|
|
@@ -886,21 +918,19 @@ Slash commands (invoked by the user in Claude Code):
|
|
|
886
918
|
|
|
887
919
|
| Command | What it does |
|
|
888
920
|
| ------------- | ----------------------------------------------------------------- |
|
|
889
|
-
| `/tl` | Write a handoff baton
|
|
890
|
-
| `/clear` | Built-in Claude Code reset.
|
|
921
|
+
| `/tl` | Write a handoff baton that names the predecessor exactly (use before a new chat, restart, or Claude Desktop `/clear`). On Grok, also launches `grok-continue` after a successful baton write |
|
|
922
|
+
| `/clear` | Built-in Claude Code reset. VS Code can auto-inherit through `SessionStart source='clear'`; Claude Desktop requires `/tl` first |
|
|
891
923
|
| `/sc-detail <time>` | Retrieve L2 body text and L3 tool I/O for a past turn |
|
|
892
924
|
|
|
893
|
-
>
|
|
894
|
-
>
|
|
895
|
-
>
|
|
896
|
-
>
|
|
897
|
-
> fallback for `/clear` triggered outside `UserPromptSubmit` (for example via
|
|
898
|
-
> the VSCode extension menu); `THROUGHLINE_DISABLE_AUTO_HANDOFF=1` only opts
|
|
899
|
-
> out of that fallback.
|
|
925
|
+
> Built-in `/clear` does not reach the tested clients' `UserPromptSubmit` hook.
|
|
926
|
+
> `/tl` is the deterministic baton path. VS Code `/clear` uses the separate
|
|
927
|
+
> `source='clear'` auto path; `THROUGHLINE_DISABLE_AUTO_HANDOFF=1` disables only
|
|
928
|
+
> that auto path.
|
|
900
929
|
|
|
901
930
|
Hook subcommands (invoked by Claude Code, not by humans):
|
|
902
931
|
`session-start` (SessionStart), `process-turn` (Stop),
|
|
903
|
-
`prompt-submit` (UserPromptSubmit —
|
|
932
|
+
`prompt-submit` (UserPromptSubmit — executes pending handoff and writes `/tl`
|
|
933
|
+
batons; Grok `/tl` also launches `grok-continue`).
|
|
904
934
|
|
|
905
935
|
### Observer completed-turn feed (development)
|
|
906
936
|
|
|
@@ -998,13 +1028,13 @@ plain `.mjs` files.
|
|
|
998
1028
|
└── <session_id>.json Per-session activity state for the monitor
|
|
999
1029
|
```
|
|
1000
1030
|
|
|
1001
|
-
Schema
|
|
1031
|
+
Schema v9:
|
|
1002
1032
|
|
|
1003
1033
|
- `sessions` — one row per `session_id`, with `project_path` and `merged_into`
|
|
1004
1034
|
- `skeletons` — L1 one-liners, keyed by `(session_id, origin_session_id, turn, role)`
|
|
1005
1035
|
- `bodies` — L2 verbatim text (user + assistant), same key shape
|
|
1006
1036
|
- `details` — L3 records with `kind` column (`tool_input` / `tool_output` / `system` / `image` / `thinking`) and `source_id` for idempotent re-processing
|
|
1007
|
-
- `handoff_batons` — one row per `project_path`, with `session_id` and `created_at`. Written by the `UserPromptSubmit` hook
|
|
1037
|
+
- `handoff_batons` — one row per `project_path`, with `session_id` and `created_at`. Written by the `UserPromptSubmit` hook for `/tl`. A compatibility `/clear` branch remains in the hook, but tested built-in `/clear` commands are not forwarded to it. The next new session consumes and deletes an eligible baton at its **first user prompt**, if it was born within the 1-hour TTL. (v8 dropped the `memo_text` column when memo was retired in v0.4.0.)
|
|
1008
1038
|
- `pending_handoffs` — one row per newborn session (`session_id` PK, `project_path`, `source`, `auto_predecessor_id`, `created_at`). Registered by `SessionStart`, consumed exactly once by the session's first `UserPromptSubmit`. Rows belonging to ghost sessions are never consumed and stay behind harmlessly (a few hundred bytes each). Added in v9 (ADR 0014).
|
|
1009
1039
|
- `injection_log` — audit trail of injection events
|
|
1010
1040
|
|
|
@@ -1161,23 +1191,21 @@ and `~/.throughline/state/*.json`. A fresh database with schema v9 is created on
|
|
|
1161
1191
|
the next hook fire.
|
|
1162
1192
|
|
|
1163
1193
|
**New session didn't inherit memory from the previous one**
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
never recorded (no Stop hook fired — check `throughline status`),
|
|
1168
|
-
1-hour baton TTL expired before the new session opened, (c) the new
|
|
1169
|
-
`project_path` (cwd) differs from the previous one,
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
Memory is still in SQLite — you can retrieve specific turns with
|
|
1173
|
-
`/sc-detail <time>`.
|
|
1194
|
+
Use `/tl` before the boundary when you need deterministic inheritance. VS Code
|
|
1195
|
+
`/clear` can also use the `source='clear'` auto path; Claude Desktop cannot, so
|
|
1196
|
+
it requires `/tl` before `/clear`. Other likely causes are: (a) the previous
|
|
1197
|
+
session was never recorded (no Stop hook fired — check `throughline status`),
|
|
1198
|
+
(b) the 1-hour baton TTL expired before the new session opened, (c) the new
|
|
1199
|
+
session's `project_path` (cwd) differs from the previous one, or (d)
|
|
1200
|
+
`THROUGHLINE_DISABLE_AUTO_HANDOFF=1` disabled the VS Code auto path. Memory is
|
|
1201
|
+
still in SQLite — retrieve specific turns with `/sc-detail <time>`.
|
|
1174
1202
|
|
|
1175
1203
|
---
|
|
1176
1204
|
|
|
1177
1205
|
## Development
|
|
1178
1206
|
|
|
1179
1207
|
```bash
|
|
1180
|
-
git clone https://github.com/kitepon
|
|
1208
|
+
git clone https://github.com/kitepon/Throughline.git
|
|
1181
1209
|
cd Throughline
|
|
1182
1210
|
npm link # Put `throughline` on PATH (dev only)
|
|
1183
1211
|
throughline install --project # Register hooks for this repo only
|
|
@@ -1203,9 +1231,8 @@ the first generation to pick up the auto-start task.
|
|
|
1203
1231
|
- [`docs/01_l1_l2_l3_redesign.md`](docs/01_l1_l2_l3_redesign.md) — **core design
|
|
1204
1232
|
spec** for the L1/L2/L3 differential layer model (schema v4 base + v5 L3
|
|
1205
1233
|
classification extension). Authoritative for the memory layering rules.
|
|
1206
|
-
- [`docs/
|
|
1207
|
-
|
|
1208
|
-
why the current inheritance is opt-in rather than heuristic.
|
|
1234
|
+
- [`docs/02_clear_auto_handoff_plan.md`](docs/02_clear_auto_handoff_plan.md) —
|
|
1235
|
+
current `/clear` and `/tl` handoff contract.
|
|
1209
1236
|
- [`docs/08_codex_dual_support.md`](docs/08_codex_dual_support.md) —
|
|
1210
1237
|
architecture brief for adding Codex support without replacing the Claude
|
|
1211
1238
|
Code hook/slash-command path.
|
|
@@ -1215,17 +1242,15 @@ the first generation to pick up the auto-start task.
|
|
|
1215
1242
|
- [`docs/05_codex_first_roadmap.md`](docs/05_codex_first_roadmap.md) —
|
|
1216
1243
|
current next-phase TODO plan: Codex primary first, Codex rewind-compatible
|
|
1217
1244
|
trim next, Claude rewind finalization after that.
|
|
1218
|
-
- [`docs/07_codex_trim_implementation_plan.md`](docs/07_codex_trim_implementation_plan.md) —
|
|
1219
|
-
historical integrated TODO plan and implementation record for Claude/Codex
|
|
1220
|
-
dual support and rollback trim.
|
|
1221
1245
|
- [`docs/04_public_release_plan.md`](docs/04_public_release_plan.md) — public
|
|
1222
1246
|
release plan, implementation status by version, § 0 fallback rule, and
|
|
1223
1247
|
remaining tasks.
|
|
1224
|
-
- [`docs/
|
|
1225
|
-
|
|
1226
|
-
- [`docs/
|
|
1227
|
-
|
|
1228
|
-
|
|
1248
|
+
- [`docs/archive/12_desktop_clear_handoff_plan.md`](docs/archive/12_desktop_clear_handoff_plan.md) —
|
|
1249
|
+
historical Claude Desktop measurements, NO-GO decision, and backfill acceptance.
|
|
1250
|
+
- [`docs/00_overview.md`](docs/00_overview.md) — current/history/evidence map and
|
|
1251
|
+
document lifecycle rules.
|
|
1252
|
+
- [`docs/archive/`](docs/archive/) — completed plans and superseded designs,
|
|
1253
|
+
kept only for historical reference.
|
|
1229
1254
|
|
|
1230
1255
|
---
|
|
1231
1256
|
|
package/bin/throughline.mjs
CHANGED
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
* throughline auditor-context --json # Read-only bounded auditor context JSON
|
|
17
17
|
* throughline factory-diagnostics --json # Native factory read-only readiness JSON
|
|
18
18
|
* throughline migrate --json # Migrate the existing Throughline database only
|
|
19
|
-
* throughline
|
|
19
|
+
* throughline self-update # Update package, integrations, database, and verify the result
|
|
20
|
+
* throughline runtime-errors enable --json # Enable product-owned runtime error collection
|
|
21
|
+
* throughline runtime-errors snapshot --json # Read product-owned runtime error aggregates
|
|
20
22
|
* throughline codex-capture # Capture active Codex rollout turns into Throughline DB
|
|
21
|
-
* throughline codex-hook user-prompt-submit # Codex
|
|
22
|
-
* throughline codex-hook post-tool-use # Codex
|
|
23
|
+
* throughline codex-hook user-prompt-submit # Codex rollout capture + monitor state hook
|
|
24
|
+
* throughline codex-hook post-tool-use # Codex tool-loop capture + monitor state hook
|
|
23
25
|
* throughline codex-hook stop # Codex native Stop hook (capture + L1 summarize)
|
|
24
26
|
* throughline codex-summarize # Summarize captured Codex L2 turns into L1 via Codex CLI
|
|
25
27
|
* throughline codex-resume # Render Codex active-work context from DB
|
|
@@ -113,6 +115,11 @@ switch (cmd) {
|
|
|
113
115
|
if (exitCode !== 0) process.exitCode = exitCode;
|
|
114
116
|
break;
|
|
115
117
|
}
|
|
118
|
+
case 'self-update': {
|
|
119
|
+
const exitCode = (await import('../src/cli/self-update.mjs')).run(rest);
|
|
120
|
+
if (exitCode !== 0) process.exitCode = exitCode;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
116
123
|
case 'runtime-errors': {
|
|
117
124
|
const exitCode = (await import('../src/cli/runtime-errors.mjs')).run(rest);
|
|
118
125
|
if (exitCode !== 0) process.exitCode = exitCode;
|
|
@@ -186,6 +193,15 @@ switch (cmd) {
|
|
|
186
193
|
console.log(pkg.version);
|
|
187
194
|
break;
|
|
188
195
|
}
|
|
196
|
+
case '--self-update-identity': {
|
|
197
|
+
if (rest.length > 0) {
|
|
198
|
+
process.exitCode = 2;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
const { buildSelfUpdateIdentity } = await import('../src/cli/self-update.mjs');
|
|
202
|
+
console.log(JSON.stringify(buildSelfUpdateIdentity()));
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
189
205
|
default:
|
|
190
206
|
await showHelp();
|
|
191
207
|
}
|
|
@@ -235,22 +251,25 @@ Usage:
|
|
|
235
251
|
session/prompt bodies, secrets, absolute paths, or raw state
|
|
236
252
|
throughline migrate --json Migrate the existing Throughline database only.
|
|
237
253
|
Does not create a missing database and emits a versioned JSON result
|
|
238
|
-
throughline
|
|
239
|
-
|
|
240
|
-
|
|
254
|
+
throughline self-update [--json]
|
|
255
|
+
Update the official npm package, reapply product-owned
|
|
256
|
+
integrations, migrate an existing database, and verify
|
|
257
|
+
the installed version and public diagnostics in one call
|
|
258
|
+
throughline runtime-errors enable --json
|
|
259
|
+
Enable product-owned local runtime error collection.
|
|
260
|
+
Also supports disable, snapshot, diagnostics, ack <cursor>,
|
|
261
|
+
resolve <fingerprint>, reopen <fingerprint>, and compact
|
|
241
262
|
throughline codex-capture Capture active Codex rollout turns into DB
|
|
242
263
|
(requires --codex-thread-id or env thread id)
|
|
243
264
|
throughline codex-hook user-prompt-submit
|
|
244
|
-
Codex UserPromptSubmit hook: capture rollout and
|
|
245
|
-
|
|
246
|
-
instruction from verified rollout token_count
|
|
265
|
+
Codex UserPromptSubmit hook: capture rollout and
|
|
266
|
+
write monitor state; automatic refresh is disabled
|
|
247
267
|
throughline codex-hook post-tool-use
|
|
248
268
|
Codex PostToolUse hook: during tool loops, capture
|
|
249
|
-
rollout and
|
|
250
|
-
instruction from verified rollout token_count
|
|
269
|
+
rollout and write monitor state; no instruction injection
|
|
251
270
|
throughline codex-hook stop Codex native Stop hook: capture rollout,
|
|
252
|
-
summarize old L2 turns into L1, and
|
|
253
|
-
|
|
271
|
+
summarize old L2 turns into L1, and write monitor state;
|
|
272
|
+
automatic current-thread refresh is disabled
|
|
254
273
|
throughline codex-summarize Summarize captured Codex L2 into L1 via Codex CLI
|
|
255
274
|
(requires a codex:<thread-id> session)
|
|
256
275
|
throughline codex-resume Render Codex active-work context from DB
|
package/docs/00_overview.md
CHANGED
|
@@ -1,59 +1,72 @@
|
|
|
1
1
|
# Throughline Documentation Overview
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Throughline の文書は、現行契約・履歴・証拠を分ける。通常作業で読むのはこのページの
|
|
4
|
+
「現行契約」だけであり、完了済み計画を無意識に読み込ませない。
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## 現行契約
|
|
6
7
|
|
|
7
8
|
| 文書 | 役割 |
|
|
8
9
|
|---|---|
|
|
9
|
-
| [
|
|
10
|
-
| [
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
| [../README.md](../README.md) / [../README.ja.md](../README.ja.md) | 利用者向けの導入、設定、コマンド、状態、診断、復旧、更新 |
|
|
11
|
+
| [CLAUDE.md](https://github.com/kitepon/Throughline/blob/main/CLAUDE.md) | Claude Code 作業者向けの製品正本 |
|
|
12
|
+
| [AGENTS.md](https://github.com/kitepon/Throughline/blob/main/AGENTS.md) | Codex など Claude Code 以外の作業者向け入口 |
|
|
13
|
+
| [01_l1_l2_l3_redesign.md](01_l1_l2_l3_redesign.md) | L1/L2/L3 記憶レイヤーの設計 |
|
|
14
|
+
| [02_clear_auto_handoff_plan.md](02_clear_auto_handoff_plan.md) | `/clear` / `/tl` handoff の現行仕様 |
|
|
15
|
+
| [04_public_release_plan.md](04_public_release_plan.md) | 公開配布、明示的失敗、release gate |
|
|
16
|
+
| [05_codex_first_roadmap.md](05_codex_first_roadmap.md) | Codex primary / trim / Claude finalization の現行順序 |
|
|
17
|
+
| [06_codex_trim_rollback_fix_plan.md](06_codex_trim_rollback_fix_plan.md) | Codex rollback / inject incident 後の現行判断 |
|
|
18
|
+
| [08_codex_dual_support.md](08_codex_dual_support.md) | Claude primary を維持する Codex adapter 方針 |
|
|
19
|
+
| [09_rollback_context_trim_insight.md](09_rollback_context_trim_insight.md) | rollback を context delete primitive と見る設計 |
|
|
20
|
+
| [adr/](adr/) | 現行実装が依拠する不変の設計判断 |
|
|
21
|
+
|
|
22
|
+
特に現行 host 契約は [ADR 0021](adr/0021-grok-host-capture.md) と
|
|
23
|
+
[ADR 0022](adr/0022-cursor-host-capture.md)、二相 handoff と schema v9 は
|
|
24
|
+
[ADR 0014](adr/0014-two-phase-handoff-ghost-baton.md)、製品所有 migration は
|
|
25
|
+
[ADR 0018](adr/0018-product-owned-database-migration.md) を正とする。
|
|
26
|
+
|
|
27
|
+
## 固定参照の互換入口
|
|
28
|
+
|
|
29
|
+
次の短い文書は現行契約の正本ではない。旧pathを固定した計画・証拠・公開URLから、
|
|
30
|
+
archiveと現行正本へ案内するためだけに残す。
|
|
31
|
+
|
|
32
|
+
| 互換入口 | 現行正本 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| [12_desktop_clear_handoff_plan.md](12_desktop_clear_handoff_plan.md) | [02_clear_auto_handoff_plan.md](02_clear_auto_handoff_plan.md) |
|
|
35
|
+
| [15_windows_ci_release_latency_plan.md](15_windows_ci_release_latency_plan.md) | [04_public_release_plan.md](04_public_release_plan.md) / [ADR 0020](adr/0020-windows-ci-release-latency.md) |
|
|
36
|
+
| [16_readonly_handoff_context_plan.md](16_readonly_handoff_context_plan.md) | [README.md](../README.md) / [公開JSON例](throughline-handoff-context.example.json) |
|
|
37
|
+
| [plan_grok-successor-launch.md](plan_grok-successor-launch.md) | [ADR 0021](adr/0021-grok-host-capture.md) / [README.md](../README.md) |
|
|
38
|
+
|
|
39
|
+
## 履歴
|
|
28
40
|
|
|
29
41
|
| 場所 | 役割 |
|
|
30
42
|
|---|---|
|
|
31
|
-
| [
|
|
43
|
+
| [archive/](archive/) | 完了済み計画、置換済み設計、過去の実装・受入記録。通常は読まない |
|
|
32
44
|
| [audit-2026-05/](audit-2026-05/) | 2026-05 の監査・インシデント記録 |
|
|
33
|
-
| [
|
|
34
|
-
| [../
|
|
45
|
+
| [adr/](adr/) | 判断時点の背景も保持する設計判断記録 |
|
|
46
|
+
| [../CHANGELOG.md](../CHANGELOG.md) | 公開版ごとの変更履歴 |
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
## 証拠
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- [ADR 0022](adr/0022-cursor-host-capture.md): Cursor を first-class hook host にし、注入は sessionStart の `additional_context`、hook は `~/.cursor/hooks.json` への upsert。
|
|
50
|
+
| 場所 | 役割 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| [../rag/INDEX.md](../rag/INDEX.md) | 外部仕様・実機調査の索引 |
|
|
53
|
+
| [evidence/](https://github.com/kitepon/Throughline/tree/main/evidence) | host受入などの固定証拠 |
|
|
54
|
+
| [throughline-handoff-context.example.json](throughline-handoff-context.example.json) | 公開JSON契約の例 |
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
ThroughlineはClaude Stop receiptとCodex rolloutの`task_complete`だけからcompleted cursorを構築し、
|
|
47
|
-
ObserverがDB、WAL、rolloutを直接監視するfallbackは持たない。waitは最大3600秒で、`changed`、`timeout`、
|
|
48
|
-
`resync_required`、`ambiguous_parent`を返す。
|
|
56
|
+
## 製品の所有境界
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
Throughline は単独で install、設定、状態保存、schema と migration、診断、復旧、更新、
|
|
59
|
+
release 判定まで完結する。状態の正本は `~/.throughline/` と製品コードであり、他製品は
|
|
60
|
+
公開CLI・JSON契約を介して連携する。dotagents は工場全体の配線と統合契約を管理するが、
|
|
61
|
+
Throughline の状態を直接書き換えず、製品の単独運用やrelease判断を制御しない。
|
|
54
62
|
|
|
55
|
-
##
|
|
63
|
+
## 文書の寿命
|
|
56
64
|
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
65
|
+
- 現行値・操作・判断は既存の現行文書へ統合し、同じ意味の現行文書を増やさない。
|
|
66
|
+
- 完了した計画、置換済み設計、当時の受入記録は `archive/` へ物理移動する。
|
|
67
|
+
- 履歴・証拠は削除せず、通常の必読経路から外す。
|
|
68
|
+
- source と文書が食い違う場合は source とfocused testで確認し、現行文書を同じ変更で直す。
|
|
69
|
+
- 新しい文書は、現行契約・履歴・証拠のどれかを決めてから置く。
|
|
70
|
+
- `npm run verify:docs` は全local link、top-level分類、archive索引、固定参照の互換stub、
|
|
71
|
+
公開npm tarball内Markdownの相対link/image閉包を検査する。Markdown-only変更でも
|
|
72
|
+
製品所有CIがこの入口を実行する。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 新 L1/L2/L3 設計(再定義)
|
|
2
2
|
|
|
3
|
-
> **Status**: 実装完了(2026-04-16 時点)。この文書は **L1/L2/L3 再定義の設計記録**であり、schema v4-v5 相当の変更までを扱う。以後の `handoff_batons` (v6)・`memo_text` (v7)・state.usage スナップショット・VSCode 自動起動・monitor 診断機能は本仕様と独立で、[CLAUDE.md](
|
|
3
|
+
> **Status**: 実装完了(2026-04-16 時点)。この文書は **L1/L2/L3 再定義の設計記録**であり、schema v4-v5 相当の変更までを扱う。以後の `handoff_batons` (v6)・`memo_text` (v7)・state.usage スナップショット・VSCode 自動起動・monitor 診断機能は本仕様と独立で、[CLAUDE.md](https://github.com/kitepon/Throughline/blob/main/CLAUDE.md) と [04_public_release_plan.md](04_public_release_plan.md) に索引あり。
|
|
4
4
|
> 全ステップ (1〜8) 実装済み。L1/L2/L3 すべて書き込みパスが稼働。schema v5 で details に `kind` / `source_id` 列追加済み。
|
|
5
5
|
> 進捗の詳細は「実装順序」セクション末尾の進捗表を参照。
|
|
6
6
|
|