Add --verbose and --json flags to cargo agents sync#234
Open
nikomatsakis wants to merge 2 commits into
Open
Conversation
c766b36 to
f0c5ab6
Compare
nikomatsakis
commented
Jun 1, 2026
| @@ -0,0 +1,389 @@ | |||
| //! Structured report layer. | |||
Member
Author
There was a problem hiding this comment.
I feel like we need to document this pattern somehow -- eg., in AGENTS.md and in the design docs.
f0c5ab6 to
b0a2627
Compare
b0a2627 to
e792d4d
Compare
Introduce a tracing-based report layer that captures structured events and renders them in three modes: Normal (human-friendly to stdout), Verbose (decision trace to stderr), or Json (accumulated array). The report layer is always installed. Commands emit events via tracing with a `report` field; the layer handles rendering. This replaces direct println!/eprintln! in sync and plugin commands. Commands instrumented: - `sync`: plugin/group/skill matching, directory searches, installations, removals, warnings — all via report events - `plugin list`: provider listing with contained plugins - `plugin validate`: per-item validation results and crate checks - `hook` dispatch: hook selection and execution (debug level) Global flags: - `-v`/`--verbose`: show debug-level decision trace on stderr - `--json`: emit JSON array to stdout, suppress human output Co-authored-by: Claude <claude@anthropic.com>
- Add `sync_with_report` helper to test harness for capturing report events with a scoped tracing subscriber - Three integration tests: - INFO level emits only install/remove events - DEBUG level includes plugin/skill decision trace - Skipped skills appear with reasons when predicates don't match - Document -v/--json in cargo-agents global options reference - Document report behavior in cargo-agents-sync reference Co-authored-by: Claude <claude@anthropic.com>
e792d4d to
d12c924
Compare
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.
What does this PR do?
Introduce a structured report system for sync decisions. A custom tracing layer captures events with a
reportfield and either pretty-prints them to stderr (--verbose) or accumulates JSON (--json).-vshows which plugins/groups/skills were considered and why each was included or skipped, plus searched directories--jsonemits a JSON array of structured event objects to stdout-v --jsoncombines both: verbose detail in JSON formatDisclosure questions
AI disclosure.
Questions for reviewers.