Local video editor for coding agents: 42 FFmpeg tools with a machine-readable contract and an MCP server, for Claude Code, Cursor and Codex. Cut, captions, reframe, loudness, platform exports. No cloud, no API keys.
Python agent-skillsai-agentsaudio-processingcaptionsclaude-codecodexcoding-agentcursorffmpegloudness-normalizationmcpmcp-servermodel-context-protocolpythonsubtitlestranscodingvideovideo-editingvideo-processingwhisper
ci: the auto-bump moves the roadmap's released-version sentence (#289)
Shogo Kajiyamac5f040ccee96
diff --git a/.github/scripts/bump_roadmap_md.py b/.github/scripts/bump_roadmap_md.pynew file mode 100644index 0000000..2166269--- /dev/null+++ b/.github/scripts/bump_roadmap_md.py@@ -0,0 +1,58 @@+#!/usr/bin/env python3+"""Move docs/roadmap.md's "The released version today is **X**" sentence to the next release.++Used by .github/workflows/release.yml's auto-bump step. Before this, the auto-bump moved+package.json, plugin.json, contract.md and CHANGELOG.md but not this sentence, which+tests/test_contract.py pins to package.json -- so every label-driven release (2.2.1: f95e3c7)+left main red until a docs PR (#288) moved it by hand.++The prose after the version describes one particular release, written by hand in its PR. An+automatic bump cannot write that prose, so it keeps it and says which version it describes:++ The released version today is **2.2.1** — `render.py` ...+ -> The released version today is **2.2.2** (notes in CHANGELOG.md); **2.2.1** — `render.py` ...++A later automatic bump only moves the leading version; the hand-written prose stays attached to+the version it was written for until a PR replaces the sentence. The sentence must be found+exactly once; anything else is an error rather than a silent partial bump.+"""+import re+import sys++NOTE = " (notes in CHANGELOG.md); "+++def bump_roadmap_md(text: str, old: str, new: str) -> str:+ pattern = re.compile(r"The released version today is \*\*" + re.escape(old) + r"\*\*"+ + r"(" + re.escape(NOTE) + r"\*\*[^*]+\*\*)?")+ found = pattern.findall(text)+ if len(found) != 1:+ raise ValueError(f"docs/roadmap.md: expected exactly one 'The released version today is "+ f"**{old}**' sentence, found {len(found)}")++ def repl(m: "re.Match[str]") -> str:+ described = m.group(1) or f"{NOTE}**{old}**"+ return f"The released version today is **{new}**{described}"++ return pattern.sub(repl, text, count=1)+++def main(argv) -> int:+ if len(argv) != 4:+ print("usage: bump_roadmap_md.py PATH OLD NEW", file=sys.stderr)+ return 2+ path, old, new = argv[1:]+ with open(path, encoding="utf-8") as f:+ text = f.read()+ try:+ text = bump_roadmap_md(text, old, new)+ except ValueError as e:+ print(e, file=sys.stderr)+ return 1+ with open(path, "w", encoding="utf-8", newline="") as f:+ f.write(text)+ return 0+++if __name__ == "__main__":+ sys.exit(main(sys.argv))diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex cd702d9..46c09f0 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -116,7 +116,7 @@ jobs:# since PR titles are attacker-controlled text and GitHub Actions expression# interpolation into a run: block is a known script-injection vector -- only our own# already-resolved, numeric version strings pass through ${{ }} here.- - name: Auto-bump package.json / docs/contract.md / CHANGELOG.md+ - name: Auto-bump package.json / docs/contract.md / docs/roadmap.md / CHANGELOG.mdif: |steps.setup.outputs.needs_auto_bump == 'true' &&steps.drafter.outputs.resolved_version != '' &&@@ -161,6 +161,14 @@ jobs:contract = contract_path.read_text(encoding="utf-8")contract_path.write_text(bump_contract_md(contract, old, new), encoding="utf-8")+ # The roadmap's "released version today" sentence is pinned to package.json by a test;+ # the auto-bump used to leave it behind, so every label-driven release left main red+ # until a docs PR moved it (2.2.1 -> #288).+ from bump_roadmap_md import bump_roadmap_md+ roadmap_path = root / "docs" / "roadmap.md"+ roadmap = roadmap_path.read_text(encoding="utf-8")+ roadmap_path.write_text(bump_roadmap_md(roadmap, old, new), encoding="utf-8")+last_tag = f"v{old}" if old != "0.0.0" else Nonerev_range = f"{last_tag}..HEAD" if last_tag else "HEAD"log = subprocess.run(@@ -203,7 +211,7 @@ jobs:git config user.name "github-actions[bot]"git config user.email "github-actions[bot]@users.noreply.github.com"- git add package.json .claude-plugin/plugin.json docs/contract.md CHANGELOG.md+ git add package.json .claude-plugin/plugin.json docs/contract.md CHANGELOG.md docs/roadmap.mdgit commit -m "chore(release): bump version to ${NEW_VERSION} [skip ci]"# A merge that landed during this step would still make the push non-fast-forward;# replay the bump on top of it (a conflict here is real and should fail the run).diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 3066f88..0c8cfb6 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -87,7 +87,9 @@ would have caught the original bug isn't done yet.it gets a command and a sentence in the gallery's Inspection section.- A release PR moves `docs/roadmap.md`'s "the released version today is ..." line in the **samePR as the version bump**, so the roadmap never describes a version that is already out as- planned.+ planned. A label-driven release (release.yml's auto-bump) moves only the version number and+ keeps the hand-written prose, marked with the version it describes+ (`.github/scripts/bump_roadmap_md.py`); the next hand-written release PR replaces the sentence.## Reporting issuesdiff --git a/tests/test_contract.py b/tests/test_contract.pyindex 85b1861..b728c37 100644--- a/tests/test_contract.py+++ b/tests/test_contract.py@@ -1109,6 +1109,39 @@ class ContractTests(unittest.TestCase):with self.assertRaises(ValueError):bump.bump_contract_md(hist + hist, "1.10.0", "1.10.1")+ def test_release_roadmap_bump_moves_the_released_version_sentence(self):+ """.github/scripts/bump_roadmap_md.py (release.yml's auto-bump): the roadmap sentence+ pinned to package.json moves with the bump. The auto-bump used to skip it, so the 2.2.1+ label release left test_roadmap_released_version_matches_package_json red on main until+ a docs PR (#288). The hand-written prose stays, marked with the version it describes."""+ import importlib.util+ spec = importlib.util.spec_from_file_location(+ "bump_roadmap_md", ROOT / ".github" / "scripts" / "bump_roadmap_md.py")+ bump = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(bump)++ old = json.loads((ROOT / "package.json").read_text())["version"]+ ma, mi, pa = old.split(".")+ new = f"{ma}.{mi}.{int(pa) + 1}"+ text = (ROOT / "docs" / "roadmap.md").read_text(encoding="utf-8")+ out = bump.bump_roadmap_md(text, old, new)+ m = re.search(r"The released version today is \*\*([^*]+)\*\*", out)+ self.assertEqual(m.group(1), new)+ changed = [(a, b) for a, b in zip(text.splitlines(), out.splitlines()) if a != b]+ self.assertEqual(len(changed), 1, changed)++ s = "The released version today is **2.2.1** — `render.py` checks inputs.\n"+ once = bump.bump_roadmap_md(s, "2.2.1", "2.2.2")+ self.assertEqual(once, "The released version today is **2.2.2** (notes in CHANGELOG.md); "+ "**2.2.1** — `render.py` checks inputs.\n")+ twice = bump.bump_roadmap_md(once, "2.2.2", "2.2.3")+ self.assertEqual(twice, once.replace("**2.2.2**", "**2.2.3**"))+ # a missing or doubled sentence is an error, never a partial bump+ with self.assertRaises(ValueError):+ bump.bump_roadmap_md(s, "2.2.0", "2.2.1")+ with self.assertRaises(ValueError):+ bump.bump_roadmap_md(s + s, "2.2.1", "2.2.2")+# ------------------------------------------------------------------ MCP inputSchema derived from the contractdef _rpc(self, requests, root=ROOT, full=False):text = "".join(json.dumps(r) + "\n" for r in requests)