Files
Garry Tan e4041f7a7f v1.11.0.0 feat(ship): workspace-aware version allocation (#1168)
* feat: bin/gstack-next-version util + workspace_root config key

Host-aware (GitHub + GitLab + unknown) VERSION allocator. Queries the open
PR queue, fetches each PR's VERSION at head, scans configurable Conductor
sibling worktrees for WIP work, and picks the next free slot at the
requested bump level.

Pure reader, never writes files. /ship consumes the JSON and decides.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: fixture tests for gstack-next-version

21 pure-function tests covering parseVersion / bumpVersion / cmpVersion /
pickNextSlot (with 8 collision scenarios) / markActiveSiblings (4 cases)
plus one CLI smoke test against the live repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(scripts): detect-bump + compare-pr-version helpers

Shared between /ship (legacy path) and the CI version-gate job.
detect-bump: derive bump level from VERSION diff. compare-pr-version:
CI gate logic with three exit paths (pass / block / fail-open).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(ci): version-gate + pr-title-sync workflows (GitHub + GitLab)

Merge-time collision gate. Fail-open on util errors (network, auth, bug),
fail-closed on confirmed collisions. pr-title-sync rewrites the PR title
when VERSION changes on push, only for titles that already carry the
v<X.Y.Z.W> prefix (custom titles left alone).

GitLab CI mirrors both jobs for host parity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(skills): queue-aware /ship + drift abort in /land-and-deploy + advisory in /review

ship Step 12: queue-aware version pick (FRESH path) + drift detection
(ALREADY_BUMPED path). Prompts user to rebump when queue moved, runs
the full ship metadata path (VERSION, package.json, CHANGELOG header,
PR title) on the rebump so nothing goes stale.

ship Step 19: PR title format v<X.Y.Z.W> <type>: <summary> — version
ALWAYS first. Rerun path updates title (not just body) when VERSION
changed.

land-and-deploy Step 3.4: detect drift, ABORT with instruction to
rerun /ship. Never auto-mutates from land.

review Step 3.4: advisory one-line queue status. Non-blocking.

Goldens refreshed for all three hosts (claude/codex/factory).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(skill): /landing-report read-only queue dashboard

Standalone skill that renders the current PR queue, sibling worktrees,
and what all four bump levels would claim. Pure reader. Useful when
running many parallel Conductor workspaces to see what's in flight
before shipping anything.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: versioning invariant in CLAUDE.md

Document that VERSION is a monotonic sequence, not a strict semver
commitment. Bump level expresses intent; queue-advance within a level
is permitted. Prevents future re-litigation of the workspace-aware
ship design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: bump version and changelog (v1.8.0.0)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(ship): exclude current PR from queue-awareness (self-reference bug)

Version gate flagged PR #1168 as stale because the util counted the PR
itself as a queued claim. The exclude filter removes that self-reference.

New --exclude-pr <N> flag on bin/gstack-next-version. CI workflows pass
github.event.pull_request.number / CI_MERGE_REQUEST_IID. Local /ship
auto-detects via gh pr view when the flag isn't passed, with a warning
recording the auto-exclusion so it's observable.

Caught during the first live ship through the v1.8.0.0 gate — the kind
of dogfood the whole release is designed for.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Merge remote-tracking branch 'origin/main' into garrytan/workspace-aware-ship

Rebumped v1.8.0.0 -> v1.11.0.0 (minor-past main's v1.10.1.0) using
bin/gstack-next-version — the same queue-aware path this branch introduces.
CHANGELOG repositioned so v1.11.0.0 sits above main's new entries
(v1.10.1.0 / v1.10.0.0 / v1.9.0.0).

Conflicts resolved:
- VERSION, package.json: rebumped to v1.11.0.0 (util-picked)
- bin/gstack-config: merged both lists (workspace_root + gbrain keys)
- CHANGELOG.md: hoisted v1.11.0.0 entry above main's new entries

Pre-existing failures in main (4) documented but not fixed in this PR:
1. gstack-brain-sync secret scan > blocks bearer-json (brain-sync tests)
2. no files larger than 2MB (security-bench fixture, already TODO'd)
3. selectTests > skill-specific change (touchfiles scoping)
4. Opus 4.7 overlay pacing directive (expectation stale after v1.10.1.0
   removed the Fan out nudge)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci: re-trigger PR workflows after merge

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:03:27 -07:00

164 lines
6.6 KiB
Cheetah

---
name: landing-report
version: 0.1.0
description: |
Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots
are currently claimed by open PRs, which sibling Conductor workspaces have
WIP work likely to ship soon, and what slot /ship would pick next. No
mutations — just a snapshot. Use when asked to "landing report", "what's in
the queue", "show me open PRs", or "which version do I claim next". (gstack)
triggers:
- landing report
- version queue
- ship queue
- what version comes next
- show open PR versions
allowed-tools:
- Bash
- Read
sensitive: false
---
# /landing-report — Version Queue Dashboard
{{PREAMBLE}}
---
## Why this skill exists
When you're running 5-10 parallel Conductor workspaces, it helps to see — at a
glance — which version numbers are claimed, by whom, and what slot your next
`/ship` would land in. This skill is a read-only call into the same
`bin/gstack-next-version` utility `/ship` uses, but with nothing mutating.
Think of it as `gh pr list` for VERSION numbers.
---
## Step 1: Detect platform and base branch
Same detection as other gstack skills.
```bash
BASE_BRANCH=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || \
gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || \
echo main)
echo "Base branch: $BASE_BRANCH"
```
---
## Step 2: Read current state
```bash
CURRENT_VERSION=$(cat VERSION 2>/dev/null | tr -d '[:space:]' || echo "0.0.0.0")
git fetch origin "$BASE_BRANCH" --quiet 2>/dev/null || true
BASE_VERSION=$(git show "origin/$BASE_BRANCH:VERSION" 2>/dev/null | tr -d '[:space:]' || echo "$CURRENT_VERSION")
echo "origin/$BASE_BRANCH VERSION: $BASE_VERSION"
echo "branch HEAD VERSION: $CURRENT_VERSION"
```
---
## Step 3: Query the queue
Call the util three times — once for each bump level — so the user sees what
they'd claim for micro/patch/minor/major. Cheap (same gh call cached by bun).
```bash
for LEVEL in micro patch minor major; do
bun run bin/gstack-next-version \
--base "$BASE_BRANCH" \
--bump "$LEVEL" \
--current-version "$BASE_VERSION" \
> "/tmp/landing-$LEVEL.json" 2>/dev/null || echo '{"offline":true}' > "/tmp/landing-$LEVEL.json"
done
```
---
## Step 4: Render the dashboard
Build a single table output. Use the `patch`-level JSON as canonical for
queue + siblings (they're identical across bump levels; only `.version`
differs).
Use `jq` to extract:
- `.host` — github | gitlab | unknown
- `.offline` — did the query fail?
- `.claimed` — array of {pr, branch, version, url}
- `.siblings` — all sibling worktrees found
- `.active_siblings` — subset that's likely about to ship
Render in this exact format:
```
╔══════════════════════════════════════════════════════════════════╗
║ GSTACK LANDING REPORT ║
╠══════════════════════════════════════════════════════════════════╣
║ Repo: <owner/repo> ║
║ Base: <base> @ v<base-version> ║
║ Host: <github|gitlab|unknown> ║
║ Status: <ONLINE|OFFLINE: queue-awareness unavailable> ║
╚══════════════════════════════════════════════════════════════════╝
Open PRs claiming versions on <base>:
#1152 alpha-branch → v1.7.0.0
#1153 beta-branch → v1.7.0.0 ⚠ collision with #1152
#1151 gamma-branch → v1.6.5.0
Sibling Conductor worktrees (<workspace_root>):
path branch VERSION last commit PR
──────────────────────────────────────────────────────────────────────────────────
../tokyo-v2 feat/dashboard v1.7.1.0 3h ago none ★ active
../melbourne feat/review v1.6.0.0 12d ago none
../osaka feat/payments v1.8.0.0 5h ago #1155
★ active = has VERSION ahead of base AND last commit < 24h AND no open PR.
These are the ones likely to ship soon.
If you ran /ship right now, you'd claim:
micro bump: v1.6.3.1 (queue-advance: none)
patch bump: v1.7.1.0 (bumped past claimed 1.7.0.0)
minor bump: v1.8.0.0 (bumped past claimed 1.7.0.0)
major bump: v2.0.0.0 (no major collisions)
```
For offline / unknown-host output, print a shorter block:
```
╔══════════════════════════════════════════════════════════════════╗
║ GSTACK LANDING REPORT ║
╠══════════════════════════════════════════════════════════════════╣
║ Status: OFFLINE — queue-awareness unavailable ║
║ Reason: <offline reason from warnings> ║
╚══════════════════════════════════════════════════════════════════╝
Fallback: local VERSION bumps still work, but collisions cannot be detected.
```
---
## Step 5: Suggest next action
After rendering the table, suggest ONE of:
1. **If there are collisions in the queue** (two open PRs claim the same version):
"⚠ Two open PRs collide on v<X>. Whoever merges second will either overwrite
the first's CHANGELOG entry or land a duplicate. Consider asking one author
to rerun /ship to pick up the next free slot."
2. **If an active sibling outranks the user's branch version:**
"Sibling worktree <path> has v<X> committed <N>h ago and hasn't PR'd yet.
If that work ships first, your branch will need to rebump at land time."
3. **If everything looks clean:**
"Queue is clean. Next /ship will claim a slot without conflict."
---
## Plan Mode
PLAN MODE EXCEPTION — ALWAYS RUN. This skill is entirely read-only: no file
writes, no git mutations, no network state changes. Safe to run in plan mode.