Skip to content

fix(loop-sync): honor json output flag#138

Merged
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
Zhang-986:codex/loop-sync-json-output
Jul 4, 2026
Merged

fix(loop-sync): honor json output flag#138
cobusgreyling merged 1 commit into
cobusgreyling:mainfrom
Zhang-986:codex/loop-sync-json-output

Conversation

@Zhang-986

Copy link
Copy Markdown
Contributor

Summary

Make loop-sync --json emit the machine-readable drift report it documents, so CI and agent loops can parse the result reliably.

Changes

  • New pattern or starter (followed templates/pattern-template.md + updated registry.yaml)
  • Doc / example improvement
  • Tool change (loop-sync)
  • Story (includes real failure or surprise + lesson)

Details

loop-sync already parsed --json, but parseArgs did not return the parsed json flag. As a result, users running loop-sync <target> --json still received the human-readable report.

This fixes the CLI contract by carrying the parsed flag through to main, and adds a CLI-level regression test that parses stdout as JSON even when loop-sync exits with the existing warning code.

Checklist (from CONTRIBUTING)

  • All required sections present for patterns
  • Links work from README, patterns/README, starters/README, docs/index
  • No secrets, tokens, internal company URLs
  • STATE.md* examples use .example suffix
  • Safety-related content references docs/safety.md
  • Ran node tools/loop-audit/dist/cli.js . through scripts/ci-audit-gates.sh

Testing / Dogfood

  • cd tools/loop-sync && npm test
  • bash scripts/ci-validate-gates.sh
  • bash scripts/ci-audit-gates.sh
  • git diff --check

Screenshots / Examples (if UI or command output)

Before this change, loop-sync --json emitted the human-readable Loop Sync Report. The added regression test now executes the built CLI with --json and verifies stdout parses as JSON.


This template enforces the high bar this reference is known for.

@Zhang-986 Zhang-986 requested a review from cobusgreyling as a code owner July 4, 2026 02:33
@cobusgreyling cobusgreyling merged commit 3499dcb into cobusgreyling:main Jul 4, 2026
2 checks passed
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.

2 participants