← Code review and governance guides

How to review a SpecDD pull request

How-To Code review and governance Intermediate 1141000HOWTO-1141000

HOWTO-1141000Code review and governanceIntermediate

This guide shows you how to review a pull request that uses spec-driven development.

The goal is not to add another layer of process. The goal is to make the review concrete: every meaningful code, test, task, and spec change should line up with the local contracts that humans and agents are expected to follow later.

Short answer

Review the pull request against the effective SpecDD specs for the changed files. Confirm that every changed file is inside Can modify or Owns, required behavior in Must still holds, Must not and Forbids are not weakened by implementation, tasks were updated only after verification, and code, specs, tests, and documentation tell the same story.

When to use this guide

Use this guide when:

Steps

1. Identify the review target

Start by naming the change in human terms:

Review the Itinerary validation change.

Then identify:

Do not rely on file proximity alone. A sibling spec is not inherited just because it looks related.

2. Check write authority

For each changed file, ask why the pull request was allowed to change it.

Acceptable reasons usually include:

Suspicious reasons include:

If a file is outside authority, request changes before reviewing details.

3. Review behavior against specs

Map the pull request to the relevant spec sections:

The implementation should not merely look plausible. It should satisfy the local contract.

If behavior changed and the spec did not, decide whether the code is wrong or the spec needs an update. Do not approve a pull request where the spec and code disagree.

4. Check Must not and Forbids

Review negative constraints explicitly.

Must not covers forbidden behavior, non-goals, and architecture boundaries:

Must not:
  Change destination search behavior.

Forbids covers blocked dependencies, paths, modules, libraries, tools, or access:

Forbids:
  ../booking/*
  Direct browser storage writes from itinerary behavior.

These sections are stronger than a task that happens to ask for adjacent work. A task cannot authorize behavior that Must not forbids or a dependency that Forbids blocks.

5. Verify spec, code, and tests are aligned

Look at the pull request as one changeset:

For low-risk wording fixes, this may be quick. For behavior, security, dependency, or public contract changes, expect stronger evidence.

6. Review tasks and Done when

Completed task markers should be earned:

Tasks:
  [x] Add missing-place validation.

Accept [x] only when the work is implemented and checked. Use [?] when the change needs a decision and [!] when work is blocked by a real constraint.

Done when is the review checklist for completion. If it says a behavior must be covered by a check, the pull request should show that check or explain why it could not be run.

7. Decide approve, revise, or stop

Use three review outcomes:

A good request for changes names the violated contract and the smallest useful correction.

Review checklist

Before approving, ask:

Common mistakes

How to verify the result

The pull request review worked when:

← Code review and governance guides