City DevOps wants PR review automation to emit machine-parseable inline comments. Which Claude Code CI pattern fits?
Select an answer to reveal the explanation.
Short Explanation
CI needs comments it can post, not a novel. JSON output plus a schema turns review findings into structured inline comments the bot can place on the PR.
Full Explanation
City DevOps PR review bots must emit findings that CI can turn into inline comments without a human rewriting each sentence. The correct pattern is to use Claude Code's JSON output format together with a JSON schema that defines fields such as file path, line, severity, category, and message. Structured output lets the pipeline map each finding to a GitHub or GitLab comment API call, keep schema validation in the gate, and archive auditable review artifacts for municipal change-control.
Free-form prose plus regex scraping fails as a concept because narrative wording drifts between runs; regexes break when Claude rephrases, and the pipeline cannot reliably bind a finding to a file and line. Disabling output formatting so reviewers invent a schema each run fails because CI needs a stable contract across every permitting, parks, or housing PR—ad-hoc schemas destroy automation and comparison over time. Requiring an interactive terminal so humans retype findings fails because unattended municipal pipelines cannot wait for a TTY; interactive retyping also reintroduces transcription error and removes the audit trail of machine-validated structure.
Exam caveat: JSON output format and a schema make comments machine-parseable; they do not by themselves guarantee that every finding is correct or that severity policy is right—those still need categorical prompt criteria and human oversight for high-risk merges. Operational check: in the city CI job, assert Claude emits schema-valid JSON, reject the step on validation failure, and only then post structured inline comments; confirm a sample PR shows path/line-bound comments rather than a single prose blob in the job log.