Version: 1.0.0 Last Updated: 2025-11-17 Scope: Rust IaC Template (adaptable to other governed systems)
This playbook documents the systematic approach for shipping governed releases. It captures the process used successfully for v2.0.x → v2.3.0 and provides a reusable pattern for future releases.
Key Principles:
- Incremental: Small, focused releases
- Governed: Specs → Code → Tests → Policies → Docs
- Safe: Multiple validation gates before release
- Traceable: Clear commit history, tags, CHANGELOG
Deliverable: docs/vX.Y.Z-plan.md
Steps:
-
Create Release Plan Document
# Create plan from template cp docs/templates/RELEASE_PLAN.md docs/vX.Y.Z-plan.md -
Define Scope
- Theme: Single sentence describing the release focus
- Epics: 1-3 major features/improvements (prefer 1 for focused releases)
- Guardrails: Explicit list of what will NOT change (critical for stability)
-
Acceptance Criteria Mapping
- Create new AC IDs in
specs/spec_ledger.yaml - Link to relevant existing specs (API, domain model, policy)
- Define clear exit criteria
- Create new AC IDs in
-
Decision Log
- Document any architectural decisions upfront (e.g., library version choices)
- Include rationale and alternatives considered
- Update as new decisions emerge during implementation
Example (from v2.3.0):
## Scope
**Theme**: OTLP Tracing + Telemetry Production Readiness
**Epic**: Implement OTLP export for distributed tracing
**Guardrails** (Locked):
- ❌ No changes to business-core, model, rust_iac_xtask_core APIs
- ❌ No new xtask commands
- ✅ Only: OTLP implementation + minimal docs/config
## Decision Log
**Decision 1**: Stick with OpenTelemetry 0.31.0 (current workspace version)
- Rationale: No dependency churn, better long-term maintenance
- Rejected: Pinning to 0.24.x (technical debt)Gate: Plan approved (self or team review)
Deliverable: TODO list or tracker (can be in plan doc or separate issue)
Steps:
-
Break Down Epics into Tasks
- Use TODO lists (e.g., TodoWrite tool in Claude Code)
- Or create GitHub issues with
vX.Y.Zmilestone - Each task should be testable/verifiable
-
Identify Dependencies
- Library version research
- API compatibility checks
- External documentation review
-
Estimate Scope
- Rough time estimate (not commitments, just sanity check)
- Flag high-risk/complex items early
Example (from v2.3.0):
1. Research OpenTelemetry 0.31.x API patterns
2. Implement try_init_otlp() in telemetry crate
3. Add otlp feature flag to Cargo.toml
4. Test OTLP with/without feature flag
5. Create OTLP testing guide (docs/how-to/test-otlp-tracing.md)
6. Update CHANGELOG.md
7. Tag and push release
Gate: Roadmap is clear and bounded
Steps:
-
Create Feature Branch (optional for solo work)
git checkout -b feat/vX.Y.Z-epic-name
-
Implement Code
- Follow guardrails from Phase 1
- Add
#[cfg(feature = "...")]for optional features - Write inline docs as you go
-
Write Tests
- Unit tests for new functions
- Integration tests for new adapters
- BDD scenarios for new user-facing behavior
-
Maintain TODO List
- Mark tasks as in_progress → completed
- Add new tasks if discovered during implementation
Example Code Pattern (feature-gated):
#[cfg(feature = "otlp")]
fn try_init_otlp(service_name: &str, endpoint: &str) -> Result<(), Box<dyn Error>> {
// Implementation
}
pub fn init_tracing(service_name: &str) {
#[cfg(feature = "otlp")]
{
if let Ok(endpoint) = std::env::var("OTLP_ENDPOINT") {
match try_init_otlp(service_name, &endpoint) {
Ok(()) => return,
Err(e) => eprintln!("OTLP init failed: {e}, falling back"),
}
}
}
// Default console tracing
tracing_subscriber::fmt().init();
}Gate: Code compiles, passes local smoke tests
All gates must pass before release.
cargo fmt --all -- --checkFix: cargo fmt --all
cargo clippy --all-targets --all-features -- -D warningsFix: Address clippy warnings (prefer fixing over #[allow(...)])
cargo test --workspaceFix: Debug failing tests, add missing test cases
cargo run -p xtask -- selftestIncludes:
- Format, clippy, tests (as above)
- BDD scenarios (
cargo run -p xtask -- bdd) - AC mapping (
cargo run -p xtask -- ac-status) - Policy tests (
cargo run -p xtask -- policy-test, ifconftestavailable) - Bundler smoke test
Fix: Address any failures systematically
# Default build (no features)
cargo build -p <crate>
# With optional features
cargo build -p <crate> --features <feature-name>
# All features
cargo build --all-featuresExample (from v2.3.0):
cargo build -p rust-as-spec-telemetry # Console-only
cargo build -p rust-as-spec-telemetry --features otlp # With OTLPGate: All validation passes cleanly
Deliverables: Updated docs, CHANGELOG entry
Steps:
-
Create How-To Guides (if new features)
docs/how-to/test-<feature>.md- Include copy-paste commands
- Add troubleshooting section
-
Update Crate READMEs (if applicable)
crates/<crate>/README.md- Explain new APIs, feature flags, environment variables
-
Update CHANGELOG.md
- Create new
## [X.Y.Z] - YYYY-MM-DDsection - Structure:
- Added: New features, APIs
- Changed: Breaking changes (avoid if possible)
- Fixed: Bug fixes
- Technical Details: File changes, dependencies
- Design Decisions: Rationale for choices
- Validation: What tests passed
- Create new
CHANGELOG Template:
## [X.Y.Z] - YYYY-MM-DD
### Added
**Feature Name**
- Description of what was added
- Key capabilities
- Environment variables / feature flags
**Documentation**
- `docs/how-to/...` - Brief description
- `crates/<crate>/README.md` - Brief description
### Technical Details
**Files Modified:**
- `path/to/file.rs` - What changed
**New Files:**
- `path/to/new-file.md` - Purpose
**Validation:**
- ✅ `cargo build ...` - Status
- ✅ `cargo clippy ...` - Status
- ✅ `cargo test ...` - Status
**Dependencies:**
- Library X.Y.Z - Why chosen
### Design Decisions
**Decision Name:**
- Chose: X
- Rationale: Why
- Rejected: Y (reason)
### Notes
- Important user-facing information
- How to enable new features
- Migration guidance (if applicable)Gate: Docs are complete and accurate
Deliverable: Git tag vX.Y.Z, pushed to origin
Steps:
-
Final Git Status Check
git status # Should be clean or only show intended changes -
Stage All Changes
git add <files> git status # Verify staged files
-
Create Commit
git commit -m "$(cat <<'EOF' feat(<scope>): <brief summary> <Detailed description> Key changes: - Change 1 - Change 2 Validation: - cargo clippy (clean) - cargo test (passing) - selftest (green) EOF )"
-
Create Annotated Tag
git tag -a vX.Y.Z -m "$(cat <<'EOF' Project Name vX.Y.Z: <Release Theme> <Brief summary of what shipped> See CHANGELOG.md for full details. EOF )"
-
Verify Tag
git tag -l | tail -5 # Should show new tag git show vX.Y.Z # Should show tag message + commit
-
Push to Origin
git push origin main --tags
Example (from v2.3.0):
git commit -m "feat(telemetry): add OTLP tracing support via feature flag
Implements OpenTelemetry 0.31.x OTLP export with graceful fallback.
Key changes:
- Added telemetry/otlp feature flag
- Implemented try_init_otlp() with gRPC transport
- Created docs/how-to/test-otlp-tracing.md
- Updated CHANGELOG.md with v2.3.0 entry
Validation:
- cargo clippy --all-features (clean)
- cargo test --workspace (passing)
- selftest (core checks green)"
git tag -a v2.3.0 -m "Rust IaC Template v2.3.0: OTLP Tracing
OTLP tracing support via feature flag with comprehensive testing guide.
See CHANGELOG.md for full details."
git push origin main --tagsGate: Tag exists on remote, CI passes (if applicable)
Steps:
-
Verify Release Artifacts
- GitHub tag visible:
https://github.com/<org>/<repo>/releases/tag/vX.Y.Z - CHANGELOG updated on main branch
- Documentation updated
- GitHub tag visible:
-
Update Project Board (if using)
- Close
vX.Y.Zmilestone - Move any deferred tasks to next milestone
- Close
-
Create Next Version Plan (only if needed)
- Don't rush into vX.Y+1.0
- Wait for real usage feedback
- Consider pilot projects first
-
Document Lessons Learned
- What went well?
- What was painful?
- Update this playbook if process improved
Example Post-Release Actions:
## v2.3.0 Retrospective
**What Worked:**
- Research phase (context7 MCP) found exact API patterns quickly
- Feature flag kept default builds clean
- Graceful fallback prevented production risk
**What Could Improve:**
- Initial clippy warnings (let-chain) - should have run clippy earlier
- Lifetime issues with .to_string() - better awareness of 'static requirements
**Next Steps:**
- Run greenfield pilot before planning v2.4.0
- Maintain friction log to inform future improvementsQuick sanity checks before any kernel release:
-
cargo xtask selftestpasses -
cargo xtask docs-checkpasses -
cargo xtask contracts-checkpasses (docs match selftest steps + AC counts) -
cargo xtask ui-contract-checkpasses (UI HTML matches specs/ui_contract.yaml) -
cargo xtask idp-checkpasses (OpenAPI + TS consumer + config)
- Plan document created (
docs/vX.Y.Z-plan.md) - Scope clearly defined (theme + epics + guardrails)
- TODO list or tracker created
- Code implementation complete
-
cargo fmt --all -- --checkpasses -
cargo clippy --all-targets --all-features -- -D warningspasses -
cargo test --workspacepasses -
cargo run -p xtask -- selftestpasses -
cargo run -p xtask -- docs-checkpasses -
cargo run -p xtask -- contracts-checkpasses (docs match selftest + ledger) -
cargo run -p xtask -- idp-checkpasses (OpenAPI + TS consumer + config) - Feature flag matrix tested (if applicable)
- How-to guides created (if new features)
- Crate READMEs updated (if applicable)
- CHANGELOG.md updated with vX.Y.Z entry
- Git status clean (only intended changes)
- Commit message follows format
- Tag created with annotated message
- Tag pushed to origin
- CI passes (if applicable)
- GitHub release visible
- CHANGELOG visible on main branch
- Milestone closed (if using)
- Retrospective notes captured
- Friction log template ready for pilots
This playbook enforces:
- Traceability: Every release links to specs (AC IDs), code (commits), tests (BDD), and docs (CHANGELOG)
- Quality: Multiple validation gates prevent regressions
- Transparency: Decision log captures rationale for future reference
- Stability: Guardrails prevent scope creep and breaking changes
Spec Integration:
- Plan documents reference AC IDs from
specs/spec_ledger.yaml - BDD scenarios map to AC IDs
xtask ac-statusshows coverage before release
Policy Integration:
xtask policy-testruns OPA/Rego checks- Prevents releasing code that violates policies (K8s, privacy, etc.)
This playbook is designed for the Rust IaC Template but adapts to:
- Simplify: Skip plan docs for trivial releases
- Keep: Validation gates (fmt, clippy, test, CHANGELOG)
- Keep: Git tagging for traceability
- Add: PR reviews before merge
- Add: Release manager role
- Add: Staging environment validation
- Keep: All validation gates
- Replace:
cargocommands with language-specific tooling (e.g.,pytest,npm test) - Keep: Phase structure (Plan → Code → Validate → Document → Tag)
- Keep: CHANGELOG discipline
- Template Releases: CHANGELOG.md
- Selftest Documentation: reference/xtask-commands.md
- AC Ledger: specs/spec_ledger.yaml
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2025-11-17 | Initial playbook extraction |
End of Release Playbook