feat(conventionalcommits): implement Parser + Commit against #505 interface (TDD against bash byte-oracle) #524

Closed
opened 2026-07-25 19:51:50 +02:00 by bosun · 1 comment
Owner

Implement internal/conventionalcommits package satisfying the Go interface landed in #505.

Motivation

Phase 1 kicks off contract-driven TDD-per-phase per ADR-0009 §3.1. internal/conventionalcommits is one of two Phase 1 pure-logic libs (sibling: #523 semver). Interface (Parser, Commit) is Surveyor-approved in #505; implementation lands here.

Scope

  • internal/conventionalcommits/*.go — implementation satisfying #505 interface (Parser.Parse, Commit types, type/scope/breaking-change detection, bump-suggest logic)
  • Bash byte-oracle: existing bash implementation in lib/conventionalcommits.sh (or the equivalent parsing logic in release-prep.sh) is the behavior-of-record.
  • TDD approach (contract-driven per ADR-0009 §3.1):
    1. Test against interface first
    2. Oracle harness case using internal/harness — Go impl vs bash oracle on shared fixture corpus
    3. Implementation to green
  • Fixture corpus at testdata/fixtures/conventionalcommits/ — real commit-message shapes from the CHANGELOG corpus (147KB, frankenbit/release-toolkit git history) as C6-adjacent source

AC

  • internal/conventionalcommits implementation compiles + all #505 interface methods satisfied — verified in PR#526 3cca869; ParseCommit additive constructor introduced beside frozen ParseSubject for BREAKING CHANGE body-trailer detection (Surveyor S1 design call: endorse + doc-pointer + defer amendment to Phase 6)
  • Unit tests green (go test ./internal/conventionalcommits/...) — verified in PR#526 gate run
  • Equivalence-harness cases against bash oracle green — verified: Surveyor reproduced cc port byte-faithful to real conventional-commits.sh (review 4553), harness teeth proven by her own mutation on parse surface. Same harness vehicle as #523 (Go oracleshim + bash dispatcher + TestMain-binary) reused as ratified
  • Bump-suggest logic byte-identical to bash oracle — verified: CategorizeRange landed, consumes semver.BumpLevel from #523
  • go vet ./... + golangci-lint run clean — verified: gate own instrument (golangci-lint) fired, all clean
  • Depends on: #505 (interfaces), #503 (harness), #504 (contracts — semver contract shape adjacent for bump-emit)
  • Sibling: #523 (semver — parallelizable OR sequential Engineer continuation)
  • Downstream: Phase 3 changelog-engine (#507) consumes this for section grouping
  • Refs ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 1 row, §5 (fail-loud + trivalent-verdict discipline)

Anchor

Filed 2026-07-25 by Bosun on operator continuation direction for Phase 1 dispatch. Engineer natural continuation-in-domain per #505 authorship + staged wake-context.

Implement `internal/conventionalcommits` package satisfying the Go interface landed in #505. ## Motivation Phase 1 kicks off contract-driven TDD-per-phase per ADR-0009 §3.1. `internal/conventionalcommits` is one of two Phase 1 pure-logic libs (sibling: [[#523 semver]]). Interface (`Parser`, `Commit`) is Surveyor-approved in #505; implementation lands here. ## Scope - `internal/conventionalcommits/*.go` — implementation satisfying #505 interface (Parser.Parse, Commit types, type/scope/breaking-change detection, bump-suggest logic) - **Bash byte-oracle**: existing bash implementation in `lib/conventionalcommits.sh` (or the equivalent parsing logic in `release-prep.sh`) is the behavior-of-record. - **TDD approach** (contract-driven per ADR-0009 §3.1): 1. Test against interface first 2. Oracle harness case using `internal/harness` — Go impl vs bash oracle on shared fixture corpus 3. Implementation to green - Fixture corpus at `testdata/fixtures/conventionalcommits/` — real commit-message shapes from the CHANGELOG corpus (147KB, `frankenbit/release-toolkit` git history) as C6-adjacent source ## AC - [x] `internal/conventionalcommits` implementation compiles + all `#505` interface methods satisfied — verified in PR#526 3cca869; ParseCommit additive constructor introduced beside frozen ParseSubject for BREAKING CHANGE body-trailer detection (Surveyor S1 design call: endorse + doc-pointer + defer amendment to Phase 6) - [x] Unit tests green (`go test ./internal/conventionalcommits/...`) — verified in PR#526 gate run - [x] Equivalence-harness cases against bash oracle green — verified: Surveyor reproduced cc port byte-faithful to real conventional-commits.sh (review 4553), harness teeth proven by her own mutation on parse surface. Same harness vehicle as #523 (Go oracleshim + bash dispatcher + TestMain-binary) reused as ratified - [x] Bump-suggest logic byte-identical to bash oracle — verified: CategorizeRange landed, consumes semver.BumpLevel from #523 - [x] `go vet ./...` + `golangci-lint run` clean — verified: gate own instrument (golangci-lint) fired, all clean ## Related - Depends on: #505 (interfaces), #503 (harness), #504 (contracts — semver contract shape adjacent for bump-emit) - Sibling: #523 (semver — parallelizable OR sequential Engineer continuation) - Downstream: Phase 3 changelog-engine (#507) consumes this for section grouping - Refs ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 1 row, §5 (fail-loud + trivalent-verdict discipline) ## Anchor Filed 2026-07-25 by Bosun on operator continuation direction for Phase 1 dispatch. Engineer natural continuation-in-domain per #505 authorship + staged wake-context.
bosun closed this issue 2026-07-25 20:40:14 +02:00
Author
Owner

Closed by hand — PR#526 merged as 3cca8699390251870dd4ef7ff7f7085dc657cfad on v2/next (fast-forward). All 5 ACs ticked with substrate anchors above.

Two commits landed:

  • C1: S1+S2 fold from #525 into semver files (doc/comment/test only, delineated from cc work). Surveyor verified faithful + new overflow test non-vacuous.
  • C2: cc impl (ParseCommit additive constructor + CategorizeRange + harness vs pure oracle fns). Byte-faithful to lib/conventional-commits.sh.

Surveyor S1 (design call): endorsed additive ParseCommit + doc-pointer + interface amendment DEFERRED to Phase 6 (natural surface where orchestrators consume cc). Pass-with-disclosure applied — the frozen #505 interface stays intact for Phase 1 close; Phase 6 lifts if needed.

Surveyor forward-note: #442 register-scrub obligation moves to Phase 3 composer (cross-phase, non-blocking on Phase 1).

Cross-references:

  • ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 1 row, §5 (fail-loud + trivalent-verdict discipline)
  • Depends on: #505 (interfaces), #503 (harness), #504 (contracts), #523 (semver — BumpLevel consumed)
  • Sibling: #523 (semver — closed prior)
  • Cross-phase: #442 (register-scrub → Phase 3), interface amendment → Phase 6

Phase 1 status: 2/2 complete (#523 + #524). Milestone #73 closes on this tracker close.

**Closed by hand** — PR#526 merged as `3cca8699390251870dd4ef7ff7f7085dc657cfad` on v2/next (fast-forward). All 5 ACs ticked with substrate anchors above. **Two commits landed**: - **C1**: S1+S2 fold from #525 into semver files (doc/comment/test only, delineated from cc work). Surveyor verified faithful + new overflow test non-vacuous. - **C2**: cc impl (ParseCommit additive constructor + CategorizeRange + harness vs pure oracle fns). Byte-faithful to `lib/conventional-commits.sh`. **Surveyor S1 (design call)**: endorsed additive ParseCommit + doc-pointer + **interface amendment DEFERRED to Phase 6** (natural surface where orchestrators consume cc). Pass-with-disclosure applied — the frozen #505 interface stays intact for Phase 1 close; Phase 6 lifts if needed. **Surveyor forward-note**: #442 register-scrub obligation moves to Phase 3 composer (cross-phase, non-blocking on Phase 1). **Cross-references**: - ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 1 row, §5 (fail-loud + trivalent-verdict discipline) - Depends on: #505 (interfaces), #503 (harness), #504 (contracts), #523 (semver — BumpLevel consumed) - Sibling: #523 (semver — closed prior) - Cross-phase: #442 (register-scrub → Phase 3), interface amendment → Phase 6 **Phase 1 status**: 2/2 complete (#523 + #524). Milestone #73 closes on this tracker close.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#524
No description provided.