feat(cli): simplify the machine contract before the freeze #85
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!85
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/cli-machine-contract-23"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #23.
Freezes the CLI's machine contract before v0.1 by removing its exceptions
rather than adding capability:
sessions listbecomes a point verb answering{"v":1,"sessions":[…]};--format jsonlis now a usage error there.left (a global carrier flag on a window-addressed verb) speaks the verb's
own
--formatframing under the newusagekind, and a machine formatsilences the console log so a point verb's stderr is its one error object.
ErrorKind: a typed refusal exits 1,a failure to ask at all exits 2. Transport stalls report
daemon_lost,keeping
timeoutfor waits a caller asked for.short_idleaves every reply that saw no roster (an unchecked uniquenessclaim);
listandinfokeep it, shortened against the roster they carry.--to-host, matching--to-socket; thefelis sshalias is gone.error.kindon every stream verb.Doc cascade:
docs/reference/cli.md,docs/reference/control-surfaces.md,docs/reference/ipc.md,docs/reference/spec.md,docs/explanation/architecture/control-surfaces.md,docs/explanation/architecture/ipc.md,docs/explanation/architecture/session-lifecycle.md, the affected how-topages,
README.md,CHANGELOG.md, and the product-shippedskills/felis.Verified: just check green (fmt, clippy, nextest, deny); reviewed by
plan/correctness/docs lenses and pi sol.
Deferred
parse_point_format/parse_stream_format/parse_region_sourcewith clap
ValueEnums so help, completions and man pages list possiblevalues — no acceptance criterion needs it (it is #55's review note), and it
would add ~150 lines of enum, conversion and test to a change already at the
size ceiling.
protocol/unsupportedrow in the golden failure matrix (a pinnedminor-4 fixture daemon) — the plan itself allows skipping it; the harness
cannot pin an older negotiated minor without a new daemon fixture.
render_long_help()assertion thatfelis sshis gone, a__mangentest that the page set equals the visiblesubcommand set) — both are listed as "consider";
the_ssh_alias_no_longer_resolvesalready pins the parse side, and theman-page set follows clap with no separate list to drift from.
untouched lines of
cli.md/control-surfaces.md— out of scope; thechecker only governs added lines and reports 0 hits.
ipc.mdstates normative answers for an operation-lookup query no wiremessage can ask — the ledger's queryability belongs to the ledger feature
(#24-adjacent), not to this issue's criteria.
felis sshalias,
--hostas a retarget destination,listas a JSONL stream, aclosed
error.kind, and rosterlessshort_id— the triage plan scopedchangelog handling to a single "Removed" entry; every cited line predates
this branch and stands as history.
The CLI's machine surface froze avoidable exceptions into shapes a consumer would have to carry past the first tag: a bounded roster was framed as a stream, a usage error after a successful parse was human whatever `--format` said, and every exit code was a per-site literal, so one condition exited 1 on one verb and 2 on another. Five changes, each removing an exception rather than adding a capability: - `sessions list` becomes a point verb answering `{"sessions":[…]}`. The roster is bounded and arrives in one frame, and `felis bridge` already answered it as one object, so the stream framing described no source anyone had. - Every refusal clap can state is stated to clap (`--ssh-arg` requires its carrier, `--session` conflicts with a trailing command override, `send`'s payload is required unless `--wait` / `--key` stands in). That leaves one post-parse refusal, a global carrier flag on a verb addressed to a window, which clap cannot express; it now speaks the verb's framing under the new `usage` kind. A machine format also silences the console log, so a point verb's stderr is its one error object and nothing else. - The exit code becomes a function of `ErrorKind`: a typed refusal exits 1, a failure to ask at all exits 2. The transport stalls that shared the `timeout` token report `daemon_lost` instead, keeping `timeout` for the waits a caller asked for. - `short_id` leaves every reply that saw no roster. A prefix nothing checked is an unchecked claim of uniqueness, and a consumer reading one field on two kinds of reply cannot tell the cases apart. - The retarget destination is `--to-host`, matching `--to-socket`, and the `felis ssh` alias is gone: one operation spelled two ways gave one destination three spellings, and the alias's positional destination is what kept `--ssh-arg`'s requirement out of clap. Refs #234b22c3d08762be87be9d