From fda5bf7d52c683763fa3e6498005743ebd339e27 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:03:49 +0000 Subject: [PATCH 1/2] docs(agents): require work on dev and retire versioned -dev branches AGENTS.md now tells agents to branch from origin/dev and open PRs into dev (stable hotfixes from master excepted), and states that vX.Y-dev branches are retired and must not be used even while they still exist on the remote. CONTRIBUTING.md says the same instead of hinting at choosing among historical versioned branches. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit f5389e043bddba0a45fa8c6ff3dd37f8dbd0b85e) --- AGENTS.md | 10 ++++++---- CONTRIBUTING.md | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index eede9338b..1710114bb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,10 +72,12 @@ make format ## Branching and PR Workflow - `dev` is the integration branch; `master` is the latest stable Dash Platform release line. -- Select PR targets by their role and dependencies, not by sorting versioned - branch names. -- Create feature branches from integration and open PRs back into it. Stable - hotfixes branch from `master` and are forward-ported to integration. +- Do all development on `dev`: create feature branches from `origin/dev` and + open PRs into `dev`. The only exception is a stable hotfix, which branches + from `master` and is forward-ported to `dev`. +- Versioned `vX.Y-dev` branches (e.g. `v1.8-dev`, `v1.9-dev`) are retired. Never + branch from, target, or compare against them, even if one still exists on + the remote. - Keep commits focused and well-described. - Use conventional commit format for commit and PR titles. - Do not manually edit or generate `CHANGELOG.md` for development changes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4fc60a848..1bdf4b75e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ The useful distinction is each branch's role: Target `dev` for ordinary integration PRs. Select another target explicitly for a release, hotfix or dependent change, following [RELEASES.md](RELEASES.md). -Choose by the branch's role rather than sorting historical versioned names. +Versioned `vX.Y-dev` branches (e.g. `v1.9-dev`) are retired; never target them. A PR that depends on another open PR can target its parent feature branch. Describe the dependency and keep its diff focused; after the parent lands, From ca4d9d25e0fc4ea18660cd08c6320f7319b80f08 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:11:33 +0000 Subject: [PATCH 2/2] chore: drop remaining v1.8-dev references from tooling and OpenAPI - scripts/release/plan.py requires origin/dev and no longer falls back to origin/v1.8-dev; the test now asserts that versioned -dev branches never stand in for a missing dev. - scripts/prepare-docs.py links source files to dev by default (the Makefile still passes the exact SHA). - rpc/openapi/openapi.yaml advertises the Tenderdash version instead of a branch name, and links the license on master. A test in version/ keeps info.version equal to TMVersionDefault, and the release skill updates both. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/tenderdash-release/SKILL.md | 7 ++++--- rpc/openapi/openapi.yaml | 4 ++-- scripts/prepare-docs.py | 4 ++-- scripts/release/plan.py | 8 ++++---- scripts/release/test_release.py | 4 ++-- scripts/tests/test_prepare_docs.py | 16 ++++++++-------- version/version_test.go | 21 +++++++++++++++++++++ 7 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 version/version_test.go diff --git a/.agents/skills/tenderdash-release/SKILL.md b/.agents/skills/tenderdash-release/SKILL.md index faadfd06c..887e5fc37 100644 --- a/.agents/skills/tenderdash-release/SKILL.md +++ b/.agents/skills/tenderdash-release/SKILL.md @@ -97,9 +97,10 @@ Platform rollout, and required tests in the release plan. ## Prepare the reviewable release Work in an isolated feature/release checkout at the reviewed source SHA. Preserve -unrelated work. Update `TMVersionDefault` in `version/version.go` to the chosen -version, and only the protocol versions justified above. Prepare `CHANGELOG.md` -from the reviewed changes, preserving existing release sections. Include the +unrelated work. Update `TMVersionDefault` in `version/version.go` and +`info.version` in `rpc/openapi/openapi.yaml` to the chosen version (a test in +`version/` keeps them equal), and only the protocol versions justified above. +Prepare `CHANGELOG.md` from the reviewed changes, preserving existing release sections. Include the version/date, meaningful user-facing changes, breaking behavior and migration; exclude already-released patches and reverted effects. Commit prefixes can help organize the notes but cannot replace diff review. Do not regenerate old history diff --git a/rpc/openapi/openapi.yaml b/rpc/openapi/openapi.yaml index c7bc0c153..0f5332ec8 100644 --- a/rpc/openapi/openapi.yaml +++ b/rpc/openapi/openapi.yaml @@ -49,10 +49,10 @@ info: ws ws://localhost:26657/websocket > { "jsonrpc": "2.0", "method": "subscribe", "params": ["tm.event='NewBlock'"], "id": 1 } - version: "v1.8-dev" + version: "2.0.0-dev.1" license: name: Apache 2.0 - url: https://github.com/dashpay/tenderdash/blob/v1.8-dev/LICENSE + url: https://github.com/dashpay/tenderdash/blob/master/LICENSE servers: - url: http://localhost:26657 description: Interact with the Tenderdash RPC locally on your device diff --git a/scripts/prepare-docs.py b/scripts/prepare-docs.py index edc3aaf22..749dc4e51 100644 --- a/scripts/prepare-docs.py +++ b/scripts/prepare-docs.py @@ -51,7 +51,7 @@ def rewrite_link(match, source, root, source_ref): return prefix + replacement -def prepare(root=ROOT, source_ref="v1.8-dev"): +def prepare(root=ROOT, source_ref="dev"): root = root.resolve() summary = (root / "book/SUMMARY.md").read_text() listed = set(re.findall(r"\]\(([^)]+\.md)\)", summary)) @@ -99,7 +99,7 @@ def prepare(root=ROOT, source_ref="v1.8-dev"): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--source-ref", - default="v1.8-dev", + default="dev", help="Git ref for links to repository source files", ) args = parser.parse_args() diff --git a/scripts/release/plan.py b/scripts/release/plan.py index 6ca2ec070..550c42733 100755 --- a/scripts/release/plan.py +++ b/scripts/release/plan.py @@ -57,9 +57,9 @@ def release_plan(repo, mode, source, baseline): if version and tuple(map(int, version.groups())) > baseline_version: raise ValueError(f"newer reachable stable tag {tag}; review the baseline") - integration = ( - "origin/dev" if exists(repo, "refs/remotes/origin/dev") else "origin/v1.8-dev" - ) + integration = "origin/dev" + if not exists(repo, "refs/remotes/origin/dev"): + raise ValueError("origin/dev not found; fetch the integration branch") integration_sha = git(repo, "rev-parse", "--verify", f"{integration}^{{commit}}") stable_sha = git(repo, "rev-parse", "--verify", "origin/master^{commit}") if mode == "next": @@ -67,7 +67,7 @@ def release_plan(repo, mode, source, baseline): raise ValueError( "next release source must be on the fetched integration lineage" ) - target = "dev" if integration == "origin/dev" else "v1.8-dev" + target = "dev" else: if not ancestor(repo, stable_sha, source_sha): raise ValueError("hotfix source must descend from origin/master") diff --git a/scripts/release/test_release.py b/scripts/release/test_release.py index 008451a7e..705fc4802 100644 --- a/scripts/release/test_release.py +++ b/scripts/release/test_release.py @@ -97,11 +97,11 @@ def test_unreachable_baseline_is_rejected(self): self.git("tag", "v9.0.0") self.assertIn("ancestor", self.plan("--baseline", "v9.0.0", success=False)) - def test_transition_uses_v18_not_highest_version(self): + def test_versioned_dev_branches_never_replace_missing_dev(self): self.git("update-ref", "-d", "refs/remotes/origin/dev") self.git("update-ref", "refs/remotes/origin/v1.8-dev", self.dev) self.git("update-ref", "refs/remotes/origin/v9.0-dev", "origin/master") - self.assertEqual(self.plan()["integration"], "origin/v1.8-dev") + self.assertIn("origin/dev", self.plan(success=False)) def test_backport_evidence_identifies_patch_already_on_stable(self): self.git("checkout", "-q", "-b", "stable", "origin/master") diff --git a/scripts/tests/test_prepare_docs.py b/scripts/tests/test_prepare_docs.py index 66a47a251..bdd0898f8 100644 --- a/scripts/tests/test_prepare_docs.py +++ b/scripts/tests/test_prepare_docs.py @@ -41,14 +41,14 @@ def write(self, path, content): def test_stages_sources_assets_and_rpc_without_changing_originals(self): original = (self.root / "docs/README.md").read_text() self.write("docs/image.svg", "") - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") staged = self.root / "book/src" welcome = (staged / "docs/README.md").read_text() self.assertNotIn("Old metadata", welcome) self.assertIn("[Guides](docs/index.md)", (staged / "README.md").read_text()) self.assertIn("[Protocol](../spec/consensus.md#rounds)", welcome) self.assertIn( - "https://github.com/dashpay/tenderdash/blob/v1.8-dev/internal/state.go", + "https://github.com/dashpay/tenderdash/blob/dev/internal/state.go", welcome, ) self.assertIn( @@ -79,29 +79,29 @@ def test_ignores_old_vuepress_dependencies_and_output(self): for directory in ("node_modules", ".vuepress", "dist", "_build", "spec"): (self.root / "docs" / directory).mkdir() self.write(f"docs/{directory}/stale.md", "# Old build output\n") - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") for directory in ("node_modules", ".vuepress", "dist", "_build", "spec"): self.assertFalse((self.root / "book/src/docs" / directory).exists()) def test_strips_metadata_without_final_newline(self): self.write("docs/README.md", "---\norder: false\n---") - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") self.assertEqual((self.root / "book/src/docs/README.md").read_text(), "") def test_rejects_unlisted_chapter(self): self.write("spec/new-protocol.md", "# New protocol\n") with self.assertRaisesRegex(ValueError, "new-protocol.md"): - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") def test_rejects_missing_chapter(self): (self.root / "spec/consensus.md").unlink() with self.assertRaisesRegex(ValueError, "consensus.md"): - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") def test_removes_stale_staged_files(self): - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") self.write("book/src/stale.md", "# Removed\n") - self.module.prepare(self.root, "v1.8-dev") + self.module.prepare(self.root, "dev") self.assertFalse((self.root / "book/src/stale.md").exists()) diff --git a/version/version_test.go b/version/version_test.go new file mode 100644 index 000000000..5ce3923fd --- /dev/null +++ b/version/version_test.go @@ -0,0 +1,21 @@ +package version + +import ( + "os" + "path/filepath" + "strconv" + "testing" + + "github.com/stretchr/testify/require" +) + +// The release process bumps TMVersionDefault; the RPC OpenAPI document must +// advertise the same version. +func TestOpenAPIVersionMatchesTMVersionDefault(t *testing.T) { + spec, err := os.ReadFile(filepath.Join("..", "rpc", "openapi", "openapi.yaml")) + require.NoError(t, err) + + want := "\n version: " + strconv.Quote(TMVersionDefault) + "\n" + require.Contains(t, string(spec), want, + "rpc/openapi/openapi.yaml info.version must be %q", TMVersionDefault) +}