Skip to content

fix(log): check the sidecar command line before opening the pack - #7

Merged
HaoZeke merged 3 commits into
mainfrom
fix/sidecar-cli
Nov 16, 2026
Merged

HaoZeke merged 3 commits into
mainfrom
fix/sidecar-cli

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

A command line the sidecar binary does not take now exits with status 2 and opens nothing, and the docs list origin= among an entry's lookup keys.

  • The binary's doc and the book promise status 2 for a command line it does not take, but run opened DIR/.sidecar/pack and took its lock before it looked at the command. An unknown command or a missing argument left a new sidecar beside the project, and a non-numeric tree SIZE, include without --trusted, or a --trusted line that is not a key exited 1.
  • parse now builds a typed command with every argument checked, so any command line the binary does not take is status 2 before run opens the pack. Everything run can fail on is status 1. The module doc and sidecar_keys now list path=, blob= and origin=.
  • The test runs each rejected command line and expects status 2 with no .sidecar created. The include test also finds the two logged checkpoints by origin=.

The branch has towncrier fragments.

The module doc and the sidecar_keys doc gave an entry's lookup keys as
path= and blob=, but sidecar_keys also keys an included child checkpoint
by origin=, so a parent finds every checkpoint of one child log by its
origin. Both docs now list the three keys and which changes carry them.
The code was right, so there is no failing test; the include test now
also finds the two logged checkpoints by origin=.
The binary's doc and the book promise status 2 for a command line it
does not take, but run opens DIR/.sidecar/pack and takes its lock before
it looks at the command, and main tells a usage error from a store error
by the wording of the message. An unknown command or a missing argument
leaves a new sidecar beside the project, and a non-numeric tree SIZE,
include without --trusted, or a --trusted line that is not a key exit 1.
The test runs each and expects status 2 with no .sidecar created.
parse now builds a typed command with every argument it takes checked,
the numbers parsed and the --trusted lines read as verifiers, so any
command line the binary does not take is status 2 before run opens
DIR/.sidecar/pack. Everything run can fail on is a store, a file or a
proof and is status 1, which replaces telling the two apart by the
wording of the message. The binary's doc and the reference page say a
rejected command line opens nothing.
@HaoZeke
HaoZeke merged commit 0e8ee68 into main Nov 16, 2026
6 checks passed
@HaoZeke
HaoZeke deleted the fix/sidecar-cli branch November 16, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant