@@ -247,16 +247,76 @@ internal/
247247- **Log fetching**: `?content=true` with raw text fallback + `Accept: text/plain`; script steps only
248248- **Step types handled**: `script` (logs), `waiter` (hidden), `trigger`/`deploy` (metadata only)
249249
250- ## CI Pipeline
250+ ## Dynamic Build Details (Tertiary Validation)
251251
252- The project uses Buildkite for its own CI (`.buildkite/ pipeline.yml`):
252+ builddeck enriches build details and artifacts with data from dedicated pipeline steps — not from Buildkite itself. These are **tertiary validations**: Buildkite doesn't validate them; our dedicated steps do.
253253
254- 1. **Lint & test** — `golangci-lint`, `go vet`, `go test`, `gosec`, `govulncheck`
255- 2. **Build** — `go build ./cmd/builddeck`
256- 3. **Checksum** — downloads binary, runs `sha256sum`, uploads `builddeck.sha256`
257- 4. **Release** — on tag push: builds multi-arch, creates GitHub Release, uploads binaries
254+ ### Git Tag from Tag Step
258255
259- Pipeline reads from default branch — changes must be on `main` before PR builds pass.
256+ The **Tag step** (`:bookmark: Tag`) in the pipeline:
257+ 1. Runs after all validation passes
258+ 2. Analyzes conventional commits since last tag
259+ 3. Creates/pushes semver tag (e.g., `v0.1.1`)
260+ 3. builddeck queries Buildkite API for tags on the build's commit SHA
261+ 4. Displays the tag in build details under the commit hash
262+
263+ This is **not** Buildkite-managed — it's our step creating the tag, our TUI discovering it.
264+
265+ ### Artifact Checksum from Checksum Step
266+
267+ The **Checksum step** (`:lock: Checksum`) in the pipeline:
268+ 1. Downloads the binary artifact
269+ 2. Runs `sha256sum` → produces `builddeck.sha256`
270+ 3. Uploads `.sha256` as companion artifact
271+ 4. builddeck detects `.sha256` artifacts, fetches them, parses the hash
272+ 5. Displays checksum inline next to matching artifact
273+
274+ This is **tertiary validation** — Buildkite doesn't compute or verify checksums; our dedicated step and TUI do.
275+
276+ ### Contract for Pipeline Authors
277+
278+ To enable these features, add these steps to your pipeline:
279+
280+ ```yaml
281+ steps:
282+ # ... your validation steps ...
283+
284+ - label: ":bookmark: Tag"
285+ key: tag
286+ depends_on:
287+ - test
288+ - lint
289+ # ... all validation steps ...
290+ command: |
291+ # Auto-tag based on conventional commits
292+ VERSION=$(determine_version_from_commits)
293+ git tag -a "$VERSION" -m "Release $VERSION"
294+ git push origin "$VERSION"
295+
296+ - label: ":golang: Build and Release"
297+ key: build
298+ depends_on: tag
299+ command: |
300+ # Build binary
301+ # Query GitHub for tag on this commit SHA
302+ VERSION=$(gh api repos/:owner/:repo/git/refs/tags --jq '.[] | select(.object.sha == "'$BUILDKITE_COMMIT'") | .ref' | sed 's|refs/tags/||')
303+ go build -ldflags="-X main.version=$VERSION" ...
304+
305+ - label: ":lock: Checksum"
306+ key: checksum
307+ depends_on: build
308+ command: |
309+ buildkite-agent artifact download builddeck /tmp/
310+ sha256sum /tmp/builddeck | tee builddeck.sha256
311+ buildkite-agent artifact upload builddeck.sha256
312+ ```
313+
314+ The ** Tag** step runs after all validation (fan-in), creates the tag.
315+ The ** Checksum** step runs after build, creates ` .sha256 ` companion artifact.
316+
317+ builddeck automatically:
318+ - Queries tags for each build's commit SHA → shows in build details
319+ - Detects ` .sha256 ` companion artifacts → shows checksum on artifacts
260320
261321## Planned Next Features
262322
0 commit comments