Repository navigation
[spec-enforcer] Enforce specifications for workqueue, workflow/codemod, workflow/gradershell - #78726
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 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)
This was referenced Nov 17, 2026
Contributor
Author
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specification Test Enforcement
Adds README-derived specification tests for
workflow/codemodandworkflow/gradershell, and extendsworkqueuetests 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 documentedStatstype, stable node identities, and more integer-only canonical JSON cases.workqueueworkflow/codemodworkflow/gradershellCounts 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
!integrationbuild tag, and theTestSpec_prefix.Spec-Implementation Mismatches
None observed in the tested contracts.
SPEC_AMBIGUITYcomments 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 fmtand whitespace checks passed.go build ./pkg/workqueue/... ./pkg/workflow/codemod/... ./pkg/workflow/gradershell/...passed.go test -v -run TestSpecpassed for all three processed packages.make agent-report-progresscompleted its build, schema freshness, and impacted unit-test checks. Its lint steps initially failed becausegolangci-lintwas absent and dependency-download output caused the custom-linter filter to fail. After installinggolangci-lintv2.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 impactedtest-unitcheck ran once.upload_code_coveragewith labelspec-enforcer/generated-tests.workqueueworkflow/codemodworkflow/gradershellStatement coverage is experimental and does not measure specification completeness.
Round-Robin State
workqueue,workflow/codemod,workflow/gradershellworkqueue; missing specification tests for the other two packagesworkflow/lint,workflow/shellpattern,workflow/taintReferences: §44073602297