Vibescript Showcase
Release readiness
Model a release workflow with typed enums, time-aware scheduling, and structured status reporting.
Source
showcase/workflows/release_readiness.vibe
# title: Release readiness
# category: Vibescript Showcase
# difficulty: Showcase
# summary: Model a release workflow with typed enums, time-aware scheduling, and structured status reporting.
# description: This example shows how Vibescript enums, typed function signatures, template strings, and deterministic time formatting can make workflow code read like product logic instead of puzzle code.
# tags: workflows, enums, types, templates
# featured: true
# feature_rank: 0
# vibe: 0.2
enum ReleaseStatus
Draft
Approved
Scheduled
Live
end
def next_status(status: ReleaseStatus) -> ReleaseStatus
if status == ReleaseStatus::Draft
ReleaseStatus::Approved
elsif status == ReleaseStatus::Approved
ReleaseStatus::Scheduled
elsif status == ReleaseStatus::Scheduled
ReleaseStatus::Live
else
ReleaseStatus::Live
end
end
def launch_label(launch_at: time?) -> string
if launch_at == nil
"unscheduled"
else
launch_at.format("2006-01-02T15:04:05Z")
end
end
def publishable?(status: ReleaseStatus, launch_at: time?) -> bool
status == ReleaseStatus::Scheduled && launch_at != nil
end
def release_report(name: string, status: ReleaseStatus, launch_at: time? = nil) -> hash
{
name: name,
status: status.name,
next_status: next_status(status).name,
publishable: publishable?(status, launch_at),
launch_at: launch_label(launch_at),
banner: "{{name}} is {{status}}".template({ name: name, status: status.name })
}
end
def run
launch_at = 2.hours.after(Time.at(1700000000))
{
draft: release_report("billing-v2", ReleaseStatus::Draft),
scheduled: release_report("billing-v2", ReleaseStatus::Scheduled, launch_at)
}
end
Output
Press run to execute run from this example.