Repository navigation
[spec-enforcer] Enforce specifications for lifecycle, workflow/lint, workflow/shellpattern - #79020
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues in the added specification test suites.
No open issues 🎉
What changed in this PR
Adds the first README-driven specification test suites for three gh-aw packages, without changing production code.
Changes:
- Covers lifecycle identity stability, URL constraints, rule isolation, equality, and replay merging.
- Tests lint runner contracts and registration of all 37 documented built-in rules; conditionally skips the documented but missing
Severity.Stringmethod. - Tests lexical shell-expansion detection, byte offsets, ordering, and nested arithmetic without executing scripts.
| File | Description |
|---|---|
pkg/workflow/shellpattern/spec_test.go |
Adds lexical expansion detection and arithmetic handling tests. |
pkg/workflow/lint/spec_test.go |
Adds runner, rule registration, and conditional severity-label contract tests. |
pkg/lifecycle/spec_test.go |
Adds delivery, classification, rule isolation, equality, and merge contract tests. |
Review effort: Balanced (adaptive)
This was referenced Nov 18, 2026
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 the first README-driven specification suites for three packages without spec_test.go files.
lifecycleworkflow/lintworkflow/shellpatternCounts are top-level test functions. All three package builds and specification suites pass, with the explicit skipped mismatch below. The experimental Cobertura coverage upload was accepted as
spec-enforcer/generated-tests.Spec-Implementation Mismatches
The lint README promises
Severity.String, but neitherErrornorWarningimplements that method.TestSpec_PublicAPI_SeverityStringretains the contract behind a narrowly conditionalSPEC_MISMATCHskip and automatically enables its assertions when the method exists. This run does not establish full README conformance.Test derivation, specification gaps, and validation
Test Derivation
All tests derive from package README.md specifications. Implementation reading was limited to exported signatures, type declarations, and import paths; existing unit-test logic was not used. Tests use external packages, the
!integrationbuild tag, andTestSpec_names.Lifecycle covers stable delivery IDs, target URL constraints, human/publisher classification, independent rule copies, timestamp-normalized equality, and retained execution evidence during replay. Lint covers custom runners, copied registrations, rule selection, AST applicability, read-only inputs, diagnostic locations, and all 37 documented built-in constructors. Shellpattern covers parameter transformations, indirect expansion, command substitution, lexical quoted/comment matches, byte offsets, ordering, and nested arithmetic. Script strings are never executed.
SPEC_AMBIGUITYcomments record that lifecycle observation states/signals and authority ordering are unspecified, and that shellpattern does not enumerate transformation syntax. Transformation tests use the Bash${parameter@operator}form; no requirements are inferred for pattern removal, replacement, or case modification. Lint custom-rule validation criteria and exact severity labels are also unspecified.Validation
make fmtand whitespace checks passed.go buildpassed for all three processed package trees.test-unitchecks frommake agent-report-progresspassed. Its initially missinggolangci-lintdependency was installed at the repository-pinned v2.15.0; the remaining lint check then reported 0 issues. Unit-test gating ran once.make check-workflow-drift: all 366 workflows compiled successfully, with no lock-file drift.Round-Robin State
Next Actions
Reconcile the documented
Severity.Stringcontract and clarify the marked specification gaps before extending those assertions.References: §44294301271