Repository navigation
Description
Settled in a grill-with-docs session (PR #2155, Q1–Q16; ADR 0003, ADR 0009, ADR 0013, ADR 0026). Subsumes #336 and #653.
Problem Statement
Cutting a release of thirdshift currently requires a maintainer at a Linux terminal to pick a version number by hand and run an interactive shell script:
- A Cron job cannot run releases unattended on a daily or custom schedule because the script requires an explicit version number on the command line, has no Pass mode that skips quietly when nothing shipped has changed since the last release, and loops indefinitely if candidate commits on
mainhave completed with failing push CI. - Releases live outside thirdshift's Command model: they write no Command record, Command log, Session trace or Activity log entry, cannot be given a Stop, do not appear in Working, Done or Needs you in the Inbox, send no Run notification, and are invisible to Cron jobs and the Console API.
- Although the released source comes from a freshly fetched
origin/main, the shell script still invokescargo runagainst the Launch directory's working tree for the summary session, release Experiment and targeted Fix run (ensure release.sh works with the latest on default branch (ensure no need to git pull locally before it runs) #336), and its summary invocation is not isolated inside the fresh-home sandbox (agy release summaries can still read local files #653). - Unattended Review run and Fix run Passes do not skip open release bump pull requests, risking unwanted review commits on a version-only bump branch or an early Self-merge before the release tag is published.
- Tag publication on GitHub currently lacks a workflow check that the tagged tree is an exact version bump off
origin/mainpushed by the repository owner, and factory Sessions on the host are not explicitly fenced from invoking a release command or pushing tags without detection. - When the summary agent is unavailable, the fallback places GitHub's generated notes inside the bump pull request's summary markers, causing the release-notes job to append generated notes a second time on the GitHub Release page.
Solution
Introduce thirdshift release as a native Release run Command scoped to JacobStephens2/thirdshift, retiring the shell release script, its Python experiment helper, and the hidden release-summary CLI shim while keeping the release-notes helper invoked by GitHub Actions.
Started with no explicit version (thirdshift release, optionally with --patch, --minor or --major), a Release run is a Pass that honors the live Experiment and Quota wait gates, coordinates via a dedicated machine lock and an atomic origin reservation outside the repository's Command limit, auto-resumes recoverable unfinished releases, skips human-blocked unfinished releases, and skips quietly when no shipped-artifact or release-pipeline paths changed since the last release tag or when all candidate main commits have completed with failing push CI. When neither a version nor a bump flag is supplied, a single sandboxed, traced Session reads the merged pull requests since the last release tag, chooses minor or patch (never major), and writes the release summary, falling back to patch and non-duplicated generated notes if the Harness is unavailable. Started with an explicit version (thirdshift release <version>), it acts as a direct Command that cuts or resumes that version on demand.
Unattended Review run and Fix run Passes skip release bump pull requests, factory Sessions are refused if they invoke thirdshift release (with tag pushes and thirdshift release flagged in destructive-command signals), POST /api/v1/start exposes release behind admin scope (leaving release --review terminal-only), the release workflow verifies owner identity and an exact origin/main bump tree before publishing, and an interactive Day shift wizard script provisions the repository's Admin-only v* tag ruleset on GitHub.
User Stories
- As a maintainer, I want to schedule
thirdshift releasein a Cron job with no version argument, so that new versions of thirdshift are released automatically on a daily or custom schedule. - As a maintainer, I want an unscoped Release run Pass to skip quietly with exit code
0and no Run notification when only documentation, website, agent-skill or test files changed since the last release tag, so that scheduled runs never publish identical binaries. - As a maintainer, I want a skipped Release run Pass to write to the Activity log only when its skip reason changes and to update Pass last-fired tracking on Cron jobs, so that an idle schedule stays quiet while proving the timer is firing.
- As a maintainer, I want
thirdshift releasewith no version or bump flag to have the configured Harness chooseminororpatchand write the release summary in a single Session, so that scheduled releases get appropriate semantic versions and curated notes in one model call. - As a maintainer, I want automatic Harness bump selection capped to
minororpatch, so that an unattended cron run can never publish1.0.0or another major version without an explicit human request. - As a maintainer, I want
thirdshift releaseto fall back to apatchbump and GitHub's generated release notes when the summary Harness fails or returns malformed output, without duplicating## What's Changedon the GitHub Release page, so that a model outage neither blocks a release nor mangles its notes. - As a maintainer, I want to pass
--patch,--minoror--majortothirdshift releasewithout a version number, so that a manual or scheduled Pass can pin the bump level while still skipping when nothing shipped changed. - As a maintainer, I want to pass an explicit
<version>(thirdshift release <version>) higher than the version onmain, so that I can cut or resume a specific version on demand even when no shipped paths changed. - As a maintainer, I want
<version>and--major/--minor/--patchvalidated as mutually exclusive, and non-X.Y.Zor non-increasing versions refused before pushing anything, so that invalid invocations fail immediately and cleanly. - As a maintainer, I want
thirdshift releaseto accept standard Command flags (--harness,--model,--effort,--email,--email-unless-merged,--no-email), so that summary model selection and Run notifications work consistently with the rest of thirdshift. - As a maintainer, I want
--reviewto print the summary and let me accept, edit in$EDITOR, or cancel on a terminal, while refusing immediately when standard input is not a terminal, so that interactive review stays available by hand and fails fast if misconfigured in cron. - As a maintainer, I want
--with-experiment(off by default) to run or resume the release Experiment against the last release tag before bumping, promptingrelease anyway? [y/N]onfailorinconclusiveonly on an interactive terminal and failing cleanly when unattended, so that optional release gating never hangs waiting on cron stdin. - As a maintainer, I want
thirdshift releaseto execute entirely from the runningthirdshiftbinary against a freshly fetchedorigin/mainin temporary detached worktrees without compiling or reading the Launch directory's working tree, so that scheduled hosts never needgit pullor a clean checkout (ensure release.sh works with the latest on default branch (ensure no need to git pull locally before it runs) #336). - As a maintainer, I want the release summary and bump-selection Session to run inside the fresh-home sandbox with no host filesystem read access and its Session trace recorded under the Release run, so that untrusted pull-request text cannot leak local secrets (agy release summaries can still read local files #653) and token usage, models and spans are recorded.
- As a maintainer, I want
thirdshift releaseto refuse Launch directories whoseoriginis notJacobStephens2/thirdshift, so that running it in another repository fails safely before touching Git or GitHub. - As a maintainer, I want Release run Passes to skip during a live Experiment on the machine or a Quota wait, so that releases respect machine-wide evaluation isolation and GitHub rate-limit reserves.
- As a maintainer, I want Release runs to coordinate via a dedicated local machine lock and an atomic
originrelease reservation (plusin-progresson an open bump pull request) outside the repository's Command limit, so that two Release runs never collide on one machine or across machines while active Spec runs or Ticket runs cannot starve a daily release. - As a maintainer, I want unattended Review run (
--author) and Fix run Passes to skiprelease-*pull requests targetingmain, so that background Passes never push review commits onto a version-only bump branch or Self-merge a bump pull request before its tag is published. - As a maintainer, I want an unscoped Release run Pass to auto-resume and recover unfinished
release-<X.Y.Z>states that are machine-recoverable (a pushed branch without a PR, an open non-draft exact-bump PR waiting on CI, or an unpublished failed release workflow run) while skipping when an unfinished release is blocked on a human (such as a draft bump PR after a failed automatic Fix run or foreign commits on the branch), so that transient interruptions self-heal and genuine blockers do not spam Needs you on every cron tick. - As a maintainer, I want
thirdshift releaseto select the newestmaincommit descending from the last release tag that has shipped changes and green push CI, wait when candidatemaincommits still have push CI queued or running, and skip (in Pass mode) or fail (in direct mode) when all candidate commits with shipped changes have completed non-green push CI, so that scheduled releases neither miss an in-flight merge nor hang forever on a brokenmain. - As a maintainer, I want
thirdshift releasewaiting on bump PR checks to run at most one targeted Fix run (--no-merge --no-base-fix) on a merge conflict or completed failing CI, re-validate the exact version-bump tree afterward, refresh any requested Experiment and summary if the content base moved, and stop before tagging if the PR becomes a draft or remains blocked, so that normalmaindrift during CI recovers automatically without ever tagging unreviewed code. - As a maintainer, I want a live Release run to appear in Working in the Inbox (writing periodic progress lines during CI and workflow waits so Silent detection stays accurate) and respond to
thirdshift stop, so that I can monitor and stop a release from the CLI or Console. - As a maintainer, I want a Release run that publishes the release and merges the bump PR to land in Done (quiet under
email-unless-merged), while a Release run that fails—or publishes the release but fails to merge the bump PR—lands in Needs you and sends its Run notification even underemail-unless-merged, settling once the bump PR is merged or closed, a later Release run starts or succeeds, or it receives a Dismissal. - As a maintainer, I want
thirdshift releaseto stop once the release is published and the bump PR is merged without runningthirdshift update, so that releasing and host binary upgrades remain independent schedules. - As a maintainer, I want
POST /api/v1/startand the Console Start controls to exposereleasebehindadminscope (refusingrun-only tokens and narrowed viewers, and keepingrelease --reviewCLI-only), so that only administrators can trigger a release remotely. - As a maintainer, I want
thirdshift releaseto refuse execution when called from inside a factory Session (THIRDSHIFT_SESSIONorTHIRDSHIFT_PARENT_RECORDpresent) and destructive-command signals to flagthirdshift releaseandgit pushtag operations, so that unattended Ticket or Spec agents on the thirdshift host cannot cut releases. - As a maintainer, I want the GitHub release workflow to verify on tag pushes before publishing that
github.actorisJacobStephens2and that the tagged commit's tree equals an ancestor commit onorigin/mainplus only theCargo.tomlandCargo.lockversion bump for that tag, so that unmerged code or non-owner tag pushes can never publish binaries to GitHub Releases or crates.io. - As a maintainer, I want an interactive wizard script in the repository to configure the Admin-only
refs/tags/v*tag ruleset onJacobStephens2/thirdshift(allowing tag creation and updates only by Repository Admin and blocking tag deletion), so that write collaborators cannot push release tags while unattended cron and unpublished-tag recovery under the owner account continue to work. - As a maintainer, I want the user manual, generated prompts page, and hand-written site pages updated from the retired shell script to
thirdshift release, so that all documentation reflects the new command and workflow.
Implementation Decisions
- Command and Pass identity. Release run becomes a first-class Command kind across CLI parsing, Command record stages, Command log allocation, Activity log recording (including deduplicated skip reasons for the Release Pass kind), Pass last-fired timestamps, Cron jobs command recognition, Stop handling, Run metrics, Inbox evaluation, and Run notifications. Any invocation without a positional
<version>(thirdshift release,--patch,--minor,--major) is a Pass;thirdshift release <version>is a direct Command. - Repository and session fences. Before doing Git or GitHub work,
thirdshift releaseverifies it is running on Linux, refuses immediately ifTHIRDSHIFT_SESSIONorTHIRDSHIFT_PARENT_RECORDis set in the environment, and verifies the Launch directory'soriginremote resolves toJacobStephens2/thirdshift. Destructive-command pattern detection adds patterns forthirdshift releaseinvocations andgit pushcommands that push tags (--tagsorrefs/tags/). - Admission, locks, and cross-Pass isolation. In Pass mode, admission checks the live Experiment gate and Quota wait gate before taking locks. Every Release run acquires a machine-local lock file under
~/.thirdshiftand an atomicoriginreservation ref dedicated to releases (distinct from the repository's Command limit slots), plusin-progresson the bump pull request while live: if the local lock ororiginreservation is already held, a Pass skips quietly and a direct Command fails naming the active lock/reservation. Unattended Review run (--author) and Fix run Passes exclude pull requests targetingmainwhose head branch matchesrelease-*; targetedthirdshift fix <pr-url> --no-merge --no-base-fixcontinues to work. - Unfinished release discovery and recovery. After locking,
thirdshift releaseinspectsoriginfor an unfinishedrelease-<X.Y.Z>branch, openRelease <X.Y.Z>pull request, or unpublishedv<X.Y.Z>tag newer than the latest published GitHub Release:- In direct
<version>mode, it validates and resumes/recovers that exact<version>(refusing if another unfinished version is live or if<version>is closed/invalid/human-blocked, with explicit recovery instructions). - In Pass mode, if an unfinished release is in a machine-recoverable state (pushed exact-bump branch without a PR, open non-draft exact-bump PR waiting on CI, or completed failed
release.ymlworkflow with no published GitHub Release), it adopts that release (re-cutting with any higher requested bump flag when re-cutting from newermain) and completes or recovers it; if the unfinished release is human-blocked (such as a draft bump PR left by a failed targeted Fix run, non-bump commits onrelease-<X.Y.Z>, or an unverifiable publication state), the Pass skips naming that blocked release so cron does not repeatedly fail into Needs you.
- In direct
- Candidate
mainselection and shipped-path filter. For a fresh cut,thirdshift releasefetchesorigin/mainand tags, determines the last publishedv*release boundary onmain, and scans first-parentorigin/maincommits descending from that tag:- In Pass mode, a candidate commit is eligible only if its diff from the last release tag touches at least one shipped-artifact or release-pipeline path:
src/,skills/,processes/,Cargo.toml,Cargo.lock,dist-workspace.toml,rust-toolchain.toml,README.md,LICENSE,.github/workflows/release*,.github/workflows/publish-crates.yml, orscripts/release*. Iforigin/mainhas no commit touching those paths since the last tag, the Pass skips quietly. - Among eligible commits (all commits newer than the last tag in direct
<version>mode, or shipped-change commits in Pass mode), it immediately selects the newest commit whose latest pushci.ymlworkflow run completed withsuccess. If none has succeeded yet, it polls (writing periodic progress lines) as long as at least one eligible commit has a queued or running pushci.ymlrun. If every eligible commit's latest pushci.ymlrun has completed non-green with nothing pending, Pass mode skips naming the failingmainCI and direct mode fails immediately. - A local unversioned candidate ref pins the selected content commit while an Experiment runs so an interrupted run resumes against the same content commit unless a newer release tag on
maininvalidates its ancestry.
- In Pass mode, a candidate commit is eligible only if its diff from the last release tag touches at least one shipped-artifact or release-pipeline path:
- In-process Experiment, sandboxed bump+summary Session, and fallback notes.
- All sub-steps execute directly from the running
thirdshiftbinary against temporary detached worktrees of fetched commits—never viacargo runon the Launch directory's checkout. - With
--with-experiment, the release Experiment runs (or resumes) comparing the selected content commit against the prior release tag on touched Eval suites; pending rechecks or leak decisions are polled with periodic progress lines;failorinconclusivepromptsrelease anyway? [y/N]when stdin is a terminal and fails immediately when unattended. --reviewis validated up front before expensive work and refused if stdin is not a terminal.- The release prompt moves into the compiled prompt catalog (and generated prompts page). It runs as a tool-less recorded Session inside the fresh-home
bwrapsandbox (binding only Harness binary/credentials and an empty temporary directory, routed through the provider-allowlisting proxy). When no<version>or bump flag was given, the prompt supplies the merged pull requests since the last release tag and the two candidate versions (X.(Y+1).0forminor,X.Y.(Z+1)forpatch), instructing the Harness to emitminororpatch(pickingminorfor new CLI commands/flags, Console pages/actions, config keys or user-visible contract changes, andpatchfor bug fixes, edge-case hardening or internal refinements) together with the Markdown summary referencing those PRs; when<version>or--major/--minor/--patchwas supplied, the version is fixed and the Session writes only the summary. - If the summary Session fails or returns empty/unparseable output, automatic bump selection defaults to
patch, a warning is logged, and the bump PR body displays GitHub'sgenerate-notesoutput outside<!-- release-summary:start --> ... <!-- release-summary:end -->(leaving the markers empty or absent) so the post-release notes job never duplicates## What's Changedon the GitHub Release page.
- All sub-steps execute directly from the running
- Bump PR, targeted Fix recovery, tag push, publication wait, and merge.
- The bump commit rewrites only
Cargo.tomlandCargo.lockon top of the selected content commit, opens or updatesRelease <version>fromrelease-<version>intomain(carrying the<!-- release-content-base: <sha> -->marker), and waits for PR workflow runs and mergeability (300-second startup/settling grace, unbounded wait on queued/running checks, periodic progress lines). - On a Merge conflict or completed failing PR workflow, at most one targeted in-process Fix run (
--no-merge --no-base-fix) is attempted; any adopted head must still have a Git tree identical to itsorigin/mainmerge-base plus the exactCargo.toml/Cargo.lockbump, refreshing the requested Experiment and summary if the merge-base changed. Draft PRs or further failures stop before tagging and leave the PR open for human review. - Once checks pass and the PR is mergeable,
v<version>is pushed on the validated bump head,release.ymlis polled to completion, andRelease <version>is merged intomainwith a merge commit matching the validated head commit. Published releases are never moved; an inconclusive GitHub Release lookup refuses rather than risking moving a published tag.
- The bump commit rewrites only
- Inbox, Run notifications, and Console API.
- Live Release runs appear in Working. A run that both publishes the GitHub Release and merges the bump PR ends succeeded in Done (linking the published Release; treated as cleanly merged under
email-unless-merged, so saved without emailing). A run that fails before publication—or publishes the Release but fails to merge the bump PR—lands in Needs you and emails underemail-unless-merged, settling when the bump PR merges/closes, a later Release run starts or succeeds, or the row is dismissed. POST /api/v1/startand Console Start controls addrelease(supporting optionalversion, bump modemajor/minor/patch, andwith_experiment, plus standard Harness and email fields) gated byadminscope rather thanrunscope.release --reviewis registered as a reasoned CLI-only exclusion in parity checks and ADR 0026;--release-summaryand the retired shell/Python release scripts are removed (keepingscripts/release-notes.shfor.github/workflows/release-notes.yml).
- Live Release runs appear in Working. A run that both publishes the GitHub Release and merges the bump PR ends succeeded in Done (linking the published Release; treated as cleanly merged under
- Workflow publication guard, tag-ruleset wizard, and docs.
- The release workflow generator adds
processes/**toRELEASE_PATHSand injects a tag-push guard ahead of artifact publication (hostandpublish-crates) verifyinggithub.actor == 'JacobStephens2'and verifying that the tagged commit's Git tree equals a commit reachable onorigin/mainwith onlyCargo.tomlandCargo.lockset to the tag's version;.github/workflows/release.ymlis regenerated. - An interactive bash wizard script walks a maintainer through creating/verifying the
refs/tags/v*GitHub repository ruleset onJacobStephens2/thirdshift(restricting tag creation and updates to Repository Admin and blocking tag deletion). - Generated prompts, the user manual (
#releasing), and the hand-written site pages (index.html,how-it-works,architecture) are updated to describethirdshift releasein place ofscripts/release.sh.
- The release workflow generator adds
Testing Decisions
- Good tests exercise observable behavior through the binary, HTTP API, crontab inventory, and workflow generator rather than internal helper functions.
- Primary seam —
thirdshift releaseblack-box CLI integration suite: port and extend the existing release integration suite to invoke the compiledthirdshiftbinary against an isolated bareoriginrepository with fakeghand fake Harness executables (replacing sourced shell-function calls):- Pass skips (deduplicated Activity log lines, exit
0, no Run notification) when nothing changed, when only non-shipped paths (docs/,site/,tests/) changed, during a live Experiment or Quota wait, whenrelease.lockororiginrelease reservation is held, when all shipped-changemaincommits finished CI red, and when an unfinishedrelease-<X.Y.Z>PR is human-blocked (draft or foreign commits). - Candidate
mainselection: immediate cut from newest green shipped-change commit, polling while push CI is pending, and refusal/skip when red. - Single-session
bwrap-sandboxedminorvspatchselection (including refusingmajorfrom model output, recording a Session trace, verifying host files outside the sandbox cannot be read, and falling back topatch+ non-duplicated generated notes when the Harness fails). - Explicit
<version>and--major/--minor/--patchflags, mutual-exclusion errors,--reviewnon-TTY refusal and TTY$EDITORflow,--with-experimentTTY override vs unattended failure, targeted Fix run recovery, unpublished failed-workflow recovery,THIRDSHIFT_SESSIONrefusal, Stop cleanup, and Inbox (Working,Done,Needs yousettlement,email-unless-mergednotification behavior, unmerged-after-publish warning landing in Needs you).
- Pass skips (deduplicated Activity log lines, exit
- Console, Cron jobs, Pass eligibility, and destructive signals (existing integration suites):
- API parity, OpenAPI, Start controls, and scope tests verifying
releaserequiresadminscope (403forrun-only tokens/viewers),release --reviewis CLI-only, and--release-summaryis gone. - Cron jobs tests verifying
thirdshift releaserecognition and Pass last-fired age display. - Unattended Review run and Fix run Pass tests verifying
release-*pull requests targetingmainare skipped while explicitthirdshift fix <pr-url> --no-mergeremains allowed. - Destructive-command fixture cases covering
thirdshift releaseandgit pushtag forms.
- API parity, OpenAPI, Start controls, and scope tests verifying
- Workflow generator, prompt catalog, and site suites:
- Generator unit tests verifying
processes/**inRELEASE_PATHSand thegithub.actor+ exactorigin/mainbump-tree guard in generatedrelease.yml, plus--checkpassing against.github/workflows/release.yml. - Prompt-page check and site test suite passing after regenerating prompts and manual pages.
- Generator unit tests verifying
Out of Scope
- Generalizing
thirdshift releaseto repositories other thanJacobStephens2/thirdshift(Q2). - Running
thirdshift updatelocally or across the Fleet insidethirdshift release(Q6). - Allowing the Harness to choose a
majorversion bump without an explicit--majorflag or<version>argument (Q7). - Automatically mutating live GitHub repository rulesets during an unattended factory run (handled by the interactive Day shift wizard script instead, Q14).
Further Notes
- Domain docs and grill transcript landed in PR Record the #2054 Release run grill and update domain docs #2155 (
GLOSSARY.md,ADR 0026,docs/grill-with-docs/2054-release-command.md). - Closing this Spec also resolves ensure release.sh works with the latest on default branch (ensure no need to git pull locally before it runs) #336 and agy release summaries can still read local files #653.
Activity
Merge pull request #2155 from JacobStephens2/docs/2054-release-comman…
[-]make `thirdshift release` command to release new versions of thirdshift, so a cronjob can be set to daily release a new version or on whatever schedule desired[/-][+]Spec: `thirdshift release` Command and Pass for scheduled and on-demand releases[/+]thirdshift release <version>: Release run Command, Consoleadminstart, Cron jobs, and happy-path release #2157minor/patchselection #2158--with-experiment, and--review#21592 remaining items
Address Spec #2054 review findings
Point release-* skip notes in the manual at thirdshift release
Address Spec #2054 whole-Spec review findings