feat: componentize GStack 2 runtime and release integrity

This commit is contained in:
Sinabina
2026-07-20 14:16:23 -07:00
parent b0ea2296d1
commit f14445bb00
270 changed files with 9681 additions and 51572 deletions
@@ -225,7 +225,7 @@ glab mr view -F json 2>/dev/null | python3 -c "import sys,json; print(json.load(
3. The Documentation section should include:
a. **Doc diff preview** — for each file modified, describe what specifically changed (e.g.,
"README.md: added /document-release to skills table, updated skill count from 9 to 10").
"README.md: added $ship --mode Prepare --module document-release to skills table, updated skill count from 9 to 10").
b. **Documentation debt** — if the coverage map from Step 1.5 found gaps, append a
`### Documentation Debt` subsection listing:
@@ -188,7 +188,7 @@ After producing the completion checklist, evaluate in priority order:
## Step 8.1: Plan Verification
Automatically verify the plan's testing/verification steps using the `/qa-only` skill.
Automatically verify the plan's testing/verification steps using the `$qa --mode Report --module qa-only` skill.
### 1. Check for verification section
@@ -210,17 +210,17 @@ curl -s -o /dev/null -w '%{http_code}' http://localhost:4000 2>/dev/null || echo
**If NO_SERVER:** Skip with "No dev server detected — skipping plan verification. Run /qa separately after deploying."
### 3. Invoke /qa-only inline
### 3. Invoke $qa --mode Report --module qa-only inline
Read the `/qa-only` skill from disk:
Read the `$qa --mode Report --module qa-only` skill from disk:
```bash
cat references/legacy/qa-only.md
```
**If unreadable:** Skip with "Could not load /qa-only — skipping plan verification."
**If unreadable:** Skip with "Could not load $qa --mode Report --module qa-only — skipping plan verification."
Follow the /qa-only workflow with these modifications:
Follow the $qa --mode Report --module qa-only workflow with these modifications:
- **Skip the preamble** (already handled by /ship)
- **Use the plan's verification section as the primary test input** — treat each verification item as a test case
- **Use the detected dev server URL** as the base URL
@@ -1,12 +1,12 @@
## Step 18: Documentation sync (via subagent, before PR creation)
**Dispatch /document-release as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent gets a fresh context window — zero rot from the preceding 17 steps. It also runs the **full** `/document-release` workflow (with CHANGELOG clobber protection, doc exclusions, risky-change gates, named staging, race-safe PR body editing) rather than a weaker reimplementation.
**Dispatch $ship --mode Prepare --module document-release as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent gets a fresh context window — zero rot from the preceding 17 steps. It also runs the **full** `$ship --mode Prepare --module document-release` workflow (with CHANGELOG clobber protection, doc exclusions, risky-change gates, named staging, race-safe PR body editing) rather than a weaker reimplementation.
**Sequencing:** This step runs AFTER Step 17 (Push) and BEFORE Step 19 (Create PR). The PR is created once from final HEAD with the `## Documentation` section baked into the initial body. No create-then-re-edit dance.
**Subagent prompt:**
> You are executing the /document-release workflow after a code push. Read the full skill file `references/legacy/document-release.md` and execute its complete workflow end-to-end, including CHANGELOG clobber protection, doc exclusions, risky-change gates, and named staging. Do NOT attempt to edit the PR body — no PR exists yet. Branch: `<branch>`, base: `<base>`.
> You are executing the $ship --mode Prepare --module document-release workflow after a code push. Read the full skill file `references/legacy/document-release.md` and execute its complete workflow end-to-end, including CHANGELOG clobber protection, doc exclusions, risky-change gates, and named staging. Do NOT attempt to edit the PR body — no PR exists yet. Branch: `<branch>`, base: `<base>`.
>
> After completing the workflow, output a single JSON object on the LAST LINE of your response (no other text after it):
> `{"files_updated":["README.md","CLAUDE.md",...],"commit_sha":"abc1234","pushed":true,"documentation_section":"<markdown block for PR body's ## Documentation section>"}`
@@ -21,7 +21,7 @@
3. If `files_updated` is non-empty, print: `Documentation synced: {files_updated.length} files updated, committed as {commit_sha}`.
4. If `files_updated` is empty, print: `Documentation is current — no updates needed.`
**If the subagent fails or returns invalid JSON:** Print a warning and proceed to Step 19 without a `## Documentation` section. Do not block /ship on subagent failure. The user can run `/document-release` manually after the PR lands.
**If the subagent fails or returns invalid JSON:** Print a warning and proceed to Step 19 without a `## Documentation` section. Do not block /ship on subagent failure. The user can run `$ship --mode Prepare --module document-release` manually after the PR lands.
---
@@ -94,7 +94,7 @@ you missed it.>
<If plan items deferred: list deferred items>
## Linked Spec
<Auto-detect: look for /spec archives matching this branch via:
<Auto-detect: look for $plan --mode Specification --module spec archives matching this branch via:
eval "$($GSTACK_BIN/gstack-paths)"
eval "$($GSTACK_BIN/gstack-slug)"
CURRENT_BRANCH=$(git branch --show-current)
@@ -124,7 +124,7 @@ you missed it.>
Deferred items: <list from Plan Completion>.
Close #<N> manually after follow-up lands.>
<If no /spec archive matches this branch: omit this entire section.>
<If no $plan --mode Specification --module spec archive matches this branch: omit this entire section.>
## Verification Results
<If verification ran: summary from Step 8.1 (N PASS, M FAIL, K SKIPPED)>
@@ -145,7 +145,7 @@ you missed it.>
- [x] All Rails tests pass (N runs, 0 failures)
- [x] All Vitest tests pass (N tests)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
🤖 Generated with [Claude Code](https:/$review --mode Deep --module claude.com/claude-code)
```
#### Redaction scan (PR body + title) — runs before create AND edit
@@ -93,7 +93,7 @@ source <($GSTACK_BIN/gstack-diff-scope <base> 2>/dev/null)
4. **Apply the design checklist** against the changed files. For each item:
- **[HIGH] mechanical CSS fix** (`outline: none`, `!important`, `font-size < 16px`): classify as AUTO-FIX
- **[HIGH/MEDIUM] design judgment needed**: classify as ASK
- **[LOW] intent-based detection**: present as "Possible — verify visually or run /design-review"
- **[LOW] intent-based detection**: present as "Possible — verify visually or run $design --mode Implement --module design-review"
5. **Include findings** in the review output under a "Design Review" header, following the output format in the checklist. Design findings merge with code review findings into the same Fix-First flow.
@@ -213,7 +213,7 @@ Using the coverage percentage from the diagram in substep 4 (the `COVERAGE: X/Y
### Test Plan Artifact
After producing the coverage diagram, write a test plan artifact so `/qa` and `/qa-only` can consume it:
After producing the coverage diagram, write a test plan artifact so `/qa` and `$qa --mode Report --module qa-only` can consume it:
```bash
eval "$($GSTACK_BIN/gstack-slug 2>/dev/null)" && mkdir -p "${GSTACK_HOME:-$HOME/.gstack}"/projects/${PROJECT_ID:-unknown}
@@ -236,7 +236,7 @@ Use AskUserQuestion:
### Step T4: Execute the chosen action
**If "Investigate and fix now":**
- Switch to /investigate mindset: root cause first, then minimal fix.
- Switch to $debug --mode Diagnose-only --module investigate mindset: root cause first, then minimal fix.
- Fix the pre-existing failure.
- Commit the fix separately from the branch's changes: `git commit -m "fix: pre-existing test failure in <test-file>"`
- Continue with the workflow.