Doc comments on every exported Go symbol and package, enforced in CI #2086

Closed
opened 2026-10-29 14:12:31 +00:00 by ben · 4 comments
Owner

Why

CODING-STANDARDS.md requires a doc comment on every exported symbol and package. A count on 28 Oct found ~2,530 of 2,946 exported funcs/methods and 97 of 115 packages documented — about 416 funcs/methods and 18 packages still missing.

Done when

  • A lint check for exported-symbol docs (e.g. revive exported) runs in CI
  • The tree passes it
## Why CODING-STANDARDS.md requires a doc comment on every exported symbol and package. A count on 28 Oct found ~2,530 of 2,946 exported funcs/methods and 97 of 115 packages documented — about 416 funcs/methods and 18 packages still missing. ## Done when - [ ] A lint check for exported-symbol docs (e.g. `revive` `exported`) runs in CI - [ ] The tree passes it

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: Add a CI lint check that every exported Go symbol and package has a doc comment (CODING-STANDARDS.md), and make the tree pass it.

Current behavior:
CODING-STANDARDS.md requires a doc comment on every exported symbol and package, but nothing enforces it — no revive config or exported-docs lint runs in CI (confirmed 2026-10-29). A 2026-10-28 count found ~2,530/2,946 exported funcs/methods and 97/115 packages documented — about 416 funcs/methods and 18 packages still undocumented.

Desired behavior:
A lint for exported-symbol and package doc comments (e.g. revive's exported rule, or equivalent) runs in CI, and the whole Go tree passes it.

Acceptance criteria:

  • CI runs an exported-symbol/package doc-comment lint over the Go tree
  • Every exported func/method/type/const/var and every package carries a Go-convention doc comment (comment begins with the symbol/package name)
  • The lint is wired into the existing CI gate chain and fails on a missing doc comment
  • The scan excludes node_modules/ and .sandcastle/nix-store/ (the #1913 gofmt-scan convention)

Out of scope:

  • Rewording existing, already-present doc comments for style
  • Documenting unexported symbols

Triage note (model): this is largely mechanical (~416 symbols). A model-sonnet override may right-size it off the Opus default — applying that label stays a human decision (triage-labels.md).

> *This was generated by AI during triage.* ## Agent Brief **Category:** enhancement **Summary:** Add a CI lint check that every exported Go symbol and package has a doc comment (CODING-STANDARDS.md), and make the tree pass it. **Current behavior:** CODING-STANDARDS.md requires a doc comment on every exported symbol and package, but nothing enforces it — no `revive` config or exported-docs lint runs in CI (confirmed 2026-10-29). A 2026-10-28 count found ~2,530/2,946 exported funcs/methods and 97/115 packages documented — about 416 funcs/methods and 18 packages still undocumented. **Desired behavior:** A lint for exported-symbol and package doc comments (e.g. `revive`'s `exported` rule, or equivalent) runs in CI, and the whole Go tree passes it. **Acceptance criteria:** - [ ] CI runs an exported-symbol/package doc-comment lint over the Go tree - [ ] Every exported func/method/type/const/var and every package carries a Go-convention doc comment (comment begins with the symbol/package name) - [ ] The lint is wired into the existing CI gate chain and fails on a missing doc comment - [ ] The scan excludes `node_modules/` and `.sandcastle/nix-store/` (the #1913 gofmt-scan convention) **Out of scope:** - Rewording existing, already-present doc comments for style - Documenting unexported symbols **Triage note (model):** this is largely mechanical (~416 symbols). A `model-sonnet` override may right-size it off the Opus default — applying that label stays a human decision (triage-labels.md).

swarm-claim host=matou-dev-server-01 run=56890
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=56890 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #2086 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 81644a7c6f is not reachable from origin/main (not landed)
  • changed_files: '.golangci.yml' is not in the diff of the claimed commits
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'scripts/tests/exported-docs-lint-test.sh' is not in the diff of the claimed commits
envelope
{
  "issue": 2086,
  "status": "success",
  "commits": [
    "81644a7c6ff63dad55f80daca27699488b17dcb4"
  ],
  "changed_files": [
    ".golangci.yml",
    "STATUS.md",
    "scripts/tests/exported-docs-lint-test.sh"
  ],
  "tests": [
    {
      "command": "nix develop -c bash scripts/tests/exported-docs-lint-test.sh",
      "exit_code": 0
    },
    {
      "command": "nix develop -c golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'",
      "exit_code": 0
    },
    {
      "command": "pre-push Go gate (go test ./... + golangci-lint, both modules)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "CI runs an exported-symbol/package doc-comment lint over the Go tree": "revive is enabled in .golangci.yml with no rules: block, so golangci-lint applies revive's default ruleset, which includes `exported` and `package-comments`; seam-smoke.sh runs `golangci-lint run ./...` over root + broker. Documented on the `- revive` line (commit 81644a7c) and proven live by scripts/tests/exported-docs-lint-test.sh.",
    "Every exported func/method/type/const/var and every package carries a Go-convention doc comment": "Full golangci-lint run over both modules returns `0 issues.` (root and broker; re-confirmed by the pre-push gate). The 28-Oct ~416 count included exported methods on unexported receivers and standard-interface methods (Error/Unwrap/String), which revive's Go-convention rule correctly exempts.",
    "The lint is wired into the existing CI gate chain and fails on a missing doc comment": "golangci-lint runs in scripts/seam-smoke.sh (the CI/Sandcastle gate). Proven to fail on a missing comment: a deliberately-undocumented exported func is flagged `exported: ... should have comment or be unexported`, and scripts/tests/exported-docs-lint-test.sh asserts the real config flags both an undocumented func and a missing package comment (red-before-green verified with a rules:[blank-imports] patch).",
    "The scan excludes node_modules/ and .sandcastle/nix-store/": "golangci-lint scans only go.work modules via `go list ./...`, which ignores node_modules (confirmed: the one vendored node_modules/.pnpm/flatted .go is not in `go list ./...`) and never descends into .sandcastle/nix-store (no module there). The green full run is the evidence; .golangci.yml also excludes third_party/builtin/examples."
  },
  "summary": "Pinned and documented the already-live revive exported/package-comments doc-comment lint, with a seam test that reds if it is ever silently dropped.",
  "blockers": []
}
**close-report** for #2086 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 81644a7c6ff63dad55f80daca27699488b17dcb4 is not reachable from origin/main (not landed) - changed_files: '.golangci.yml' is not in the diff of the claimed commits - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'scripts/tests/exported-docs-lint-test.sh' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 2086, "status": "success", "commits": [ "81644a7c6ff63dad55f80daca27699488b17dcb4" ], "changed_files": [ ".golangci.yml", "STATUS.md", "scripts/tests/exported-docs-lint-test.sh" ], "tests": [ { "command": "nix develop -c bash scripts/tests/exported-docs-lint-test.sh", "exit_code": 0 }, { "command": "nix develop -c golangci-lint run ./...", "exit_code": 0 }, { "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'", "exit_code": 0 }, { "command": "pre-push Go gate (go test ./... + golangci-lint, both modules)", "exit_code": 0 } ], "criteria": { "CI runs an exported-symbol/package doc-comment lint over the Go tree": "revive is enabled in .golangci.yml with no rules: block, so golangci-lint applies revive's default ruleset, which includes `exported` and `package-comments`; seam-smoke.sh runs `golangci-lint run ./...` over root + broker. Documented on the `- revive` line (commit 81644a7c) and proven live by scripts/tests/exported-docs-lint-test.sh.", "Every exported func/method/type/const/var and every package carries a Go-convention doc comment": "Full golangci-lint run over both modules returns `0 issues.` (root and broker; re-confirmed by the pre-push gate). The 28-Oct ~416 count included exported methods on unexported receivers and standard-interface methods (Error/Unwrap/String), which revive's Go-convention rule correctly exempts.", "The lint is wired into the existing CI gate chain and fails on a missing doc comment": "golangci-lint runs in scripts/seam-smoke.sh (the CI/Sandcastle gate). Proven to fail on a missing comment: a deliberately-undocumented exported func is flagged `exported: ... should have comment or be unexported`, and scripts/tests/exported-docs-lint-test.sh asserts the real config flags both an undocumented func and a missing package comment (red-before-green verified with a rules:[blank-imports] patch).", "The scan excludes node_modules/ and .sandcastle/nix-store/": "golangci-lint scans only go.work modules via `go list ./...`, which ignores node_modules (confirmed: the one vendored node_modules/.pnpm/flatted .go is not in `go list ./...`) and never descends into .sandcastle/nix-store (no module there). The green full run is the evidence; .golangci.yml also excludes third_party/builtin/examples." }, "summary": "Pinned and documented the already-live revive exported/package-comments doc-comment lint, with a seam test that reds if it is ever silently dropped.", "blockers": [] } ``` </details>

close-report for #2086 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 2086,
  "status": "success",
  "commits": [
    "81644a7c6ff63dad55f80daca27699488b17dcb4"
  ],
  "changed_files": [
    ".golangci.yml",
    "STATUS.md",
    "scripts/tests/exported-docs-lint-test.sh"
  ],
  "tests": [
    {
      "command": "nix develop -c bash scripts/tests/exported-docs-lint-test.sh",
      "exit_code": 0
    },
    {
      "command": "nix develop -c golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'",
      "exit_code": 0
    },
    {
      "command": "pre-push Go gate (go test ./... + golangci-lint, both modules)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "CI runs an exported-symbol/package doc-comment lint over the Go tree": "revive is enabled in .golangci.yml with no rules: block, so golangci-lint applies revive's default ruleset, which includes `exported` and `package-comments`; seam-smoke.sh runs `golangci-lint run ./...` over root + broker. Documented on the `- revive` line (commit 81644a7c) and proven live by scripts/tests/exported-docs-lint-test.sh.",
    "Every exported func/method/type/const/var and every package carries a Go-convention doc comment": "Full golangci-lint run over both modules returns `0 issues.` (root and broker; re-confirmed by the pre-push gate). The 28-Oct ~416 count included exported methods on unexported receivers and standard-interface methods (Error/Unwrap/String), which revive's Go-convention rule correctly exempts.",
    "The lint is wired into the existing CI gate chain and fails on a missing doc comment": "golangci-lint runs in scripts/seam-smoke.sh (the CI/Sandcastle gate). Proven to fail on a missing comment: a deliberately-undocumented exported func is flagged `exported: ... should have comment or be unexported`, and scripts/tests/exported-docs-lint-test.sh asserts the real config flags both an undocumented func and a missing package comment (red-before-green verified with a rules:[blank-imports] patch).",
    "The scan excludes node_modules/ and .sandcastle/nix-store/": "golangci-lint scans only go.work modules via `go list ./...`, which ignores node_modules (confirmed: the one vendored node_modules/.pnpm/flatted .go is not in `go list ./...`) and never descends into .sandcastle/nix-store (no module there). The green full run is the evidence; .golangci.yml also excludes third_party/builtin/examples."
  },
  "summary": "Pinned and documented the already-live revive exported/package-comments doc-comment lint, with a seam test that reds if it is ever silently dropped.",
  "blockers": []
}
**close-report** for #2086 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2086, "status": "success", "commits": [ "81644a7c6ff63dad55f80daca27699488b17dcb4" ], "changed_files": [ ".golangci.yml", "STATUS.md", "scripts/tests/exported-docs-lint-test.sh" ], "tests": [ { "command": "nix develop -c bash scripts/tests/exported-docs-lint-test.sh", "exit_code": 0 }, { "command": "nix develop -c golangci-lint run ./...", "exit_code": 0 }, { "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'", "exit_code": 0 }, { "command": "pre-push Go gate (go test ./... + golangci-lint, both modules)", "exit_code": 0 } ], "criteria": { "CI runs an exported-symbol/package doc-comment lint over the Go tree": "revive is enabled in .golangci.yml with no rules: block, so golangci-lint applies revive's default ruleset, which includes `exported` and `package-comments`; seam-smoke.sh runs `golangci-lint run ./...` over root + broker. Documented on the `- revive` line (commit 81644a7c) and proven live by scripts/tests/exported-docs-lint-test.sh.", "Every exported func/method/type/const/var and every package carries a Go-convention doc comment": "Full golangci-lint run over both modules returns `0 issues.` (root and broker; re-confirmed by the pre-push gate). The 28-Oct ~416 count included exported methods on unexported receivers and standard-interface methods (Error/Unwrap/String), which revive's Go-convention rule correctly exempts.", "The lint is wired into the existing CI gate chain and fails on a missing doc comment": "golangci-lint runs in scripts/seam-smoke.sh (the CI/Sandcastle gate). Proven to fail on a missing comment: a deliberately-undocumented exported func is flagged `exported: ... should have comment or be unexported`, and scripts/tests/exported-docs-lint-test.sh asserts the real config flags both an undocumented func and a missing package comment (red-before-green verified with a rules:[blank-imports] patch).", "The scan excludes node_modules/ and .sandcastle/nix-store/": "golangci-lint scans only go.work modules via `go list ./...`, which ignores node_modules (confirmed: the one vendored node_modules/.pnpm/flatted .go is not in `go list ./...`) and never descends into .sandcastle/nix-store (no module there). The green full run is the evidence; .golangci.yml also excludes third_party/builtin/examples." }, "summary": "Pinned and documented the already-live revive exported/package-comments doc-comment lint, with a seam test that reds if it is ever silently dropped.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#2086
No description provided.