Repository navigation
[spec-enforcer] Enforce specifications for linters, atif, workflowcontract - #75890
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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 on lines
+130
to
+133
| type repeatingReader struct { | ||
| pattern []byte | ||
| offset int | ||
| } |
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{}}, |
| // 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) |
This was referenced Nov 8, 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
This PR adds specification-driven tests for the selected packages.
lintersatifworkflowcontractTest 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
.github/workflows/daily-performance-summary.mdlacks the lifecycle-windowgithub-pr-queryandgithub-issue-queryinstructions required byTestDailyPerformanceSummaryUsesStableWindowMetrics. 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/make agent-report-progresspassed build, custom linters, schema freshness, and impacted ATIF tests; the aggregate target remained incomplete becausegolangci-lintis not installedRound-Robin State
linters,atif,workflowcontractworkqueue,actionpins,agentdrainReferences: