fix(prep): reject doubled version prefix #1016

Merged
pullings merged 1 commit from i/617-reject-doubled-v into main 2026-08-28 00:03:05 +02:00
Owner

Refs #617

Decision

Reject doubled v prefixes. The live current-main reproduction accepted vv1.2.3 at rt prep's version boundary and only failed later during changelog composition. The established semver parser already accepts one optional leading v and rejects vv; DetermineVersion now delegates the raw target to it and returns its canonical Version.String() output. The parser's single-v behavior is unchanged.

Controls

  • TestParse_Invalid pins vv1.2.3 as invalid at the parser layer.
  • TestDetermineVersionTargetMatchesSemverValidator differentially compares the prep boundary with the parser across bare, single-v, prerelease/build, and doubled-v inputs.
  • Mutation evidence: temporarily restoring the old caller-side TrimPrefix made both doubled-v cases fail the differential test with parser invalid, DetermineVersion error=nil; the implementation was restored before commit.

Verification

  • go build ./...: PASS
  • go vet ./...: PASS
  • go test -count=1 ./...: PASS
  • golangci-lint cache clean && golangci-lint run --timeout=5m: 0 issues
  • bats --print-output-on-failure tests/: 118/118 PASS
  • repository shellcheck: PASS
  • changelog body and fragment checks: PASS
  • git diff --cached --check: PASS
  • current main 3960ecc5e6fcd6643c4a1af880ade2bc5d24bfff and this head merge cleanly (git merge-tree --write-tree: rc=0)
Refs #617 ## Decision Reject doubled `v` prefixes. The live current-main reproduction accepted `vv1.2.3` at `rt prep`'s version boundary and only failed later during changelog composition. The established semver parser already accepts one optional leading `v` and rejects `vv`; `DetermineVersion` now delegates the raw target to it and returns its canonical `Version.String()` output. The parser's single-`v` behavior is unchanged. ## Controls - `TestParse_Invalid` pins `vv1.2.3` as invalid at the parser layer. - `TestDetermineVersionTargetMatchesSemverValidator` differentially compares the prep boundary with the parser across bare, single-`v`, prerelease/build, and doubled-`v` inputs. - Mutation evidence: temporarily restoring the old caller-side `TrimPrefix` made both doubled-`v` cases fail the differential test with `parser invalid, DetermineVersion error=nil`; the implementation was restored before commit. ## Verification - `go build ./...`: PASS - `go vet ./...`: PASS - `go test -count=1 ./...`: PASS - `golangci-lint cache clean && golangci-lint run --timeout=5m`: 0 issues - `bats --print-output-on-failure tests/`: 118/118 PASS - repository shellcheck: PASS - changelog body and fragment checks: PASS - `git diff --cached --check`: PASS - current main `3960ecc5e6fcd6643c4a1af880ade2bc5d24bfff` and this head merge cleanly (`git merge-tree --write-tree`: rc=0)
fix(prep): reject doubled version prefix (#617)
All checks were successful
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 2s
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
ac-closure-check / ac-closure check (pull_request) Successful in 6s
ac-closure-check / check (pull_request) Successful in 0s
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 6s
changelog-body-check / check (pull_request) Successful in 0s
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 7s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 27s
manifest-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / workflow-schema (pull_request) Successful in 4s
tests / bats (pull_request) Successful in 13s
tests / dated-examples (pull_request) Successful in 4s
tests / shellcheck (pull_request) Successful in 3s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 4s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 4s
workflow-parse-check / check (pull_request) Successful in 0s
f891c3ae5f
lookout approved these changes 2026-08-28 00:01:03 +02:00
lookout left a comment

APPROVED — exact head f891c3ae5f. DetermineVersion now delegates the complete target string to the single-v SemVer parser, rejecting doubled v prefixes while preserving ordinary v-prefixed canonical output. Differential tests cover valid, single-v, prerelease/build, and doubled-v inputs; semver invalid-table coverage includes vv1.2.3. Verified go test ./..., go vet ./..., go build ./..., gofmt, git diff --check, Bats 118/118, and golangci-lint (0 issues).

APPROVED — exact head f891c3ae5f326951e1058e084aad9c2d92a68021. DetermineVersion now delegates the complete target string to the single-v SemVer parser, rejecting doubled v prefixes while preserving ordinary v-prefixed canonical output. Differential tests cover valid, single-v, prerelease/build, and doubled-v inputs; semver invalid-table coverage includes vv1.2.3. Verified go test ./..., go vet ./..., go build ./..., gofmt, git diff --check, Bats 118/118, and golangci-lint (0 issues).
lookout approved these changes 2026-08-28 00:01:03 +02:00
lookout left a comment

APPROVED — exact head f891c3ae5f. DetermineVersion now delegates the complete target string to the single-v SemVer parser, rejecting doubled v prefixes while preserving ordinary v-prefixed canonical output. Differential tests cover valid, single-v, prerelease/build, and doubled-v inputs; semver invalid-table coverage includes vv1.2.3. Verified go test ./..., go vet ./..., go build ./..., gofmt, git diff --check, Bats 118/118, and golangci-lint (0 issues).

APPROVED — exact head f891c3ae5f326951e1058e084aad9c2d92a68021. DetermineVersion now delegates the complete target string to the single-v SemVer parser, rejecting doubled v prefixes while preserving ordinary v-prefixed canonical output. Differential tests cover valid, single-v, prerelease/build, and doubled-v inputs; semver invalid-table coverage includes vv1.2.3. Verified go test ./..., go vet ./..., go build ./..., gofmt, git diff --check, Bats 118/118, and golangci-lint (0 issues).
pullings deleted branch i/617-reject-doubled-v 2026-08-28 00:03:05 +02:00
Sign in to join this conversation.
No description provided.