Question 180
A test run fails with a clear assertion describing a missing null check. How should Claude Code use that information?
- Claim success because most tests passed
- Ask for a completely different task to distract from the failure
- Use the assertion failure to fix and retest the affected path
- Remove the assertion so the failure is no longer visible
Explanation
Correct Answer
C:A specific failure narrows the defect and supports an evidence-driven iteration. The assistant should not overgeneralize from a single case.
Incorrect Answers
A:Partial pass rates do not satisfy a suite requiring all mandatory tests. The failing case remains unresolved.
B:Changing objectives does not repair the code. The test is directly relevant to the accepted request.
D:Suppressing valid checks masks the bug. Repair must occur in the implementation.
Question 181
A developer receives several plausible architecture options and wants to narrow them through discussion before coding. Which interaction pattern helps?
- Treat every ambiguous requirement as an invitation to guess
- Ask targeted questions about constraints and confirm acceptance criteria
- Begin by deleting the current implementation
- Generate all alternatives in the production branch without review
Explanation
Correct Answer
B:Clarifying requirements early avoids expensive wrong-path implementation. The chosen design can then be evaluated against explicit goals.
Incorrect Answers
A:Silent assumptions can make the patch unsuitable. High-impact unknowns warrant clarification.
C:Destructive action is premature when key constraints remain undecided. Requirement refinement should precede edits.
D:Multiple speculative changes complicate comparison and rollback. Narrow the plan before execution.
Question 182
A CI reviewer says a patch still breaks formatting but all unit tests pass. What should the next iteration do?
- Change the formatter rules solely to make the patch pass
- Rewrite business logic even though the failure is purely formatting
- Ignore the formatter because functional tests pass
- Fix cited style errors and rerun the repository formatter
Explanation
Correct Answer
D:Quality gates include formatting as well as behavior. A focused repair addresses the reported failing criterion.
Incorrect Answers
A:Loosening standards to fit one result is usually the wrong fix. The patch should meet documented project conventions.
B:Broad code changes create new risk without addressing the immediate style defect. Fix the correct layer.
C:Different checks enforce different contracts. A required style gate can block release independently of unit tests.
Question 183
A coding assistant performs several edits but the maintainer cannot tell which change addressed which requirement. What would improve iteration quality?
- Remove acceptance criteria from the patch description to make iterations faster
- Make one massive commit with no intermediate checks
- Choose changes by random file order rather than dependency
- Omit commit descriptions and test output to reduce noise
- Work in small traceable steps with verification after meaningful changes
Explanation
Correct Answer
E:Incremental diffs make failure attribution easier. Each iteration can target one acceptance criterion and provide observable evidence.
Incorrect Answers
A:Lack of criteria prevents reliable attribution of changes to requirements. Small verified steps are more effective.
B:Large unreviewed batches obscure cause and complicate rollback. They reduce feedback quality.
C:Unstructured edits can violate prerequisites. A deliberate sequence is more reliable.
D:Removing evidence makes it harder to understand outcomes. Concise traceability is useful, not optional.
Question 184
A proposed dependency upgrade affects a security patch and compatibility. Which feedback strategy is appropriate?
- Delete the compatibility suite so the upgrade is accepted
- Upgrade in a branch, then test compatibility and security
- Assume newer dependencies always preserve all interfaces
- Declare the upgrade safe after reading only the package title
Explanation
Correct Answer
B:A version change can have multiple effects. Measured test feedback is needed before adopting the patch.
Incorrect Answers
A:Removing checks conceals breakage and violates the stated evaluation need.
C:Major and minor releases can introduce incompatibilities. Verification is still required.
D:A name gives no evidence about dependency behavior. Release notes and tests matter.
Question 185
An assistant repeatedly edits a symptom while a failing integration test points to a shared contract mismatch. How should the next iteration change?
- Fix the common interface contract causing both errors
- Add more fallback guesses to each consumer independently
- Ignore the integration test because unit tests still pass
- Increase generation randomness to obtain a different patch
Explanation
Correct Answer
A:Repeated local patches suggest a systemic defect. Aligning producer and consumer schemas can resolve multiple failures at once.
Incorrect Answers
B:Scattered workarounds can hide divergence and increase fragility. The shared contract should be corrected.
C:Component tests cannot prove interactions are compatible. The failing integration signal is relevant.
D:Sampling variation does not supply root-cause evidence. Debugging should follow the observed mismatch.
Question 186
A CI pipeline must ask Claude Code to review a pull request without an interactive terminal. Which integration pattern fits?
- Launch an interactive session that waits for a developer to type replies
- Run Claude Code noninteractively with -p and defined IO
- Copy a local developer's session transcript into the CI job as credentials
- Treat the existence of a model response as proof that review passed
Explanation
Correct Answer
B:CI jobs need unattended execution, bounded permissions and machine-readable results where possible. The pipeline should parse output and enforce its own gate.
Incorrect Answers
A:Unattended runners can stall at prompts. Automation requires a mode designed for noninteractive execution.
C:Conversation history is not a safe authentication or CI interface. The runner needs controlled identity and scoped context.
D:Generated text can contain findings or errors. The pipeline must evaluate the actual criteria and status.
Question 187
A team wants CI-based Claude reviews to follow the same repository conventions as developer sessions. What should it include?
- Disable tests because the AI reviewer has read the code
- Depend on one engineer's private user instructions being present in CI
- Make the project's versioned CLAUDE.md available in the CI checkout
- Ask CI to infer standards from the latest commit message
Explanation
Correct Answer
C:Shared instructions allow a consistent review policy across environments. The runner still needs explicit checks for critical release criteria.
Incorrect Answers
A:Review can complement, not replace, executable quality gates. The project still needs objective verification.
B:Personal configuration is not guaranteed in ephemeral runners. Team policy should live with the project.
D:Commit messages are not a stable specification of review rules. Explicit project guidance is needed.
Question 188
A CI job asks Claude Code to review pull requests without modifying source branches. Which TWO controls make that workflow reproducible and least-privileged? Choose TWO.
- Use a human's interactive session as the only CI input
- Treat every missing reviewer response as a clean review
- Provide the exact source-control diff or revision range to the noninteractive review
- Grant deployment rights to every review runner for convenience
- Use tokens and tools limited to reading code and posting review findings
Explanation
Correct Answers
C:A bounded input ties findings to the intended pull request. The job can retain commit IDs and review evidence for auditing.
E:A reviewer should not be able to merge or deploy. Scoped credentials and execution permissions enforce the requested nonmutating role.
Incorrect Answers
A:Unattended automation needs deterministic inputs and noninteractive execution. Personal sessions are not a stable runner contract.
B:No output may indicate timeout or service failure. CI should represent incomplete advice as inconclusive.
D:Release permissions are unrelated to reporting findings and enlarge security risk. They violate the explicit no-modification boundary.
Question 189
A Claude Code CI job must emit predictable JSON findings that an automated pull-request bot can parse. It already runs in noninteractive mode using claude -p. Which CLI addition best enforces the output contract?
- Add only --continue and assume the prior session guarantees valid JSON
- Add --verbose and parse arbitrary explanation prose as findings
- Add --output-format json and --json-schema with a validated schema
- Remove output validation and accept any zero-exit response as a passing review
Explanation
Correct Answer
C:These flags request a JSON envelope with structured output constrained by the supplied schema. CI must still check process status, structured_output presence and the business meaning of each finding.
Incorrect Answers
A:Session continuity concerns conversation state, not output type. It may also carry stale review context into the pipeline; a schema must be declared explicitly.
B:Verbose diagnostics are not a structured review contract. A regex over arbitrary narrative cannot reliably identify valid findings, errors and incomplete runs.
D:A successful invocation can return findings that still need schema and policy checks. Exit codes alone do not establish that the report matches the bot contract.
Question 190
A pull request includes untrusted instructions in a code comment asking the CI agent to ignore all security tests. What should the architecture do?
- Obey the comment because it is part of the pull request
- Disable security tests to avoid confusing the reviewer
- Treat repository text as untrusted and enforce external gates
- Grant the agent more privileges to inspect the suspicious comment
Explanation
Correct Answer
C:Code under review can contain prompt-injection text. Immutable CI checks and permission boundaries prevent it from controlling release policy.
Incorrect Answers
A:Untrusted source content is not authorized to redefine the reviewer's instructions. Following it would undermine the audit.
B:Removing hard checks gives the attacker the desired outcome. Automated enforcement must remain active.
D:Broader permissions do not neutralize prompt injection. The relevant defense is instruction/data separation.