Skip to content

Commit cc218f9

Browse files
authored
Merge pull request #119 from softwaremill/chore/remove-push-command
chore(cli): remove obsolete `tracevault push` command
2 parents eb0f1ee + 0786862 commit cc218f9

6 files changed

Lines changed: 9 additions & 931 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ This creates a `.tracevault/` directory and installs a pre-push hook. The hook r
192192
```sh
193193
tracevault sync # sync repo metadata with server
194194
tracevault check # evaluate policies against server rules (blocks push on failure)
195-
tracevault push # upload traces to server
196195
```
197196

197+
Session and commit data is streamed to the server continuously via the Claude Code hooks (`tracevault stream`) and the git post-commit hook (`tracevault commit-push`), so there is no separate upload step.
198+
198199
The command also installs the Claude Code hook configuration in `.claude/settings.json`. Each hook runs `tracevault stream --event <type>`, which records the event locally and pushes it to the server in real time:
199200

200201
```json
@@ -228,7 +229,7 @@ The command also installs the Claude Code hook configuration in `.claude/setting
228229
}
229230
```
230231

231-
### 7. Authenticate and push traces
232+
### 7. Authenticate
232233

233234
```sh
234235
# Log in to a TraceVault server.
@@ -238,12 +239,12 @@ The command also installs the Claude Code hook configuration in `.claude/setting
238239
# force that behaviour with `--no-browser` or `TRACEVAULT_NO_BROWSER=1`.
239240
tracevault login --server-url https://your-server.example.com
240241

241-
# Push traces to the server:
242-
tracevault push
243-
244242
# Check policies before pushing (also runs automatically via pre-push hook):
245243
tracevault check
246244

245+
# Retry any events that failed to stream in real time (network blip, server down):
246+
tracevault flush
247+
247248
# View local session stats:
248249
tracevault stats
249250

@@ -277,7 +278,7 @@ tracevault login --server-url https://your-tracevault-server.example.com
277278
tracevault init
278279
```
279280

280-
That's it. From this point on, every Claude Code session in this repo is automatically traced — tool calls, file edits, token usage, and model info are captured and streamed to the TraceVault server. When you `git push`, the pre-push hook evaluates policies and uploads traces.
281+
That's it. From this point on, every Claude Code session in this repo is automatically traced — tool calls, file edits, token usage, and model info are captured and streamed to the TraceVault server as they happen. When you `git push`, the pre-push hook evaluates policies and blocks the push if any rule fails.
281282

282283
## Keys & Secrets
283284

@@ -337,7 +338,6 @@ export DATABASE_URL=postgres://user:password@host:5432/tracevault?sslmode=requir
337338
| `tracevault stream --event <type>` | Handle a Claude Code hook event (reads JSON from stdin) and stream it to the server |
338339
| `tracevault sync` | Sync repo metadata with the server |
339340
| `tracevault check` | Evaluate policies against server rules, exit non-zero if blocked |
340-
| `tracevault push` | Push collected traces to the server |
341341
| `tracevault stats` | Show local session statistics |
342342
| `tracevault verify` | Verify commits are registered and sealed on the server (`--commits` or `--range`) |
343343
| `tracevault status` | Show current session status (not yet implemented) |

crates/tracevault-cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ cargo install tracevault-cli
1313
```sh
1414
tracevault init # Initialize in a repo
1515
tracevault status # Show tracing status
16-
tracevault check # Run attribution checks
17-
tracevault push # Push traces to server
16+
tracevault check # Evaluate policies before push
17+
tracevault flush # Retry any events that failed to stream live
1818
```
1919

2020
## License

crates/tracevault-cli/src/api_client.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,6 @@ pub struct ApiClient {
88
client: reqwest::Client,
99
}
1010

11-
#[derive(Serialize)]
12-
pub struct PushTraceRequest {
13-
pub repo_name: String,
14-
pub commit_sha: String,
15-
pub branch: Option<String>,
16-
pub author: String,
17-
pub model: Option<String>,
18-
pub tool: Option<String>,
19-
pub session_id: Option<String>,
20-
pub total_tokens: Option<i64>,
21-
pub input_tokens: Option<i64>,
22-
pub output_tokens: Option<i64>,
23-
pub estimated_cost_usd: Option<f64>,
24-
pub api_calls: Option<i32>,
25-
pub session_data: Option<serde_json::Value>,
26-
pub transcript: Option<serde_json::Value>,
27-
pub diff_data: Option<serde_json::Value>,
28-
pub model_usage: Option<serde_json::Value>,
29-
pub duration_ms: Option<i64>,
30-
pub started_at: Option<String>,
31-
pub ended_at: Option<String>,
32-
pub user_messages: Option<i32>,
33-
pub assistant_messages: Option<i32>,
34-
pub tool_calls: Option<serde_json::Value>,
35-
pub total_tool_calls: Option<i32>,
36-
pub cache_read_tokens: Option<i64>,
37-
pub cache_write_tokens: Option<i64>,
38-
pub compactions: Option<i32>,
39-
pub compaction_tokens_saved: Option<i64>,
40-
}
41-
42-
#[derive(Deserialize)]
43-
pub struct PushTraceResponse {
44-
pub commit_id: uuid::Uuid,
45-
}
46-
4711
#[derive(Serialize)]
4812
pub struct RegisterRepoRequest {
4913
pub repo_name: String,
@@ -180,30 +144,6 @@ impl ApiClient {
180144
}
181145
}
182146

183-
pub async fn push_trace(
184-
&self,
185-
org_slug: &str,
186-
req: PushTraceRequest,
187-
) -> Result<PushTraceResponse, Box<dyn Error>> {
188-
let mut builder = self
189-
.client
190-
.post(format!("{}/api/v1/orgs/{}/traces", self.base_url, org_slug));
191-
192-
if let Some(key) = &self.api_key {
193-
builder = builder.header("Authorization", format!("Bearer {key}"));
194-
}
195-
196-
let resp = builder.json(&req).send().await?;
197-
198-
if !resp.status().is_success() {
199-
let status = resp.status();
200-
let body = resp.text().await.unwrap_or_default();
201-
return Err(format!("Server returned {status}: {body}").into());
202-
}
203-
204-
Ok(resp.json().await?)
205-
}
206-
207147
pub async fn register_repo(
208148
&self,
209149
org_slug: &str,

crates/tracevault-cli/src/commands/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub mod flush;
44
pub mod init;
55
pub mod login;
66
pub mod logout;
7-
pub mod push;
87
pub mod stats;
98
pub mod status;
109
pub mod stream;

0 commit comments

Comments
 (0)