Plan the API version stamps' phase 2, task by task - #332
Merged
Merged
Conversation
Five tasks from stamps spec: the snapshot rule, the --write-snapshot command, the version-scheme test, the policy and the runbook, and the branch's verification. The plan's code was dry-run from the plan's own text in a throwaway worktree before it was proposed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C79QePZ862i61EJodupwVT
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C79QePZ862i61EJodupwVT
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The implementation plan for phase 2 of #227's API version stamps, specified in #331 (
stamps spec). Plan only — the build follows as its own pull request and closes #227. The build must merge before the v0.1.0 release candidate, whose merge-back would otherwise turnmainred.The five tasks
read_snapshot,render_snapshot, and arecordedargument tocheck_versionadded--write-snapshotcommand, which refuses while a stamp fails or no version can be derivedsetuptools_scmscheme it depends onstamps spec §1's and§3.4's tables, including the branch-name trapdocs-style.rst, runbook steps 4 and 10, and the retired Two gates will move at the first tag notepixi run tests,lint,docs, and no snapshot committedThe plan commits no
.github/api-surface.txt: the first snapshot is written at the release candidate's freeze, by runbook step 4.What planning measured first
main()takes no arguments today, and two tests call it. A parser readingsys.argvwould be handed pytest's own arguments there, somaintakes an explicitargvthat defaults to empty.pyproject.tomlholding only[tool.setuptools_scm]is enough forsetuptools_scmto derive the scheme's versions in a temporary repository, so Task 3's test builds one from the committed manifest's table.floors spec §3.3's "Forty-one" becomes forty-two, as Leave what a release moves out of the container census #325's test moved it before. Task 3 runs that gate before and after the change.How the plan's code was checked
Once merged, a plan is checked by nothing, so this one was run before it was proposed. A driver took every code block from the plan file and applied them task by task to a throwaway worktree of
mainatb8e5cb1. It ran each step's own commands — tests, lint, commits and mutations — against the installed pixi environments.The first run found three lint errors in the plan's code, and a second run from the corrected text was clean.
ruff checkrejectedmatch="api-surface.txt:4", whose.is unescaped.*args: tests waiveANN001but notANN002.ruff formatrewrote an 89-character assert.An executor would have hit a failing hook at Task 1's first commit.
Checking every expectation against the runs found five more corrections:
-kfilters select a test their expectation did not mention:schemein Task 3, andrunbookin Task 4's red run and in its mutation;SNAPSHOT_HEADER, notSNAPSHOTorSnapshotError.Every expected count now matches a measured one.
On the second run:
TypeErrors and sevenAttributeErrors. Task 2: 4 failed, threeTypeErrors and aSnapshotErrorraised out ofmain. Task 4: 2 failed, 1 passed.floors spec §3.3gate failed before the change, counting 42 guarded tests against the specification's forty-one, and passed after it.pre-commit run --all-filespassed. The docs build succeeded with no warnings and all five gates passing. No.github/api-surface.txtwas committed.Not dry-run: runbook steps 4 and 10 themselves, which first run at the release candidate. Task 3's test pins the version behaviour they rely on, and Task 2 runs the command for real without writing.
The finish, left to the build's controller
File one issue for the two items #227 carries past phase 2 —
versionaddedtoversion-addedonce the Sphinx floor passes 9.0, and suggestingversion-addedto numpydoc'sDIRECTIVES— and repointstamps spec §8's Deferred item to cite it; open the build withCloses #227.🤖 Generated with Claude Code
https://claude.ai/code/session_01C79QePZ862i61EJodupwVT