@diffexai/diffex 0.2.1 → 0.2.3

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +5 -725
  3. package/THIRD-PARTY-NOTICES.txt +6 -2
  4. package/dist/AGENTS.md +28 -0
  5. package/dist/cli/session-selection.d.ts +7 -0
  6. package/dist/cli/session-selection.js +181 -0
  7. package/dist/config.d.ts +2 -0
  8. package/dist/config.js +2 -0
  9. package/dist/core/extensions/factory.d.ts +21 -0
  10. package/dist/core/extensions/factory.js +254 -0
  11. package/dist/core/extensions/loader.d.ts +2 -10
  12. package/dist/core/extensions/loader.js +2 -251
  13. package/dist/core/prompt-templates.js +6 -1
  14. package/dist/core/resource-loader.js +7 -2
  15. package/dist/core/system-prompt.js +9 -8
  16. package/dist/core/tools/subagents.js +1 -0
  17. package/dist/main.js +3 -176
  18. package/dist/node_modules/@diffexai/diffex-agent-core/THIRD-PARTY-NOTICES.txt +6 -2
  19. package/dist/node_modules/@diffexai/diffex-agent-core/distribution-components.json +4 -4
  20. package/dist/node_modules/@diffexai/diffex-agent-core/distribution-files.json +1 -1
  21. package/dist/node_modules/@diffexai/diffex-agent-core/package.json +1 -6
  22. package/dist/node_modules/@diffexai/diffex-ai/THIRD-PARTY-NOTICES.txt +6 -2
  23. package/dist/node_modules/@diffexai/diffex-ai/dist/cli.js +0 -0
  24. package/dist/node_modules/@diffexai/diffex-ai/dist/image-models.generated.d.ts +180 -0
  25. package/dist/node_modules/@diffexai/diffex-ai/dist/image-models.generated.js +182 -2
  26. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/.manifest.json +1 -1
  27. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/kimi-coding.json +1 -1
  28. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/nvidia.json +1 -1
  29. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/openrouter.json +1 -1
  30. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
  31. package/dist/node_modules/@diffexai/diffex-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  32. package/dist/node_modules/@diffexai/diffex-ai/distribution-components.json +3 -3
  33. package/dist/node_modules/@diffexai/diffex-ai/distribution-files.json +9 -9
  34. package/dist/node_modules/@diffexai/diffex-ai/package.json +1 -6
  35. package/dist/node_modules/@diffexai/diffex-client/THIRD-PARTY-NOTICES.txt +6 -2
  36. package/dist/node_modules/@diffexai/diffex-client/distribution-components.json +3 -3
  37. package/dist/node_modules/@diffexai/diffex-client/distribution-files.json +1 -1
  38. package/dist/node_modules/@diffexai/diffex-client/package.json +1 -6
  39. package/dist/node_modules/@diffexai/diffex-harness-state/THIRD-PARTY-NOTICES.txt +6 -2
  40. package/dist/node_modules/@diffexai/diffex-harness-state/distribution-components.json +2 -2
  41. package/dist/node_modules/@diffexai/diffex-harness-state/distribution-files.json +1 -1
  42. package/dist/node_modules/@diffexai/diffex-harness-state/package.json +1 -6
  43. package/dist/node_modules/@diffexai/diffex-protocol/THIRD-PARTY-NOTICES.txt +6 -2
  44. package/dist/node_modules/@diffexai/diffex-protocol/distribution-components.json +2 -2
  45. package/dist/node_modules/@diffexai/diffex-protocol/distribution-files.json +1 -1
  46. package/dist/node_modules/@diffexai/diffex-protocol/package.json +1 -6
  47. package/dist/node_modules/@diffexai/diffex-telemetry/THIRD-PARTY-NOTICES.txt +6 -2
  48. package/dist/node_modules/@diffexai/diffex-telemetry/distribution-components.json +2 -2
  49. package/dist/node_modules/@diffexai/diffex-telemetry/distribution-files.json +1 -1
  50. package/dist/node_modules/@diffexai/diffex-telemetry/package.json +1 -6
  51. package/dist/node_modules/@diffexai/diffex-tui/THIRD-PARTY-NOTICES.txt +6 -2
  52. package/dist/node_modules/@diffexai/diffex-tui/distribution-components.json +2 -2
  53. package/dist/node_modules/@diffexai/diffex-tui/distribution-files.json +1 -1
  54. package/dist/node_modules/@diffexai/diffex-tui/package.json +1 -6
  55. package/distribution-components.json +13 -13
  56. package/distribution-files.json +66 -74
  57. package/docs/installation.md +118 -0
  58. package/docs/quickstart.md +7 -24
  59. package/docs/usage.md +10 -4
  60. package/npm-shrinkwrap.json +2 -2
  61. package/package.json +36 -10
  62. package/release/distribution-manifest.json +7 -6
  63. package/release/install-package-lock.json +5 -5
  64. package/release/install-package.json +2 -2
  65. package/NOTICE +0 -6
  66. package/dist/node_modules/@diffexai/diffex-agent-core/NOTICE +0 -6
  67. package/dist/node_modules/@diffexai/diffex-ai/NOTICE +0 -6
  68. package/dist/node_modules/@diffexai/diffex-client/NOTICE +0 -6
  69. package/dist/node_modules/@diffexai/diffex-harness-state/NOTICE +0 -6
  70. package/dist/node_modules/@diffexai/diffex-protocol/NOTICE +0 -6
  71. package/dist/node_modules/@diffexai/diffex-telemetry/NOTICE +0 -6
  72. package/dist/node_modules/@diffexai/diffex-tui/NOTICE +0 -6
  73. package/docs/development.md +0 -71
  74. package/docs/docs.json +0 -160
  75. package/docs/images/doom-extension.png +0 -0
  76. package/docs/images/exy.png +0 -0
  77. package/docs/index.md +0 -78
  78. package/docs/invocation-traces.md +0 -82
  79. package/docs/termux.md +0 -127
  80. package/docs/windows.md +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diffexai/diffex",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Coding agent CLI with read, bash, edit, write, update_plan tools and session management",
5
5
  "type": "module",
6
6
  "imports": {
@@ -8,7 +8,8 @@
8
8
  "#harness-trace": "./dist/vendor/harness-trace/index.js"
9
9
  },
10
10
  "diffexConfig": {
11
- "configDir": ".diffex"
11
+ "configDir": ".diffex",
12
+ "production": true
12
13
  },
13
14
  "bin": {
14
15
  "diffex": "dist/cli.js"
@@ -30,11 +31,40 @@
30
31
  },
31
32
  "files": [
32
33
  "dist",
33
- "docs",
34
+ "docs/compaction.md",
35
+ "docs/containerization.md",
36
+ "docs/custom-provider.md",
37
+ "docs/environment-variables.md",
38
+ "docs/evolution.md",
39
+ "docs/extensions.md",
40
+ "docs/installation.md",
41
+ "docs/json.md",
42
+ "docs/keybindings.md",
43
+ "docs/llama-cpp.md",
44
+ "docs/models.md",
45
+ "docs/packages.md",
46
+ "docs/prompt-templates.md",
47
+ "docs/providers.md",
48
+ "docs/quickstart.md",
49
+ "docs/rpc.md",
50
+ "docs/sdk.md",
51
+ "docs/security.md",
52
+ "docs/session-format.md",
53
+ "docs/sessions.md",
54
+ "docs/settings.md",
55
+ "docs/shell-aliases.md",
56
+ "docs/skills.md",
57
+ "docs/terminal-setup.md",
58
+ "docs/themes.md",
59
+ "docs/tmux.md",
60
+ "docs/tui.md",
61
+ "docs/usage.md",
62
+ "docs/images/interactive-mode.png",
63
+ "docs/images/tree-view.png",
64
+ "README.md",
34
65
  "CHANGELOG.md",
35
66
  "npm-shrinkwrap.json",
36
67
  "LICENSE",
37
- "NOTICE",
38
68
  "THIRD-PARTY-NOTICES.txt",
39
69
  "distribution-components.json",
40
70
  "distribution-files.json",
@@ -91,12 +121,8 @@
91
121
  ],
92
122
  "author": "Mario Zechner",
93
123
  "license": "Apache-2.0",
94
- "repository": {
95
- "type": "git",
96
- "url": "git+https://github.com/diffexai/diffex.git",
97
- "directory": "packages/coding-agent"
98
- },
99
124
  "engines": {
100
125
  "node": ">=22.19.0"
101
- }
126
+ },
127
+ "homepage": "https://diffex.ai/"
102
128
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "source": {
5
5
  "repository": "diffexai/diffex",
6
- "commit": "f2a661684af35fe6e9a3209c6f9720144e1fd423",
6
+ "commit": "a9a2beea7798edd34c62e836d73a0d50b6260950",
7
7
  "visibility": "private"
8
8
  },
9
9
  "disclosurePolicy": {
@@ -43,7 +43,7 @@
43
43
  "HTML export templates and their reviewed marked/highlight.js bundles",
44
44
  "runtime theme and model JSON",
45
45
  "SQLite migration SQL",
46
- "documentation including inline examples",
46
+ "user-facing documentation explicitly listed in scripts/distribution-docs.json",
47
47
  "Diffex-owned TUI native prebuilds using system APIs"
48
48
  ],
49
49
  "publicHosting": "npmjs",
@@ -63,13 +63,14 @@
63
63
  "protocol",
64
64
  "telemetry",
65
65
  "tui"
66
- ]
66
+ ],
67
+ "developmentDocumentation": "exclude from all distribution artifacts, including bootstrap and hosted runtime; keep private development records in the source repository"
67
68
  },
68
69
  "packages": [
69
70
  {
70
71
  "name": "@diffexai/diffex",
71
- "version": "0.2.1",
72
- "tarball": "https://registry.npmjs.org/@diffexai/diffex/-/diffex-0.2.1.tgz"
72
+ "version": "0.2.3",
73
+ "tarball": "https://registry.npmjs.org/@diffexai/diffex/-/diffex-0.2.3.tgz"
73
74
  }
74
75
  ],
75
76
  "binaryPlatforms": [],
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@diffexai/diffex-coding-agent-install",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@diffexai/diffex-coding-agent-install",
9
- "version": "0.2.1",
9
+ "version": "0.2.3",
10
10
  "dependencies": {
11
- "@diffexai/diffex": "0.2.1"
11
+ "@diffexai/diffex": "0.2.3"
12
12
  },
13
13
  "engines": {
14
14
  "node": ">=22.19.0"
@@ -450,8 +450,8 @@
450
450
  }
451
451
  },
452
452
  "node_modules/@diffexai/diffex": {
453
- "version": "0.2.1",
454
- "resolved": "https://registry.npmjs.org/@diffexai/diffex/-/diffex-0.2.1.tgz",
453
+ "version": "0.2.3",
454
+ "resolved": "https://registry.npmjs.org/@diffexai/diffex/-/diffex-0.2.3.tgz",
455
455
  "license": "Apache-2.0",
456
456
  "dependencies": {
457
457
  "@anthropic-ai/sdk": "0.91.1",
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@diffexai/diffex-coding-agent-install",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "private": true,
5
5
  "description": "Lockfile root used by the Diffex installer and updater.",
6
6
  "dependencies": {
7
- "@diffexai/diffex": "0.2.1"
7
+ "@diffexai/diffex": "0.2.3"
8
8
  },
9
9
  "overrides": {
10
10
  "protobufjs": "7.6.5",
package/NOTICE DELETED
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,6 +0,0 @@
1
- Diffex
2
- Copyright 2026 Luntraa, Inc.
3
-
4
- Where this distribution contains Pi Agent Harness-derived portions,
5
- those portions retain their MIT terms and copyright notice in LICENSE.
6
- The Apache-2.0 package declaration does not replace third-party terms.
@@ -1,71 +0,0 @@
1
- # Development
2
-
3
- See [AGENTS.md](https://github.com/diffexai/diffex/blob/main/AGENTS.md) for additional guidelines.
4
-
5
- ## Setup
6
-
7
- ```bash
8
- git clone https://github.com/diffexai/diffex
9
- cd diffex
10
- npm install
11
- npm run build
12
- ```
13
-
14
- Run from source:
15
-
16
- ```bash
17
- /path/to/diffex/diffex-test.sh
18
- ```
19
-
20
- The script can be run from any directory. Diffex keeps the caller's current working directory.
21
-
22
- ## Forking / Rebranding
23
-
24
- Configure via `package.json`:
25
-
26
- ```json
27
- {
28
- "diffexConfig": {
29
- "name": "diffex",
30
- "configDir": ".diffex"
31
- }
32
- }
33
- ```
34
-
35
- Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, config paths, and environment variable names.
36
-
37
- ## Path Resolution
38
-
39
- Three execution modes: npm install, standalone binary, tsx from source.
40
-
41
- **Always use `src/config.ts`** for package assets:
42
-
43
- ```typescript
44
- import { getPackageDir, getThemeDir } from "./config.js";
45
- ```
46
-
47
- Never use `__dirname` directly for package assets.
48
-
49
- ## Debug Command
50
-
51
- `/debug` (hidden) writes to `~/.diffex/agent/diffex-debug.log`:
52
- - Rendered TUI lines with ANSI codes
53
- - Last messages sent to the LLM
54
-
55
- ## Testing
56
-
57
- ```bash
58
- ./test.sh # Run non-LLM tests (no API keys needed)
59
- npm test # Run all tests
60
- npm test -- test/specific.test.ts # Run specific test
61
- ```
62
-
63
- ## Project Structure
64
-
65
- ```
66
- packages/
67
- ai/ # LLM provider abstraction
68
- agent/ # Agent loop and message types
69
- tui/ # Terminal UI components
70
- coding-agent/ # CLI and interactive mode
71
- ```
package/docs/docs.json DELETED
@@ -1,160 +0,0 @@
1
- {
2
- "navigation": [
3
- {
4
- "title": "Start here",
5
- "items": [
6
- {
7
- "title": "Overview",
8
- "path": "index.md"
9
- },
10
- {
11
- "title": "Quickstart",
12
- "path": "quickstart.md"
13
- },
14
- {
15
- "title": "Using Diffex",
16
- "path": "usage.md"
17
- },
18
- {
19
- "title": "Providers",
20
- "path": "providers.md"
21
- },
22
- {
23
- "title": "Security",
24
- "path": "security.md"
25
- },
26
- {
27
- "title": "Containerization",
28
- "path": "containerization.md"
29
- },
30
- {
31
- "title": "Settings",
32
- "path": "settings.md"
33
- },
34
- {
35
- "title": "Harness Evolution",
36
- "path": "evolution.md"
37
- },
38
- {
39
- "title": "Keybindings",
40
- "path": "keybindings.md"
41
- },
42
- {
43
- "title": "Sessions",
44
- "path": "sessions.md"
45
- },
46
- {
47
- "title": "Compaction",
48
- "path": "compaction.md"
49
- }
50
- ]
51
- },
52
- {
53
- "title": "Customization",
54
- "items": [
55
- {
56
- "title": "Extensions",
57
- "path": "extensions.md"
58
- },
59
- {
60
- "title": "Skills",
61
- "path": "skills.md"
62
- },
63
- {
64
- "title": "Prompt Templates",
65
- "path": "prompt-templates.md"
66
- },
67
- {
68
- "title": "Themes",
69
- "path": "themes.md"
70
- },
71
- {
72
- "title": "Diffex Packages",
73
- "path": "packages.md"
74
- },
75
- {
76
- "title": "Custom Models",
77
- "path": "models.md"
78
- },
79
- {
80
- "title": "Custom Providers",
81
- "path": "custom-provider.md"
82
- }
83
- ]
84
- },
85
- {
86
- "title": "Reference",
87
- "items": [
88
- {
89
- "title": "Session Format",
90
- "path": "session-format.md"
91
- }
92
- ]
93
- },
94
- {
95
- "title": "Programmatic Usage",
96
- "items": [
97
- {
98
- "title": "SDK",
99
- "path": "sdk.md"
100
- },
101
- {
102
- "title": "RPC Mode",
103
- "path": "rpc.md"
104
- },
105
- {
106
- "title": "JSON Event Stream Mode",
107
- "path": "json.md"
108
- },
109
- {
110
- "title": "TUI Components",
111
- "path": "tui.md"
112
- }
113
- ]
114
- },
115
- {
116
- "title": "Platform Setup",
117
- "items": [
118
- {
119
- "title": "Windows",
120
- "path": "windows.md"
121
- },
122
- {
123
- "title": "Termux on Android",
124
- "path": "termux.md"
125
- },
126
- {
127
- "title": "tmux",
128
- "path": "tmux.md"
129
- },
130
- {
131
- "title": "Terminal Setup",
132
- "path": "terminal-setup.md"
133
- },
134
- {
135
- "title": "Shell Aliases",
136
- "path": "shell-aliases.md"
137
- }
138
- ]
139
- },
140
- {
141
- "title": "Development",
142
- "items": [
143
- {
144
- "title": "Development",
145
- "path": "development.md"
146
- }
147
- ]
148
- }
149
- ],
150
- "redirects": [
151
- {
152
- "from": "session.md",
153
- "to": "session-format.md"
154
- },
155
- {
156
- "from": "tree.md",
157
- "to": "sessions.md"
158
- }
159
- ]
160
- }
Binary file
Binary file
package/docs/index.md DELETED
@@ -1,78 +0,0 @@
1
- # Diffex Documentation
2
-
3
- Diffex is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and Diffex packages.
4
-
5
- ## Quick start
6
-
7
- Install Diffex with npm:
8
-
9
- ```bash
10
- npm install -g --ignore-scripts @diffexai/diffex
11
- ```
12
-
13
- `--ignore-scripts` disables dependency lifecycle scripts during install. Diffex does not require install scripts for normal npm installs.
14
-
15
- To uninstall Diffex, use the matching package manager. For npm installs:
16
-
17
- ```bash
18
- npm uninstall -g @diffexai/diffex
19
- ```
20
-
21
- For pnpm, Yarn, or Bun installs, use the matching global remove command: `pnpm remove -g @diffexai/diffex`, `yarn global remove @diffexai/diffex`, or `bun uninstall -g @diffexai/diffex`.
22
-
23
- Then run it in a project directory:
24
-
25
- ```bash
26
- diffex
27
- ```
28
-
29
- Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting Diffex.
30
-
31
- For the full first-run flow, see [Quickstart](quickstart.md).
32
-
33
- ## Start here
34
-
35
- - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
36
- - [Using Diffex](usage.md) - interactive mode, slash commands, context files, and CLI reference.
37
- - [Providers](providers.md) - subscription and API-key setup for built-in providers.
38
- - [llama.cpp](llama-cpp.md) - run a local router and manage models with `/llama`.
39
- - [Security](security.md) - project trust, sandbox boundaries, and vulnerability reporting.
40
- - [Containerization](containerization.md) - sandbox Diffex with Docker or OpenShell.
41
- - [Settings](settings.md) - global and project settings.
42
- - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
43
- - [Sessions](sessions.md) - session management, branching, and tree navigation.
44
- - [Compaction](compaction.md) - context compaction and branch summarization.
45
-
46
- ## Customization
47
-
48
- - [Extensions](extensions.md) - TypeScript modules for tools, commands, events, and custom UI.
49
- - [Skills](skills.md) - Agent Skills for reusable on-demand capabilities.
50
- - [Prompt templates](prompt-templates.md) - reusable prompts that expand from slash commands.
51
- - [Themes](themes.md) - built-in and custom terminal themes.
52
- - [Diffex packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
53
- - [Custom models](models.md) - add model entries for supported provider APIs.
54
- - [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
55
-
56
- ## Programmatic usage
57
-
58
- - [SDK](sdk.md) - embed Diffex in Node.js applications.
59
- - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
60
- - [JSON event stream mode](json.md) - print mode with structured events.
61
- - [TUI components](tui.md) - build custom terminal UI for extensions.
62
-
63
- ## Reference
64
-
65
- - [Environment variables](environment-variables.md) - Diffex process configuration and session metadata available to bash tools.
66
- - [Session format](session-format.md) - JSONL session file format, entry types, and SessionManager API.
67
-
68
- ## Platform setup
69
-
70
- - [Windows](windows.md)
71
- - [Termux on Android](termux.md)
72
- - [tmux](tmux.md)
73
- - [Terminal setup](terminal-setup.md)
74
- - [Shell aliases](shell-aliases.md)
75
-
76
- ## Development
77
-
78
- - [Development](development.md) - local setup, project structure, and debugging.
@@ -1,82 +0,0 @@
1
- # Invocation Traces
2
-
3
- Diffex creates immutable invocation trace intervals for each CLI process whose initial session is persisted.
4
- An interval closes as soon as its operations settle, so a running peer can discover completed evidence without reading a trace that is still changing.
5
- Concurrent operations in one process share an interval until every operation in that interval settles.
6
- Ephemeral commands such as `--no-session`, `--help`, and `--list-models` do not create traces.
7
-
8
- Trace creation is passive.
9
- If the trace file cannot be created, Diffex prints one warning and continues without durable telemetry.
10
-
11
- ## Storage and Discovery
12
-
13
- Trace files are stored in `~/.diffex/agent/evolution-workspaces/<workspace-id>/traces/` by default, or under the corresponding workspace directory beneath `DIFFEX_CODING_AGENT_DIR`.
14
- Each file is named `<UTC timestamp>_<trace ID>.jsonl`.
15
- A long-running process can create multiple files as successive operations settle.
16
- The trace directory is restricted to the current user with mode `0700`, and each trace file uses mode `0600` on POSIX systems.
17
-
18
- Tools can discover a workspace's traces by scanning its trace directory for `.jsonl` files and validating them with the harness trace reader. Trace directories are intentionally separate: sessions in the same workspace contribute to the same evidence stream, while another workspace has independent invocation ordering, reported token totals, and evolution jobs.
19
- The trace header identifies the producing Diffex build and runtime.
20
- Session attachment records identify every referenced session ID, path, format, and transition reason.
21
-
22
- ## Retention and Session Changes
23
-
24
- Traces are retained until the user explicitly removes them.
25
- Diffex does not currently apply an automatic age or size limit.
26
-
27
- Deleting a session does not delete its traces.
28
- Moving or renaming a session does not rewrite existing trace references.
29
- This preserves invocation evidence while allowing readers to report that referenced session content is missing or moved.
30
-
31
- Trace files contain execution telemetry and immutable session entry references, not duplicated transcript content.
32
-
33
- ## Evidence Ownership
34
-
35
- Each fact has one authoritative source so a trace remains compact and materialization does not create competing copies.
36
-
37
- | Source | Authoritative facts | Materialized form |
38
- | --- | --- | --- |
39
- | Coding-agent v3 session JSONL | Messages, assistant tool calls, tool results, message usage, model and thinking changes, compaction and branch summaries, custom extension entries, labels, and session metadata | `session_item` evidence selected by entry ordinal, entry ID, and digest |
40
- | AgentHarness session JSONL | Durable entries, operation admission and settlement, abort requests, retry attempts, tool admission, queue changes, deferred writes, usage, lane pointers, and session facts | `session_item` evidence selected by durable session sequence |
41
- | Agent and AI telemetry spans | Agent runs, turns, logical provider requests, provider outcomes, tool execution outcomes, usage, and causal invocation, turn, request, and tool-call identifiers | Consolidated `span` evidence |
42
- | Coding-agent and extension telemetry spans | User-visible operations, retries and sleeps, extension hook outcomes, subagent coordination, terminal commands, external artifact references, and runtime diagnostics | Consolidated `span` evidence |
43
- | Trace lifecycle records | Producer identity, session bindings, harness activation, session segments, trace writer degradation, and completed, failed, or aborted interval termination | `trace_record` evidence and document diagnostics |
44
- | Missing trace footer | A process that did not close its active interval orderly | A `crashed` materialized termination status with a missing-footer diagnostic |
45
-
46
- Agent and extension events remain live notification APIs.
47
- Their durable facts are represented by the owning session entry, session record, or telemetry span listed above rather than by copying event payloads into the trace.
48
-
49
- Prompt and queue operation spans record one event per immutable skill identity for these observable facts:
50
-
51
- - `diffex.skill.available`: the installed or evolved version was available when the request was admitted
52
- - `diffex.skill.listed`: the version appeared in the system prompt sent to the model
53
- - `diffex.skill.selected`: an automatic selector returned the version, when such a selector is used
54
- - `diffex.skill.explicitly_referenced`: the admitted user request contained its versioned reference
55
- - `diffex.skill.force_loaded`: a `/skills` reference expanded its captured content into the request
56
- - `diffex.skill.read`: the model-callable `read` tool successfully read content whose path and digest match the catalog version
57
-
58
- Each event includes the skill ID, version, content digest, source kind, source, scope, and, when configured, the active workspace identity and applicable skill and active harness revisions. Prompt spans carry the top-level task-lineage identifier, and queue spans admitted during a task remain nested beneath that prompt; retries, tool calls, subagents, and repeated reads therefore remain observable within the same top-level lineage. Tool results and terminal operation outcomes remain independent evidence. Traces never emit an inferred `used` event or treat listing, selection, loading, reading, or co-occurrence as proof that a skill caused an outcome.
59
-
60
- Startup and configuration failures are recorded as runtime diagnostic spans after trace creation.
61
- Failures that prevent trace creation remain an explicit limitation because no durable trace destination exists.
62
-
63
- ## Materialization
64
-
65
- `materializeJsonlInvocation()` reads and validates a trace, resolves every referenced session binding, verifies each segment boundary, and returns a versioned `MaterializedInvocation` document.
66
- The optional session path resolver can locate a session that moved after the trace was written while preserving both its recorded and resolved paths.
67
-
68
- Coding-agent v3 content digests are SHA-256 hashes of `JSON.stringify(entry)`.
69
- Prefix digests are SHA-256 hashes of the LF-framed canonical entry JSON from the first non-header entry through the referenced entry.
70
- AgentHarness segments use inclusive durable session sequence bounds.
71
-
72
- The materializer embeds only session items referenced by trace segments.
73
- It preserves message and tool payloads exactly as stored in the session, combines span starts, events, and settlements, and retains every contributing trace record ID, span ID, session binding ID, session entry ID, and session sequence.
74
-
75
- Evidence is ordered deterministically by trace sequence, session cursor, timestamp, span parentage, and causal identifiers.
76
- Session cursor order is durable inside a segment, but the document reports ordering ambiguity when clocks and segment boundaries cannot establish a total order with trace records.
77
-
78
- Missing, changed, truncated, or incompatible session data produces diagnostics without discarding valid trace records or earlier session evidence.
79
- Writer-degraded and crashed traces likewise produce partial documents instead of failing materialization.
80
-
81
- `serializeMaterializedInvocation()` emits stable, indented JSON with a trailing newline for storage or bounded LLM analysis.
82
- The materialized document contains evidence only and does not include extracted claims, evolution proposals, approval state, or behavior mutations.