Skip to content

Add spec-extractor, spec-enforcer, and spec-librarian agentic workflows#26083

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-agentic-workflows-specification-extraction
Apr 13, 2026
Merged

Add spec-extractor, spec-enforcer, and spec-librarian agentic workflows#26083
pelikhan merged 2 commits intomainfrom
copilot/add-agentic-workflows-specification-extraction

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Three daily workflows to maintain pkg/*/README.md as authoritative package specifications. All share the pkg-specifications label.

  • spec-extractor.md — Copilot engine. Round-robin 3-4 packages/run via cache-memory. Analyzes exported symbols, doc comments, and dependencies to generate/update README.md specs in W3C style. Creates PRs.

  • spec-enforcer.md — Claude engine. Round-robin 2-3 packages/run via cache-memory. Generates spec_test.go files derived from README.md specifications, not from reading implementation source. Uses SPEC_AMBIGUITY: / SPEC_MISMATCH: comment conventions for documenting gaps. Creates PRs.

  • spec-librarian.md — Copilot engine. Full daily audit across all packages. Checks coverage gaps, staleness (source newer than spec by >7 days), API drift (undocumented/phantom symbols), cross-package terminology conflicts, and dependency graph accuracy. Creates issues with skip-if-match dedup.

Copilot AI and others added 2 commits April 13, 2026 18:08
…orkflows

Add three agentic workflows for maintaining Go package specifications:

- spec-extractor: Extracts README.md specs from Go packages using copilot
  engine with cache-memory round-robin (daily, creates PRs)
- spec-enforcer: Generates spec-driven test suites using Claude engine
  with cache-memory round-robin (daily, creates PRs)
- spec-librarian: Daily audit of all specs for inconsistencies and
  staleness (daily, creates issues)

All workflows share the 'pkg-specifications' label for common tracking.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1b7312fb-2292-4227-84ea-2d170e3906be

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove hardcoded package count in spec-librarian success criteria
- Clarify spec-extractor success criteria with dynamic package count
- Add SPEC_AMBIGUITY and SPEC_MISMATCH comment conventions to spec-enforcer

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1b7312fb-2292-4227-84ea-2d170e3906be

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 13, 2026 20:32
Copilot AI review requested due to automatic review settings April 13, 2026 20:32
@pelikhan pelikhan merged commit 4869a40 into main Apr 13, 2026
69 of 91 checks passed
@pelikhan pelikhan deleted the copilot/add-agentic-workflows-specification-extraction branch April 13, 2026 20:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds three new agentic workflows (extractor, enforcer, librarian) plus their compiled lockfiles to keep pkg/*/README.md as authoritative package specs and generate spec-derived tests / audits on a daily cadence.

Changes:

  • Add spec-extractor workflow to round-robin generate/update pkg/*/README.md specifications and open PRs.
  • Add spec-enforcer workflow to generate spec_test.go files from README specs and open PRs.
  • Add spec-librarian workflow to audit coverage/staleness/drift across all packages and open a deduped issue when needed.
Show a summary per file
File Description
.github/workflows/spec-extractor.md New workflow definition for generating/updating package README specifications and creating PRs.
.github/workflows/spec-extractor.lock.yml Compiled workflow for spec-extractor (pinned actions/images, expanded jobs).
.github/workflows/spec-enforcer.md New workflow definition for generating spec-driven tests from README specifications and creating PRs.
.github/workflows/spec-enforcer.lock.yml Compiled workflow for spec-enforcer (pinned actions/images, expanded jobs).
.github/workflows/spec-librarian.md New workflow definition for daily spec audits, drift/staleness checks, and issue creation with deduping.
.github/workflows/spec-librarian.lock.yml Compiled workflow for spec-librarian (pinned actions/images, expanded jobs).

Copilot's findings

Tip

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

Comments suppressed due to low confidence (2)

.github/workflows/spec-librarian.md:142

  • The “Exported functions in source” check only matches func <Name> at the beginning of the line, so it will miss exported methods (e.g., func (T) Method) which are also part of the public API surface. Consider including receiver methods in the extraction (or using a Go-aware symbol listing via Serena / go doc / go list) so API drift detection is accurate.
# Exported functions in source
grep -h "^func [A-Z]" pkg/<package>/*.go 2>/dev/null | sed 's/(.*//' | sort

.github/workflows/spec-librarian.md:193

  • This dependency validation step greps only lines containing the keyword import, which won’t capture actual imported package paths for multi-line import blocks (it will typically just match import (). That makes the dependency graph check unreliable; consider extracting quoted import specs (lines containing "...") or using go list/Serena to get the real import set per package.
  if [ -f "$dir/README.md" ]; then
    echo "=== $pkg ==="
    grep -h "import" "$dir"/*.go 2>/dev/null | grep "gh-aw/pkg/" | sort -u
  fi
  • Files reviewed: 6/6 changed files
  • Comments generated: 3

pkg=$(basename "$dir")
if [ -f "$dir/README.md" ]; then
spec_date=$(git log -1 --format=%ci -- "$dir/README.md" 2>/dev/null)
source_date=$(git log -1 --format=%ci -- "$dir/*.go" 2>/dev/null)
### Step 4: Identify Dependencies

```bash
grep -h "import" pkg/<package>/*.go | grep -v "_test.go"
Comment on lines +39 to +41
- "head -n * pkg/*/*.go"
- "cat pkg/*/*.go"
- "wc -l pkg/*/*.go"
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.

3 participants