Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/spec-enforcer.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ find pkg/<package> -name 'spec_test.go' -type f
cat pkg/<package>/spec_test.go 2>/dev/null || echo "No spec tests exist"
```

## Phase 3: Generate Specification Tests
## Phase 3: Create or Update Specification Tests

Write tests in `pkg/<package>/spec_test.go` that validate the specification.
Create or update `pkg/<package>/spec_test.go` to validate the specification. If the file already exists, review it against the current README.md and update any tests that are outdated, missing, or incorrect. Use `edit` to write the complete updated file contents (this overwrites the existing file).

### Test File Structure

Expand Down Expand Up @@ -340,9 +340,11 @@ cat > /tmp/gh-aw/cache-memory/spec-enforcer/enforcements/<package>.json <<EOF
EOF
```

### Create Pull Request
### Create Pull Request or Call Noop
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Heading uses "Call Noop"; elsewhere the safe-output tool is referred to as noop (lowercase, in backticks), e.g. .github/workflows/shared/noop-reminder.md:1. Consider renaming this heading to use noop for consistency and clarity that it’s a tool name.

Suggested change
### Create Pull Request or Call Noop
### Create Pull Request or Call `noop`

Copilot uses AI. Check for mistakes.

If any spec test files were created or updated:
After reviewing all selected packages, choose exactly **one** of the following:
Comment on lines +343 to +345
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The Phase 5 title above this section still says "Save Cache and Create PR", but this section now allows ending the run with noop when nothing changed. Please update the Phase 5 heading to reflect the new two-outcome flow (PR or noop) so the instructions don’t contradict each other.

Copilot uses AI. Check for mistakes.

**Option A — If any spec test files were created or updated**, create a PR:

**PR Title**: `Enforce specifications for <pkg1>, <pkg2>`

Expand Down Expand Up @@ -375,6 +377,14 @@ All tests are derived from README.md specifications, not from implementation sou
*Auto-generated by Package Specification Enforcer workflow*
```

**Option B — If no spec test files were changed** (all selected packages already have up-to-date tests that fully reflect their README.md specifications), call `noop` instead of creating a PR:

```json
{"noop": {"message": "No changes needed: reviewed <pkg1>, <pkg2>, <pkg3>. All spec_test.go files are up-to-date with current README.md specifications."}}
```

> **Important**: Every run MUST end by either creating a PR (Option A) or calling `noop` (Option B). Completing the analysis without doing either is an error.

## Important Guidelines

1. **Specification-first**: Tests MUST come from the README.md, not source code
Expand All @@ -389,11 +399,11 @@ All tests are derived from README.md specifications, not from implementation sou
## Success Criteria

- ✅ 2-3 packages with specifications processed per run
- ✅ `spec_test.go` created or updated for each package
- ✅ `spec_test.go` created or updated for each package that needs changes
- ✅ All tests derived from README.md content
- ✅ Tests compile and pass (or mismatches documented)
- ✅ Cache memory updated with enforcement state
- ✅ Round-robin rotation advances correctly
- ✅ PR created with test changes
- ✅ PR created with test changes **OR** `noop` called when all tests are already up-to-date

{{#import shared/noop-reminder.md}}
Loading