Skip to content

[spec-extractor] Update package specifications for gitutil, logger, stringutil, timeutil#27536

Merged
pelikhan merged 1 commit intomainfrom
spec-extractor/run-2026-04-21-05f9cc0f10992630
Apr 21, 2026
Merged

[spec-extractor] Update package specifications for gitutil, logger, stringutil, timeutil#27536
pelikhan merged 1 commit intomainfrom
spec-extractor/run-2026-04-21-05f9cc0f10992630

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Package Specification Updates

This PR fixes inaccuracies found during the spec-extractor round-robin run for 4 packages.

Package Status Changes
gitutil Updated Added missing IsValidFullSHA; fixed IsRateLimitError description
logger Updated Documented ACTIONS_RUNNER_DEBUG=true behavior
stringutil Updated Fixed 3 inaccurate descriptions
timeutil Updated Fixed incorrect FormatDurationNs example

What Changed

pkg/gitutil/README.md

  • IsRateLimitError: description now includes all 3 matched patterns ("api rate limit exceeded", "rate limit exceeded", "secondary rate limit") — the "secondary rate limit" case was previously undocumented
  • IsValidFullSHA: added missing documentation for this exported function (validates 40-character lowercase hex SHAs)

pkg/logger/README.md

  • Added documentation for ACTIONS_RUNNER_DEBUG=true behavior: when this env var is set (as in GitHub Actions debug runs) and DEBUG is not explicitly set, all loggers are enabled automatically (equivalent to DEBUG=*)

pkg/stringutil/README.md

  • NormalizeWhitespace: previous description said it "collapses multiple consecutive whitespace characters into a single space" — this was completely wrong. The function trims trailing whitespace from each line and ensures exactly one trailing newline
  • IsPositiveInteger: previous description said "non-empty string containing only digit characters" — this was incomplete. The function actually requires strictly positive integers (no zero, no leading zeros, must parse to > 0)
  • NormalizeSafeOutputIdentifier: previous description said it only converts dashes to underscores — it also converts periods (required because MCP tool names cannot contain periods)

pkg/timeutil/README.md

  • FormatDurationNs example: FormatDurationNs(2_500_000_000) documented as returning "2s" but Go's time.Duration.Round(time.Second) rounds half-away from zero, so 2.5s rounds to "3s". Fixed example to use 2_000_000_000 (exactly 2 billion nanoseconds = 2s)

Extraction Method

  • Source code analysis of exported function implementations and their doc comments
  • Verification of all examples against actual implementation logic
  • Comparison of spec_test.go files (which already noted SPEC_MISMATCH for the timeutil issue)

Round-Robin State

  • Packages processed this run: gitutil, logger, stringutil, timeutil (indices 6, 7, 12, 15)
  • Next packages in rotation: tty, types, typeutil, workflow (indices 16+)
  • Total packages: 21
  • Coverage: First run — cache initialized

Auto-generated by Package Specification Extractor workflow §24717864418

Generated by Package Specification Extractor · ● 4.9M ·

  • expires on Apr 24, 2026, 10:49 AM UTC

…meutil

- gitutil: add missing IsValidFullSHA documentation; fix IsRateLimitError
  to include 'secondary rate limit' pattern
- logger: document ACTIONS_RUNNER_DEBUG=true enables all loggers
- stringutil: fix NormalizeWhitespace description (trims trailing whitespace
  per-line, not collapse to single space); fix IsPositiveInteger description
  (must be > 0, no leading zeros); fix NormalizeSafeOutputIdentifier to
  document period replacement in addition to dash replacement
- timeutil: fix FormatDurationNs example (2_500_000_000ns rounds to 3s
  not 2s due to Go's away-from-zero rounding)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation documentation Improvements or additions to documentation pkg-specifications labels Apr 21, 2026
@pelikhan pelikhan merged commit 141ced0 into main Apr 21, 2026
@pelikhan pelikhan deleted the spec-extractor/run-2026-04-21-05f9cc0f10992630 branch April 21, 2026 13:29
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 pkg-specifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant