{
  "uid": "cogitave.learn.open-your-first-pull-request.pass-the-gates-and-open-the-pr",
  "kind": "moduleUnit",
  "href": "/modules/open-your-first-pull-request/pass-the-gates-and-open-the-pr/",
  "title": "Pass the gates and open the PR",
  "summary": "",
  "type": null,
  "products": [],
  "roles": [],
  "levels": [],
  "subjects": [],
  "headings": [
    "Let the pre-commit hooks run",
    "Satisfy docs-as-code",
    "Open the pull request"
  ],
  "source": "You have a signed, well-formed commit. Now let the checks run, make the change\ndocs-complete, and open the pull request.\n\n## Let the pre-commit hooks run\n\nWhen you commit, a **pre-commit runner** runs a standard set of checks against\nyour staged files, and the same commands run in CI so local and CI stay in\nparity. Cogitave uses **lefthook**, a single polyglot runner, across its estate;\nits\n[hooks-precommit standard](../../../../standards/docs/standards/hooks-precommit.md)\ndefines the full set:\n\n| Stage | What runs |\n| --- | --- |\n| Formatters | rustfmt, gofumpt, biome (TS/JSON/CSS/MD) |\n| Linters | clippy (`-D warnings`), golangci-lint, biome lint |\n| Hygiene | trailing-whitespace, final newline, large-file block, merge-conflict and YAML/JSON validity |\n| Secret scan | gitleaks on staged files, offline |\n| commit-msg | commitlint (Conventional Commits) |\n\nFormatters that fix files re-stage them, so most style problems are corrected\nbefore you even see them.\n\n> [!IMPORTANT]\n> The hook is a **bypassable convenience** - the real gate is CI. A contributor\n> can skip the local hook, but the same checks run again on the pull request and\n> block the merge there. So a green hook is a head start, not a guarantee; a\n> passing PR is what counts. In CI the secret scan is also deeper (full history),\n> not just staged files.\n\n## Satisfy docs-as-code\n\nDocs-as-code is the discipline: if code changes, docs change, and a gate enforces\nit mechanically rather than on the honor system. Cogitave's version of the rule\nis blunt - **if code changes, docs change** - and its `docs-required` CI gate\nfails a pull request that touches code but does not touch `docs/`, a `*.md` file,\nor the `CHANGELOG`. That is written into Cogitave's floor\n([AGENTS.md](../../../../../AGENTS.md), rule 4) and its\n[documentation standard](../../../../standards/docs/standards/documentation.md); a\n`docs-exempt` label exists for the genuine exceptions, but reaching for it is the\nexception, not the habit. Separately, schema validation and any broken xref,\nlink, or bookmark are **blocking errors**, so the docs you write have to resolve,\nnot just exist.\n\nPractically: before you open the PR, ask what a reader needs to know because of\nyour change, and write that down in the same branch.\n\n## Open the pull request\n\nPush your branch and open the PR. You are **proposing** a change - opening a\nGitHub PR and stopping for review is exactly the propose-only shape you learned in\nthe request lifecycle. The reviewer and the CODEOWNER hold the merge gate; agents\npropose and humans enact\n([AGENTS.md](../../../../../AGENTS.md), rules 6-7).\n\n> [!TIP]\n> Never push to a protected branch. Open a branch and a PR, let every gate go\n> green, and let a human merge. That is the finish line.\n",
  "partOf": "cogitave.learn.open-your-first-pull-request",
  "durationInMinutes": 6,
  "quiz": null
}