← Back to Skills

Artifact Promotion

Tawa uses artifact promotion to move builds through environments without rebuilding. Build once in sandbox, promote the same image to UAT, then to production.

Commanddeploy

About

Tawa uses artifact promotion to move builds through environments without rebuilding. Build once in sandbox, promote the same image to UAT, then to production.

Skill Content

This is the raw markdown that gets installed as a Claude Code command.

---
name: tawa-artifact-promotion
description: "Promoting a build sandbox -> UAT -> prod with tawa promote, gates (soak, HIL approval, security), tawa approve --commit, PolicyEco versions. Use when promoting, approving a commit for a gated deploy, or reading tawa gates status."
---

# Artifact Promotion

## Overview

Tawa uses artifact promotion to move builds through environments without rebuilding. Build once in sandbox, promote the same image to UAT, then to production.

## Promotion Path

```
sandbox (full build + deploy)
  → UAT (image reuse, Helm upgrade only, ~1 min)
    → prod (image reuse + HIL approval required)
```

## CLI Commands

### Promote to next environment
```bash
tawa promote --to uat          # sandbox → UAT
tawa promote --to prod --yes   # UAT → prod (requires --yes for prod)
tawa promote --to uat --force  # bypass gate checks
```

### Check deployment gates
```bash
tawa gates status              # show gate status for current environment
tawa gates status --env prod   # check prod gates
tawa gates status --json       # machine-readable output
```

### Approve production promotion (HIL gate)
```bash
tawa approve                   # approve pending promotion
tawa approve --build <id>      # approve specific build
```

### Approving a commit for a gated production deploy

Services enrolled in the deploy-approval gate need a sign-off on the **exact commit** before
it can ship. Approving the branch tip **deploys it** (iec-builder#290, `autoDeploy.onApproval`);
see [Ship on Approval and on Merge](auto-deploy.md). Otherwise, approve and then deploy:

```bash
tawa approve --commit 586badb --env prod   # short SHA (7+ hex chars) is fine
tawa deploy --prod                         # only when tawa approve says it did not deploy
```

The builder resolves a short SHA to the full 40-character SHA **at approval time**, through
Forgejo, and stores only the full SHA. `tawa approve` prints the commit it actually approved.
An approval is single-use and expires after 24 hours.

| You passed | Result |
|------------|--------|
| Full 40-char SHA | Stored as given |
| Unique 7–39 char prefix | Resolved to the full SHA and stored |
| Prefix that is unknown **or ambiguous** in the repo | Refused, `422 UNKNOWN_COMMIT` — pass the full SHA |
| Not 7–40 hex chars (`main`, `586bad`) | Refused, `400 INVALID_COMMIT` |

If Forgejo cannot be asked (repo elsewhere, Forgejo down), the builder falls back to this
service's build history: one matching built commit is accepted, more than one is refused with
`422 AMBIGUOUS_COMMIT`.

> **Fixed 2026-10-04 (iec-builder#256).** The approve route used to store the SHA exactly as
> typed, while the gate matches the full SHA exactly. `tawa approve --commit 586badb` reported
> success and the next deploy was still `BLOCKED: no valid, unconsumed approval`. Short-SHA
> approvals made before the fix never match; re-approve, or let them expire.

### View platform versions
```bash
tawa versions                  # list all version snapshots
tawa versions show v1.0.0      # show service matrix for a version
tawa versions diff v1.0.0 v1.1.0  # compare two versions
```

### Check for breaking changes
```bash
tawa upgrade                   # show migration guide for your service
tawa upgrade --json            # machine-readable output
```

## Deployment Gates

Gates are checks that must pass before promotion is allowed. They don't block deployment — only promotion.

| Gate | What it checks | Required? |
|------|---------------|-----------|
| security | Dependency vulnerability scan | Yes |
| integration | Service-to-service connectivity | Yes |
| soak | Minimum time since the source build completed | **Gated services only** (see below) |
| hil | Human-in-the-loop approval for the exact commit | **Gated services only** (see below) |
| compliance | Septor audit trail + Wallet events | Yes |

### Soak tiers (iec-builder#331)

The soak is two builder runtime settings (Console → Operations → **Builder Switches**), read on every
gate check, so a change applies within about 15 seconds:

| Setting | Default | Applies to |
|---------|---------|------------|
| `promotion.soakMinutes.gated` | `120` | Services enrolled in the deploy-approval gate (the money-handling services) |
| `promotion.soakMinutes.ungated` | `0` | Every other service |

"Gated" is the same check the deploy-approval gate uses (`service.deployApprovalRequired`, or
`DEPLOY_APPROVAL_SERVICES`). With 0 minutes the soak gate is reported `required: false`,
`passed: true`, reason `No soak for ungated services`. `tawa gates status` shows the tier and
minutes in the soak gate's `details` (`{ tier, soakMinutes }`).

> **Correction (2026-10-21):** the soak used to be a hard-coded 2 hours, required for every
> service. Derek decided there is no soak on services that do not handle money.

### HIL tiers (iec-builder#332)

Same tier check as the soak: a service enrolled in the deploy-approval gate
(`service.deployApprovalRequired`, or `DEPLOY_APPROVAL_SERVICES`) needs a valid, unexpired
approval (`tawa approve` or the portal approval subtask) for the **exact commit** being promoted.
Any other service does not.

| Setting | Default | Effect |
|---------|---------|--------|
| `promotion.hil.ungatedRequired` | `false` | `true` makes ungated services need an approval too |

For an ungated service the hil gate is reported `required: false`, `passed: true`, reason
`No approval needed for ungated services`, with the tier in `details`. It promotes with no approval
and no `--force`. Gated services are unchanged, and so are the deploy-approval gate and
`tawa approve`.

> **Correction (2026-10-22):** the hil gate used to be required for every service and environment,
> even though this page said "Prod only". Derek decided there is no human-approval gate on
> promotions for services that do not handle money.

### Gate behavior
- Gates are evaluated at promotion time, not at deploy time
- `--force` bypasses all gates (logged to Septor audit trail)
- HIL approvals expire after 24 hours
- All promotions are audited via Septor

## How It Works (Technical)

1. `tawa deploy` builds and deploys to sandbox (full pipeline)
2. `tawa promote --to uat` calls builder API which:
   - Finds the latest completed build in sandbox
   - Verifies all gates pass (or `--force`)
   - Creates a new Build record reusing the same Docker image
   - Deploys to UAT namespace via Helm (no Docker build)
3. `tawa promote --to prod --yes` does the same UAT → prod, plus:
   - Requires a valid HIL approval (from `tawa approve`)
   - Records the promotion in Koko's promotion registry
   - Emits `promotion.completed` Septor audit event

## Septor Audit Events

| Event | When | Data |
|-------|------|------|
| `promotion.completed` | After successful promotion | serviceId, environments, imageTag, force flag |
| `promotion.approved` | After HIL approval | serviceId, buildId, approvedBy, expiresAt |

## PolicyEco Versions

A PolicyEco version is a snapshot of all platform services at specific image SHAs. Use versions to:
- Pin your app to a known-good platform state
- Detect breaking changes before upgrading
- Track what changed between platform releases

```bash
# Target a specific platform version during local dev
tawa dev --platform-version v1.0.0
```

## Best Practices

1. Always deploy to sandbox first — never promote from nothing
2. Let the soak gate do its job on gated services — don't `--force` just to go faster
3. Run `tawa gates status` before promoting to catch issues early
4. Use `tawa upgrade` to check for breaking changes before updating
5. HIL approvals are personal — the approver is recorded in the audit trail

Install

Copy the skill content and save it to:

~/.claude/commands/tawa-artifact-promotion.md
Download .md

Coming soon via CLI:

tawa chaac install tawa-artifact-promotion

Details

Format
Command
Category
deploy
Version
1.0.1321
Tokens
~1,920
Updated
2026-11-25
platformpromotiondeploymentgatesenvironmentsversioning