Skip to content

[spec-enforcer] Enforce specifications for actionpins, agentdrain, fileutil#27011

Merged
pelikhan merged 1 commit intomainfrom
spec-enforcer/actionpins-agentdrain-fileutil-2026-04-18-d28597dd4ceac0d5
Apr 18, 2026
Merged

[spec-enforcer] Enforce specifications for actionpins, agentdrain, fileutil#27011
pelikhan merged 1 commit intomainfrom
spec-enforcer/actionpins-agentdrain-fileutil-2026-04-18-d28597dd4ceac0d5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Specification Test Enforcement

This PR adds specification-driven tests for three packages. All tests are derived from each package's README.md specification, not from implementation source code.

Package Tests Added Tests Passing Spec Sections Covered
actionpins 9 9 Public API, Types, Design Decisions
agentdrain 14 14 Public API, Types, Utility Functions, Design Decisions
fileutil 10 10 Path Validation, File/Dir Checks, File Operations, Archive Operations

Test Derivation

All tests use the TestSpec_ prefix and are table-driven, derived exclusively from README.md behavioral contracts. No internal/unexported functions are tested.

Spec-Implementation Mismatches

actionpins

  • GetActionPinsByRepo returns nil for unknown repos — The spec states "Returns all pins for a repository" without specifying nil vs empty slice. The implementation returns nil (map lookup for missing key). Annotated with // SPEC_MISMATCH.
  • ResolveActionPin in strict mode returns ("", nil) for unknown pins — The spec says "fallback behavior controlled by PinContext.StrictMode", implying strict mode errors. The implementation emits a warning to stderr and returns ("", nil) in both strict and non-strict modes when no embedded pin is found. Annotated with // SPEC_MISMATCH.

Round-Robin State

  • Packages processed this run: actionpins, agentdrain, fileutil
  • Next packages in rotation: gitutil, parser, tty, types, typeutil, workflow
  • Total eligible packages: 22 (with README.md)

References:


Auto-generated by Package Specification Enforcer workflow

Generated by Package Specification Enforcer · ● 386.4K ·

  • expires on Apr 21, 2026, 10:48 AM UTC

Adds specification-driven tests (spec_test.go) for three packages,
derived from each package's README.md contract, not implementation details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pelikhan pelikhan merged commit 84bb5c6 into main Apr 18, 2026
@pelikhan pelikhan deleted the spec-enforcer/actionpins-agentdrain-fileutil-2026-04-18-d28597dd4ceac0d5 branch April 18, 2026 10:50
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.

1 participant