Conversation
| trail show <trajectory-id> | ||
| ``` | ||
|
|
||
| Export a trajectory (markdown, json, timeline, html, pr-summary): |
There was a problem hiding this comment.
🟡 Documentation lists pr-summary as supported export format but CLI doesn't implement it
The documentation at docs/trail-snippet.md:117 states that trail export supports formats: markdown, json, timeline, html, pr-summary. However, the CLI export command at src/cli/commands/export.ts:51-63 only handles json, timeline, and html in its switch statement — any other value (including pr-summary) falls through to the default case and silently exports as markdown instead.
Root Cause
The switch statement in src/cli/commands/export.ts:51-63 has no case for "pr-summary". When a user runs trail export <id> --format pr-summary as the documentation suggests, the format string "pr-summary" doesn't match any case, so it falls through to default and calls exportToMarkdown() instead of exportToPRSummary() (which does exist at src/export/pr-summary.ts:20).
Impact: Users following this documentation will get markdown output instead of the PR summary format, with no error or warning that the format is unsupported.
| Export a trajectory (markdown, json, timeline, html, pr-summary): | |
| Export a trajectory (markdown, json, timeline, html): | |
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| Compact by commit range: | ||
| ```bash | ||
| trail compact --commits abc123..def456 |
There was a problem hiding this comment.
🟡 Documentation shows git range syntax for --commits but CLI expects comma-separated SHAs
The documentation at docs/trail-snippet.md:137 shows trail compact --commits abc123..def456 using git range syntax (..). However, the CLI implementation at src/cli/commands/compact.ts:163-171 splits the value by commas (options.commits.split(",")), so it expects comma-separated SHAs like abc123,def456.
Root Cause
The compact command parses the --commits option as:
const targetCommits = options.commits
? new Set(
options.commits.split(",").flatMap((sha) => {
const trimmed = sha.trim();
if (!trimmed) return [];
return [trimmed, trimmed.slice(0, 7)];
}),
)
: null;If a user passes abc123..def456, it will be treated as a single string "abc123..def456" (no comma to split on), which won't match any trajectory commit SHA. The command will silently find no matching trajectories.
Impact: Users following this documentation will get zero results with no error message explaining why.
| trail compact --commits abc123..def456 | |
| trail compact --commits abc123,def456 | |
Was this helpful? React with 👍 or 👎 to provide feedback.
| Compact by branch: | ||
| ```bash | ||
| trail compact --branch feature/auth | ||
| ``` |
There was a problem hiding this comment.
🟡 Documentation shows --branch feature/auth but the flag expects the base branch (e.g., main)
The documentation at docs/trail-snippet.md:131-132 says "Compact by branch" and shows trail compact --branch feature/auth, implying it compacts trajectories associated with the feature branch. However, the CLI implementation does the opposite: it finds commits on the current HEAD that are NOT in the specified branch.
Root Cause
The compact command at src/cli/commands/compact.ts:268-295 runs:
git log '${targetBranch}'..HEAD --format=%H
This gets commits on HEAD that are NOT in targetBranch. The CLI help text at src/cli/commands/compact.ts:87-88 correctly says: "Compact trajectories with commits not in the specified branch (e.g., main)".
So the correct usage is trail compact --branch main (pass the base branch), not trail compact --branch feature/auth (the feature branch). The documentation example will produce incorrect results — if you're on main and pass --branch feature/auth, you'd get commits on main not in feature/auth, which is the opposite of what's intended.
Impact: Users following this documentation will compact the wrong set of trajectories.
| Compact by branch: | |
| ```bash | |
| trail compact --branch feature/auth | |
| ``` | |
| Compact by branch (finds trajectories with commits not in the specified base branch): | |
| ```bash | |
| trail compact --branch main |
<!-- devin-review-badge-begin -->
<a href="https://app.devin.ai/review/agentworkforce/trajectories/pull/15" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review">
</picture>
</a>
<!-- devin-review-badge-end -->
---
*Was this helpful? React with 👍 or 👎 to provide feedback.*
- Remove pr-summary from export format list (CLI doesn't implement it) - Fix --branch example to show base branch (main) not feature branch - Fix --commits syntax from range (abc..def) to comma-separated (abc,def) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix trail-snippet docs from PR #15 review
Uh oh!
There was an error while loading. Please reload this page.