Skip to content

fix(check): keep --json output valid when a name or group does not resolve - #868

Merged
runkids merged 1 commit into
mainfrom
runkids/check-unknown-name-json
Nov 11, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/check-unknown-name-json

Conversation

@runkids

@runkids runkids commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

None. This is the second follow-up listed under "Not covered" in #865 and #867.

What and why

skillshare check <name> --json could not be trusted as a CI gate:

  • A mistyped name passed. When no name or group resolved, it printed an empty result and exited 0. Text mode exits 1.
  • stdout was not JSON. The warning for a skipped name (! nope: ...) was printed on stdout before the JSON object.
  • A group name did the same. check frontend --json printed 'frontend' is a group — expanding to ... before the JSON.
  • Early failures were plain text. An invalid flag combination or a missing project config printed ✗ ... on stdout.

With --json, check now:

  • exits 1 and prints {"error": "no valid skills to check: <reasons>"} when nothing resolves;
  • lists skipped names in a warnings array when other names do resolve (the field is absent when there are none);
  • does not print the group expansion note;
  • reports every other failure as the same error object.

Text mode is unchanged. check --json without names is unchanged, so the Herdr panel is not affected.

Behavior changes to review

  • A script that relied on exit 0 from check <unknown> --json, or that read the plain-text error, will now see exit 1 and an error object.
  • The filtered result can carry a new warnings field.

Also updated: the Exit Status paragraph of check.md in English and four translations, and the built-in skill's check section.

Checks

  • make check in a devcontainer-image container on the worktree: exit 0.
  • Ten new integration tests: unknown name (alone, two names, with --exit-code, project mode), unknown group, a group of local skills only (positional and --group), a group name that expands, an unknown name beside a known one, an invalid flag combination, and a missing project config. Nine were run against the unfixed code and failed; the test for a group of local skills only was added after that run and has only been run with the fix.
  • Ran the built binary in an isolated home to read the output and exit codes.
  • Reviewed with the skillshare-code-review skill; its confirmed findings are fixed. The first version sent warnings to stderr; the review pointed at the structured-output contract in main.go (nothing on stderr) and the warnings field other commands use.
  • Not run: the website build.

Not covered

  • check --group --json (a typo where --json is taken as the group name) runs in text mode and then appends an error object.
  • The JSON Output section of check.md describes warnings and error in prose and has no sample of them.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

…solve

check <name> --json printed its warnings and the group expansion note on stdout before the JSON, so the output could not be parsed. When no name or group resolved it then printed an empty result and exited 0, while text mode exits 1, so a CI gate with a mistyped name passed.

With --json, check now exits 1 with an error object when nothing resolves, lists skipped names in a warnings field when some do, and reports every other failure (bad flag combination, missing config) as the same error object. Text mode is unchanged.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T16:08:09.285982Z 5199a13 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 55161e4 into main Nov 11, 2026
9 checks passed
@runkids
runkids deleted the runkids/check-unknown-name-json branch November 15, 2026 17:52
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