Skip to content

[spec-enforcer] Enforce specifications for workqueue, workflow/codemod, workflow/gradershell - #78726

Merged
pelikhan merged 1 commit into
mainfrom
spec-enforcer-44073602297-f88d5be904f25cdf
Nov 17, 2026
Merged

pelikhan merged 1 commit into
mainfrom
spec-enforcer-44073602297-f88d5be904f25cdf

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Specification Test Enforcement

Adds README-derived specification tests for workflow/codemod and workflow/gradershell, and extends workqueue tests for its documented public contracts. Codemod tests cover atomic edits, exact path lookup, source preservation, comments, and lexical edits. Gradershell tests cover literal words and direct shell code evaluation. Workqueue adds its newly documented Stats type, stable node identities, and more integer-only canonical JSON cases.

Package Tests Added Tests Passing Spec Sections Covered
workqueue 1 function; 7 additional cases in existing tables 14 Public API, Types, Constants
workflow/codemod 6 functions 6 Overview, Public API
workflow/gradershell 2 functions 2 Public API

Counts refer to top-level test functions. All 22 functions and 123 subtests pass.

Test Derivation

All cases derive from package README.md specifications. Source inspection was limited to exported signatures, import paths, and type declarations; implementation logic and existing non-spec test logic did not inform the cases. The requested README extractors returned contract JSON, and the test-output classifier confirmed successful builds and specification tests. Every test file uses an external test package, the !integration build tag, and the TestSpec_ prefix.

Spec-Implementation Mismatches

None observed in the tested contracts. SPEC_AMBIGUITY comments identify unspecified node-ID encoding, sequence ordering and collision behavior, and shell evaluation scope and callback semantics. Undocumented lifecycle fixtures and concurrency guarantees are not assumed.

Validation and experimental coverage
  • make fmt and whitespace checks passed.
  • go build ./pkg/workqueue/... ./pkg/workflow/codemod/... ./pkg/workflow/gradershell/... passed.
  • go test -v -run TestSpec passed for all three processed packages.
  • make agent-report-progress completed its build, schema freshness, and impacted unit-test checks. Its lint steps initially failed because golangci-lint was absent and dependency-download output caused the custom-linter filter to fail. After installing golangci-lint v2.15.0, Go lint reported zero issues. The custom linter passed the repository's unchanged change-scoped filter; its 15 diagnostics were all in unchanged files. The impacted test-unit check ran once.
  • Generated and verified the combined Cobertura report, then submitted it through upload_code_coverage with label spec-enforcer/generated-tests.
Package Specification-test statement coverage
workqueue 2.6%
workflow/codemod 48.5%
workflow/gradershell 9.9%

Statement coverage is experimental and does not measure specification completeness.

Round-Robin State

  • Run mode: round-robin
  • Packages processed this run: workqueue, workflow/codemod, workflow/gradershell
  • Selection: changed cached README hash for workqueue; missing specification tests for the other two packages
  • Next packages in rotation: workflow/lint, workflow/shellpattern, workflow/taint
  • Total eligible packages: 51 Go packages with README.md
  • Cache: hit; cursor advanced from 40 to 45. Rotation, merged README hashes, and enforcement records were saved and read back successfully.
  • Steering issue: [WIP] Package Specification Enforcer: work in progress #78722 had no comments on the final check.

References: §44073602297

Generated by 📋 Package Specification Enforcer · codex · routed: gpt61 high · ~89 AIC · ⌖ ~2 AIC · ⊞ 461 · ◷

  • expires on Nov 20, 2026, 3:38 AM UTC-08:00

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.

🟢 Approval recommended

The reviewed changes add focused README-derived specification tests covering documented APIs and behaviors across the three packages, with no active issues identified.

No open issues 🎉

What changed in this PR

Adds README-derived black-box specification tests for the workqueue, codemod, and gradershell packages, covering documented public APIs, canonical JSON behavior, source-preserving transformations, and shell evaluation detection.

Changes:

  • Extends workqueue tests for canonical JSON, Stats, and stable NodeID behavior.
  • Adds codemod tests for atomic application, exact lookup, source preservation, comments, and lexical edits.
  • Adds gradershell tests for literal word extraction and shell code evaluation detection.
File Description
pkg/​workqueue/​spec_test.go Adds specification tests for canonical JSON cases, the Stats type, and NodeID behavior.
pkg/​workflow/​gradershell/​spec_test.go Adds specification tests for literal shell words and shell code evaluation detection.
pkg/​workflow/​codemod/​spec_test.go Adds source-preserving specification tests for codemod frontmatter transformations and public APIs.

Review effort: Lite (adaptive)

@pelikhan
pelikhan merged commit 89e7632 into main Nov 17, 2026
3 checks passed
@pelikhan
pelikhan deleted the spec-enforcer-44073602297-f88d5be904f25cdf branch November 17, 2026 15:07
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.3.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants