From dc2eddce37b475eb4b9dadf30fd1084d6eac7a59 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Thu, 16 Jul 2026 09:49:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20(scripts):=20Let=20the=20metada?= =?UTF-8?q?ta=20generator=20own=20the=20prereq=20SDK-version=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each README's prose "## Prerequisites" table carried a hand-written `| Agent Assembly SDK | |` row that lived outside the generated sdk-install block and drifted from the source of truth (rc.3 / an old beta vs. the block's rc.5) — AAASM-4703. Add a label-driven pass that rewrites only the version token in that row for whichever language label it carries, preserving the `>=` operator and any trailing note (e.g. the LlamaIndex adapter caveat). The label cell is matched exactly, so the generated block's own row is never touched. Idempotent. --- scripts/generate_example_metadata.py | 109 +++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/scripts/generate_example_metadata.py b/scripts/generate_example_metadata.py index 35af397..9a55ecf 100755 --- a/scripts/generate_example_metadata.py +++ b/scripts/generate_example_metadata.py @@ -365,6 +365,61 @@ def rewrite_go_readme(path: Path, sdk: GoSdk) -> bool: return _write_if_changed(path, new_text) +# --------------------------------------------------------------------------- +# Hand-written "Prerequisites" table row +# --------------------------------------------------------------------------- +# +# Many READMEs carry, in their prose ``## Prerequisites`` table, a row of the +# form ``| Agent Assembly SDK | |`` that sits *outside* the +# generated sdk-install block. Left to hand-maintenance it drifts from the SoT +# (AAASM-4703): the generated block advertised rc.5 while these rows still said +# rc.3 / an old beta. The generator now owns the version literal in that row too +# so the two can never disagree again. +# +# The label cell is matched *exactly* (``Agent Assembly SDK`` with no +# trailing parenthetical), which is precisely what distinguishes this prose row +# from the generated block's row (``... SDK () | ...``) — so this pass +# never touches the generated block. + + +# A PEP 440 / SemVer-ish pre-release version literal, covering the shapes used +# across these examples: ``0.0.1rc5`` (python), ``v0.0.1-rc.5`` (go), and any +# alpha/beta/rc pre-release suffix. Only the version token is rewritten, so an +# operator prefix (``>= ``) and any trailing note (``(with the LlamaIndex +# adapter)``) are preserved verbatim. +_VERSION_TOKEN_RE = re.compile( + r"v?\d+\.\d+\.\d+(?:[-.]?(?:rc|beta|alpha|b|a)\.?\d+)?" +) + + +def _prereq_row_re(label: str) -> re.Pattern[str]: + return re.compile( + r"^(?P
\|[ \t]*Agent Assembly "
+        + re.escape(label)
+        + r" SDK[ \t]*\|[ \t]*)(?P[^|]*?)(?P[ \t]*\|[ \t]*)$",
+        re.MULTILINE,
+    )
+
+
+def rewrite_prereq_row(path: Path, label: str, version: str) -> bool:
+    """Align the ``Agent Assembly