trajectories 0.0.0 → 0.1.2
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 +36 -0
- package/LICENSE +201 -0
- package/README.md +288 -2
- package/dist/cli.js +30210 -0
- package/dist/convert.d.ts +31 -0
- package/dist/convert.js +431 -0
- package/dist/deepagents_checkpoint.py +362 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8402 -0
- package/dist/log-baseline.d.ts +26 -0
- package/dist/log-baseline.js +104 -0
- package/dist/log-content.d.ts +16 -0
- package/dist/log-content.js +80 -0
- package/dist/log-io.d.ts +10 -0
- package/dist/log-io.js +121 -0
- package/dist/log-read.d.ts +24 -0
- package/dist/log-read.js +117 -0
- package/dist/log-reconcile.d.ts +5 -0
- package/dist/log-reconcile.js +38 -0
- package/dist/log-records.d.ts +35 -0
- package/dist/log-records.js +85 -0
- package/dist/log-recovery.d.ts +18 -0
- package/dist/log-recovery.js +123 -0
- package/dist/log-stage.d.ts +14 -0
- package/dist/log-stage.js +138 -0
- package/dist/log-state.d.ts +89 -0
- package/dist/log-state.js +92 -0
- package/dist/log-switch.d.ts +3 -0
- package/dist/log-switch.js +98 -0
- package/dist/log-types.d.ts +129 -0
- package/dist/log-types.js +8 -0
- package/dist/log.d.ts +8 -0
- package/dist/log.js +62 -0
- package/dist/migrate.d.ts +29 -0
- package/dist/migrate.js +173 -0
- package/dist/normalization-runtime.d.ts +1 -0
- package/dist/normalization-runtime.js +3150 -0
- package/dist/portable.d.ts +9 -0
- package/dist/portable.js +26 -0
- package/dist/readers/canonical.d.ts +13 -0
- package/dist/readers/canonical.js +54 -0
- package/dist/readers/cline.d.ts +10 -0
- package/dist/readers/cline.js +107 -0
- package/dist/readers/cursor.d.ts +20 -0
- package/dist/readers/cursor.js +374 -0
- package/dist/readers/deepagents.d.ts +41 -0
- package/dist/readers/deepagents.js +163 -0
- package/dist/readers/fx.d.ts +11 -0
- package/dist/readers/fx.js +573 -0
- package/dist/readers/github-copilot.d.ts +8 -0
- package/dist/readers/github-copilot.js +216 -0
- package/dist/readers/grok-build.d.ts +12 -0
- package/dist/readers/grok-build.js +391 -0
- package/dist/readers/guards.d.ts +4 -0
- package/dist/readers/guards.js +121 -0
- package/dist/readers/pi-compaction.d.ts +7 -0
- package/dist/readers/pi-compaction.js +112 -0
- package/dist/readers/pi-context.d.ts +13 -0
- package/dist/readers/pi-context.js +64 -0
- package/dist/store.d.ts +25 -0
- package/dist/store.js +218 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.js +1 -0
- package/dist/writers/claude-code.d.ts +5 -0
- package/dist/writers/claude-code.js +51 -0
- package/dist/writers/cline.d.ts +3 -0
- package/dist/writers/cline.js +77 -0
- package/dist/writers/codex.d.ts +3 -0
- package/dist/writers/codex.js +32 -0
- package/dist/writers/cursor.d.ts +3 -0
- package/dist/writers/cursor.js +197 -0
- package/dist/writers/deepagents.d.ts +3 -0
- package/dist/writers/deepagents.js +116 -0
- package/dist/writers/entropy.d.ts +5 -0
- package/dist/writers/entropy.js +33 -0
- package/dist/writers/fx.d.ts +3 -0
- package/dist/writers/fx.js +135 -0
- package/dist/writers/github-copilot.d.ts +3 -0
- package/dist/writers/github-copilot.js +71 -0
- package/dist/writers/grok-build.d.ts +3 -0
- package/dist/writers/grok-build.js +43 -0
- package/dist/writers/helpers.d.ts +17 -0
- package/dist/writers/helpers.js +75 -0
- package/dist/writers/omp.d.ts +3 -0
- package/dist/writers/omp.js +7 -0
- package/dist/writers/opencode.d.ts +3 -0
- package/dist/writers/opencode.js +65 -0
- package/dist/writers/pi.d.ts +3 -0
- package/dist/writers/pi.js +45 -0
- package/docs/cline-native-format.md +43 -0
- package/docs/copilot-native-format.md +78 -0
- package/docs/cursor-native-format.md +103 -0
- package/docs/deepagents-native-format.md +98 -0
- package/docs/evidence-api.md +170 -0
- package/docs/fx-native-format.md +87 -0
- package/docs/harness-parity-bootstrap.md +78 -0
- package/docs/harness-support-parity.md +107 -0
- package/docs/inspirations.md +103 -0
- package/docs/ledger-migration.md +141 -0
- package/docs/pi-compaction-context.md +75 -0
- package/docs/pi-provider-context.md +76 -0
- package/docs/research/2026-10-06-huihua-and-oar.md +176 -0
- package/docs/research/ledger/README.md +96 -0
- package/docs/research/ledger/confer/2026-09-13-round-10/README.md +61 -0
- package/docs/research/ledger/confer/2026-09-13-round-2/cass.md +72 -0
- package/docs/research/ledger/confer/2026-09-13-round-3/README.md +70 -0
- package/docs/research/ledger/confer/2026-09-13-round-5/README.md +61 -0
- package/docs/research/ledger/confer/2026-09-13-round-6/README.md +68 -0
- package/docs/research/ledger/confer/2026-09-13-round-7/README.md +64 -0
- package/docs/research/ledger/confer/2026-09-13-round-9/README.md +59 -0
- package/docs/research/ledger/confer/2026-09-14-wake/wake.md +146 -0
- package/docs/research/ledger/docs/inspirations.md +320 -0
- package/docs/research/ledger/docs/pr2-pr6-integration.md +53 -0
- package/docs/research/ledger/docs/research/2026-09-07-confer-inspirations.md +163 -0
- package/docs/research/ledger/docs/research/2026-09-07-letta-continuous-service.md +104 -0
- package/docs/research/ledger/docs/research/2026-09-08-claude-history-retrieval.md +117 -0
- package/docs/research/ledger/docs/research/2026-09-09-agentsview-native-discovery.md +87 -0
- package/docs/research/ledger/docs/research/2026-09-09-daemon-observation.md +231 -0
- package/docs/research/ledger/docs/research/2026-09-09-discovery-pagination.md +114 -0
- package/docs/research/ledger/docs/research/2026-09-09-harness-transcript-contract.md +145 -0
- package/docs/research/ledger/docs/research/2026-09-09-native-history-discovery.md +180 -0
- package/docs/research/ledger/docs/research/2026-09-09-native-history-implementation.md +137 -0
- package/docs/research/ledger/docs/research/2026-09-09-other-inspirations.md +279 -0
- package/docs/research/ledger/docs/research/2026-09-09-trajectory-and-letta-code.md +128 -0
- package/docs/research/ledger/docs/research/2026-09-13-diagnostics-coverage.md +116 -0
- package/docs/research/ledger/docs/research/2026-09-13-fts-rebuild.md +83 -0
- package/docs/research/ledger/docs/research/2026-09-13-read-path-split.md +74 -0
- package/docs/research/ledger/docs/research/2026-09-13-runtime-rollout.md +102 -0
- package/docs/research/ledger/docs/research/2026-09-13-scan-outcomes.md +80 -0
- package/docs/research/ledger/docs/research/2026-09-13-search-quality.md +105 -0
- package/docs/research/ledger/docs/research/2026-09-13-source-coverage.md +64 -0
- package/docs/research/ledger/docs/research/2026-09-13-sync-wall-budget.md +82 -0
- package/docs/research/ledger/docs/research/2026-09-13-typed-read-gate.md +81 -0
- package/docs/research/ledger/docs/research/2026-09-13-writer-lease.md +84 -0
- package/docs/research/ledger/docs/research/2026-09-16-c1-copy-fallback.md +227 -0
- package/docs/research/ledger/docs/research/2026-09-16-c10-kimi.md +414 -0
- package/docs/research/ledger/docs/research/2026-09-16-c2-derive-counter.md +216 -0
- package/docs/research/ledger/docs/research/2026-09-16-c3-echo-filter.md +305 -0
- package/docs/research/ledger/docs/research/2026-09-16-c4-title-index.md +349 -0
- package/docs/research/ledger/docs/research/2026-09-16-c5-trigram.md +268 -0
- package/docs/research/ledger/docs/research/2026-09-16-c6-recency-prior.md +438 -0
- package/docs/research/ledger/docs/research/2026-09-16-c7-tombstones.md +467 -0
- package/docs/research/ledger/docs/research/2026-09-16-c8-remote-truth.md +390 -0
- package/docs/research/ledger/docs/research/2026-09-16-c9-grok.md +380 -0
- package/docs/research/ledger/docs/research/2026-09-16-wake-port-program.md +38 -0
- package/docs/research/ledger/docs/research/2026-09-17-cursor-blobstore.md +157 -0
- package/docs/research/ledger/manifest.json +540 -0
- package/legacy/NOTICE.md +50 -0
- package/legacy/bin/ledger-core.ts +7 -0
- package/legacy/bin/ledger.ts +7 -0
- package/legacy/bin/traj-bridge.ts +7 -0
- package/legacy/scripts/import-claude-history.ts +130 -0
- package/legacy/scripts/native-history-smoke.ts +52 -0
- package/legacy/scripts/observe-daemon.ts +570 -0
- package/legacy/scripts/retitle-sessions.md +19 -0
- package/legacy/scripts/verify-runtime-rollout.ts +151 -0
- package/legacy/src/canonical.ts +108 -0
- package/legacy/src/cli.ts +1293 -0
- package/legacy/src/db.ts +2254 -0
- package/legacy/src/diagnostics.ts +87 -0
- package/legacy/src/discovery.ts +56 -0
- package/legacy/src/embeddings.ts +382 -0
- package/legacy/src/filter.ts +602 -0
- package/legacy/src/gemini_embeddings.ts +103 -0
- package/legacy/src/identity.ts +9 -0
- package/legacy/src/index.ts +10 -0
- package/legacy/src/ingest.ts +791 -0
- package/legacy/src/managed.ts +178 -0
- package/legacy/src/native/common.ts +68 -0
- package/legacy/src/native/cursor.ts +647 -0
- package/legacy/src/native/grok.ts +540 -0
- package/legacy/src/native/kimi.ts +706 -0
- package/legacy/src/native/opencode.ts +470 -0
- package/legacy/src/native/sqlite-ro.ts +281 -0
- package/legacy/src/native.ts +97 -0
- package/legacy/src/normalizer.ts +457 -0
- package/legacy/src/parentage.ts +562 -0
- package/legacy/src/pressure.ts +162 -0
- package/legacy/src/private-storage.ts +74 -0
- package/legacy/src/reader.ts +1255 -0
- package/legacy/src/scanner.ts +591 -0
- package/legacy/src/schema-gate.ts +263 -0
- package/legacy/src/schema.ts +829 -0
- package/legacy/src/semantic-top-k.ts +71 -0
- package/legacy/src/session-hash.ts +49 -0
- package/legacy/src/store-status.ts +218 -0
- package/legacy/src/sync-preparation.ts +45 -0
- package/legacy/src/sync-truth.ts +843 -0
- package/legacy/src/sync.ts +1233 -0
- package/legacy/src/types.ts +436 -0
- package/legacy/src/vocab.txt +30522 -0
- package/legacy/src/watch.ts +673 -0
- package/legacy/src/writer-lease.ts +310 -0
- package/ops/README.md +150 -0
- package/ops/install-cli.sh +63 -0
- package/ops/install-native.sh +35 -0
- package/ops/install-release.sh +49 -0
- package/ops/linux/install-systemd-user.sh +103 -0
- package/ops/macos/install-launchd.sh +72 -0
- package/ops/sync-settings.sh +37 -0
- package/package.json +21 -5
- package/skills/trajectories/SKILL.md +138 -0
- package/skills/trajectories/scripts/trajectories_recent.sh +26 -0
- package/skills/trajectories/scripts/trajectories_search.sh +26 -0
- package/index.js +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Cursor native session format
|
|
2
|
+
|
|
3
|
+
The Cursor adapter targets the native `AgentKv` store loaded by Cursor CLI and
|
|
4
|
+
ACP. It is pinned to `cursor-agent 2026.10.01-e373342`; Cursor does not publish
|
|
5
|
+
this persisted protobuf schema as a stable interchange API.
|
|
6
|
+
|
|
7
|
+
## Export contract
|
|
8
|
+
|
|
9
|
+
`writeCursor` emits two text files:
|
|
10
|
+
|
|
11
|
+
- `cursor/<session-id>.readout.json` is the binding entrypoint. It contains all
|
|
12
|
+
SQLite `meta` rows and every content-addressed blob as base64, plus the source
|
|
13
|
+
records verbatim under `provenance.sourceRecords`.
|
|
14
|
+
- `cursor/prepare-cursor.mjs` validates the runtime and blob hashes, then creates
|
|
15
|
+
new stores without replacing an existing Cursor session.
|
|
16
|
+
|
|
17
|
+
The readout has format identifier `cursor-agent-sqlite-readout-v1`. It is a
|
|
18
|
+
lossless logical readout of the selected store rows and blob bytes, not a copy
|
|
19
|
+
of SQLite page bytes. `readCursor(raw)` reads this entrypoint before prepare.
|
|
20
|
+
`readCursorNative(storeDbOrSessionDirectory, nativeSessionId?)` opens an
|
|
21
|
+
existing database read-only and produces the same readout. When an ACP
|
|
22
|
+
`meta.json` sidecar exists, its `cwd` is retained as provenance.
|
|
23
|
+
|
|
24
|
+
Prepare writes the same store to both locations used by the tested runtime:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
$HOME/.cursor/chats/<md5(resolve(cwd))>/<session-id>/store.db
|
|
28
|
+
$HOME/.cursor/acp-sessions/<session-id>/store.db
|
|
29
|
+
$HOME/.cursor/acp-sessions/<session-id>/meta.json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The database has `PRAGMA user_version=1` and two tables:
|
|
33
|
+
|
|
34
|
+
```sql
|
|
35
|
+
CREATE TABLE blobs (id TEXT PRIMARY KEY, data BLOB);
|
|
36
|
+
CREATE TABLE meta (key TEXT PRIMARY KEY, value TEXT);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Blob IDs are lowercase SHA-256 hashes of the raw protobuf bytes. `meta['0']` is
|
|
40
|
+
the hex encoding of UTF-8 JSON metadata; `latestRootBlobId` selects the root
|
|
41
|
+
conversation blob. The emitted protobuf subset contains agent turns, user
|
|
42
|
+
messages, assistant messages, thinking messages, and completed MCP tool calls.
|
|
43
|
+
Tool arguments use protobuf `Value`; results retain complete text and the
|
|
44
|
+
source success flag. Source system and observation records remain verbatim in
|
|
45
|
+
the entrypoint and are diagnosed because AgentKv has no equivalent active
|
|
46
|
+
conversation step.
|
|
47
|
+
|
|
48
|
+
The reader rejects unknown fields in decoded messages. It also rejects root
|
|
49
|
+
state carrying compaction summaries, branches, checkpoints, or subagents.
|
|
50
|
+
Those stores can still be archived as native evidence, but cannot be continued
|
|
51
|
+
through this codec without choosing a branch or losing state.
|
|
52
|
+
|
|
53
|
+
`prepare-cursor.mjs` requires the exact tested version by default. Setting
|
|
54
|
+
`CURSOR_NATIVE_ALLOW_UNTESTED=1` is an explicit caller override; it does not
|
|
55
|
+
make another version verified.
|
|
56
|
+
|
|
57
|
+
## Loader verification
|
|
58
|
+
|
|
59
|
+
The native probe used the official installer in an isolated home and made no
|
|
60
|
+
model request. It performed this sequence:
|
|
61
|
+
|
|
62
|
+
1. Export a user message, thinking step, MCP tool call with structured
|
|
63
|
+
arguments, a 4,103-character result, and an assistant message.
|
|
64
|
+
2. Run the emitted prepare action with Node 22.23.1.
|
|
65
|
+
3. Start the real Cursor ACP process, initialize protocol version 1, and call
|
|
66
|
+
`session/load` for the imported UUID. No `session/prompt` request is sent.
|
|
67
|
+
4. Assert Cursor's `session/update` replay contains the user text,
|
|
68
|
+
completed tool content, and final assistant text.
|
|
69
|
+
|
|
70
|
+
Source reasoning remains archived in the central snapshot. The destination
|
|
71
|
+
writer omits it with an `untranslated-reasoning` diagnostic.
|
|
72
|
+
|
|
73
|
+
The test is opt-in because it needs a Cursor executable and credential:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
CURSOR_NATIVE_BIN=/path/to/cursor-agent CURSOR_API_KEY=... \
|
|
77
|
+
bun test packages/trajectories/test/cursor.test.ts
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
On 2026-10-05, the account's `cursor-agent models` output included GLM 5.2 and
|
|
81
|
+
GPT-5.6 routes but no GLM 5.3 route. Cursor exposes a model selector but no
|
|
82
|
+
provider selector, so the writer rejects `provider` rather than silently
|
|
83
|
+
changing it. A requested GLM 5.3 run must remain blocked until Cursor lists an
|
|
84
|
+
exact GLM 5.3 model ID.
|
|
85
|
+
|
|
86
|
+
## Source evidence
|
|
87
|
+
|
|
88
|
+
The official runtime artifacts inspected for this codec were:
|
|
89
|
+
|
|
90
|
+
| Artifact | SHA-256 |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| Cursor install script | `dd6677f33cb7efa34809557b1c6df3a11e389b76ce4e56ce5751db13dd7260e6` |
|
|
93
|
+
| `cursor-agent 2026.10.01-e373342` | `2ccc9a8e167797641448b5e5c936f006ba137a2555f117f38c5eb76a5238a233` |
|
|
94
|
+
| runtime `index.js` | `39218adfc45db4c75727b3a19c61ac12ff671aa4417c94591a1b1469658c59ea` |
|
|
95
|
+
| runtime chunk `4945.index.js` (AgentKv serializer/store) | `e6b1a2a2d0a7974dd9ad5920483cecbcc1c3c76a9dc1978d11a081cab62e2df6` |
|
|
96
|
+
| runtime chunk `6136.index.js` (ACP storage/load/replay) | `1fd63a6a85df08cd65f82b11d8831fee053d282563f4b7727729c6d90abeecd3` |
|
|
97
|
+
| `@letta-ai/trajectory` 0.4.3 Cursor decoder | `4989a4a872e83086335117f14459f04a7d71d1feee2ddfb6256be0833c28c9e6` |
|
|
98
|
+
|
|
99
|
+
[Cursor's CLI reference](https://cursor.com/docs/cli/reference/parameters)
|
|
100
|
+
documents `cursor-agent --resume <chat-id>`, and its
|
|
101
|
+
[ACP guide](https://cursor.com/docs/cli/acp) documents session loading. The
|
|
102
|
+
runtime bundle is the authoritative source for the private store schema,
|
|
103
|
+
message field numbers, storage paths, and history replay behavior used here.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Deep Agents native checkpoint format
|
|
2
|
+
|
|
3
|
+
This codec targets deepagents-code 0.1.80 (commit e4c1ffe9ee63d7854147de490ca27495ef157a7b) with deepagents 0.7.21. Deep Agents persists conversations as LangGraph checkpoints, not transcript files.
|
|
4
|
+
|
|
5
|
+
## Export and prepare
|
|
6
|
+
|
|
7
|
+
writeDeepAgents emits:
|
|
8
|
+
|
|
9
|
+
- checkpoint.json: a validated, portable seed and the SDK entrypoint.
|
|
10
|
+
- import_deepagents.py: a deterministic importer.
|
|
11
|
+
|
|
12
|
+
checkpoint.json has this shape:
|
|
13
|
+
|
|
14
|
+
~~~json
|
|
15
|
+
{
|
|
16
|
+
"version": 1,
|
|
17
|
+
"source": "deepagents",
|
|
18
|
+
"session": {
|
|
19
|
+
"threadId": "<uuid>",
|
|
20
|
+
"checkpointNamespace": "",
|
|
21
|
+
"cwd": "/absolute/workspace",
|
|
22
|
+
"createdAt": "<ISO-8601>",
|
|
23
|
+
"model": "glm-5.3"
|
|
24
|
+
},
|
|
25
|
+
"messages": [
|
|
26
|
+
{ "id": "trajectory:<thread-id>:1", "role": "human", "content": "...", "timestamp": "<ISO-8601>" },
|
|
27
|
+
{
|
|
28
|
+
"id": "trajectory:<thread-id>:2",
|
|
29
|
+
"role": "ai",
|
|
30
|
+
"content": "",
|
|
31
|
+
"reasoning": [],
|
|
32
|
+
"toolCalls": [{ "id": "...", "name": "...", "args": {} }],
|
|
33
|
+
"model": "glm-5.3",
|
|
34
|
+
"timestamp": "<ISO-8601>"
|
|
35
|
+
},
|
|
36
|
+
{ "id": "trajectory:<thread-id>:3", "role": "tool", "content": "...", "toolCallId": "...", "timestamp": "<ISO-8601>" }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
~~~
|
|
40
|
+
|
|
41
|
+
Each exported message has a deterministic native ID scoped by the thread. Deep Agents' ACP replay indexes persisted messages by that field, so the importer rejects a missing or duplicate ID. Database readouts from older native checkpoints may omit IDs; archive decoding and history safety validation still accept those readouts.
|
|
42
|
+
|
|
43
|
+
The seed supports the root checkpoint namespace only. Reasoning, compaction state, branches, pending tool calls, and tool success status are not invented. Unsupported source records remain in the central snapshot and produce diagnostics.
|
|
44
|
+
|
|
45
|
+
The returned prepare step calls:
|
|
46
|
+
|
|
47
|
+
~~~text
|
|
48
|
+
python3 import_deepagents.py checkpoint.json <export>/.state/sessions.db
|
|
49
|
+
~~~
|
|
50
|
+
|
|
51
|
+
The Python interpreter must contain the pinned Deep Agents packages. The importer sets DEEPAGENTS_HOME to the export directory and invokes the official deepagents_code.sessions.save_thread_seed API. That API creates <export>/.state/sessions.db; no database file exists before prepare runs. The importer refuses to overwrite or stamp a destination that already contains the requested thread ID.
|
|
52
|
+
|
|
53
|
+
The importer then reads and replaces that checkpoint through the public get_checkpointer, aget_tuple, and aput APIs. It preserves the checkpoint payload and existing metadata while adding the required durable ACP metadata written by deepagents_acp.server.AgentServerACP._persist_session: acp_session is true and cwd is the seed workspace. This makes the converted thread eligible for native ACP session/load without constructing an agent or calling a model during prepare.
|
|
54
|
+
|
|
55
|
+
Resume uses:
|
|
56
|
+
|
|
57
|
+
~~~text
|
|
58
|
+
env DEEPAGENTS_HOME=<export> dcode -r <thread-id>
|
|
59
|
+
~~~
|
|
60
|
+
|
|
61
|
+
ACP clients can instead launch the pinned CLI as a stdio server and call session/load with the same thread ID and cwd:
|
|
62
|
+
|
|
63
|
+
~~~text
|
|
64
|
+
env DEEPAGENTS_HOME=<export> dcode --acp --model zai:glm-5.3 --no-mcp --no-interpreter
|
|
65
|
+
~~~
|
|
66
|
+
|
|
67
|
+
ACP load rejects checkpoints without that marker as Resource not found and rejects a different cwd as invalid parameters. The importer does not set optional acp_mode or acp_model metadata because those fields describe ACP UI selections rather than the checkpoint's content model.
|
|
68
|
+
|
|
69
|
+
## Reading
|
|
70
|
+
|
|
71
|
+
readDeepAgents({ path, threadId, pythonExecutable? }) accepts either checkpoint.json or sessions.db.
|
|
72
|
+
|
|
73
|
+
- For checkpoint.json, it validates every field and derives canonical records in memory.
|
|
74
|
+
- For sessions.db, it delegates SQLite decoding, checkpoint ancestry, pending writes, and message reconstruction to @letta-ai/trajectory 0.4.3 and the installed LangGraph Python packages.
|
|
75
|
+
|
|
76
|
+
For a database input, raw is the stable JSON readout of the selected checkpoint. It is not the SQLite bytes. It carries the thread, namespace, checkpoint ID and timestamp, cwd, model, and selected messages. Canonical source group identity remains the upstream JSON tuple [threadId, checkpointNamespace]; the native runtime selector is the bare threadId.
|
|
77
|
+
|
|
78
|
+
## Z.AI GLM-5.3
|
|
79
|
+
|
|
80
|
+
Deep Agents' official custom-provider path uses langchain_openai:ChatOpenAI. An isolated profile can configure:
|
|
81
|
+
|
|
82
|
+
~~~toml
|
|
83
|
+
[models.providers.zai]
|
|
84
|
+
display_name = "Z.AI"
|
|
85
|
+
class_path = "langchain_openai:ChatOpenAI"
|
|
86
|
+
api_key_env = "ZAI_API_KEY"
|
|
87
|
+
base_url = "https://api.z.ai/api/coding/paas/v4"
|
|
88
|
+
models = ["glm-5.3"]
|
|
89
|
+
|
|
90
|
+
[models.providers.zai.params]
|
|
91
|
+
use_responses_api = false
|
|
92
|
+
~~~
|
|
93
|
+
|
|
94
|
+
Resume with --model zai:glm-5.3. The codec never copies credentials or changes the provider when the caller did not request one.
|
|
95
|
+
|
|
96
|
+
## Native acceptance
|
|
97
|
+
|
|
98
|
+
The pinned importer was exercised with Python 3.12.15. dcode threads list --json loaded the generated store and reported the seeded thread, cwd, checkpoint ID, and five messages. The official Letta checkpoint loader then read the same .state/sessions.db, including both tool calls, both results, and the final assistant message. A pinned dcode ACP server accepted session/load and replayed the converted messages without a prompt or model request; the same checkpoint without the marker was rejected as Resource not found. Evidence is under /root/.local/share/harness-parity-implementation-2026-10-05/evidence.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Evidence inspection API
|
|
2
|
+
|
|
3
|
+
Status: **skipped by the owner on 2026-10-06; not an implementation task or SDK export**.
|
|
4
|
+
The design below is retained as history. The owner accepted the existing captured
|
|
5
|
+
native transcript for conversion debugging and chose to skip a separate evidence
|
|
6
|
+
inspection interface. Type-checking and contract review did not demonstrate a
|
|
7
|
+
consumer need. Do not revive this API as an active optimization.
|
|
8
|
+
The owner subsequently rejected per-capture full-snapshot persistence itself;
|
|
9
|
+
[canonical-log storage](../../../docs/adr/0011-trajectories-log-authority.md) is
|
|
10
|
+
the replacement target, with migration pending.
|
|
11
|
+
|
|
12
|
+
Baseline: `cd23e7354fc40d630dae94151b4bb4d6d90734f9`.
|
|
13
|
+
Applies the owner-invoked `addy:api-and-interface-design` skill to the evidence
|
|
14
|
+
and ingestion candidates in the [Huihua/OAR assessment](research/2026-10-06-huihua-and-oar.md).
|
|
15
|
+
|
|
16
|
+
## Goal and boundary
|
|
17
|
+
|
|
18
|
+
Given a complete Trajectories snapshot and a canonical record position, identify
|
|
19
|
+
the captured native evidence that produced that record. Preserve our own format,
|
|
20
|
+
canonical identities and existing conversion/session calls. A caller can inspect
|
|
21
|
+
an archived history without declaring it portable or executing any harness.
|
|
22
|
+
|
|
23
|
+
This adds one proposed SDK factory, `inspectEvidence(snapshot)`, returning a
|
|
24
|
+
read-only view. It does not add persisted fields to `Snapshot` or modify Letta's
|
|
25
|
+
canonical schema. The snapshot already owns captured text, sidecars, identities
|
|
26
|
+
and hashes. The view holds locators into that evidence rather than payload copies.
|
|
27
|
+
|
|
28
|
+
## Proposed TypeScript contract
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import type { Snapshot } from 'trajectories';
|
|
32
|
+
|
|
33
|
+
type EvidenceArtifact =
|
|
34
|
+
| { readonly kind: 'raw'; readonly sha256: string }
|
|
35
|
+
| { readonly kind: 'attachment'; readonly name: string; readonly sha256: string };
|
|
36
|
+
|
|
37
|
+
type EvidenceLocation =
|
|
38
|
+
| { readonly kind: 'utf8'; readonly startByte: number; readonly endByte: number }
|
|
39
|
+
| { readonly kind: 'json'; readonly path: readonly (string | number)[] };
|
|
40
|
+
|
|
41
|
+
interface NativeEvidenceRef {
|
|
42
|
+
readonly artifact: EvidenceArtifact;
|
|
43
|
+
readonly location: EvidenceLocation;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface EvidenceRecordKey {
|
|
47
|
+
readonly snapshotId: Snapshot['id'];
|
|
48
|
+
readonly canonicalIndex: number;
|
|
49
|
+
readonly recordId: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type RecordEvidence = EvidenceRecordKey & (
|
|
53
|
+
| {
|
|
54
|
+
readonly kind: 'mapped';
|
|
55
|
+
readonly references: readonly [NativeEvidenceRef, ...NativeEvidenceRef[]];
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
readonly kind: 'unmapped';
|
|
59
|
+
readonly reason: 'synthetic' | 'ambiguous' | 'unsupported';
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
interface EvidenceView {
|
|
64
|
+
readonly snapshotId: Snapshot['id'];
|
|
65
|
+
readonly recordCount: number;
|
|
66
|
+
record(canonicalIndex: number): RecordEvidence;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare function inspectEvidence(snapshot: Snapshot): EvidenceView;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The factory is a proposal in this document. The current package exports neither
|
|
73
|
+
it nor these new types. Literal casing follows the existing SDK conventions.
|
|
74
|
+
|
|
75
|
+
## Identity and location rules
|
|
76
|
+
|
|
77
|
+
- `canonicalIndex` is the zero-based position in this exact snapshot's
|
|
78
|
+
`canonical.records`, including metadata. It is not a global sequence, native
|
|
79
|
+
turn id, or transport arrival order. `recordId` corroborates the record; native
|
|
80
|
+
ids and canonical ids alone cannot disambiguate every repeated observation.
|
|
81
|
+
- Each result includes `snapshotId`, so a saved mapping cannot silently become
|
|
82
|
+
a mapping for a later head. The artifact digest identifies the captured content;
|
|
83
|
+
attachment names select content already retained in that snapshot.
|
|
84
|
+
- `utf8` uses zero-based byte offsets in the captured string's UTF-8 encoding,
|
|
85
|
+
with an exclusive end. Both ends must be valid encoding boundaries. It does
|
|
86
|
+
not claim that a prior lossy decoding preserved an original file byte-for-byte.
|
|
87
|
+
- `json.path` addresses a value within the captured JSON artifact. String steps
|
|
88
|
+
select exact own object keys; integer steps select array positions. An empty
|
|
89
|
+
path addresses the entire value. This also covers selected database rows or
|
|
90
|
+
checkpoint exports, without claiming a database image or reopening that store.
|
|
91
|
+
- One native frame can support multiple canonical components; those components
|
|
92
|
+
share its reference. One canonical record can require multiple evidence refs.
|
|
93
|
+
Reference order follows captured source order, not consumer request timing.
|
|
94
|
+
- Every mapped reference must exist in the captured artifact, have its expected
|
|
95
|
+
digest, and be proven to support the selected normalized record. A matching
|
|
96
|
+
native id or timestamp alone is insufficient. If proof is missing or
|
|
97
|
+
ambiguous, return `unmapped`; do not select the first plausible frame.
|
|
98
|
+
|
|
99
|
+
`synthetic` describes a generated record without direct native evidence;
|
|
100
|
+
`ambiguous` means available candidates cannot be distinguished;
|
|
101
|
+
`unsupported` means the decoder or historical normalization cannot prove a
|
|
102
|
+
mapping. These are ordinary inspection results, not exceptions or evidence of
|
|
103
|
+
runtime failure. An unknown native frame still remains in captured raw history;
|
|
104
|
+
it is not fabricated into a canonical conversation to make it addressable.
|
|
105
|
+
|
|
106
|
+
## Validation, errors and cost
|
|
107
|
+
|
|
108
|
+
The exported factory is a boundary: validate snapshot integrity once there,
|
|
109
|
+
using the existing snapshot contract. Locate evidence from captured content,
|
|
110
|
+
with decoder-specific verification, rather than trusting client-supplied maps.
|
|
111
|
+
Internal view lookups use that validated captured generation. Caller mutation
|
|
112
|
+
after construction must not redirect the view to another record or artifact.
|
|
113
|
+
|
|
114
|
+
Invalid snapshots throw an `Error`, consistent with the SDK's current throwing
|
|
115
|
+
strategy. `record()` throws a `RangeError` for a non-integer, negative or
|
|
116
|
+
out-of-range index. Ordinary unavailable evidence uses the explicit union above.
|
|
117
|
+
Consumers must not branch on diagnostic prose. This proposal does not retrofit
|
|
118
|
+
new error shapes across existing SDK calls.
|
|
119
|
+
|
|
120
|
+
Build or cache the native-location index once per view; repeated lookups must
|
|
121
|
+
not reparse the entire transcript. Keep payloads in their original captured
|
|
122
|
+
artifacts. Index cost and mapping coverage must be measured; this is not a
|
|
123
|
+
constant-memory promise. Consumers can page through `recordCount` and indexed
|
|
124
|
+
lookups without another public collection/list API.
|
|
125
|
+
|
|
126
|
+
## Compatibility and implementation gate
|
|
127
|
+
|
|
128
|
+
`Snapshot.version`, existing snapshot ids, `raw`, `attachments`, canonical record
|
|
129
|
+
content/order and all current public calls retain their meaning. In particular,
|
|
130
|
+
snapshot identity currently hashes canonical records and sidecars, while session
|
|
131
|
+
head comparisons and acknowledgement replay depend on that identity. Persisting
|
|
132
|
+
an unchecked optional map or adding a hashed sidecar would require different
|
|
133
|
+
integrity/migration handling; the derived view avoids that change.
|
|
134
|
+
|
|
135
|
+
The contract is shared across the existing 11 SDK codecs. Decoder coverage must
|
|
136
|
+
be reported per record and per source; exposing the common API does not establish
|
|
137
|
+
complete mapping coverage. Legacy SQLite search rows alone lack the whole native
|
|
138
|
+
capture and are not substitutes for a `Snapshot`.
|
|
139
|
+
|
|
140
|
+
Before exporting this API, demonstrate exact locations against real captured
|
|
141
|
+
fixtures across supported source shapes: JSONL, JSON and selected database or
|
|
142
|
+
checkpoint exports. Verify repeated ids, multiple components from one frame,
|
|
143
|
+
sidecars, multibyte text, synthetic records and explicit unsupported cases.
|
|
144
|
+
Changing a snapshot's canonical content while retaining the same native capture
|
|
145
|
+
must not create a false mapped result. Repeated lookups must preserve identities
|
|
146
|
+
and avoid repeated full parsing.
|
|
147
|
+
|
|
148
|
+
Existing Pi active-context, interrupted-draft and incomplete-tool protections
|
|
149
|
+
remain conversion gates. An evidence reference proves only a recorded fact.
|
|
150
|
+
It does not prove that a pause stopped execution, reconcile a late effect, or
|
|
151
|
+
capture a host request that never entered the native log.
|
|
152
|
+
|
|
153
|
+
## Separate, unmeasured streaming candidate
|
|
154
|
+
|
|
155
|
+
Skipping evidence inspection does not establish a performance result. The current
|
|
156
|
+
[optimization assessment](research/2026-10-06-huihua-and-oar.md#what-remains-worth-measuring)
|
|
157
|
+
keeps long-history acquisition and retained checkpoint size as measurement
|
|
158
|
+
candidates, with no new public API or performance implementation in this checkpoint.
|
|
159
|
+
|
|
160
|
+
Keep `readSnapshot` as the existing complete-snapshot API for the first ingestion
|
|
161
|
+
prototype. Test incremental parsing internally before adding an exported stream
|
|
162
|
+
or another session/state abstraction. Reading chunks and concatenating them into
|
|
163
|
+
the same bulk parser is not evidence of incremental normalization.
|
|
164
|
+
|
|
165
|
+
Compare the prototype against the same captured native inputs. Require identical
|
|
166
|
+
canonical records, diagnostics, snapshot identities and conversion behavior;
|
|
167
|
+
measure temporary memory, time and retained snapshot size. Full snapshots still
|
|
168
|
+
retain complete history. Failed or cancelled acquisition must not publish a
|
|
169
|
+
complete snapshot or advance a managed head. Only a demonstrated useful result
|
|
170
|
+
justifies expanding the public API for cancellation or partial observation.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# FX native session format
|
|
2
|
+
|
|
3
|
+
Trajectories reads and writes FX's native `session.json` format. The implementation is pinned to first-party FX commit [`4d966e272cfc4296cdf703f409480088cf2e72ba`](https://github.com/vercel-labs/fx/tree/4d966e272cfc4296cdf703f409480088cf2e72ba).
|
|
4
|
+
|
|
5
|
+
FX discovers sessions at `$HOME/.fx/sessions/<session-id>/session.json`. A native export therefore uses this layout relative to `WriteOptions.directory`:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.fx/sessions/<session-id>/session.json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The generated resume vector sets `HOME` to that directory and invokes `fx [--provider P] [--model M] resume <session-id>`. FX treats provider and model as global launch options, so they precede `resume`. The public [sessions documentation](https://fx.sh/docs/using-fx/sessions) documents the profile location, `fx resume <session-id>`, and the read-only `fx session <session-id> --json` inspection command. Custom OpenAI-compatible providers and the `FX_PROVIDER`/`FX_MODEL` overrides are documented under [custom model connections](https://fx.sh/docs/configure-fx/custom-model-connections).
|
|
12
|
+
|
|
13
|
+
## Written schema
|
|
14
|
+
|
|
15
|
+
The writer emits the legacy top-level session schema version 1 implemented by FX's pinned [`session_json.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_json.zig):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"schema_version": 1,
|
|
20
|
+
"id": "<uuid>",
|
|
21
|
+
"created_at_ms": 1791187200000,
|
|
22
|
+
"updated_at_ms": 1791187200000,
|
|
23
|
+
"workspace_root": "/absolute/workspace",
|
|
24
|
+
"conversation_language": "en",
|
|
25
|
+
"history_len": 1,
|
|
26
|
+
"history": []
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Each completed turn is an `assistant` history entry containing the user text, final assistant text, and optional execution memory. Execution memory uses presentation schema version 3 from pinned [`session_codec.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_codec.zig). It retains every completed batch, including parallel calls:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"kind": "assistant",
|
|
35
|
+
"user": { "text": "Inspect both files", "images": [] },
|
|
36
|
+
"assistant": "Both files are inspected.",
|
|
37
|
+
"execution": {
|
|
38
|
+
"schema_version": 3,
|
|
39
|
+
"tool_steps": [{
|
|
40
|
+
"assistant": "I will inspect them.",
|
|
41
|
+
"tool_calls": [{
|
|
42
|
+
"id": "call-1",
|
|
43
|
+
"name": "read_file",
|
|
44
|
+
"arguments_json": "{\"path\":\"a.txt\"}",
|
|
45
|
+
"provider_result": null
|
|
46
|
+
}],
|
|
47
|
+
"tool_results": [{
|
|
48
|
+
"tool_call_id": "call-1",
|
|
49
|
+
"tool_name": "read_file",
|
|
50
|
+
"status": "success",
|
|
51
|
+
"output": "contents",
|
|
52
|
+
"output_bytes": 8,
|
|
53
|
+
"stored_output_bytes": 8,
|
|
54
|
+
"truncated": false,
|
|
55
|
+
"provider_native": false,
|
|
56
|
+
"created_at_ms": 1791187200000,
|
|
57
|
+
"permission_feedback": []
|
|
58
|
+
}]
|
|
59
|
+
}],
|
|
60
|
+
"files": []
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
FX's pinned [`session_store.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_store.zig) recognizes this legacy file, loads it through `parseLegacyExact`, and migrates it when opened for writing. This private writer boundary is version-pinned because FX does not expose a public import API for arbitrary completed history.
|
|
66
|
+
|
|
67
|
+
## Reader and portability boundary
|
|
68
|
+
|
|
69
|
+
`readFx` accepts legacy monolithic top-level schemas 1 and 2. It also accepts the pinned runtime's current schema 4 when given the complete native companions:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
session.json metadata header (schema 4)
|
|
73
|
+
events.jsonl ordered conversation envelopes (schemas 1–3)
|
|
74
|
+
tool-results/<artifact_ref> exact stored tool-result bodies
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Schema 4 is defined by pinned [`session_codec.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_codec.zig), [`session_event.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_event.zig), and [`session_log.zig`](https://github.com/vercel-labs/fx/blob/4d966e272cfc4296cdf703f409480088cf2e72ba/src/core/session/session_log.zig). `session.json` no longer contains history. The reader therefore requires `events.jsonl`, validates contiguous native sequence numbers and completed tool linkage, and resolves every tool result through its named artifact. A missing artifact, an unsafe path, invalid UTF-8, or a byte-count mismatch fails the read; the event preview is never substituted for an absent body.
|
|
78
|
+
|
|
79
|
+
The earlier top-level schema 3 is a distinct `event_log_v1` manifest with generation IDs, byte boundaries, fingerprints, and checkpoints. It is rejected explicitly because interpreting only its manifest as schema 4 would invent history. This codec does not claim top-level schema 3 support.
|
|
80
|
+
|
|
81
|
+
Schema 4 provider replay stays byte-for-byte in the `events.jsonl` attachment. The reader projects only the pinned configured-provider OpenAI chat-completions subset whose native-emitted compact replay object has no duplicate keys, contains one visible `reasoning` or `reasoning_content` string, has no opaque `reasoning_details`, matches the exact session provider binding and model, and lists `_tool_call_ids` that exactly match the following tool-call batch. That visible string becomes a canonical reasoning record. Built-in-provider replay, opaque or noncanonical bytes, unknown fields, ambiguous visible fields, source mismatches, and call-association mismatches remain archive-only and fail portability.
|
|
82
|
+
|
|
83
|
+
Configured-provider binding identity, tool provenance, result completeness, committed-file presentation, file evidence, and turn summaries also stay byte-for-byte in the snapshot's raw header and attachments and are surfaced as diagnostics. Completed semantic user, assistant, tool-call, and exact stored tool-result records remain portable. A `partial` or `unknown` result preserves the complete stored artifact only; it does not claim the upstream provider's original output was complete. Images, steering, interrupted turns, context checkpoints, uncertain arguments or identities, tool images, and command replay still fail portability because canonical history cannot reproduce that active context.
|
|
84
|
+
|
|
85
|
+
For every accepted schema, the reader preserves the native bytes in the surrounding snapshot and normalizes completed turns, tool calls, terminal results, status, and final replies under source type `fx`.
|
|
86
|
+
|
|
87
|
+
The writer intentionally omits credentials, settings, permissions, images, provider replay, file evidence, steering, compaction state, and usage. System, reasoning, and observation records remain in the central snapshot and produce explicit `untranslated-*` writer diagnostics; the exported FX file does not install them as target instructions or provider reasoning. The snapshot attachment preserves imported replay bytes, but the writer does not claim to recreate opaque native state or provider caches. An export is refused if a turn or tool batch is incomplete.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Harness parity bootstrap
|
|
2
|
+
|
|
3
|
+
This extends the [initial inventory](./harness-support-parity.md). Execution
|
|
4
|
+
remains in HarnessAgent; Trajectories has no AI SDK/runtime dependency and
|
|
5
|
+
prepares history artifacts without executing them.
|
|
6
|
+
|
|
7
|
+
| Surface | Before | Bootstrap |
|
|
8
|
+
| --- | ---: | ---: |
|
|
9
|
+
| Ledger / Trajectories CLI history readers | 16 | 18 |
|
|
10
|
+
| Trajectories SDK reader/writer codecs | 6 | 11 |
|
|
11
|
+
| Vercel concrete adapters plus our OMP | 11 | 11 |
|
|
12
|
+
| Omakase registry names | 9 | 11 |
|
|
13
|
+
| Committed compiled adapter imports | 6 | 7 |
|
|
14
|
+
|
|
15
|
+
New codecs: Cursor, Deep Agents, GitHub Copilot, Cline and fx. Cline/fx also
|
|
16
|
+
gain archive discovery, normalization and search ingestion. All 11 execution
|
|
17
|
+
runtimes now have a history codec. Archive-only runtimes remain Droid, Gemini,
|
|
18
|
+
Hermes, Kimi, Letta Code, OpenClaw and OpenHands.
|
|
19
|
+
|
|
20
|
+
Registry coverage is separate from installation. This candidate includes Grok
|
|
21
|
+
Build 1.0.39 in Omakase's static import map, verified in an actual compiled
|
|
22
|
+
executable with Bun 1.3.14. Deep Agents, Cline, Copilot and fx are registered
|
|
23
|
+
but require their adapters to be installed/included before execution through
|
|
24
|
+
that binary. Cursor is named `cursor-cli` in Omakase; `grok` and `copilot-cli`
|
|
25
|
+
are the legacy scanner aliases for SDK `grok-build` and `github-copilot`.
|
|
26
|
+
|
|
27
|
+
The generated [implementation inventory](../evidence/harness-support-bootstrap.json)
|
|
28
|
+
has source fingerprints. Run `bun scripts/parity/inventory.ts --check` from the
|
|
29
|
+
package to detect stale coverage. It does not advertise model compatibility.
|
|
30
|
+
|
|
31
|
+
## Verification boundaries
|
|
32
|
+
|
|
33
|
+
| Target | Native store / import | Loader pin | Model continuation |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| Cursor | SQLite row/blob artifact; explicit prepare writes CLI/ACP stores | 2026.10.01-e373342 | Offline only: account lists no GLM5.3 route |
|
|
36
|
+
| Deep Agents | Selected checkpoint messages/metadata; official checkpoint helper | dcode 0.1.80 | Frozen GLM ACP probe |
|
|
37
|
+
| GitHub Copilot | events.jsonl + workspace.yaml | CLI 1.0.91 / SDK 1.0.16 | Frozen GLM BYOK probe |
|
|
38
|
+
| Cline | Core messages/manifest + explicit index prepare; adapter history.json | Core 0.0.79 / CLI 3.0.68 | Frozen GLM public Core SDK probe |
|
|
39
|
+
| fx | Legacy monolithic schemas 1/2; schema 4 manifest + event journal + tool-result artifacts | 0.0.13 at 4d966e27 | Frozen GLM native CLI probe |
|
|
40
|
+
| Grok Build | Native v1 journal/summary, no synthetic user prefix | Bundled 1.0.5 / adapter 1.0.39 | Frozen HarnessAgent GLM probe |
|
|
41
|
+
|
|
42
|
+
Each new codec has a real zero-inference native-loader check, distinct from
|
|
43
|
+
codec/seed round trips. The 11-codec central binding check preserves user and
|
|
44
|
+
assistant text, call IDs/names/arguments and unbounded tool results. It does
|
|
45
|
+
not execute native preparation or inference. The older six-harness
|
|
46
|
+
[36-transfer cohort](../evidence/results-2026-10-03.md) remains historical
|
|
47
|
+
evidence under its own source freeze, not a new result for this candidate.
|
|
48
|
+
|
|
49
|
+
Live probes in [scripts/parity](../scripts/parity/README.md) use a preserved real
|
|
50
|
+
Claude Code session, withheld user/tool facts, a new native file write, matching
|
|
51
|
+
empty controls and native history readback. They require a clean pushed source
|
|
52
|
+
freeze, run sequentially and retain failed attempts. The
|
|
53
|
+
[measured results](../evidence/harness-parity-results-2026-10-05.md) preserve all
|
|
54
|
+
five cohorts. The final live run is 7/10, with three complete control/import
|
|
55
|
+
pairs; retained Cline readback and a localhost Grok control repair are separate
|
|
56
|
+
checks. Cursor remains offline-only.
|
|
57
|
+
|
|
58
|
+
## Native history versus adapter resume state
|
|
59
|
+
|
|
60
|
+
An adapter lifecycle envelope is not the native conversation. Grok's ACP
|
|
61
|
+
adapter creates `acpSessionId` and `coldSession` lazily on its first turn, so an
|
|
62
|
+
empty `createSession → stop` handle cannot resume an imported journal alone.
|
|
63
|
+
An offline localhost turn materializes adapter-owned configuration metadata;
|
|
64
|
+
the lab merges that metadata with the genuine empty handle and imported UUID,
|
|
65
|
+
then calls ordinary HarnessAgent resume. `onSession` installs the native files
|
|
66
|
+
before bridge startup. Captured provider input contains the original user,
|
|
67
|
+
calls, full tool results and assistant, followed by the new prompt.
|
|
68
|
+
|
|
69
|
+
This is a pinned prototype, not a general public adapter import API. The
|
|
70
|
+
template/configuration fingerprint must match. SDK conversion never invents
|
|
71
|
+
opaque adapter state or copies runtime credentials. Native history, managed
|
|
72
|
+
identity and adapter lifecycle metadata retain separate responsibilities.
|
|
73
|
+
|
|
74
|
+
Cursor keeps SQLite rows/blobs, not database page bytes. Deep Agents captures
|
|
75
|
+
decoded messages and checkpoint metadata, not all graph channels, pending
|
|
76
|
+
writes or arbitrary custom reducers. Its ACP importer requires unique message
|
|
77
|
+
IDs plus the native `acp_session`/cwd markers. No codec promises permissions,
|
|
78
|
+
provider caches, active approvals, workspace transfer or exactly-once effects.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Harness support and parity
|
|
2
|
+
|
|
3
|
+
Historical baseline at `104a013`. The [parity bootstrap](./harness-parity-bootstrap.md)
|
|
4
|
+
records the subsequent implementation; the original fingerprints and evidence
|
|
5
|
+
remain unchanged.
|
|
6
|
+
|
|
7
|
+
Verified 2026-10-05. This is an inventory of implementations and existing evidence,
|
|
8
|
+
not a new live compatibility test. Execution stays behind Vercel HarnessAgent.
|
|
9
|
+
|
|
10
|
+
| Surface | Harnesses | Meaning |
|
|
11
|
+
| --- | ---: | --- |
|
|
12
|
+
| Ledger / migrated Trajectories CLI | 16 | Discover, normalize and index native history |
|
|
13
|
+
| Trajectories session SDK | 6 | Read central snapshots and export another harness's native history |
|
|
14
|
+
| Vercel concrete harness adapters | 10 | A runtime-specific execution adapter exists upstream |
|
|
15
|
+
| Vercel adapters plus our OMP adapter | 11 | Initial execution/conversion parity target |
|
|
16
|
+
| Omakase's shared agent registry | 9 | Names recognized; adapters can still be unavailable |
|
|
17
|
+
| Current generated compiled import map | 6 | Adapters selected for inclusion when compiling this tree |
|
|
18
|
+
|
|
19
|
+
Counts are unique native runtimes. Generic ACP, the core HarnessAgent package,
|
|
20
|
+
ATIF (an interchange format), and the alternative Pi Durable backend are not
|
|
21
|
+
additional harnesses. Amp, Goose and Mastra are documented as coming soon at the
|
|
22
|
+
upstream checkpoint, with no concrete adapter package in that tree.
|
|
23
|
+
|
|
24
|
+
## Support matrix
|
|
25
|
+
|
|
26
|
+
`History` means the migrated CLI has a native reader/normalizer path. `Sessions`
|
|
27
|
+
means the SDK has both a reader and a native export writer. `Adapter` means a
|
|
28
|
+
concrete HarnessV1 implementation exists; it does not mean it is installed or
|
|
29
|
+
live-tested here. `Map` refers to the committed build-time map, not an inspected
|
|
30
|
+
deployed executable.
|
|
31
|
+
|
|
32
|
+
| Harness | History | Sessions | Adapter | Omakase registry | Map |
|
|
33
|
+
| --- | --- | --- | --- | --- | --- |
|
|
34
|
+
| Claude Code | Yes | Yes | Vercel | Yes | Yes |
|
|
35
|
+
| Codex | Yes | Yes | Vercel | Yes | Yes |
|
|
36
|
+
| Pi | Yes | Yes | Vercel | Yes | Yes |
|
|
37
|
+
| Oh My Pi | Yes | Yes | Ours | Yes | Yes |
|
|
38
|
+
| OpenCode | Yes | Yes | Vercel | Yes | Yes |
|
|
39
|
+
| Grok Build | Yes | Yes | Vercel | Yes | No |
|
|
40
|
+
| Cursor | Yes | No | Vercel | Yes | Yes |
|
|
41
|
+
| Deep Agents | Yes | No | Vercel | Yes | No |
|
|
42
|
+
| GitHub Copilot CLI | Yes | No | Vercel | No | No |
|
|
43
|
+
| Cline | No | No | Vercel | Yes | No |
|
|
44
|
+
| fx | No | No | Vercel | No | No |
|
|
45
|
+
| Hermes | Yes | No | None inventoried | No | No |
|
|
46
|
+
| Letta Code | Yes | No | None inventoried | No | No |
|
|
47
|
+
| OpenClaw | Yes | No | None inventoried | No | No |
|
|
48
|
+
| Factory Droid | Yes | No | None inventoried | No | No |
|
|
49
|
+
| OpenHands | Yes | No | None inventoried | No | No |
|
|
50
|
+
| Kimi CLI (wire format) | Yes | No | None inventoried | No | No |
|
|
51
|
+
| Gemini CLI | Yes | No | None inventoried | No | No |
|
|
52
|
+
|
|
53
|
+
Aliases must be normalized when comparing inventories: Ledger `grok` is SDK
|
|
54
|
+
`grok-build`; Ledger `copilot-cli` maps to the `harness-github-copilot` runtime;
|
|
55
|
+
Omakase `cursor-cli` maps to Ledger `cursor`. Kimi's inventoried reader handles
|
|
56
|
+
`wire.jsonl`; this does not establish compatibility with every Kimi Code release.
|
|
57
|
+
|
|
58
|
+
The union is **18 harnesses**: 16 history sources plus Cline and fx. Of the 11
|
|
59
|
+
execution implementations, nine have CLI history support and six have SDK
|
|
60
|
+
session conversion. CLI readers do not automatically become SDK readers: the
|
|
61
|
+
SDK's `Harness` union and converter are currently restricted to those six.
|
|
62
|
+
|
|
63
|
+
## Recommended parity scope
|
|
64
|
+
|
|
65
|
+
Make every available execution adapter eligible for central history conversion:
|
|
66
|
+
**11 harnesses first**. Keep archive/search support for the other seven. This
|
|
67
|
+
preserves HarnessAgent while giving Trajectories a clear, verifiable boundary.
|
|
68
|
+
|
|
69
|
+
1. Complete Omakase's existing six-harness path: Grok already has conversion
|
|
70
|
+
evidence, but its adapter is absent from the generated import map. Pin and
|
|
71
|
+
integrate it, then verify a real HarnessAgent handoff before claiming coverage.
|
|
72
|
+
2. Add SDK readers and writers for Cursor, Deep Agents and GitHub Copilot. Reuse
|
|
73
|
+
Ledger's decoding logic without pulling its Bun search/index engine into the
|
|
74
|
+
Node SDK. Deep Agents uses checkpoint storage; Cursor has native store formats,
|
|
75
|
+
so this requires active-context handling as well as emitting JSON.
|
|
76
|
+
3. Add history readers and native writers for Cline and fx. Cline is registered
|
|
77
|
+
but missing from the map; Copilot and fx also need registry and build integration.
|
|
78
|
+
4. Track history read, native export, execution availability and verified handoff
|
|
79
|
+
separately in a shared capability inventory. Derive the advertised switchable
|
|
80
|
+
set from their intersection. Keep adapter imports and execution out of the SDK.
|
|
81
|
+
|
|
82
|
+
The inventory in this change documents the gap. It does not implement those
|
|
83
|
+
adapters, a shared runtime registry, package upgrades or automatic service cutover.
|
|
84
|
+
Generic ACP can reduce execution-adapter work for compatible agents; it does not
|
|
85
|
+
create a native history reader or prove that an agent accepts imported history.
|
|
86
|
+
|
|
87
|
+
## Evidence and checkpoints
|
|
88
|
+
|
|
89
|
+
- Our implementation: `archeism/oh-my-ai` at
|
|
90
|
+
`f57b5b3bd6278261f10696b9207153e93e9bc9c1`, research branch. These new packages
|
|
91
|
+
and results must not be represented as already merged to main or published.
|
|
92
|
+
- Original Ledger main and port attribution:
|
|
93
|
+
[`43081aef`](https://github.com/archeism/ledger/blob/43081aef54c23b4bd017b6c0e11fc42a9a1cb381/packages/core/src/scanner.ts).
|
|
94
|
+
Its scanner and the migrated scanner expose the same 16 source names.
|
|
95
|
+
- Vercel main:
|
|
96
|
+
[`7c41e416` adapter documentation](https://github.com/vercel/ai/blob/7c41e416b6d5ca630cc5f72b330e6c4743f82265/content/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx).
|
|
97
|
+
The frozen Git tree contains ten concrete adapter package manifests and one
|
|
98
|
+
generic ACP manifest, in addition to the core harness package.
|
|
99
|
+
- Local sources: [SDK types](../src/types.ts), [CLI scanner](../legacy/src/scanner.ts),
|
|
100
|
+
[registry](../../agents/src/harness-registry.mjs), and
|
|
101
|
+
[generated map](../../agents/src/harness-import-map.generated.mjs).
|
|
102
|
+
- Prior live evidence: [36/36 transfers across the six SDK harnesses](../evidence/results-2026-10-03.md).
|
|
103
|
+
This tested native CLI history continuation, not every HarnessAgent adapter or
|
|
104
|
+
arbitrary branches, compaction, in-flight tools, approvals or native state.
|
|
105
|
+
- [Machine-readable audit](../evidence/harness-support-2026-10-05.json) preserves
|
|
106
|
+
source identities, derived sets and independent review. No new model runs or
|
|
107
|
+
GitHub Actions were requested for this source inventory. Skills remain unchanged.
|