Skip to content

Commit 798da49

Browse files
authored
Close package spec audit gaps across workflow/actionpins/stats and normalize README consistency (#26759)
1 parent 94f3284 commit 798da49

File tree

15 files changed

+88
-2
lines changed

15 files changed

+88
-2
lines changed

pkg/actionpins/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ Resolution supports two modes:
3737
| `ResolveActionPin` | `func(actionRepo, version string, ctx *PinContext) (string, error)` | Resolves a pinned reference with optional dynamic SHA lookup and fallback behavior |
3838
| `GetCachedActionPin` | `func(repo string, ctx *PinContext) string` | Returns a pinned reference preferring cache/dynamic resolution when available |
3939

40+
## Usage Example
41+
42+
```go
43+
ctx := &actionpins.PinContext{StrictMode: true}
44+
45+
reference, err := actionpins.ResolveActionPin("actions/checkout", "v5", ctx)
46+
if err != nil {
47+
panic(err)
48+
}
49+
50+
fmt.Println(reference) // actions/checkout@<sha> # v5
51+
```
52+
4053
## Dependencies
4154

4255
**Internal**:

pkg/console/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Console Package
1+
# console Package
22

33
The `console` package provides utilities for formatting and rendering terminal output in GitHub Agentic Workflows. It covers message formatting, table and section rendering, interactive prompts, progress bars, spinners, struct rendering, and accessibility support.
44

@@ -783,3 +783,7 @@ if console.IsAccessibleMode() {
783783
// Use simpler, non-animated output
784784
}
785785
```
786+
787+
---
788+
789+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/envutil/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@ concurrency := envutil.GetIntFromEnv("GH_AW_MAX_CONCURRENT_DOWNLOADS", 5, 1, 20,
4444
- Warning messages use `console.FormatWarningMessage` so they render consistently in terminals.
4545
- All warnings go to `os.Stderr` to avoid polluting structured stdout output.
4646
- The function only handles integers; floating-point or string env vars should be read directly via `os.Getenv`.
47+
48+
---
49+
50+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/logger/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Logger Package
1+
# logger Package
22

33
A simple, debug-style logging framework for Go that follows the pattern matching syntax of the [debug npm package](https://www.npmjs.com/package/debug).
44

@@ -212,3 +212,7 @@ slogLogger.Warn("something unusual happened", "count", 42)
212212
- Colors assigned using FNV-1a hash for consistent namespace-to-color mapping
213213
- Color palette chosen for readability on both light and dark terminals
214214
- Uses ANSI 256-color codes for better compatibility
215+
216+
---
217+
218+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/repoutil/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ repoutil.SplitRepoSlug("github/gh-aw/x") // error: invalid repo format: github/g
4040

4141
- All debug output uses `logger.New("repoutil:repoutil")` and is only emitted when `DEBUG=repoutil:*`.
4242
- For paths that include sub-folders (e.g. GitHub Actions `uses:` fields such as `github/codeql-action/upload-sarif`), use `gitutil.ExtractBaseRepo` first to strip the sub-path before calling `SplitRepoSlug`.
43+
44+
---
45+
46+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/semverutil/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ semverutil.IsCompatible("v6.0.0", "v5") // false
101101
- All debug output uses `logger.New("semverutil:semverutil")` and is only emitted when `DEBUG=semverutil:*`.
102102
- The package intentionally delegates to `golang.org/x/mod/semver` for canonical semver logic rather than implementing its own parsing.
103103
- `ParseVersion` uses `semver.Canonical` before splitting into components, ensuring correct handling of short forms like `v1` (canonicalized to `v1.0.0`).
104+
105+
---
106+
107+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/sliceutil/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,7 @@ unique := sliceutil.Deduplicate(items)
7777
- `Any` is implemented via `slices.ContainsFunc` from the standard library.
7878
- `Deduplicate` uses a `map[T]bool` for O(n) time complexity.
7979
- None of these functions sort their output; callers that require sorted results should call `slices.Sort` on the returned slice.
80+
81+
---
82+
83+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/stats/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ The `stats` package provides `StatVar`, a compact accumulator for numeric metric
3030
| `SampleStdDev` | `func() float64` | Returns sample standard deviation |
3131
| `Median` | `func() float64` | Returns the exact median (middle value or midpoint of two middle values) |
3232

33+
## Usage Example
34+
35+
```go
36+
var s stats.StatVar
37+
38+
s.Add(10)
39+
s.Add(20)
40+
s.Add(30)
41+
42+
fmt.Println(s.Count()) // 3
43+
fmt.Println(s.Mean()) // 20
44+
fmt.Println(s.StdDev()) // 8.164965...
45+
fmt.Println(s.Median()) // 20
46+
```
47+
3348
## Dependencies
3449

3550
**Standard library only**:

pkg/stringutil/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,7 @@ Returns a human-readable description of the token type (e.g. `"fine-grained pers
177177
- All debug output uses namespace-prefixed loggers (`stringutil:identifiers`, `stringutil:sanitize`, `stringutil:urls`, `stringutil:pat_validation`) and is only emitted when `DEBUG=stringutil:*`.
178178
- `SanitizeErrorMessage` is intentionally conservative: it excludes common GitHub Actions keywords to avoid over-redacting legitimate error messages.
179179
- `StripANSI` handles both CSI sequences (`ESC[`) and other ESC-prefixed sequences to cover the full range of ANSI escape codes found in terminal output.
180+
181+
---
182+
183+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

pkg/styles/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ form := huh.NewForm(...).WithTheme(styles.HuhTheme)
9999
- The package uses `charm.land/lipgloss/v2` and `charm.land/lipgloss/v2/compat` for adaptive color support.
100100
- For visual examples and detailed usage guidelines, see `scratchpad/styles-guide.md`.
101101
- All `*` styles export pre-configured `lipgloss.Style` values (not functions), so they can be used with method chaining: `styles.Error.Copy().Underline(true)`.
102+
103+
---
104+
105+
*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*

0 commit comments

Comments
 (0)