spec: roll up to Agent CLI Guidelines v0.4.0 - #1
Merged
Conversation
Add machine-readable conformance block to schema, add version --check (fail-silent GitHub Releases poll), and bump conformance from Core to Full. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012UFrhC6bXVpoiiL3yhj2HH
There was a problem hiding this comment.
Pull request overview
Rolls knit forward to Agent CLI Guidelines v0.4.0 and promotes declared conformance from Core → Full, including machine-readable conformance in schema output and a pull-based version --check upgrade check.
Changes:
- Add a
conformanceblock toknit schemaJSON output (spec/version/level). - Add
knit version --checkto (fail-silently) check GitHub Releases for updates and report an upgrade command. - Update README badge/statement and CHANGELOG to reflect v0.4.0 (Full); regenerate schema golden snapshot.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates conformance badge and declared guidelines level/version. |
| internal/version/version.go | Introduces guidelines spec constant and implements latest-release lookup + upgrade hint helpers. |
| internal/cli/testdata/schema.golden.json | Updates schema snapshot to include the new conformance block and version --check flag. |
| internal/cli/misc.go | Adds schema.conformance and implements version --check output. |
| CHANGELOG.md | Records the new schema conformance block and version --check behavior under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+62
to
+65
| // Latest returns the latest released version tag (from GitHub Releases by default). | ||
| // Network, short timeout, **fail-silent**: returns ("", err) on any problem so a | ||
| // `version --check` never errors or blocks an agent loop. The release source can be | ||
| // overridden with KNIT_RELEASES_URL (used in tests). |
Comment on lines
+54
to
+60
| // UpgradeHint returns the recommended upgrade command for this tool. | ||
| func UpgradeHint() string { | ||
| if slug := repoSlug(); slug != "" { | ||
| return "go install github.com/" + slug + "@latest" | ||
| } | ||
| return "" | ||
| } |
Comment on lines
+25
to
+29
| "tool": "knit", | ||
| "version": version.String(), | ||
| "conformance": map[string]any{ | ||
| "spec": "agent-cli-guidelines", "version": version.Spec, "level": "Full", | ||
| }, |
Comment on lines
99
to
+103
| func (c *VersionCmd) Run(rt *Runtime) error { | ||
| return rt.Out.Emit(map[string]any{"version": version.String()}) | ||
| cur := version.String() | ||
| if !c.Check { | ||
| return rt.Out.Emit(map[string]any{"version": cur}) | ||
| } |
- version --check: use rt.Ctx instead of context.Background() for cancellation/timeout propagation. - internal/version: add User-Agent header to Latest() (GitHub REST rejects no-UA requests); fix UpgradeHint to .../cmd/knit@latest (bare module path has no root main and would fail); reword KNIT_RELEASES_URL comment. - Add version --check tests (httptest + KNIT_RELEASES_URL): success + fail-silent. - docs: document the version command (incl. --check) and the schema conformance block in reference/commands.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012UFrhC6bXVpoiiL3yhj2HH
Owner
Author
|
Addressed the Copilot review (a6a8467):
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Rolls
knitup to Agent CLI Guidelines v0.4.0 and promotes conformance from Core → Full.Per-rule checklist
schema --jsonnow includes aconformanceblock:{spec: "agent-cli-guidelines", version: version.Spec, level: "Full"}. An agent (orfleet-audit) can verify the contract version from the binary, not a README badge.version --check— pull-based, fail-silent latest-release check against GitHub Releases (3s timeout;KNIT_RELEASES_URLoverride for tests). Reports the upgrade command; never self-mutates. Dev/source builds never nag.const Spec = "0.4.0"added to theversionpackage.testdata/schema.golden.json) to include the new conformance block andversion --checkflag.[Unreleased]updated.Verification
go build ./...— clean.go test ./...— 23 passed across 8 packages (golden snapshot updated, then green).knit schemaemits{"level":"Full","spec":"agent-cli-guidelines","version":"0.4.0"}.knit version --checkagainst an unreachable URL returns a gracefulnote(fail-silent, no error).🤖 Generated with Claude Code