Skip to content

[spec-enforcer] Enforce specifications for workflow/lint, workflowcontract, workflow/shellpattern - #80709

Merged
pelikhan merged 1 commit into
mainfrom
spec-enforcer-45383914828-3a458bea3d57789a
Nov 24, 2026
Merged

pelikhan merged 1 commit into
mainfrom
spec-enforcer-45383914828-3a458bea3d57789a

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Specification Test Enforcement

Add README-derived checks for three newly documented lint registrations and five documented workflowcontract test entry points. The reviewed shellpattern specification suite is up-to-date.

Package Tests Added Tests Passing Spec Sections Covered
workflow/lint 3 53 Overview, Public API, Built-in Rules
workflowcontract 5 5 Overview, Contracts (exported test signatures)
workflow/shellpattern 0 17 Public API, lexical detection

Counts represent leaf test cases: 75 pass, with one existing lint case skipped.

Test Derivation

All tests are derived from README.md specifications, not implementation behavior. The lint additions verify that Default() registers OverprovisionedSecretsRule, UnsoundContainsRule, and BotConditionsRule. The workflowcontract suite checks the exported names and valid Go test signatures listed in its README without reproducing existing assertion logic.

Spec-Implementation Mismatches

The existing TestSpec_PublicAPI_SeverityString remains skipped: the lint README documents Severity.String, but the exported severity type does not implement it. Its existing SPEC_MISMATCH annotation is preserved.

Validation and specification limits
  • All three selected packages pass go build and their TestSpec runs.
  • make fmt and the final make agent-report-progress pass, including Go lint, impacted tests, and drift validation: all 371 workflow lock files remain in sync.
  • One combined Cobertura report was verified and accepted for upload with label spec-enforcer/generated-tests.
  • The workflowcontract README does not specify workflow paths, required wording, configuration values, or model sets. The new suite marks this SPEC_AMBIGUITY and enforces documented entry-point availability and signatures; it does not claim independent behavioral coverage of those workflows.

Round-Robin State

  • Run mode: round-robin
  • Cache: hit
  • Packages processed this run: workflow/lint, workflowcontract, workflow/shellpattern
  • Rotation cursor: 47 → 48
  • Next packages in rotation: workflow/taint, workflowcontract, workqueue
  • Total eligible packages: 52 (with README.md)

Rotation, enforcement records, and merged README hashes were saved and read back successfully; unprocessed hashes were preserved.

References: §45383914828

Generated by 📋 Package Specification Enforcer · codex · routed: gpt61 high · ~88 AIC · ⌖ ~2 AIC · ⊞ 459 · history

  • expires on Nov 27, 2026, 3:40 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.

🟡 Changes recommended

The discovery test scans all _test.go files without honoring Go build constraints, so it can falsely validate excluded contract declarations as runnable entry points.

1 open issue
What changed in this PR

Adds README-derived specification checks for workflow contract test entry points and three newly documented built-in lint rule registrations.

Changes:

  • Adds AST-based validation for five documented workflowcontract test functions and their signatures.
  • Extends lint specification coverage to verify registration of OverprovisionedSecretsRule, UnsoundContainsRule, and BotConditionsRule.
  • Preserves the existing documented Severity.String mismatch annotation and skip.
File Description
pkg/​workflowcontract/​spec_test.go Adds AST-based checks for documented workflow contract test declarations and signatures.
pkg/​workflow/​lint/​spec_test.go Adds specification checks for registration of three documented built-in lint rules.

Review effort: Lite (adaptive)

Comment on lines +27 to +34
entries, err := os.ReadDir(".")
require.NoError(t, err, "the documented test-only package must be readable")
for _, entry := range entries {
if entry.IsDir() || !strings.HasSuffix(entry.Name(), "_test.go") {
continue
}
file, err := parser.ParseFile(token.NewFileSet(), entry.Name(), nil, parser.SkipObjectResolution)
require.NoError(t, err, "Go test declarations must parse in %s", entry.Name())
@pelikhan
pelikhan merged commit 938b2e4 into main Nov 24, 2026
3 checks passed
@pelikhan
pelikhan deleted the spec-enforcer-45383914828-3a458bea3d57789a branch November 24, 2026 12:01
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