Skip to content

[spec-enforcer] Enforce specifications for lifecycle, workflow/lint, workflow/shellpattern - #79020

Merged
pelikhan merged 1 commit into
mainfrom
spec-enforcer-44294301271-e3b4a15119296d5f
Nov 18, 2026
Merged

pelikhan merged 1 commit into
mainfrom
spec-enforcer-44294301271-e3b4a15119296d5f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Specification Test Enforcement

Adds the first README-driven specification suites for three packages without spec_test.go files.

Package Tests Added Tests Passing Tests Skipped Spec Sections Covered Statement Coverage
lifecycle 8 8 0 Public API, Usage Example, Constants, Design Decisions 71.8%
workflow/lint 5 4 1 Overview, Public API, Built-in Rules 3.0%
workflow/shellpattern 3 3 0 Public API, lexical detection 90.9%

Counts 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 neither Error nor Warning implements that method. TestSpec_PublicAPI_SeverityString retains the contract behind a narrowly conditional SPEC_MISMATCH skip 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 !integration build tag, and TestSpec_ 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_AMBIGUITY comments 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 fmt and whitespace checks passed.
  • go build passed for all three processed package trees.
  • Specification tests: 15 passed, 1 explicitly skipped, 0 failed.
  • The build, custom Go linters, schema freshness check, and impacted test-unit checks from make agent-report-progress passed. Its initially missing golangci-lint dependency 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.
  • One atomic coverage profile was converted to nonempty, valid Cobertura XML and submitted successfully.
  • Rotation, merged README hashes, and per-package enforcement records were saved and read back to verify persistence.

Round-Robin State

  • Run mode: round-robin
  • Cache: hit; reusable rotation state loaded
  • Packages processed this run: lifecycle, workflow/lint, workflow/shellpattern
  • Selection: packages missing specification tests; no changed hashes among previously enforced packages
  • Last index: 48
  • Last run: 2026-11-18
  • Next packages in rotation: workflow/taint, workflowcontract, workqueue
  • Total eligible packages: 52 package directories with README.md and Go files; fixture-only READMEs excluded

Next Actions

Reconcile the documented Severity.String contract and clarify the marked specification gaps before extending those assertions.

References: §44294301271

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

  • expires on Nov 21, 2026, 3:39 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 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.String method.
  • 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)

@pelikhan
pelikhan merged commit c7962ef into main Nov 18, 2026
3 checks passed
@pelikhan
pelikhan deleted the spec-enforcer-44294301271-e3b4a15119296d5f branch November 18, 2026 20:47
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