boxel-cli: add boxel realm milestone command#4751
Conversation
628b92e to
8ca476d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21a6c246de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!(await manager.isInitialized())) { | ||
| return { ok: true, milestones: [] }; | ||
| } | ||
| const milestones = await manager.getMilestones(); |
There was a problem hiding this comment.
List all milestones instead of only latest 100
listMilestonesStep calls manager.getMilestones() without any way to override its internal cap (currently 100 checkpoints), so boxel realm milestone <local-dir> silently omits milestones on older commits in long-lived workspaces. Because this command is presented as listing milestones generally, users can miss existing milestone tags unless they happen to be in the newest 100 checkpoints; consider plumbing a limit through list mode (or removing the cap) so listing is complete/predictable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Fixed in d6d4d08 by rewriting getMilestones to enumerate by milestone/* tag via git log --no-walk rather than walking the most recent N checkpoints — no internal cap, and milestones buried deep in history are now returned. Added a unit test that tags an old checkpoint then buries it under 120 more to lock the behavior in.
There was a problem hiding this comment.
Pull request overview
Adds a new boxel realm milestone subcommand to the monorepo CLI for listing, marking, and removing checkpoint milestones in a workspace’s local .boxel-history/ repository, along with integration tests and a small plugin/docs update.
Changes:
- Introduces
realmMilestone()programmatic API +registerMilestoneCommand()Commander wiring forboxel realm milestone. - Adds new Vitest integration coverage for list/mark/remove/validation flows.
- Updates the realm-sync skill doc and bumps the plugin version.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/boxel-cli/tests/integration/realm-milestone.test.ts | New integration tests covering milestone list/mark/remove behaviors. |
| packages/boxel-cli/src/commands/realm/milestone.ts | Implements the boxel realm milestone command and core logic (ref resolution, printing, JSON mode). |
| packages/boxel-cli/src/commands/realm/index.ts | Registers the new milestone subcommand under boxel realm. |
| packages/boxel-cli/plugin/skills/realm-sync/SKILL.md | Adjusts generated command docs for boxel realm watch (and related prose). |
| packages/boxel-cli/plugin/.claude-plugin/plugin.json | Plugin version bump to reflect updated skills/docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (opts.json) { | ||
| console.log(JSON.stringify(result, null, 2)); | ||
| if (!result.ok) process.exit(1); | ||
| return; |
There was a problem hiding this comment.
Fixed in d6d4d08 — --json branch now uses cliLog.output(...). Smoke-tested --quiet --json (JSON still reaches stdout) and --quiet alone (decorative output is silenced).
| ### `boxel realm watch` | ||
|
|
||
| Watch a Boxel realm for server-side changes and pull them into a local directory | ||
|
|
||
| **Arguments:** | ||
|
|
||
| - `<realm-url>` — The URL of the realm to watch (e.g., https://app.boxel.ai/demo/) | ||
| - `<local-dir>` — The local directory to write changes into | ||
|
|
||
| **Options:** | ||
|
|
||
| - `-i, --interval <seconds>` — Polling interval in seconds | ||
| - `-d, --debounce <seconds>` — Seconds to wait after a burst of changes before applying them | ||
| - `--realm-secret-seed` — Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED) | ||
| Watch a Boxel realm; subcommands manage watch processes |
There was a problem hiding this comment.
Fixed in d6d4d08. Replaced the bare realm watch entry in SKILL_SPECS with realm watch start and realm watch stop, regenerated the synopsis, and updated the prose table at the top of the file (added a row for watch stop too).
| }); | ||
|
|
||
| it('returns error for non-existent directory', async () => { | ||
| const result = await realmMilestone('/tmp/no-such-dir-boxel-milestone'); |
There was a problem hiding this comment.
Fixed in d6d4d08 — the test now creates a temp dir via mkdtempSync and immediately rmSyncs it, so the path is guaranteed not to exist when realmMilestone is invoked.
Ports the milestone command from the standalone boxel-cli into the monorepo under `boxel realm milestone`. Exposes list, --mark, and --remove modes backed by the existing CheckpointManager methods, with --json output and 18 integration tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- checkpoint-manager: getMilestones now enumerates by milestone/* tag via `git log --no-walk`, so list mode is complete regardless of how deep the tagged checkpoints sit in history (was capped at the newest 100). Extract parseCheckpointLine helper to share log-line parsing. - realm milestone: --json branch uses cliLog.output so payload reaches stdout even under --quiet. - realm-sync SKILL.md: replace bare `realm watch` entry with the `watch start` and `watch stop` subcommands (in SKILL_SPECS + regenerated synopsis), and update the prose table accordingly. - realm-milestone integration test: derive non-existent-dir path via mkdtempSync+rmSync instead of a hard-coded /tmp path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Synopsis-bump CI gate: plugin.json must diff vs main when any generated:commands block in plugin/skills/**/SKILL.md changes. Main has moved to 0.1.3 independently of this branch, so bump to 0.1.4 to satisfy the check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d6d4d08 to
6846334
Compare
Summary
milestonecommand from the standalonecardstack/boxel-clirepo into the monorepo asboxel realm milestonepackages/boxel-cli/src/commands/realm/milestone.ts, following the same pattern asrealm historyCheckpointManagermethods (markMilestone,unmarkMilestone,getMilestones) — no library changes neededCommands
<ref>accepts a 1-based index, 7-char short hash, or full hash (via existingfindCheckpoint).Test plan
tests/integration/realm-milestone.test.ts— all passing locallycheckpoint-managerunit tests (28) still passpnpm tsc --noEmitcleanCloses CS-10626
🤖 Generated with Claude Code