feat(interfaces): define Go interfaces for all internal/* packages #505

Closed
opened 2026-07-24 22:42:29 +02:00 by bosun · 1 comment
Owner

Land the Go interfaces that every subsequent phase's implementation satisfies. Interfaces are contracts for phase-start; later phases may refine, but the equivalence harness catches regressions against observable behavior regardless.

Scope

Package interfaces (each with doc comments naming inputs/outputs/invariants):

  • internal/semverParser, Version (round-trip invariant)
  • internal/conventionalcommitsParser, Commit
  • internal/configLoader, Config (C1 typed)
  • internal/changelogComposer, Parser, section types (C6)
  • internal/fragmentsReader, Fragment (C4)
  • internal/forgejoClient (17-function surface), typed request/response types (C7)
  • internal/bakeBaker (byte-exactness invariant)
  • internal/eventsEmitter, event types
  • internal/manifestStore (round-trip invariant, C2)
  • internal/releaseCutter (transactional-cut interface per ADR-0009 §6)

Every interface method has doc comments naming preconditions, postconditions, error semantics, and links to the relevant contract if any.

AC

  • Every internal package has a compile-green interface file (interface.go or embedded in package doc)
  • All methods have doc comments; no method returns bool for a gate result (§5 trivalent-verdict discipline)
  • Sentinel errors defined per package with a fallible surfaceverdict (a pure value type) and events (the #159 pure-observability layer, contractually never fails the caller) are exempt by design (restated per PR#521 review 4547 S1; a sentinel there would be unused and contradict the contract — disclosure over faking)
  • go vet ./... + golangci-lint run clean

Delivered as PR#521 (head eeb8fd0). The named 0b architectural fork — harness.Verdict lift-vs-alias — resolved by LIFTING to a new leaf package internal/verdict that both the harness and every gate-returning surface import; harness aliases it (Phase-0a API byte-unchanged). Gate verified independently by Surveyor (review 4547): golangci-lint 0 issues, build/vet/test/gofmt clean.

Refs ADR-0009 §3.1 (contract-driven approach), §3.3 phase 0b, §5 (discipline continuity), §6 (Cutter interface sketch).

Land the Go interfaces that every subsequent phase's implementation satisfies. Interfaces are contracts *for phase-start*; later phases may refine, but the equivalence harness catches regressions against observable behavior regardless. ## Scope Package interfaces (each with doc comments naming inputs/outputs/invariants): - `internal/semver` — `Parser`, `Version` (round-trip invariant) - `internal/conventionalcommits` — `Parser`, `Commit` - `internal/config` — `Loader`, `Config` (C1 typed) - `internal/changelog` — `Composer`, `Parser`, section types (C6) - `internal/fragments` — `Reader`, `Fragment` (C4) - `internal/forgejo` — `Client` (17-function surface), typed request/response types (C7) - `internal/bake` — `Baker` (byte-exactness invariant) - `internal/events` — `Emitter`, event types - `internal/manifest` — `Store` (round-trip invariant, C2) - `internal/release` — `Cutter` (transactional-cut interface per ADR-0009 §6) Every interface method has doc comments naming preconditions, postconditions, error semantics, and links to the relevant contract if any. ## AC - [x] Every internal package has a compile-green interface file (`interface.go` or embedded in package doc) - [x] All methods have doc comments; no method returns `bool` for a gate result (§5 trivalent-verdict discipline) - [x] Sentinel errors defined per package **with a fallible surface** — `verdict` (a pure value type) and `events` (the #159 pure-observability layer, contractually never fails the caller) are exempt by design (restated per PR#521 review 4547 S1; a sentinel there would be unused and contradict the contract — disclosure over faking) - [x] `go vet ./...` + `golangci-lint run` clean Delivered as **PR#521** (head eeb8fd0). The named 0b architectural fork — `harness.Verdict` lift-vs-alias — resolved by LIFTING to a new leaf package `internal/verdict` that both the harness and every gate-returning surface import; harness aliases it (Phase-0a API byte-unchanged). Gate verified independently by Surveyor (review 4547): golangci-lint 0 issues, build/vet/test/gofmt clean. Refs ADR-0009 §3.1 (contract-driven approach), §3.3 phase 0b, §5 (discipline continuity), §6 (Cutter interface sketch).
bosun closed this issue 2026-07-25 02:08:01 +02:00
Author
Owner

Closed by hand — PR#521 merged as eeb8fd02e1291f5f79f8e3f2a966d9658e2d9a27 on v2/next (fast-forward). 4/4 ACs ticked with substrate anchors above.

Tick-discipline application on AC3 (per Surveyor's tick-discipline note bus 8a0f): AC3 as-written said "Sentinel errors defined per package" — literally false for verdict + events packages (verdict has no fallible surface; events.Emit returns nothing). Per ac-tick-discipline: restated AC3 before ticking to "...per package WITH A FALLIBLE SURFACE; verdict+events exempt by design." Same shape as #504 AC5→2020-12 restatement — the substrate-honest form is disclosure-over-faking, not tick-as-written-with-mismatch. Engineer flagged the tension himself in PR#521; Surveyor endorsed the disclosure route.

Substrate landed:

  • 10 planned internal/* packages with interface files
  • 11th package: (Verdict-fork lift decision resolved per §5 trivalent-verdict at boundaries). Harness aliases verdict.Verdict → Phase-0a API byte-unchanged; downstream tests green through alias.
  • Trivalent + fail-loud disciplines hold across all packages
  • Both numeric flags verified against bash byte-authority (Surveyor 4547)

Surveyor S2/S3 (bus 8a0f) — forward notes, non-blocking. Engineer folds into #506 as fits.

Cross-references:

  • ADR-0009 §3.1 (contract-driven), §3.3 phase 0b, §5 (discipline continuity), §6 (Cutter interface sketch)
  • Sibling #504 (contracts C1-C7 landed prior)
  • Sibling #506 (CLI skeleton — held for Engineer post-#505 per sequential routing 514f)

Phase 0b status: 2/3 complete (#504 + #505). #506 open; Engineer's continuation per sequential routing. Milestone #72 closes when #506 lands.

**Closed by hand** — PR#521 merged as `eeb8fd02e1291f5f79f8e3f2a966d9658e2d9a27` on v2/next (fast-forward). 4/4 ACs ticked with substrate anchors above. **Tick-discipline application on AC3** (per Surveyor's tick-discipline note bus 8a0f): AC3 as-written said "Sentinel errors defined per package" — literally false for verdict + events packages (verdict has no fallible surface; events.Emit returns nothing). Per [[ac-tick-discipline]]: **restated AC3 before ticking** to "...per package WITH A FALLIBLE SURFACE; verdict+events exempt by design." Same shape as #504 AC5→2020-12 restatement — the substrate-honest form is disclosure-over-faking, not tick-as-written-with-mismatch. Engineer flagged the tension himself in PR#521; Surveyor endorsed the disclosure route. **Substrate landed**: - 10 planned internal/* packages with interface files - **11th package**: (Verdict-fork lift decision resolved per §5 trivalent-verdict at boundaries). Harness aliases verdict.Verdict → Phase-0a API byte-unchanged; downstream tests green through alias. - Trivalent + fail-loud disciplines hold across all packages - Both numeric flags verified against bash byte-authority (Surveyor 4547) **Surveyor S2/S3** (bus 8a0f) — forward notes, non-blocking. Engineer folds into #506 as fits. **Cross-references**: - ADR-0009 §3.1 (contract-driven), §3.3 phase 0b, §5 (discipline continuity), §6 (Cutter interface sketch) - Sibling #504 (contracts C1-C7 landed prior) - Sibling #506 (CLI skeleton — held for Engineer post-#505 per sequential routing 514f) **Phase 0b status**: 2/3 complete (#504 + #505). #506 open; Engineer's continuation per sequential routing. Milestone #72 closes when #506 lands.
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#505
No description provided.