Skip to content

[spec-enforcer] Enforce specifications for tty, types, workflow#27305

Merged
pelikhan merged 2 commits intomainfrom
spec-enforcer/2026-04-20-tty-types-workflow-b230cdde53b4c9a6
Apr 20, 2026
Merged

[spec-enforcer] Enforce specifications for tty, types, workflow#27305
pelikhan merged 2 commits intomainfrom
spec-enforcer/2026-04-20-tty-types-workflow-b230cdde53b4c9a6

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Specification Test Enforcement

This PR adds specification-driven tests for three packages that previously had no spec_test.go coverage.

Package Tests Added Tests Passing Spec Sections Covered
tty 3 3 Public API, Design Notes
types 6 6 Types, Design Notes
workflow 11 11 Permissions System, Safe Outputs

Test Derivation

All tests are derived from README.md specifications, not from implementation source code.

pkg/tty — Tests document and verify the IsStdoutTerminal() / IsStderrTerminal() contracts: call-time evaluation (not cached), and false-return in non-TTY environments (CI, piped execution).

pkg/types — Tests validate struct construction with spec examples (stdio/HTTP/container MCP servers), JSON round-trip behavior (the spec requires json + yaml struct tags), and zero-value safety for all four types (BaseMCPServerConfig, MCPAuthConfig, TokenWeights, TokenClassWeights).

pkg/workflow — Tests focus on two untested areas of the public API:

  • Permissions factory functions: NewPermissionsContentsWritePRWrite, NewPermissionsContentsWriteIssuesWritePRWrite, NewPermissionsContentsReadDiscussionsWrite, NewPermissionsContentsReadIssuesWriteDiscussionsWrite, NewPermissionsContentsReadPRWrite, NewPermissionsContentsReadSecurityEventsWrite, NewPermissionsContentsReadProjectsWrite — each verified to produce the exact scope/level combinations documented in the README.
  • SafeOutputsConfigFromKeys: Verified to build a SafeOutputsConfig from documented key names ("add-comment", "create-issue", "create-pull-request", etc.) with HasSafeOutputsEnabled returning the correct value.

Spec-Implementation Mismatches

None found. All implementations match their README.md specifications.

Round-Robin State

  • Packages processed this run: tty, types, workflow
  • Next packages in rotation: actionpins, agentdrain, cli (or next packages in alphabetical order without recent enforcement)
  • Total eligible packages: 22 (with README.md)

References:

Auto-generated by Package Specification Enforcer workflow

Generated by Package Specification Enforcer · ● 596.6K ·

  • expires on Apr 23, 2026, 11:07 AM UTC

Add specification-driven tests derived from README.md for three packages
that previously had no spec_test.go coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

@pelikhan
Copy link
Copy Markdown
Collaborator

/cloclo fix lint issue

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 20, 2026

🎤 Bravo! /cloclo has delivered a stunning performance! Standing ovation! 🌟

@github-actions
Copy link
Copy Markdown
Contributor Author

Pull request created: #27346

🎤 Magnifique! Performance by /cloclo

@github-actions
Copy link
Copy Markdown
Contributor Author

✨ Cloclo to the rescue! 🎵

Summary

Diagnosed the lint-go failure from §24663160710 and opened a fix PR.

Root Cause

The testifylint linter (with enable-all: true) flagged two issues in the newly added pkg/types/spec_test.go:

Check Violation Fix
float-compare 10× assert.Equal(t, <float64>, ...) assert.InDelta(t, ..., 1e-9, ...)
nil-empty assert.Equal(t, "", cfg.Type, ...) assert.Empty(t, cfg.Type, ...)

All other spec test files (pkg/tty, pkg/workflow, pkg/agentdrain, pkg/stats) were clean.

Changes Made

Only pkg/types/spec_test.go was modified — 11 assertion style fixes, no logic changes.

Next Steps

Review and merge the fix PR opened from branch cloclo/fix-spec-test-lint-2026-04-20. Once merged, re-run CI on this PR to confirm the lint-go job goes green. 🟢

🎤 Magnifique! Performance by /cloclo · ● 634.1K ·

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 20, 2026

Smoke CI completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor Author

✅ smoke-ci: safeoutputs CLI comment only run (24669139937)

Generated by Smoke CI for issue #27305 ·

@pelikhan pelikhan merged commit 917b8de into main Apr 20, 2026
24 checks passed
@pelikhan pelikhan deleted the spec-enforcer/2026-04-20-tty-types-workflow-b230cdde53b4c9a6 branch April 20, 2026 13:33
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