You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc6ccd3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ci): match the version PR by base too, and keep the write monotonic
Three findings from the claude review on #133.
**The pull request was selected on its head ref alone.** GitHub allows several
open pull requests from one head branch to different bases, so
`head=<owner>:changeset-release/main` can return more than one and `.find()`
would annotate whichever the API listed first. Both refs are now matched in
the script, and the query carries `base=main` as well — the script re-checks
so that widening the query cannot silently widen what gets written.
**An older run could roll the region back.** `needs:` orders jobs inside one
run, and this workflow has no concurrency group on purpose, so two pushes in
quick succession can leave the older run's breadcrumb job writing last. The
write is now monotonic: the version already on the pull request is read back
out of the install line and compared on the 14-digit UTC stamp, which is
fixed-width precisely so a lexical compare orders builds. A concurrency group
would have been the wrong instrument — it would cancel in-progress publishes
to fix a cosmetic race.
**"At the end" was claimed unconditionally, and the stack breadcrumb can
break it.** `stack-breadcrumb.cjs`'s `canonicalizeBody` re-lays a stacked
body as breadcrumb → description → carried regions, and its `ownDescription`
strips only the regions it owns — so this one rides inside "description" and
lands above the carried blocks. Nothing here runs at that moment. The spec now
asserts placement of the write and requires the next publish to return the
region to the end, with a scenario for each; the script says where the real
fix belongs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jwc9FFroR3mTZ4hLiSkkX3
Copy file name to clipboardExpand all lines: openspec/specs/cli-nightly-builds/spec.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,9 @@ When a nightly is published, the open pull request that carries the pending rele
163
163
164
164
Every fact in that region SHALL be derived from the version the publish stamped, not determined independently. The version already encodes the build time and the commit, and a second determination reads a second clock.
165
165
166
-
The region SHALL be placed at the end of the pull request body, SHALL replace any region a previous publish left rather than adding to it, and SHALL be restored if a human deletes it. It SHALL NOT modify any other managed region on that body.
166
+
Each publish SHALL append the region at the end of the body it writes, SHALL replace any region a previous publish left rather than adding to it, and SHALL be restored if a human deletes it. It SHALL NOT modify any other managed region on that body.
167
+
168
+
Placement is asserted of the write, not of the body for all time: other writers maintain their own regions on the same body and may re-lay it, moving this region out of last place. A publish SHALL return the region to the end rather than leave it where it was found. A publish SHALL NOT overwrite a region naming a build newer than its own.
167
169
168
170
The annotation SHALL depend on the publish having succeeded, and SHALL be performed by a job that holds permission to write pull requests and holds no publishing credential — the ability to publish under the organization's scope and the ability to rewrite pull request text SHALL NOT be held by one job.
169
171
@@ -177,6 +179,16 @@ The annotation SHALL depend on the publish having succeeded, and SHALL be perfor
177
179
-**WHEN** a second nightly is published while the same pull request is open
178
180
-**THEN** the pull request SHALL carry exactly one build-info region, describing the most recent publish
179
181
182
+
#### Scenario: Another writer moves the region
183
+
184
+
-**WHEN** another writer re-lays the body and the region no longer sits at the end
185
+
-**THEN** the next publish SHALL move it back to the end rather than leave it in place or write a second one
186
+
187
+
#### Scenario: An older build does not overwrite a newer one
188
+
189
+
-**WHEN** the region on the pull request names a build newer than the one being announced
190
+
-**THEN** the body SHALL be left unchanged
191
+
180
192
#### Scenario: No open release pull request is not a failure
181
193
182
194
-**WHEN** a nightly is published and no pull request carrying pending release metadata is open
0 commit comments