Appearance
PR Docs Review Checklist
Use these 20 checks to record how your PR follows the engineering docs. The comment is required for Medium and High risk pull requests; Low risk pull requests skip it (see Risk level). Each check groups related rules; read and satisfy every applicable rule at its source before marking it pass. The checklist does not replace the source guidelines.
Review the PR diff, its affected callers, and its verification against the docs. Reading the docs alone is not enough. Never claim a test ran unless it actually ran.
The backend overview, frontend overview, and home page are indexes. Frontend Coding Guideline is currently a placeholder; it adds no checks. Frontend changes still follow the data, contract, and abstraction rules below.
Checklist
IDs are stable within version 1. Do not rename or reuse an ID for a different requirement. Keep each catalogue row in the form | ID | Check | Applies when | Source |; the validator reads IDs from these rows.
Pull request
| ID | Check | Applies when | Source |
|---|---|---|---|
| PR-001 | Scope, risk, and review path. Describe the purpose, truthful risk level, affected areas, evidence for excluded areas, and review order. Split unrelated or independently reviewable changes; keep mechanical and logic changes in separate commits; remove debug code. When an implementation issue is required, check its approved specification, decisions, constraints, and resolved questions against the implementation; any deviation is recorded in the issue first. | Every PR; implementation issues follow their own small-work exemption. | PR guideline, Issue guideline |
| PR-002 | Verification matches the change. Pair changes with tests or an explicit test gap. Self-review the diff; verify happy paths, validation, edge cases, and stated failure modes. For an implementation issue, cover every acceptance criterion with an automated test unless it is marked manual, and verify its end states. Record actual results; concurrency claims need concurrent evidence. Attach applicable API, visual, and issue evidence. | Every PR; evidence depends on the change. | PR guideline, Issue guideline |
| PR-003 | Release and recovery are understood. Identify migrations, old-code/new-schema overlap, queued payloads, breaking API changes, and rollback or forward-repair plans. State why each absent concern is not applicable. | Changes affecting deployment, schema, API contracts, or jobs. | Guideline |
Data integrity
| ID | Check | Applies when | Source |
|---|---|---|---|
| DATA-001 | One authoritative source. Use one source and one field name for each fact. No legacy aliases, multi-source probing, shadow copies, hidden reconciliation, or redundant ownership checks after an authoritative load. Preserve real boundary, capability, lifecycle, and missing-row checks. | Changes reading, writing, or transferring business data. | Guideline |
| DATA-002 | Required data stays required. Match declared nullability; do not hide missing required values with optional access, defaults, empty probes, swallowed errors, or i18n fallbacks. Integrity failures stop the operation; partial writes must not leave inconsistent state. | Changes using required data or updating related state. | Guideline |
| DATA-003 | Validation stays at boundaries. Parse, coerce, trim, and normalize only at explicit request, ingestion, DTO, validator, or migration boundaries. Unknown TypeScript objects use the documented schema validator; no any or manual field-parser helpers. Prefer framework validation. | Changes accepting or transforming external or unknown data. | Guideline |
| DATA-004 | Use the contract directly. No ad-hoc key mapping, unnecessary compact types, pass-through variables, property-access wrappers, one-use helpers, or unrequested presentation transformations. Correct the contract instead of repairing values at consumers. | Changes consuming or displaying contract fields. | Guideline |
Backend–frontend contract
| ID | Check | Applies when | Source |
|---|---|---|---|
| CONTRACT-001 | One exact, deterministic API shape. Backend JSON and canonical frontend types agree on names, relations, required keys, nulls, arrays, primitives, enums, and dates. Return required nested objects, explicitly eager-load relations, and do not hide missing required relations with defaults. | Changes producing or consuming API data. | Guideline |
| CONTRACT-002 | Contracts match API operations. Keep request, list, and detail contracts distinct. Detail/view/edit flows fetch detail data. Share canonical types; no unsafe casts, local response-type copies, or narrower types without a matching endpoint. Change backend and frontend together without compatibility shapes. | Changes to endpoints, API types, or callers. | Guideline |
| CONTRACT-003 | Consumers and transport preserve payloads. Pass original API objects through. No consumer or interceptor remapping, flattening, normalization, aliases, fake initial entities, or merged response shapes. Presentation values must not mutate payloads; transport and contract failures stay errors. | Changes to API clients, stores, components, or other consumers. | Guideline |
Abstraction
| ID | Check | Applies when | Source |
|---|---|---|---|
| ABSTRACTION-001 | Every abstraction earns its place. Inspect existing conventions and current requirements; name the direct alternative. New layers need present domain, reuse, substitution, boundary, complexity, or testing evidence. Compare total cognitive load, prefer existing primitives and local composition, keep justified local duplication, remove speculative or forwarding layers, and preserve contracts with focused tests. | Implementation or refactoring; especially new helpers, classes, or layers. | Guideline |
Models
| ID | Check | Applies when | Source |
|---|---|---|---|
| MODEL-001 | Model types describe reality. Document every column and relation with precise nullable and collection types. Keep PHPDocs synchronized with schema and model changes. Use the documented casts method and appropriate field casts, including datetime fields. | Changes to Eloquent models, attributes, casts, or relations. | Guideline |
| MODEL-002 | Model behavior and strictness are deliberate. Keep complex business behavior in dedicated Actions, Jobs, or Services. Follow strict PHP typing, explicit return types, PHPStan-compatible docs, final-by-default classes, and clear names. Check strict-model behavior for lazy loading, discarded attributes, and missing attributes; do not disable it to conceal violations. | Changes to model behavior or supporting PHP classes/configuration. | Guideline |
Date and time
| ID | Check | Applies when | Source |
|---|---|---|---|
| DATETIME-001 | Datetime formats, types, and timezone agree. Exchange ISO8601 values; use immutable dates, correct model casts/PHPDocs, and appropriate CarbonInterface or DateTimeInterface hints. Use the application timezone by default; specify another only when needed. Handle returned immutable values without assuming in-place mutation. | Changes using datetime values. | Guideline |
Requests
| ID | Check | Applies when | Source |
|---|---|---|---|
| REQUEST-001 | Requests are validated and read with types. Use Form Requests when validation/authorization is complex, array-form rules, and Custom Rules for complex validation. Avoid raw input/get/all; use documented typed access after validation. Pass validated payloads directly where appropriate instead of reparsing them. | Changes to HTTP request validation or input access. | Guideline |
| REQUEST-002 | Request and response responsibilities stay clear. Keep business logic outside Requests. Actions use the project API-response trait and documented success/exception responses; errors must remain errors. | Changes to Requests or HTTP Actions. | Guideline |
Queries
| ID | Check | Applies when | Source |
|---|---|---|---|
| QUERY-001 | Queries preserve typing and justified projections. Start database-touching Eloquent queries with Model::query(). Document collections returned by get(). Prefer complete models for modest results; justify narrower projections by data size and keep their contract exact. | Changes to Eloquent queries. | Guideline |
Custom query builders
| ID | Check | Applies when | Source |
|---|---|---|---|
| BUILDER-001 | Custom builders are registered and typed. When a custom builder is justified, extend the Eloquent Builder, register the typed newEloquentBuilder() on the model, document the static query() return type, and call custom methods through Model::query(). Do not introduce a builder merely to satisfy this checklist. | Changes creating or modifying a custom query builder. | Guideline |
Migrations
| ID | Check | Applies when | Source |
|---|---|---|---|
| MIGRATION-001 | Schema changes are compatible and safe. Inspect real schema/status and drift. Prefer Schema/Blueprint and additive changes; create complete new-table schemas. Guard added columns on existing tables, use safe nullability/defaults, clean data before tightening constraints, and retain change() modifiers. Review foreign keys, nullable ordering, indexes, constraints, driver branches, and SQLite/PostgreSQL compatibility. | New or modified migrations or schema repairs. | Guideline |
| MIGRATION-002 | Backfill, deployment, tests, and recovery are verified. Use query-builder backfills without Eloquent, representative data, batching, and separate heavy work. Preserve deployment compatibility and artifact ordering. Define safe up/down behavior or documented no-op/forward repair. Run the documented compatibility test and relevant fresh/upgrade/pretend/rollback/retry/partial-failure checks; plan locks, runtime, backfill, isolated production execution, and recovery. Do not execute production operations solely to check this item. | New or modified migrations, backfills, or migration rollout plans. | Guideline |
Write the review comment
- Use the approved revision of this docs repository. Record its full commit SHA, and the current PR head SHA.
- Copy the complete template below into one comment authored by the PR author. Replace both SHA placeholders.
- Review all 20 checks. Set each status and replace its evidence. Keep unrelated checks with
not_applicableand a specific scope reason; do not delete them. - Run the validator with the expected PR/docs SHAs supplied independently of the comment. Fix every error before requesting review.
- Update the same comment when the PR changes. Re-review the changed scope and any affected earlier claims; do not just replace the SHA.
- The reviewer checks that evidence is real and exclusions are justified before approving.
Status and evidence
| Status | Meaning | Required evidence |
|---|---|---|
pass | Every applicable requirement in this check was reviewed and satisfied. | Concrete code locations or immutable links, what was checked, and actual results. Include test/output references when relevant. |
not_applicable | None of this check applies to the PR. | A specific reason tied to the changed scope. |
fail | Not reviewed yet, not verified, or at least one applicable requirement is unmet. | The outstanding work, finding, or verification gap. This status blocks validation. |
If only part of a check applies, review that part and report pass or fail. Do not mark the whole check not_applicable. Explain any untested requirement honestly; do not convert an outstanding requirement into an exclusion.
Good evidence:
src/api/orders.ts:24 and OrderResponse.php:18 — compared field names, nullable relations, and array types; API fixture matches the canonical frontend type.tests/Feature/OrderTest.php::test_invalid_quantity — ran the test; passed. Negative quantity returns 422 and does not create an order.not_applicable: diff changes docs and navigation only; no migration, backfill, or schema rollout is included.
Insufficient evidence:
Read the docs.Looks good.All tests pass.without identifying the tests and recorded results.N/A.without explaining scope.
Comment format v1
Use the exact marker and fence lines shown below. You may write prose outside the marked block. The comment must contain exactly one review block; do not add a second block or duplicate markers.
The JSON object has exactly four keys:
version: the number1.head_sha: the current PR head commit, exactly 40 lowercase hexadecimal characters.docs_commit: the approved docs revision, in the same SHA format.checks: an array containing every catalogue ID exactly once; order does not matter.
Every check has exactly id, status, and evidence. All three are strings. Status is exactly pass, not_applicable, or fail; evidence must contain non-whitespace text. No extra keys, aliases, comments inside JSON, or trailing commas.
The copied template starts with fail for every check. It intentionally cannot pass until you complete the review. Replace every Not reviewed yet. entry with the evidence or exclusion reason.
Unreviewed template evidence is rejected for pass and not_applicable.
Copy the complete 20-check comment template
markdown
<!-- omes-docs-review:v1 -->
```json
{
"version": 1,
"head_sha": "<current PR head SHA: 40 lowercase hex characters>",
"docs_commit": "<approved docs checkout SHA: 40 lowercase hex characters>",
"checks": [
{
"id": "PR-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "PR-002",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "PR-003",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "DATA-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "DATA-002",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "DATA-003",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "DATA-004",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "CONTRACT-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "CONTRACT-002",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "CONTRACT-003",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "ABSTRACTION-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "MODEL-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "MODEL-002",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "DATETIME-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "REQUEST-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "REQUEST-002",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "QUERY-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "BUILDER-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "MIGRATION-001",
"status": "fail",
"evidence": "Not reviewed yet."
},
{
"id": "MIGRATION-002",
"status": "fail",
"evidence": "Not reviewed yet."
}
]
}
```
<!-- /omes-docs-review -->Validate a comment
Save the full comment as a UTF-8 file, then run from an approved docs checkout. It needs Deno 2:
bash
deno run -q --no-config --allow-read scripts/validate-pr-docs-review.ts \
--comment-file /tmp/pr-docs-review.md \
--head-sha "$PR_HEAD_SHA" \
--docs-sha "$APPROVED_DOCS_SHA"PR_HEAD_SHA must come from the target PR's current head, and APPROVED_DOCS_SHA from the approved docs revision. Automation must obtain these from trusted configuration/GitHub metadata, check out that docs revision, and use its catalogue and validator. Never obtain the expected SHAs from the submitted comment. The validator compares values; it does not fetch GitHub or verify the checkout revision itself.
| Exit code | Meaning |
|---|---|
0 | Format and coverage are valid, SHAs match, and all checks are pass or not_applicable. |
1 | Invalid comment, stale/wrong SHA, missing/duplicate/unknown ID, empty evidence, or a fail check. |
2 | Invalid CLI arguments, unreadable input/catalogue, or invalid catalogue. |
Errors go to stderr; a successful summary goes to stdout. LF and CRLF comments are accepted.
Reviewer and automation responsibilities
The local validator checks structure, coverage, status, and supplied SHA values. It cannot prove someone read the docs, verify evidence, or determine whether a claimed exclusion is honest. Reviewers must compare the comment with the diff and the linked guidelines.
A future GitHub integration must verify the comment author against the PR author, select their latest marked review comment, obtain trusted expected SHAs, and revalidate when the head or selected comment changes. Do not fall back to an earlier passing comment when the latest one fails.
This repository currently provides the format and local validator only. It does not fetch comments or enforce GitHub merge protection. Do not claim automatic enforcement until that integration is configured.
When source rules appear to conflict or an exception is needed, record fail and ask the reviewer to resolve the requirement. Do not invent precedence or mark an unresolved requirement pass.

