Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions bin/ensure_workspace_labels.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/usr/bin/env bash
# ensure_workspace_labels.sh — idempotently assert the canonical `pending-release`
# label on every PyAutoLabs workspace, _test, HowTo, euclid, and library repo.
# label on every PUBLISHED library repo (the only repos whose PRs carry it).
#
# The published set is defined once, as PUBLISHED_REPOS in
# PyAutoMind/scripts/lifecycle.py (it mirrors the PyPI `release` job matrix of
# PyAutoHands/.github/workflows/release.yml); REPOS below must equal it.
# Workspace, _test, HowTo, euclid, CTI and organ repos used to be listed here,
# but nothing ever publishes them, so no release could clear the label there:
# 1500+ merged PRs accumulated it before 2026-10-07. Their existing label
# definitions are harmless and left alone — this script just stops asserting them.
#
# Usage: bash PyAutoBrain/bin/ensure_workspace_labels.sh
#
Expand Down Expand Up @@ -28,24 +36,11 @@ LABEL_NAME="pending-release"
# Owner/name pairs must match PyAutoMind/repos.yaml (the body map);
# `python3 PyAutoMind/scripts/repos_sync.py --check` flags drift.
REPOS=(
PyAutoLabs/autolens_workspace
PyAutoLabs/autogalaxy_workspace
PyAutoLabs/autofit_workspace
PyAutoLabs/HowToLens
PyAutoLabs/HowToGalaxy
PyAutoLabs/HowToFit
PyAutoLabs/autolens_workspace_test
PyAutoLabs/autogalaxy_workspace_test
PyAutoLabs/autofit_workspace_test
PyAutoLabs/euclid_strong_lens_modeling_pipeline
PyAutoLabs/PyAutoNerves
PyAutoLabs/PyAutoFit
PyAutoLabs/PyAutoArray
PyAutoLabs/PyAutoGalaxy
PyAutoLabs/PyAutoLens
PyAutoLabs/PyAutoNerves
PyAutoLabs/PyAutoFit
PyAutoLabs/PyAutoCTI
PyAutoLabs/autocti_workspace
PyAutoLabs/autocti_workspace_test
)

. "$(dirname "${BASH_SOURCE[0]}")/_gh.sh"
Expand Down
12 changes: 9 additions & 3 deletions skills/prm/closeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ in step 6. Order is forced by the tooling, so do not reorder:

**Carry `pending-release:` into the record.** A library PR merged here is not
a released library, and the `active.md` row that held that fact is about to
be pruned. Copy every uncleared `- pending-release: <lib>@<pr-url>` line from
the row into the completion body, so the obligation outlives the row and the
dashboard's **Pending release** section keeps showing it. `/prm` never
be pruned. Copy every uncleared, well-formed
`- pending-release: <lib>@<pr-url>` line from the row into the completion
body verbatim, so the obligation outlives the row and the dashboard's
**Pending release** section keeps showing it. Carry **only** those: a row
with none gets none in the record — never a `pending-release: none …`
placeholder, never a `Repo#N` short form, never a link to a repo outside the
published set (PyAutoNerves, PyAutoFit, PyAutoArray, PyAutoGalaxy,
PyAutoLens). Drop such a line rather than copying it; `lifecycle.py check`
fails on it. `/prm` never
clears the key — only `/review_release` does, on a release that actually
published (`PyAutoMind/REFERENCE.md` → "The pending-release chain").

Expand Down
5 changes: 3 additions & 2 deletions skills/prm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ gh api repos/PyAutoLabs/PyAutoMind/contents/active.md --jq '.content' \
| base64 -d | grep -iE 'library-pr:|workspace-pr:|issue:| - '
```

Feature PRs from `/ship_*` carry the `pending-release` label — a useful filter,
never a merge blocker (the label describes the release state of the change, not
Published-set library PRs from `/ship_library` carry the `pending-release`
label (organ and workspace PRs never do) — a useful filter, never a merge
blocker (the label describes the release state of the change, not
the mergeability of the PR).

## CI: every run, every leg
Expand Down
29 changes: 20 additions & 9 deletions skills/ship_library/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ Build/release step. Per repo, after the vitals faculty / Heart verdict is GREEN:
2. If the worktree is not on `feature/<task-name>`, stop and report — never
auto-switch branches.
3. `git -C "$WT_ROOT/<repo>" add -A && git commit -m "<message>" && git push -u origin feature/<task-name>`.
4. `gh pr create --label "pending-release" --title "<title>" --body "<body>"`
(paste the drafted body verbatim via HEREDOC). Then **verify the label
landed**: `gh pr view <n> --json labels --jq '[.labels[].name]'`. If
4. `gh pr create --title "<title>" --body "<body>"` (paste the drafted body
verbatim via HEREDOC), adding `--label "pending-release"` **only when the
repo is in the **published set** — PyAutoNerves, PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens (`PUBLISHED_REPOS` in `PyAutoMind/scripts/lifecycle.py`, which mirrors the PyPI `release` job of PyAutoHands' `release.yml`)**. An organ (Brain, Heart, Mind, Hands, …), PyAutoCTI,
PyAutoReduce or any other repo ships on merge or is never published, so no
release could ever clear the label — never apply it there. For a
published-set PR, **verify the label landed**:
`gh pr view <n> --json labels --jq '[.labels[].name]'`. If
`pending-release` is absent, stop and report — usually the label doesn't
exist on the repo; fix with `bash "${PYAUTO_BRAIN:-$(test -d organs/PyAutoBrain && echo organs/PyAutoBrain || echo PyAutoBrain)}/bin/ensure_workspace_labels.sh"`
then `gh pr edit <n> --add-label pending-release`.
Expand Down Expand Up @@ -156,26 +160,33 @@ each). A row whose `status:` says `awaiting-merge` / `PR open` / `shipped` and
carries no `*-pr:` is drift — `lifecycle.py check` exits 1 on it, because it is
a task `/prm` cannot close.

**And the pending-release link.** Every PR this skill opens carries the
`pending-release` label, so also write
**And the pending-release link — published set only.** For every PR this
skill opened with the `pending-release` label (published-set repos only, step
4 above), also write

```markdown
- pending-release: <LibraryRepo>@<pr-url>
```

on the `active.md` row — one line per merged-but-unpublished library PR. That
on the `active.md` row — one line per merged-but-unpublished library PR, the
full PR URL, nothing else on the line. A PR in any other repo gets **no**
line, and there is never a placeholder (`pending-release: none …`, `Repo#N`
short forms): `lifecycle.py check` fails on a value that is not
`<published-repo>@<pr-url>`, because no release could ever clear it. That
is the Mind's half of the chain in `REFERENCE.md` → "The pending-release
chain": GitHub's label and the Hands release stay the source of truth, Mind
holds only the link. The dashboard's **Pending release** section renders it,
and `/review_release` clears it once a release has actually published.
and `/review_release` clears it once a release has actually published
(`lifecycle.py clear-released --version <v>`).

**Shipped (option iii passed):** offer to merge the library PR
(`gh pr merge <n> --merge --auto`), post a "Shipped" comment (PRs, summary,
optional session notes), then record completion — the dated record **is** the
ledger (issues #71/#81):
- **Draft the rich completion body** to a temp file — `## <slug>`, `issue`,
`completed: <date>`, `library-pr:`, any uncleared `pending-release:` carried
over from the `active.md` row, then the summary/traps/notes bullets.
`completed: <date>`, `library-pr:`, any uncleared well-formed
`pending-release: <lib>@<pr-url>` lines carried over from the `active.md` row
(none at all when the row has none — never a placeholder), then the summary/traps/notes bullets.
- **Write the record** — one step: it folds + removes the `active/` prompt,
refreshes `complete/index.md`, and prunes the task's `active.md` section
(all the state `lifecycle.py check` drift-checks):
Expand Down
14 changes: 8 additions & 6 deletions skills/ship_workspace/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ step. Per workspace repo, after the readiness gate is GREEN:
3. `source "$WT_ROOT/activate.sh"`, then run `/smoke_test`. Smoke runs feed
Heart's verdict — any failure means **stop**, return the failures verbatim, do
not create the PR, do not try to fix the scripts.
4. `gh pr create --repo <owner/repo> --head feature/<task-name> --label "pending-release" --title "<title>" --body "<body>"`
(paste the drafted body verbatim via HEREDOC). Verify the label landed
(`gh pr view <n> --json labels --jq '[.labels[].name]'`); if absent, fix with
`ensure_workspace_labels.sh` + `gh pr edit <n> --add-label pending-release`.
If `gh pr create`/`gh pr edit` errors (SSH-URL origin, classic-Projects
4. `gh pr create --repo <owner/repo> --head feature/<task-name> --title "<title>" --body "<body>"`
(paste the drafted body verbatim via HEREDOC). **No `pending-release`
label:** workspace repos are never published to PyPI, so no release clears
it — the label belongs to published-set library PRs only
(`PyAutoMind/REFERENCE.md` → "The pending-release chain"). If `gh pr create`/`gh pr edit` errors (SSH-URL origin, classic-Projects
GraphQL failure), use the `gh api` fallbacks in `skills/OPERATIONS.md`.
5. If a library PR URL was passed in, cross-reference it:
`gh pr comment <library-PR-number> --body "Workspace PR: <workspace-PR-URL>"`.
Expand Down Expand Up @@ -111,7 +111,9 @@ SHIP_EOF
- completed: <YYYY-MM-DD>
- library-pr: <library PR URL — if linked>
- workspace-pr: <workspace PR URL(s)>
- pending-release: <lib>@<pr-url> # any still uncleared, carried from active.md
- pending-release: <lib>@<pr-url> # only well-formed lines still uncleared on the
# active.md row (published-set libraries); omit
# the key entirely when there are none
- summary: <what landed, gotchas, follow-ups>
```

Expand Down
12 changes: 0 additions & 12 deletions skills/start_workspace/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ worktree_create <task-name> <workspace_repo1> [workspace_repo2 ...]
Same semantics as the library variant (real worktrees on `feature/<task-name>`,
symlinks for everything else, `activate.sh` written).

## pending-release label guard

Before `/ship_workspace` runs, assert the canonical `pending-release` label so
the later `gh pr create --label pending-release` cannot silently fail:

```bash
bash "${PYAUTO_BRAIN:-$(test -d organs/PyAutoBrain && echo organs/PyAutoBrain || echo PyAutoBrain)}/bin/ensure_workspace_labels.sh"
```

It is idempotent (no-op when nothing drifted) and bootstraps the label where
missing. If it exits non-zero, stop and surface the failure.

## active.md registration

Linked mode — keep the `worktree:` from `/start_library`, extend `repos:` with
Expand Down
7 changes: 2 additions & 5 deletions skills/start_workspace/start_workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ gh issue view <number> --repo <owner/repo> --json comments --jq '.comments[].bod
[`reference.md`](reference.md) → "Linked-mode API-change impact".
3. Attach the affected workspace repos to the existing task worktree (from
`/start_library`) — `reference.md` → "Attaching workspace repos".
4. Assert the `pending-release` label — `reference.md` → "pending-release label
guard".
5. Register in `active.md` (extend `repos:`, set `status: workspace-dev`, add
4. Register in `active.md` (extend `repos:`, set `status: workspace-dev`, add
`library-pr:`) and push — `reference.md` → "active.md registration".

### 4. Standalone mode
Expand All @@ -62,8 +60,7 @@ gh issue view <number> --repo <owner/repo> --json comments --jq '.comments[].bod
standalone workspace task".
4. Register in `active.md` (`status: workspace-dev`, worktree + workspace repos)
and push.
5. Assert the `pending-release` label.
6. Explore the scripts to modify/create.
5. Explore the scripts to modify/create.

### 5. Present "ready to develop"

Expand Down
Loading