Skip to content

inspect: each protocol's wire choices, their sources, and its guarantees - #110

Merged
Kinflou merged 2 commits into
mainfrom
cli/inspect
Oct 31, 2026
Merged

Kinflou merged 2 commits into
mainfrom
cli/inspect

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 31, 2026

Copy link
Copy Markdown
Member

Closes #83.

comline inspect is a new read-only command. Like check, it never writes to .comline/. For each protocol it prints a short header of choices: format, framing and handshake, their parameters, and where each came from. Below that is one row per guarantee, held or given up, with the cause and the acceptance. --json prints the same. The model is core's comline_core::inspect (core#150), which the language-server hover shares.

$ comline --plain inspect
protocol api::Legacy (shop)
  format     json@1                   JSON-RPC's format
  framing    jsonrpc (method_names = qualified) from @framing
  handshake  none                     from @handshake
  unverified "the 2009 gateway can't run a handshake"

  schema agreement       given up
      because handshake `none`
      acceptance: up to each consumer's config.idp
  encoding agreement     given up
      because handshake `none`
      acceptance: up to each consumer's config.idp
  encoding conformance   held
  version honesty        held
  • Output: the report goes to stdout. Without --plain, rows get ✓/✗ and green/yellow, through anstream (stripped when not a terminal, or with NO_COLOR). Long values get their own indented lines, so the report fits 80 columns, and a test checks that.
  • Acceptance: a dependency's protocol shows accepted by <this package> from its accept_unverified. Who accepts this package's own protocols can't be seen from here, and the report says so.
  • Out of scope: compatibility facts (line, version, shape hash) aren't shown, because they don't exist yet (core#119). docs/cli.md says so.

Tests (tests/cli/inspect.rs):

  • The exact plain text.
  • The JSON shape.
  • A dependency's protocol accepted by the consumer.
  • No protocols.
  • A broken schema.

Pins:

  • core 4706658 (core#150)
  • generation 0601f00 (generation#94)
  • comline-rust 6e8715a (comline-rust#85)
  • comline-typescript 470dc5b (comline-typescript#101)

Byte-identical: comline generate built from main and from this branch gives identical output on tests/fixtures/{chat,simple,validated}_project:

  • Rust code mode: 2, 2 and 3 files.
  • Rust --mode lib: 3, 4 and 3 files.
  • TypeScript (added to a copy of each config): 2, 2 and 3 files.

Locally: cargo fmt --check, both clippy configurations and cargo test pass.

Merge order: core#150, generation#94, comline-rust#85, comline-typescript#101, then this, then language-server, playground, docs.

Kinflou added 2 commits November 1, 2026 06:28
`comline inspect` compiles the package without writing to .comline/,
like check, and prints per protocol the format, framing and handshake,
their parameters and where each came from, then a row per guarantee:
held or given up, why, and whether it's accepted. --json prints the
same. The model is core's (comline_core::inspect, core#150).

Pins: core 4706658, generation 0601f00, comline-rust 6e8715a,
comline-typescript 470dc5b.
@Kinflou
Kinflou merged commit 76afd09 into main Oct 31, 2026
2 checks passed
@Kinflou
Kinflou deleted the cli/inspect branch October 31, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Show a package's choices and the guarantees they give, as a table

1 participant