Skip to content

Add modelsdev package spec and complete linters analyzer documentation coverage#43208

Merged
pelikhan merged 2 commits into
mainfrom
copilot/spec-librarian-update-modelsdev-spec
Jul 3, 2026
Merged

Add modelsdev package spec and complete linters analyzer documentation coverage#43208
pelikhan merged 2 commits into
mainfrom
copilot/spec-librarian-update-modelsdev-spec

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The spec audit identified one package with no specification (pkg/modelsdev) and gaps in pkg/linters/README.md for several analyzer subpackages. This PR closes those documentation gaps to restore package-spec coverage and align linter docs with the current codebase.

  • modelsdev package specification

    • Added pkg/modelsdev/README.md with:
      • package purpose and behavior
      • exported API (FindPricing) signature and semantics
      • dependency notes (logger, syncutil)
      • design details (provider/model normalization, per-million to per-token conversion, graceful fallback behavior)
  • linters README completeness

    • Updated pkg/linters/README.md to include missing analyzer documentation in the relevant sections (overview/public API/dependencies/examples), including:
      • deferinloop
      • errorfwrapv
      • httpnoctx
      • httprespbodyclose
      • sprintfint
      • timesleepnocontext
    • Also aligned the examples/dependency listing with currently present analyzer subpackages.
pricing, ok := modelsdev.FindPricing(ctx, "github", "gpt-4.1")
if !ok {
    return
}
inputUSDPerToken := pricing["input"]
outputUSDPerToken := pricing["output"]

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add README.md and documentation for modelsdev package Add modelsdev package spec and complete linters analyzer documentation coverage Jul 3, 2026
Copilot AI requested a review from pelikhan July 3, 2026 14:06
@pelikhan pelikhan marked this pull request as ready for review July 3, 2026 14:13
Copilot AI review requested due to automatic review settings July 3, 2026 14:13
@pelikhan pelikhan merged commit 2dbe13a into main Jul 3, 2026
@pelikhan pelikhan deleted the copilot/spec-librarian-update-modelsdev-spec branch July 3, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores documentation/spec coverage by adding a package specification for pkg/modelsdev and updating pkg/linters/README.md so it reflects the set of analyzer subpackages currently present in the codebase.

Changes:

  • Add a new spec README for pkg/modelsdev, documenting FindPricing, caching behavior, dependencies, and normalization/conversion rules.
  • Expand pkg/linters/README.md to include missing analyzer entries across the overview, API table, usage example, and dependencies.
Show a summary per file
File Description
pkg/modelsdev/README.md New package spec describing models.dev catalog loading, normalization, and the FindPricing API.
pkg/linters/README.md Documentation updates to cover additional analyzer subpackages and align examples/dependencies with the current analyzers.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread pkg/modelsdev/README.md
Comment on lines +15 to +17
| Function | Signature | Description |
|----------|-----------|-------------|
| `FindPricing` | `func(ctx context.Context, provider, model string) (map[string]float64, bool)` | Returns normalized per-token pricing for a provider/model pair. Falls back to cross-provider matching when provider lookup fails. Returns `(nil, false)` when no pricing is available |
Comment thread pkg/modelsdev/README.md
Comment on lines +22 to +24
import "github.com/github/gh-aw/pkg/modelsdev"

pricing, ok := modelsdev.FindPricing(ctx, "github", "gpt-4.1")
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[spec-librarian] Specification Audit — 2026-07-03 — 2 issues found

3 participants