@reasontrail/cli 0.1.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 ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ ## 0.1.2 - 2026-09-20
4
+
5
+ - Recovers automatic Codex Conversation synchronization with durable native
6
+ session identity, idempotent cursors, compaction continuity, and honest
7
+ transcript-coverage reporting for manual "update my brain" flushes.
8
+ - Synchronizes repository Markdown into revision-aware Resources with immutable
9
+ history and separate source, introducer, and sync-actor provenance across
10
+ multiple users.
11
+ - Installs, enables, starts, verifies, and observes the managed capture service,
12
+ including heartbeat, retained failure, and retry status.
13
+ - Adds read-only Conversation and repository Resource previews plus the natural-
14
+ language preview, capture, retrieval, task, and exclusion vocabulary without
15
+ changing reviewed-memory governance.
16
+ - Ships Runtime `0.3.3`, which substitutes exact-revision, current reviewed
17
+ context for redundant Codex repository discovery while preserving normal
18
+ validation, provenance, and contradiction fallback behavior.
19
+ - Keeps managed capture healthy when a legacy Conversation needs manual
20
+ reconciliation: each conflicting session is quarantined without advancing its
21
+ cursor while unrelated Conversations and repository Resources continue.
22
+ - Preserves native sessions larger than the server's 200-turn request bound by
23
+ synchronizing and reconciling the complete visible transcript in ordered,
24
+ idempotent chunks; it does not truncate long conversations.
25
+
26
+ This release keeps Runtime protocol `3` unchanged.
27
+
28
+ ## 0.1.1 - 2026-09-13
29
+
30
+ - Ships the production-proven ReasonTrail Runtime `0.3.2` using protocol `3`.
31
+ - Accepts the canonical `reasontrail.worker-result.v1` file-change vocabulary
32
+ (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`) and normalizes the reviewed legacy
33
+ aliases emitted by coding providers before submission.
34
+ - Supports lockfile-bound dependency preparation in disposable Git workspaces,
35
+ with explicit public-network authorization and Linux Bubblewrap containment.
36
+ - Documents the current hosted endpoint, device login, Runtime lifecycle,
37
+ Mission evidence/review path, human gates, upgrades, and clean uninstall.
38
+
39
+ This release does not include unrelated Conversation or provider-usage fixes.
package/README.md CHANGED
@@ -1,140 +1,204 @@
1
1
  # ReasonTrail CLI and Mission Runtime
2
2
 
3
- The official command-line interface and execution runtime for [ReasonTrail](https://reasontrail.ai) — shared project memory and autonomous Mission Control.
3
+ The official command-line interface and execution runtime for
4
+ [ReasonTrail](https://reasontrail.ai): shared project memory and supervised
5
+ Mission execution.
4
6
 
5
- ## Installation
7
+ `@reasontrail/cli` is the only public ReasonTrail npm package. It contains the
8
+ `reasontrail` CLI and a self-contained ReasonTrail Runtime; there is no separate
9
+ runtime package or download.
10
+
11
+ ## Install and verify
12
+
13
+ Requirements: Node.js 20 or newer.
6
14
 
7
15
  ```bash
8
- npm install -g @reasontrail/cli
16
+ npm install -g @reasontrail/cli@latest
17
+ reasontrail --version
18
+ reasontrail --help
9
19
  ```
10
20
 
11
- Requirements: Node.js 20 or higher.
21
+ CLI release `0.1.2` includes ReasonTrail Runtime `0.3.3`, protocol `3`.
22
+
23
+ ## Connect to hosted ReasonTrail
12
24
 
13
- ## Getting Started
25
+ Configure the named production profile, then use device login:
14
26
 
15
- ### 1. Install
16
27
  ```bash
17
- npm install -g @reasontrail/cli
28
+ reasontrail config endpoint https://app.reasontrail.ai/api/mcp --profile production
29
+ reasontrail auth login --device --profile production
30
+ reasontrail status --profile production
18
31
  ```
19
32
 
20
- ### 2. Configure a named profile
33
+ Device login prints a short-lived browser link and code. Sign in, approve the
34
+ displayed project permissions, and return to the terminal. The CLI stores the
35
+ issued credential in the system credential store or its owner-only profile
36
+ directory. Do not put credentials in command arguments, transcripts, or Git.
37
+
38
+ Every server-capable production command requires `--profile production`.
39
+ Interactive commands ask you to type `PRODUCTION`; noninteractive commands also
40
+ require the narrow `--confirm-production` flag.
41
+
42
+ From the Git checkout associated with your ReasonTrail project, bind and verify
43
+ it:
44
+
21
45
  ```bash
22
- reasontrail config endpoint http://127.0.0.1:3000/api/mcp --profile development
46
+ reasontrail . --project your-project --profile production
47
+ reasontrail status --profile production
23
48
  ```
24
49
 
25
- ReasonTrail never chooses a server implicitly. Development accepts HTTP(S) loopback
26
- endpoints only (including IPv6 loopback). Production is a separate profile and must use
27
- `https://app.reasontrail.ai/api/mcp`.
28
-
29
- ### 3. Login
50
+ ## Project memory commands
30
51
 
31
52
  ```bash
32
- reasontrail auth login --profile development
53
+ reasontrail search --query "migration decisions" --profile production
54
+ reasontrail context --request "Continue the current task" --profile production
55
+ reasontrail context --request "Inspect repository evidence" --deep --profile production
33
56
  ```
34
57
 
35
- Credentials are stored per profile in the system credential store or under
36
- `~/.config/reasontrail/profiles/<profile>/credentials.json` with mode `0600`.
37
- Legacy unprofiled credentials are not loaded.
58
+ Use `reasontrail update --profile production` with a structured reviewed outcome
59
+ on standard input to submit discoveries and task outcomes to the Brain.
60
+
61
+ ## Capture conversations and repository memory
62
+
63
+ Preview visible Codex turns or repository Markdown reconciliation before any
64
+ write:
38
65
 
39
- ### 4. Connect your repository
40
66
  ```bash
41
- cd my-project
42
- reasontrail . --profile development
67
+ reasontrail sync codex --profile production --project your-project --session <session-id>
68
+ reasontrail sync docs --profile production --project your-project
43
69
  ```
44
- Binds the current Git repository only inside the selected profile.
45
70
 
46
- ### 5. Configure your AI assistants
71
+ Add `--apply` only for an intentional synchronization. Manual session flush and
72
+ automatic capture use the same source identity, message keys, durable cursor,
73
+ and governed proposal path. A summary can succeed independently from transcript
74
+ coverage; inspect the reported source checkpoint and coverage instead of
75
+ inferring success from a zero accepted-turn count.
76
+
77
+ Install ongoing automatic capture only after the profile and project binding are
78
+ confirmed:
79
+
47
80
  ```bash
48
- reasontrail setup --profile development
81
+ reasontrail sync service install --profile production --project your-project --interval 60 --confirm-production
82
+ reasontrail sync service status --profile production --project your-project
49
83
  ```
50
- Setup installs supported skills but does not generate MCP configuration containing
51
- inline credentials. Claude transcript hooks are off by default; enable them only
52
- for development with `--enable-hooks`.
53
84
 
54
- ### 6. Verify setup
85
+ Installation enables, starts, and verifies the systemd user service or macOS
86
+ LaunchAgent. Status distinguishes installed/enabled/active manager state from
87
+ heartbeat health, last attempt, last success, and last error. A failed cycle
88
+ retains its error and retries. A legacy Conversation with conflicting stable
89
+ message ids is quarantined for manual review without advancing its cursor or
90
+ blocking healthy Conversation and Resource capture. `status`, `context`, and
91
+ `doctor` never synchronize transcripts implicitly. Long native sessions are
92
+ sent and reconciled in bounded 200-turn requests while retaining one source
93
+ identity, checkpoint, and durable cursor; the visible transcript is not
94
+ truncated to fit the per-request limit.
95
+
96
+ ## Mission Runtime
97
+
98
+ The Runtime runs on the workstation or build server that owns the repository. It
99
+ connects outbound to ReasonTrail over HTTPS, creates a disposable Git workspace,
100
+ prepares lockfile-bound dependencies under the selected network policy, invokes
101
+ the configured coding agent, and returns structured results and evidence. It
102
+ does not open an inbound port or expose an arbitrary remote-command endpoint.
103
+
104
+ Create a Runtime under **Settings → Execution Infrastructure**, choose the
105
+ project and machine-local repository path, then copy the generated enrollment
106
+ command. Its production form is:
107
+
55
108
  ```bash
56
- reasontrail status --profile development
109
+ reasontrail runtime enroll \
110
+ --profile production \
111
+ --url https://app.reasontrail.ai \
112
+ --token <runtime-token> \
113
+ --execution-root <separate-private-directory> \
114
+ --workspace <generated-project-id>=<local-repository-path>
115
+
116
+ reasontrail runtime start --profile production
57
117
  ```
58
- Verifies backend connection, authentication, repository binding, and project context availability.
59
118
 
60
- ---
119
+ The generated command supplies the opaque project id; users do not look it up or
120
+ edit an internal file. Runtime credentials are shown once and must not be
121
+ committed or copied into project configuration.
61
122
 
62
- ## Updating
123
+ Dependency network access defaults to `disabled`. For a project whose checked-in
124
+ lockfile needs anonymous public packages, explicitly authorize that policy when
125
+ enrolling or starting:
63
126
 
64
127
  ```bash
65
- npm install -g @reasontrail/cli@latest
66
- reasontrail --version
67
- reasontrail doctor --profile development
128
+ reasontrail runtime start --profile production --dependency-network public
68
129
  ```
69
130
 
70
- `--version` reports both the package version and executable source revision.
71
- `doctor` compares that revision with a same-version reviewed checkout when one is
72
- available. It checks only the selected ReasonTrail connection and does not launch
73
- assistant-wide MCP health probes, which could contact unrelated environments. Rebuild or reinstall if it reports an integrity mismatch.
131
+ Runtime `0.3.3` requires Linux Bubblewrap for dependency preparation. Package
132
+ installs run inside the disposable workspace with a private cache and a minimal
133
+ read-only host/toolchain view. Private registries and inherited package-manager,
134
+ cloud, SSH, database, and Runtime credentials are not supported by this policy.
74
135
 
75
- ---
136
+ ### Worker result contract
76
137
 
77
- ## Core Commands
138
+ Runtime workers return `reasontrail.worker-result.v1`. File changes use the
139
+ canonical values `ADDED`, `MODIFIED`, `DELETED`, and `RENAMED`. Runtime `0.3.3`
140
+ normalizes the reviewed provider aliases `CREATED`, `UPDATED`, `REMOVED`, and
141
+ `MOVED` for backward compatibility; those aliases are not the API contract.
78
142
 
79
- ### Project Context & Brain
80
- - `reasontrail status --profile development` — Check backend connection, auth status, and repository binding.
81
- - `reasontrail context --profile development --request "<query>"` — Retrieve relevant code symbols, architectural decisions, and tasks. It never synchronizes transcripts.
82
- - `reasontrail search --profile development --query "<term>"` — Search your project Brain.
83
- - `reasontrail update --profile development` — Submit structured findings and discoveries (via stdin JSON) to the Brain.
84
- - `reasontrail doctor --profile development` — Diagnostics without transcript synchronization.
85
- - `reasontrail sync codex --profile development` — Local preview only; does not initialize MCP or load credentials.
86
- - `reasontrail sync codex --profile development --apply` — Explicitly synchronize eligible sessions.
87
- - `reasontrail install --platform <claude|codex|agy>` — Manually install assistant skill.
88
- - `reasontrail uninstall --platform <claude|codex|agy>` — Remove assistant skill.
143
+ `reasontrail runtime status --profile production` reports the local enrollment;
144
+ the Execution Infrastructure page is authoritative for live `ONLINE` status,
145
+ runtime version, protocol, worker availability, and readiness.
89
146
 
90
- Every server-capable production invocation requires `--profile production`.
91
- Interactive callers must type `PRODUCTION`; noninteractive callers must add the
92
- narrow, per-invocation `--confirm-production` flag. Ambient tokens do not bypass
93
- this guard.
147
+ The Runtime runs in the foreground. Stop that local process with your terminal's
148
+ interrupt and start it again with `reasontrail runtime start`; persisted Missions
149
+ and evidence remain in ReasonTrail. To pause or continue a Mission itself, use:
94
150
 
95
- ### Mission Control
96
- - `reasontrail run "<task>"` — Start a Mission on ReasonTrail.
97
- - `reasontrail run status <mission-id>` — Inspect live mission status.
98
- - `reasontrail run stop|resume <mission-id>` — Pause or resume a mission.
99
- - `reasontrail decide <mission-id> <gate-id> <answer>` — Answer a human decision gate.
151
+ ```bash
152
+ reasontrail run stop <mission-id> --profile production
153
+ reasontrail run resume <mission-id> --profile production
154
+ ```
100
155
 
101
- ---
156
+ ## Human gates and completion
102
157
 
103
- ## Mission Runtime (Included)
158
+ Missions can pause asynchronously for provider recovery, review decisions, or
159
+ completion approval. Keep the Mission page open: it updates while the Mission is
160
+ running and presents the next required action without a normal manual refresh.
161
+ After evidence and independent review pass, select **Approve and complete the
162
+ mission** when that gate appears.
104
163
 
105
- The ReasonTrail Mission Runtime is built directly into `@reasontrail/cli` — no separate download or package is required.
164
+ ## Upgrade
106
165
 
107
- The runtime executes supervised Mission tasks directly on your local machine:
108
- - Runs locally on your workstation or build server.
109
- - Connects **outbound** to ReasonTrail over HTTPS.
110
- - Requires **no inbound firewall/NAT ports** or public IP addresses.
111
- - Claims assignments, runs local worker coding agents (Claude Code, Codex), verifies work, and submits diffs and evidence.
166
+ Stop the foreground Runtime, install the current package, verify it, and restart:
112
167
 
113
- ### 1. Enroll Machine
114
168
  ```bash
115
- reasontrail runtime enroll \
116
- --url https://app.reasontrail.ai \
117
- --token <runtime-token> \
118
- --workspace <workspace-id>=<local-repository-path>
169
+ npm install -g @reasontrail/cli@latest
170
+ reasontrail --version
171
+ reasontrail doctor --profile production
172
+ reasontrail runtime start --profile production
119
173
  ```
120
174
 
121
- ### 2. Check Status
122
- ```bash
123
- reasontrail runtime status
124
- ```
175
+ The existing profile, login, Runtime enrollment, and project bindings remain in
176
+ place. `reasontrail upgrade` is reserved and is not the supported updater.
177
+
178
+ ## Uninstall
125
179
 
126
- ### 3. Start Runtime
127
180
  ```bash
128
- reasontrail runtime start
181
+ reasontrail runtime logout --profile production
182
+ reasontrail auth logout --profile production
183
+ npm uninstall -g @reasontrail/cli
129
184
  ```
130
185
 
131
- ### 4. Logout / Remove Enrollment
186
+ Runtime logout removes the local enrollment only. Revoke the Runtime credential
187
+ and any MCP token in ReasonTrail if the machine should no longer connect. npm
188
+ uninstall does not delete ReasonTrail projects, Missions, Work, Tasks, evidence,
189
+ or other customer data; it also leaves local profile data available for a later
190
+ reinstall.
191
+
192
+ ## Local development profile
193
+
194
+ Self-hosted development uses an explicitly separate loopback-only profile:
195
+
132
196
  ```bash
133
- reasontrail runtime logout
197
+ reasontrail config endpoint http://127.0.0.1:3000/api/mcp --profile development
198
+ reasontrail auth login --device --profile development
199
+ reasontrail status --profile development
134
200
  ```
135
201
 
136
- ---
137
-
138
202
  ## License
139
203
 
140
204
  Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reasontrail/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "ReasonTrail CLI and Mission Runtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,14 +12,20 @@
12
12
  "skills",
13
13
  "runtime",
14
14
  "README.md",
15
+ "CHANGELOG.md",
15
16
  "LICENSE"
16
17
  ],
17
18
  "engines": {
18
19
  "node": ">=20"
19
20
  },
20
21
  "homepage": "https://reasontrail.ai",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/joaquimpsoares/reasontrail.git",
25
+ "directory": "packages/reasontrail-cli"
26
+ },
21
27
  "bugs": {
22
- "url": "https://reasontrail.ai"
28
+ "url": "https://github.com/joaquimpsoares/reasontrail/issues"
23
29
  },
24
30
  "license": "Apache-2.0",
25
31
  "keywords": [