Skip to content

[spec-enforcer] Enforce specifications for cli, connectors, console - #83366

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
spec-enforcer/cli-connectors-console-46871875481-677407b42faa1736
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
spec-enforcer/cli-connectors-console-46871875481-677407b42faa1736

Conversation

@github-actions

@github-actions github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

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.

Package Tests Added Tests Passing Spec Sections Covered
cli 1 31 Public API, Types, Constants, Error handling, Usage examples
connectors 1 2 Public API, Additional exported operations
console 3 13 Public API, Types, Constants, Usage examples, Design Decisions, Thread Safety

Counts 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 !integration build 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_AMBIGUITY comment 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 fmt and git diff --check passed.
  • 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-progress passed 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.
  • Atomic specification-test coverage was converted with the pinned converter revision. The nonempty Cobertura XML was validated and accepted for upload as spec-enforcer/generated-tests. This measures specification tests only.

Round-Robin State

  • Run mode: round-robin
  • Cache: hit; reusable rotation state loaded successfully
  • Packages processed this run: cli, connectors, console
  • Selection: changed CLI README, then connectors and console in rotation
  • Next packages in rotation: constants, ctxutil, envutil
  • Total eligible packages: 52 (Go packages with README.md; testdata excluded)
  • Persisted state: cursor 6, enforcement records, and merged README hashes written and read back successfully
  • Steering issue: Package Specification Enforcer: completed #83359 checked twice; no comments

References: §46871875481

Generated by 📋 Package Specification Enforcer · codex · requested: gpt-6.1-sol · routed: gpt-6.1-sol high · ~134 AIC · ⌖ ~2 AIC · ⊞ 459 · history

  • expires on Dec 5, 2026, 3:45 AM UTC-08:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread pkg/console/spec_test.go
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 thread pkg/cli/spec_test.go
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

No deployments
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