test(contracts): cover C6 section headers #870

Merged
pullings merged 1 commit from i/799-c6-section-header into main 2026-08-25 17:29:21 +02:00
Owner

Summary

Refs #799.

  • Adds the C6 section-header control for ^### .+$ with accepting and rejecting cases.
  • Extends TestC6AgainstShippedChangelog to validate all section headers alongside version headings.
  • Refuses to grade a missing or empty section-header corpus instead of passing vacuously.
  • Leaves #798's version-heading implementation boundary unchanged.

Verification

  • go test -v -count=1 ./internal/changelog -run 'TestC6': version headings=68, violations=0; section headers=233, violations=0.
  • go test -count=1 ./...: passed.
  • go vet ./...: passed.
  • Mutation artifact: /tmp/carpenter-799-verification-final.log.
    • weakened regex control: rc=1 (expected).
    • over-strict regex control: rc=1 (expected).
    • planted malformed section header: corpus rc=1 (expected).
    • empty section corpus: CANNOT GRADE, rc=1 (expected).
    • missing CHANGELOG: CANNOT GRADE, rc=1 (expected).
      Each mutation was asserted applied before its test result was read; artifact overall_rc=0.
## Summary Refs #799. - Adds the C6 section-header control for `^### .+$` with accepting and rejecting cases. - Extends `TestC6AgainstShippedChangelog` to validate all section headers alongside version headings. - Refuses to grade a missing or empty section-header corpus instead of passing vacuously. - Leaves #798's version-heading implementation boundary unchanged. ## Verification - `go test -v -count=1 ./internal/changelog -run 'TestC6'`: version headings=68, violations=0; section headers=233, violations=0. - `go test -count=1 ./...`: passed. - `go vet ./...`: passed. - Mutation artifact: `/tmp/carpenter-799-verification-final.log`. - weakened regex control: rc=1 (expected). - over-strict regex control: rc=1 (expected). - planted malformed section header: corpus rc=1 (expected). - empty section corpus: `CANNOT GRADE`, rc=1 (expected). - missing CHANGELOG: `CANNOT GRADE`, rc=1 (expected). Each mutation was asserted applied before its test result was read; artifact overall_rc=0.
test(contracts): cover C6 section headers (#799)
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 5s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 23s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 6s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 6s
register-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 3s
tests / bats (pull_request) Successful in 7s
tests / shellcheck (pull_request) Successful in 3s
check-self-bootstrap / check (push) Successful in 5s
go-ci / lint + build + test (push) Successful in 23s
release / decide + act (push) Successful in 8s
release / release (push) Successful in 0s
tests / workflow-schema (push) Successful in 3s
tests / bats (push) Successful in 7s
tests / shellcheck (push) Successful in 3s
5d136caf9c
Run the section-header grammar against every matching heading in the shipped CHANGELOG. Refuse cannot-grade for a missing or empty section corpus, and keep the accept/reject control separate from the existing version-heading control.
lookout approved these changes 2026-08-25 17:27:51 +02:00
lookout left a comment

Reviewed the exact head 5d136caf9c and APPROVED.

The C6 extension is sound: the section grammar has accepting and rejecting controls, and the shipped-corpus test independently counts and validates both populations (68 version headings and 233 section headers, zero violations). Missing or empty CHANGELOG/section corpora refuse with CANNOT GRADE rather than passing vacuously. I independently mutated the section regex (weakened and over-strict), planted a malformed section header, removed the section corpus, and removed CHANGELOG; each control failed for the intended reason.

Full go test ./... -count=1, go vet ./..., go build ./..., bats tests, and git diff --check pass. Forgejo reports all 12 contexts successful.

Reviewed the exact head 5d136caf9c76216a25d22674eae3d0bf8699d52e and APPROVED. The C6 extension is sound: the section grammar has accepting and rejecting controls, and the shipped-corpus test independently counts and validates both populations (68 version headings and 233 section headers, zero violations). Missing or empty CHANGELOG/section corpora refuse with CANNOT GRADE rather than passing vacuously. I independently mutated the section regex (weakened and over-strict), planted a malformed section header, removed the section corpus, and removed CHANGELOG; each control failed for the intended reason. Full go test ./... -count=1, go vet ./..., go build ./..., bats tests, and git diff --check pass. Forgejo reports all 12 contexts successful.
lookout approved these changes 2026-08-25 17:27:51 +02:00
lookout left a comment

Reviewed the exact head 5d136caf9c and APPROVED.

The C6 extension is sound: the section grammar has accepting and rejecting controls, and the shipped-corpus test independently counts and validates both populations (68 version headings and 233 section headers, zero violations). Missing or empty CHANGELOG/section corpora refuse with CANNOT GRADE rather than passing vacuously. I independently mutated the section regex (weakened and over-strict), planted a malformed section header, removed the section corpus, and removed CHANGELOG; each control failed for the intended reason.

Full go test ./... -count=1, go vet ./..., go build ./..., bats tests, and git diff --check pass. Forgejo reports all 12 contexts successful.

Reviewed the exact head 5d136caf9c76216a25d22674eae3d0bf8699d52e and APPROVED. The C6 extension is sound: the section grammar has accepting and rejecting controls, and the shipped-corpus test independently counts and validates both populations (68 version headings and 233 section headers, zero violations). Missing or empty CHANGELOG/section corpora refuse with CANNOT GRADE rather than passing vacuously. I independently mutated the section regex (weakened and over-strict), planted a malformed section header, removed the section corpus, and removed CHANGELOG; each control failed for the intended reason. Full go test ./... -count=1, go vet ./..., go build ./..., bats tests, and git diff --check pass. Forgejo reports all 12 contexts successful.
Sign in to join this conversation.
No description provided.