Skip to content

[spec-enforcer] Enforce specifications for linters, atif, workflowcontract - #75890

Merged
pelikhan merged 1 commit into
mainfrom
spec-enforcer-atif-42475546500-44d484f4ff91f162
Nov 8, 2026
Merged

pelikhan merged 1 commit into
mainfrom
spec-enforcer-atif-42475546500-44d484f4ff91f162

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Specification Test Enforcement

This PR adds specification-driven tests for the selected packages.

Package Tests Added Tests Passing Spec Sections Covered
linters 0 8 Public API, Constants, Design decisions, Usage examples
atif 6 6 Public API, Types, Constants, Error handling
workflowcontract 0 4 of 5 Contracts, Running the tests, Dependencies

Test Derivation

All tests are derived from README.md specifications, not from implementation source code. The new ATIF suite covers documented constants and public types, malformed and oversized input rejection, invalid trajectory validation, and validation before encoding.

Spec-Implementation Mismatches

  • SPEC_MISMATCH: .github/workflows/daily-performance-summary.md lacks the lifecycle-window github-pr-query and github-issue-query instructions required by TestDailyPerformanceSummaryUsesStableWindowMetrics. This pre-existing contract failure is recorded but not changed by this test-only enforcement PR.

Validation

  • go build ./pkg/atif/...
  • go test -v -run TestSpec ./pkg/atif/
  • go test -v -run TestSpec ./pkg/linters/
  • Experimental Cobertura report generated for the processed package set
  • make agent-report-progress passed build, custom linters, schema freshness, and impacted ATIF tests; the aggregate target remained incomplete because golangci-lint is not installed

Round-Robin State

  • Run mode: round-robin
  • Packages processed this run: linters, atif, workflowcontract
  • Next packages in rotation: workqueue, actionpins, agentdrain
  • Total eligible packages: 39 (with README.md)

References:

Generated by 📋 Package Specification Enforcer · codex · gpt56 · ~138 AIC · ⌖ ~24 AIC · ⊞ 18.8K · ◷

  • expires on Nov 11, 2026, 3:34 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 tests contain a compile-blocking helper redeclaration and two assertions that do not reliably enforce the documented input limit or exported struct shapes.

3 open issues
What changed in this PR

Adds README-derived specification tests for the atif package, covering constants, public types, input validation, size limits, trajectory validation, and encoding behavior.

Changes:

  • Verifies documented ATIF constants and exported types.
  • Tests malformed, non-object, and oversized input handling.
  • Tests invalid trajectory rejection and validation before encoding.
  • Review findings identify a helper redeclaration compile error, an oversized-input test that does not isolate the size limit, and type checks that do not enforce struct shape.
File Description
pkg/​atif/​spec_test.go Adds README-derived specification tests for the ATIF public API, constants, types, conversion, validation, and encoding behavior.

Review effort: Lite (auto)

Comment thread pkg/atif/spec_test.go
Comment on lines +130 to +133
type repeatingReader struct {
pattern []byte
offset int
}
Comment thread pkg/atif/spec_test.go
Comment on lines +44 to +50
{name: "Trajectory", value: atif.Trajectory{}},
{name: "Agent", value: atif.Agent{}},
{name: "Step", value: atif.Step{}},
{name: "ToolCall", value: atif.ToolCall{}},
{name: "Observation", value: atif.Observation{}},
{name: "ObservationResult", value: atif.ObservationResult{}},
{name: "FinalMetrics", value: atif.FinalMetrics{}},
Comment thread pkg/atif/spec_test.go
// TestSpec_PublicAPI_ConvertEnforcesInputLimit validates the documented 64 MiB
// bound without retaining the full input in memory.
func TestSpec_PublicAPI_ConvertEnforcesInputLimit(t *testing.T) {
input := io.LimitReader(&repeatingReader{pattern: []byte(" \n")}, int64(atif.MaxSessionBytes)+1)
@pelikhan
pelikhan merged commit fbfe770 into main Nov 8, 2026
3 checks passed
@pelikhan
pelikhan deleted the spec-enforcer-atif-42475546500-44d484f4ff91f162 branch November 8, 2026 16:26
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.2.2

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