-
-
Notifications
You must be signed in to change notification settings - Fork 31
Add a CLI-surface drift gate on capability-sdk/pkg/clisurface #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
UNC1739
wants to merge
2
commits into
main
Choose a base branch
from
feat/cli-surface-drift-gate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: CLI Surface Drift | ||
|
|
||
| # Fails when the documented CLI surface drifts from the live cobra tree. | ||
| # No `paths:` filter: docs-only PRs skip ci.yml. | ||
| on: | ||
| # No `branches:` filter: `on.pull_request.branches` matches the BASE, so | ||
| # `branches: [main]` would skip stacked PRs. | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| cli-surface: | ||
| name: CLI Surface Drift | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Snapshot the committed documentation | ||
| run: | | ||
| set -eo pipefail | ||
| find docs README.md -type f -exec sha256sum {} + \ | ||
| | LC_ALL=C sort > "$RUNNER_TEMP/docs.before" | ||
| echo "baselined $(wc -l < "$RUNNER_TEMP/docs.before") file(s)" | ||
|
|
||
| - name: Check CLI surface and documentation for drift | ||
| run: | | ||
| set -eo pipefail | ||
| go test ./pkg/runner -run 'TestCLISurface' -count=1 -v \ | ||
| | tee "$RUNNER_TEMP/gate.log" | ||
| for name in TestCLISurface TestCLISurfaceDocLint TestCLISurfaceGateDetectsRename; do | ||
| if ! grep -qE "^--- PASS: ${name} " "$RUNNER_TEMP/gate.log"; then | ||
| echo "::error::${name} did not run. The drift gate is not executing; check the -run pattern against the test names in pkg/runner/cli_surface_test.go." | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| - name: Verify the gate did not rewrite the goldens | ||
| run: | | ||
| set -eo pipefail | ||
| find docs README.md -type f -exec sha256sum {} + \ | ||
| | LC_ALL=C sort > "$RUNNER_TEMP/docs.after" | ||
| if ! diff -u "$RUNNER_TEMP/docs.before" "$RUNNER_TEMP/docs.after"; then | ||
| echo "::error::The drift gate wrote to the committed documentation; the diff above names every file added, removed or changed. Check mode must compare without writing, so this is a defect in the gate itself -- pkg/runner/cli_surface_test.go, or a clisurface write reached outside the -update branch. Regenerating with 'make cli-docs' will not fix it." | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| <!-- Generated from the live cobra command tree by 'make cli-docs'. Do not edit by hand. --> | ||
|
|
||
| # julius CLI reference | ||
|
|
||
| Every command, alias and flag below is derived from the cobra command tree, not from prose. | ||
| Schema version 1, surface hash `sha256:0b90ec6c9ac2f198300eb2bb9b760049de4257ac3240da746f689915930e3299`. | ||
|
|
||
| Regenerate with `make cli-docs` after adding, removing or renaming a command or a flag. | ||
|
|
||
| ## Command index | ||
|
|
||
| | Command | Aliases | Description | | ||
| | --- | --- | --- | | ||
| | [`julius`](#julius) | *(none)* | Julius - LLM Service Fingerprinting Tool | | ||
| | [`julius list`](#julius-list) | *(none)* | List all available probe definitions | | ||
| | [`julius probe`](#julius-probe) | *(none)* | Probe targets to identify LLM services | | ||
| | [`julius validate`](#julius-validate) | *(none)* | Validate probe definition files | | ||
|
|
||
| ## `julius` | ||
|
|
||
| Julius - LLM Service Fingerprinting Tool | ||
|
|
||
| - Usage: `julius` | ||
| - Aliases: *(none)* | ||
| - Requires a subcommand | ||
|
|
||
| ### Flags | ||
|
|
||
| | Flag | Short | Type | Default | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `--banner` | | bool | `true` | Show ASCII banner | | ||
| | `--ca-cert` | | string | | Path to custom CA certificate file | | ||
| | `--concurrency` | `-c` | int | `10` | Maximum concurrent probe requests per target | | ||
| | `--insecure` | | bool | `false` | Skip TLS certificate verification | | ||
| | `--max-response-size` | | int64 | `10485760` | Maximum response body size in bytes (default 10MB) | | ||
| | `--no-color` | | bool | `false` | Disable color output | | ||
| | `--output` | `-o` | string | `table` | Output format (table, json, jsonl) | | ||
| | `--probes-dir` | `-p` | string | | Override probe definitions directory | | ||
| | `--quiet` | `-q` | bool | `false` | Suppress non-match output | | ||
| | `--timeout` | `-t` | int | `5` | HTTP timeout in seconds | | ||
| | `--verbose` | `-v` | bool | `false` | Verbose output | | ||
|
|
||
| ## `julius list` | ||
|
|
||
| List all available probe definitions | ||
|
|
||
| - Usage: `julius list` | ||
| - Aliases: *(none)* | ||
|
|
||
| ### Inherited flags | ||
|
|
||
| | Flag | Short | Type | Default | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `--banner` | | bool | `true` | Show ASCII banner | | ||
| | `--ca-cert` | | string | | Path to custom CA certificate file | | ||
| | `--concurrency` | `-c` | int | `10` | Maximum concurrent probe requests per target | | ||
| | `--insecure` | | bool | `false` | Skip TLS certificate verification | | ||
| | `--max-response-size` | | int64 | `10485760` | Maximum response body size in bytes (default 10MB) | | ||
| | `--no-color` | | bool | `false` | Disable color output | | ||
| | `--output` | `-o` | string | `table` | Output format (table, json, jsonl) | | ||
| | `--probes-dir` | `-p` | string | | Override probe definitions directory | | ||
| | `--quiet` | `-q` | bool | `false` | Suppress non-match output | | ||
| | `--timeout` | `-t` | int | `5` | HTTP timeout in seconds | | ||
| | `--verbose` | `-v` | bool | `false` | Verbose output | | ||
|
|
||
| ## `julius probe` | ||
|
|
||
| Probe targets to identify LLM services | ||
|
|
||
| - Usage: `julius probe [targets...]` | ||
| - Aliases: *(none)* | ||
|
|
||
| ### Flags | ||
|
|
||
| | Flag | Short | Type | Default | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `--augustus` | | bool | `false` | Include Augustus generator configs in output | | ||
| | `--base-paths` | | string | | Comma-separated path prefixes to prepend to probe paths (e.g., /api,/proxy) | | ||
| | `--file` | `-f` | string | | Read targets from file | | ||
| | `--header` | `-H` | stringArray | `[]` | Custom HTTP header (e.g., "Authorization: Bearer token"). Can be specified multiple times | | ||
|
|
||
| ### Inherited flags | ||
|
|
||
| | Flag | Short | Type | Default | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `--banner` | | bool | `true` | Show ASCII banner | | ||
| | `--ca-cert` | | string | | Path to custom CA certificate file | | ||
| | `--concurrency` | `-c` | int | `10` | Maximum concurrent probe requests per target | | ||
| | `--insecure` | | bool | `false` | Skip TLS certificate verification | | ||
| | `--max-response-size` | | int64 | `10485760` | Maximum response body size in bytes (default 10MB) | | ||
| | `--no-color` | | bool | `false` | Disable color output | | ||
| | `--output` | `-o` | string | `table` | Output format (table, json, jsonl) | | ||
| | `--probes-dir` | `-p` | string | | Override probe definitions directory | | ||
| | `--quiet` | `-q` | bool | `false` | Suppress non-match output | | ||
| | `--timeout` | `-t` | int | `5` | HTTP timeout in seconds | | ||
| | `--verbose` | `-v` | bool | `false` | Verbose output | | ||
|
|
||
| ## `julius validate` | ||
|
|
||
| Validate probe definition files | ||
|
|
||
| - Usage: `julius validate [directory]` | ||
| - Aliases: *(none)* | ||
|
|
||
| ### Inherited flags | ||
|
|
||
| | Flag | Short | Type | Default | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `--banner` | | bool | `true` | Show ASCII banner | | ||
| | `--ca-cert` | | string | | Path to custom CA certificate file | | ||
| | `--concurrency` | `-c` | int | `10` | Maximum concurrent probe requests per target | | ||
| | `--insecure` | | bool | `false` | Skip TLS certificate verification | | ||
| | `--max-response-size` | | int64 | `10485760` | Maximum response body size in bytes (default 10MB) | | ||
| | `--no-color` | | bool | `false` | Disable color output | | ||
| | `--output` | `-o` | string | `table` | Output format (table, json, jsonl) | | ||
| | `--probes-dir` | `-p` | string | | Override probe definitions directory | | ||
| | `--quiet` | `-q` | bool | `false` | Suppress non-match output | | ||
| | `--timeout` | `-t` | int | `5` | HTTP timeout in seconds | | ||
| | `--verbose` | `-v` | bool | `false` | Verbose output | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Flag names documentation may mention even though the CLI does not accept them. | ||
| # | ||
| # The CLI-surface doc lint (see pkg/runner/cli_surface_test.go) checks every julius invocation in | ||
| # a fenced code block, every backticked flag name in prose, and every flag name | ||
| # in a Go comment under the configured Go directories against the flags cobra | ||
| # actually registers. This file is the escape hatch for deliberate mentions. | ||
| # Every entry MUST carry a '#' reason: the gate rejects an entry without one, | ||
| # because an unexplained exception is how a stale flag reference survives forever. | ||
| # | ||
| # Keep this list as short as possible. If a mention is not deliberate, fix the | ||
| # document instead of allowing it. | ||
|
|
||
| --api-key # vLLM's own flag, named in SECURITY.md as the recommended configuration for that service | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Scope the
--api-keyexception.This entry suppresses
--api-keyin every linted context. The test atpkg/runner/cli_surface_test.goLines 149-155 confirms that an allowlisted token also suppresses an invalid fencedjuliusinvocation. Scope exceptions to the required file and prose context, or keep command invocations outside the allowlist. Otherwise, future invalid Julius instructions can pass the gate.🤖 Prompt for AI Agents