process: Block a pull request whose code changes behavior without updating the knowledge layer
Back to our planType
process
Summary
Make it impossible to merge a code change that alters how the site behaves while its documentation stays the same. A pull request that touches a module's code must either update that module's note or say, with a reason, that behavior didn't change. The reviewer checks that statement. The generated reference pages must also be up to date. Both are required checks.
Problem
Today nothing connects a code change to its documentation. The rules say documentation is kept current, but a written rule is context, not enforcement (Claude Code: memory, opens in a new tab), and the open drift issues (#495, #517, #279) show it. Summary of the owner's direction (2026-11-06, Claude session, text, recorded on the epic): the review always checks for behavior changes, and a pull request whose documentation is not in sync is blocked.
No tool can tell with certainty whether a diff changes behavior. So the check makes silence impossible, and the judgment stays with the reviewer.
Proposed fix
- The map from code to notes,
docs/knowledge/map.json(created with the events entry in #715, which also uses it to load notes): a list of entries, each with the path patterns of a module or shared area and the note that describes it (for examplesrc/modules/events/**andsrc/modules/events/README.md). Only entries whose note exists are enforced, so the rollout adds one entry per module as its note lands. - A "Knowledge" section in the pull request template with one line:
Behavior change: yesand what changed, orBehavior change: noneand why. - The check, inside
PR Policy(already a required check, so it blocks from the day it merges). For each map entry: if the pull request changes a file under its paths, other than tests (*.test.*) and the note itself, then either the note is among the changed files, or the Knowledge section saysBehavior change: nonefollowed by a reason of at least 20 characters. Otherwise the check fails and says which note to update. Dependabot pull requests stay exempt as today. - The logic lives in a tested file (
.github/scripts/), not inline in the workflow, with unit tests for the matching and the parsing, the way.claude/hooks/rules.mjsis tested. Knowledge sync(the generated-reference check from the content-type sub-issue) joins the required checks of themainruleset.- The written rule follows the check: the list of required checks in
AGENTS.mdstep 4, and one line in the Definition of Done indocs/process/project-management.md(the note is updated, or "no behavior change" is declared and the reviewer agreed).
What counts as a behavior change comes from the decision record of the design sub-issue.
Acceptance criteria
- Not done: A pull request that changes
src/modules/events/ui/EventCard.tsxwith no change to the events note and no declaration failsPR Policy, and the message names the note. - Not done: The same pull request passes once the note changes, and also passes with
Behavior change: noneand a reason. - Not done: A pull request that changes only tests, or only files outside every map entry, is not asked for anything.
- Not done: The matching and parsing logic has unit tests that run in CI.
- Not done:
Knowledge syncis a required check onmain. If the session's token can't change the ruleset, the issue getsneeds ownerwith one plain question and the exact steps. - Not done:
AGENTS.mdstep 4 and the Definition of Done name the new checks. - Not done: The review of this PR lists it as a policy change the owner asked for.
Files likely touched
.github/workflows/pr-policy.yml, .github/pull_request_template.md, .github/scripts/ (new, with tests), .github/workflows/ci.yml, docs/knowledge/map.json (read, not created), AGENTS.md, docs/process/project-management.md.
Must not touch
src/, .agents/ and .claude/ (the next sub-issue changes the skills and hooks), docs/guidelines/.
Open questions
None for the owner unless the ruleset can't be changed from the session.
Area
ci, tooling
Priority
high
Generated by Claude Code, opens in a new tab