Repository navigation
[spec-enforcer] Enforce specifications for cli, connectors, console - #83366
Open
github-actions[bot] wants to merge 1 commit into
Open
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two active findings remain: the CLI specification test can miss contract drift, and the console width assertion is incompatible with documented js/wasm behavior.
2 open issues
What changed in this PR
Adds README-derived specification tests for CLI, connectors, and console packages.
Changes:
- Expands CLI constructor and compile-flag coverage.
- Tests connector strict decoding and size limits.
- Adds console width and composite-column rendering tests.
| File | Description |
|---|---|
| pkg/console/spec_test.go | Adds specification tests for table width budgets, nested rendering, and composite-column omission. |
| pkg/connectors/spec_test.go | Adds external-package tests for strict decoding and document-size limits. |
| pkg/cli/spec_test.go | Adds tests for CLI constructors and development compile-flag contracts. |
Review effort: Lite (adaptive)
Comment on lines
+157
to
+160
| if tt.width > 0 { | ||
| for line := range strings.SplitSeq(got, "\n") { | ||
| assert.LessOrEqual(t, ansi.StringWidth(line), tt.width, | ||
| "rendered line should fit the documented display-column budget: %q", line) |
Comment on lines
+72
to
+73
| required := cli.DryRunRequiredBoolFlags() | ||
| require.NotEmpty(t, required, "the documented API should identify required development-compile checks") |
This branch has not been deployed
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 README-driven contract checks for CLI constructors and development-compile validation, strict connector document decoding and size bounds, and console width budgets and composite omitempty columns.
cliconnectorsconsoleCounts represent top-level test functions; passing totals include existing specification tests. CLI constructor coverage also gains three table cases. The existing connector unknown-field regression becomes an expanded
TestSpec_table; the two legacy fixture checks retain their original names. Connector tests now use the external package and required!integrationbuild tag.Test Derivation
New specification assertions derive from package README.md contracts. Implementation access was limited to exported signatures and type declarations. README extraction and build/test classification used the requested specialized agents.
Spec-Implementation Mismatches
None found in the tested contracts. A
SPEC_AMBIGUITYcomment records that the connector README delegates declaration syntax, phases, event rules, and execution details to CONTRACT.md; detailed runtime cases were not inferred.Validation and experimental coverage
make fmtandgit diff --checkpassed.go build ./pkg/cli/... ./pkg/connectors/... ./pkg/console/...passed.go test -v -run TestSpec ./pkg/cli/ ./pkg/connectors/ ./pkg/console/passed all 46 specification tests; the output classifier reported zero failures.make agent-report-progresspassed impacted unit tests, custom Go linters, and schema freshness. Its Go lint component initially lacked golangci-lint; after installing the repository-pinned v2.15.0 into task-local temporary storage and addressing two modernization suggestions, the scoped Go lint rerun passed with zero issues.spec-enforcer/generated-tests. This measures specification tests only.Round-Robin State
References: §46871875481