diff --git a/crates/relayburn-cli/src/cli.rs b/crates/relayburn-cli/src/cli.rs index 3aee9f20..09f724b0 100644 --- a/crates/relayburn-cli/src/cli.rs +++ b/crates/relayburn-cli/src/cli.rs @@ -82,11 +82,9 @@ impl Args { } } -/// Top-level subcommand enum. One variant per binary subcommand. The -/// Wave 2 PRs replace each unit variant with a fully-typed `*Args` -/// struct (`Summary(SummaryArgs)`, etc.) once the per-command flag set -/// is wired up; until then, every variant is a stub that prints a -/// "not yet implemented" message and exits 1. +/// Top-level subcommand enum. One variant per binary subcommand, each +/// carrying its fully-typed `*Args` struct (`Summary(SummaryArgs)`, etc.) +/// and dispatched to the matching presenter in `main`. #[derive(Debug, Subcommand)] pub enum Command { /// Measure one explicit session artifact without discovery or a ledger. diff --git a/crates/relayburn-sdk/src/ingest/pending_stamps.rs b/crates/relayburn-sdk/src/ingest/pending_stamps.rs index c0220f34..59fd4cb4 100644 --- a/crates/relayburn-sdk/src/ingest/pending_stamps.rs +++ b/crates/relayburn-sdk/src/ingest/pending_stamps.rs @@ -251,11 +251,13 @@ pub fn cleanup_stale_pending_stamps_in_at( Ok(PendingStampCleanupResult { scanned, deleted }) } -/// Try to claim and apply every manifest that matches `candidate`. Sorted by -/// `spawnStartTs` (FIFO) so multiple concurrent same-harness/same-cwd runs -/// don't all collapse onto the first session that ingests. +/// Try to claim and apply the oldest manifest that matches `candidate`, +/// sorted by `spawnStartTs` (FIFO), so multiple concurrent same-harness / +/// same-cwd runs don't all collapse onto the first session that ingests. At +/// most one manifest is applied per call, matching the TS adapter's `break` +/// after the first successful append. /// -/// Side effects: each successfully claimed manifest's enrichment is folded +/// Side effects: the successfully claimed manifest's enrichment is folded /// onto the candidate session via `ledger.append_stamp`. The manifest file is /// removed on success and restored if the ledger append errors. pub fn resolve_pending_stamps_for_session_in( diff --git a/crates/relayburn-sdk/src/ledger/db.rs b/crates/relayburn-sdk/src/ledger/db.rs index 2a7fd2e9..d3876bf5 100644 --- a/crates/relayburn-sdk/src/ledger/db.rs +++ b/crates/relayburn-sdk/src/ledger/db.rs @@ -33,8 +33,8 @@ pub(crate) struct Connections { } impl Connections { - /// Open both DBs at the given paths, applying PRAGMAs + DDL. The - /// parent directory of each path must already exist. + /// Open both DBs at the given paths, applying PRAGMAs + DDL and + /// creating each parent directory if it is missing. pub fn open(burn_path: &Path, content_path: &Path) -> Result { if let Some(parent) = burn_path.parent() { if !parent.as_os_str().is_empty() { diff --git a/crates/relayburn-sdk/src/reader/inference.rs b/crates/relayburn-sdk/src/reader/inference.rs index c6f98bb9..febead3e 100644 --- a/crates/relayburn-sdk/src/reader/inference.rs +++ b/crates/relayburn-sdk/src/reader/inference.rs @@ -95,17 +95,18 @@ pub struct Inference { pub v: u32, pub source: SourceKind, pub session_id: String, - /// Stable key. For Claude this is the upstream `requestId`; for - /// Codex / opencode (no requestId) it falls back to `message_id` - /// (see [`build_inferences`] / [`InferenceFallback::MessageId`]). + /// Stable key. For Claude this is the upstream `requestId` when one + /// is available; other harnesses fall back to a `message_id`-derived + /// or synthesized key (see [`build_inferences`] / + /// [`InferenceKeySource`]). pub request_id: String, /// Source of `request_id` — `request-id` (upstream `requestId`), - /// `message-id` (fallback), or `row-uuid` (final fallback). Lets a - /// debugger tell "is this a real request key" from "is this a + /// `message-id` (fallback), or `row-synthetic` (final fallback). Lets + /// a debugger tell "is this a real request key" from "is this a /// synthesized key". pub request_id_source: InferenceKeySource, - /// Logical "turn" identity — for Claude this is `message_id`; for - /// Codex / opencode it's the same as `request_id`. + /// Logical "turn" identity — the `message_id` of the underlying row + /// group. pub turn_id: String, pub model: String, pub usage: Usage, diff --git a/crates/relayburn-sdk/src/reader/types.rs b/crates/relayburn-sdk/src/reader/types.rs index 5f26ce15..b4422aaf 100644 --- a/crates/relayburn-sdk/src/reader/types.rs +++ b/crates/relayburn-sdk/src/reader/types.rs @@ -299,13 +299,13 @@ pub enum ActivityCategory { Brainstorming, Conversation, /// Synthetic activity for a Claude slash-command (`/review`, `/init`, - /// custom skill) detected as a structural triad in the JSONL - /// transcript: caveat row → invocation row (`parentUuid == caveat.uuid`) - /// → stdout row (`parentUuid == invocation.uuid`). The three underlying - /// rows keep their own token attribution; `Skill` is a view that - /// collapses the triad into a single activity so per-category rollups - /// don't count one slash command three times. See - /// `classifier::detect_slash_triads` and AgentWorkforce/burn#438. + /// custom skill). relayhistory emits a `slash_command` marker naming the + /// caveat, invocation, and output event uids; the turns carrying those + /// events keep their own token attribution, while `Skill` collapses the + /// group into a single activity so per-category rollups don't count one + /// slash command three times. See + /// `source::relayhistory::claude::skill_messages` and + /// AgentWorkforce/burn#438. Skill, }