[spec-enforcer] Enforce specifications for agentdrain, cli#30822
Merged
pelikhan merged 1 commit intoMay 7, 2026
Merged
Conversation
- agentdrain: remove TestSpec_PublicAPI_Miner_ClusterCount_SPEC_MISMATCH which had an incorrect SPEC_MISMATCH comment (README does not document ClusterCount()) and was a duplicate of TestSpec_PublicAPI_Miner_Clusters - cli: add TestSpec tests for IsDockerAvailable, IsDockerImageAvailable, IsDockerImageDownloading; add context import for ctx-accepting functions; document signature mismatches where README omits context.Context param Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 updates specification-driven tests for the following packages, reviewed against their README.md specifications added in commit
3d1140a.actionpinsagentdraincliTest Derivation
All tests are derived from README.md specifications, not from implementation source code.
Changes
pkg/agentdrain/spec_test.goTestSpec_PublicAPI_Miner_ClusterCount_SPEC_MISMATCH: had an incorrect SPEC_MISMATCH comment (the README does not documentClusterCount()— onlyClusters() []Cluster) and was functionally duplicate of the existingTestSpec_PublicAPI_Miner_Clusterstest.pkg/cli/spec_test.goTestSpec_PublicAPI_IsDockerAvailable: validatesIsDockerAvailablereturns a bool without panicking. Documents SPEC_MISMATCH: README showsfunc() boolbut implementation requirescontext.Context.TestSpec_PublicAPI_IsDockerImageAvailable: validates non-existent image returnsfalse. Documents same SPEC_MISMATCH on the ctx parameter.TestSpec_PublicAPI_IsDockerImageDownloading: validates non-existent image returnsfalse(no SPEC_MISMATCH — signature matches README)."context"import for the new tests.Spec-Implementation Mismatches Documented
cliIsDockerAvailablefunc() bool; implementation isfunc(context.Context) boolcliIsDockerImageAvailablefunc(string) bool; implementation isfunc(context.Context, string) boolRound-Robin State
Auto-generated by Package Specification Enforcer workflow §25494513033