Skip to content

[Repo Assist] docs: add package-level godoc comments to all packages; enable revive package-comments rule#2307

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-package-godoc-2026-03-22-0470931fd50e01d5
Draft

[Repo Assist] docs: add package-level godoc comments to all packages; enable revive package-comments rule#2307
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/improve-package-godoc-2026-03-22-0470931fd50e01d5

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

This PR improves code discoverability and documentation tooling by adding package-level // Package ... doc comments to all 11 internal packages that previously lacked them. It also enables the revive linter's package-comments rule so any future missing package docs are caught by CI.

Changes

Task 5 – Coding Improvements: Package godoc comments

Six packages got new doc.go files, five packages had comments added to their primary file:

Package Approach
internal/difc new doc.go
internal/launcher new doc.go
internal/mcp new doc.go
internal/middleware new doc.go
internal/server new doc.go
internal/testutil/mcptest new doc.go
internal/envutil added to envutil.go
internal/strutil added to deduplicate.go
internal/sys added to sys.go
internal/timeutil added to format.go
internal/version added to version.go

Packages that already had docs (auth, cmd, config, guard, logger, proxy, tty) are untouched.

Task 4 – Engineering Investment: Enable revive package-comments rule

Updated .golangci.yml to:

  • Remove revive from the disable list
  • Add it to enable with only the package-comments rule configured

This is a scoped enablement — only the package-comments rule runs, so no existing code is flagged for unrelated revive issues.

Rationale

  • go doc, pkgsite, and IDE tooling all surface package-level docs prominently; without them these packages appear undocumented to users and contributors.
  • The revive package-comments rule enforces this going forward with zero false-positive risk (it only fires when the doc is entirely absent).
  • This was tracked as future work in Repo Assist memory.

Test Status

The changes are purely additive (new doc comments and a linter config tweak). No logic is modified. The environment does not have network access to download Go modules, so the full test suite could not be executed locally. CI will verify correctness on push.

The go build ./... command succeeded with the installed Go 1.25.8 toolchain, confirming there are no syntax errors in the new files.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

… package-comments lint rule

Add missing package-level documentation comments to 11 internal packages
that previously had no package doc. This improves discoverability via
'go doc', pkgsite, and IDE tooling.

Packages updated:
- internal/difc: DIFC security label management (new doc.go)
- internal/launcher: backend process lifecycle and connection pooling (new doc.go)
- internal/mcp: MCP protocol types and transports (new doc.go)
- internal/middleware: HTTP middleware for JQ schema processing (new doc.go)
- internal/server: HTTP server in routed/unified modes (new doc.go)
- internal/testutil/mcptest: test harness for MCP integration tests (new doc.go)
- internal/envutil: env var helpers with typed defaults
- internal/strutil: string deduplication and truncation helpers
- internal/sys: MCPG system tools server
- internal/timeutil: duration formatting utilities
- internal/version: gateway version management

Also enables the revive linter's package-comments rule in .golangci.yml
so missing package docs are caught by CI going forward. Only the
package-comments rule is enabled to avoid unrelated revive noise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added automation documentation Improvements or additions to documentation enhancement New feature or request repo-assist labels Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation documentation Improvements or additions to documentation enhancement New feature or request repo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants