Skip to content

Week 4 self-check answer guidance

Answers should name an observable failure, a boundary and evidence. Equivalent wording is fine when the evidence remains checkable.

Q1

For example: “For a parser change, keep the public function name stable and run the named parser test.” The failure is an accidental API break or an untested behavior change. Evidence is the diff, the test command and its output.

Q2

The request is agent context and can be omitted; the hook is invoked by Git at the commit event and its nonzero exit prevents the commit. The agent can claim it ran the test without running it, so inspect the command output and the commit result.

Q3

No. A gate needs a nonzero exit for the bad staged input and a commit that is not created. The shell status and git log/git show observation settle it.

Q4

pyproject.toml is the finding because it is a protected dependency file for this task. The Python file may still receive the unused-import finding if it contains one; each finding must be fixed before the passing run.

Q5

It leaves application behavior, test coverage and the correctness of unstaged files unverified. Run the focused test and inspect the committed diff.

Q6

Example: allowed tools are read-only search and one named test; forbidden action is editing or committing; hand-back field is research.md with file/function references. The parent opens the location because a generated summary is a claim, not proof.

Q7

The test-output field is missing. Pause or return the work until the implementer supplies that evidence; a diff alone cannot establish the behavior.

Q8

Cannot tell. The hand-back has no location, input, command or output, so there is no evidence to confirm or refute safety.

Q9

Stop when the target is outside the role's files, the required test is absent, a tool would need a forbidden capability or the hand-back cannot satisfy its contract. Record the exact boundary and ask for a narrower task.

Q10

Any decision is defensible only when its evidence matches it. For example: “Decision: accept — evidence: blocked.txt has the nonzero finding, passed.txt has PASS, and git show identifies the commit.”

Transfer

An instruction might say “before editing src/parser.py, read its tests and report the focused test.” A gate might refuse a commit that stages pyproject.toml with that parser change. The first check establishes context was requested; the second establishes the staged-path invariant at the commit event. Neither proves parser semantics.

Retrieval 1. The hook's green result does not show that the focused test ran. Read the test command and its output, then inspect the commit result.

Retrieval 2. Open the cited file and run the named check yourself. A summary without a location and observable result remains cannot tell.