Address review pass 2: Designer method naming, declared files, test robustness
- v0.15.0 notes give the methods' earlier generic Designer display names. - Fork bullets name coordinator-dispatch's and tester-inspection's second declared file. - The v0.17.0 intro points to the contract instead of repeating why it shares a commit with v0.16.0. - Contract step 4 says how pair packages join an existing release bundle. - OVERRIDING.md and README.md paragraphs are rewrapped. - tests/test_release_status.py shares section lookups, checks positive current-truth wording instead of removed sentences, ignores non-version headings, and lets version strings sit inside a checked span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
40cdbbb12b
commit
319314924c
5 files changed
+67
-49
No files matched your search
@@ -16,82 +16,93 @@ DOCUMENTS = ("README.md", "OVERRIDING.md", "RELEASE-NOTES.md", "docs/authoritati
|
||||
# either order, describes that tag as unpublished.
|
||||
NEARBY = 40
|
||||
UNPUBLISHED = r"not[- ]yet[- ](?:tagged|published)|proposed"
|
||||
# Any text within one sentence or table cell: a period ends the span only
|
||||
# when it ends a sentence, so other version strings may sit in between.
|
||||
SPAN = rf"(?:(?!\. )[^;|]){{0,{NEARBY}}}"
|
||||
VERSION_HEADING = re.compile(r"^## (v\d+\.\d+\.\d+)$", re.M)
|
||||
|
||||
|
||||
def flat(text):
|
||||
return " ".join(text.split())
|
||||
|
||||
|
||||
def read(path):
|
||||
def flat_document(path):
|
||||
return flat((ROOT / path).read_text())
|
||||
|
||||
|
||||
def contract_section(heading):
|
||||
return section(CONTRACT.read_text(), heading)
|
||||
|
||||
|
||||
def package_matrix():
|
||||
return {codes(row[0])[0]: row for row in table_rows(section((ROOT / "OVERRIDING.md").read_text(), "Package matrix"))}
|
||||
|
||||
|
||||
class ReleaseStatusTests(unittest.TestCase):
|
||||
def test_documents_never_call_a_published_release_unpublished(self):
|
||||
for document in DOCUMENTS:
|
||||
text = read(document)
|
||||
text = flat_document(document)
|
||||
for tag in PUBLISHED:
|
||||
escaped = re.escape(tag)
|
||||
pattern = (rf"(?:{UNPUBLISHED})[^.;|]{{0,{NEARBY}}}{escaped}"
|
||||
rf"|{escaped}[^.;|]{{0,{NEARBY}}}(?:{UNPUBLISHED})")
|
||||
pattern = rf"(?:{UNPUBLISHED}){SPAN}{escaped}|{escaped}{SPAN}(?:{UNPUBLISHED})"
|
||||
with self.subTest(document=document, tag=tag):
|
||||
self.assertIsNone(re.search(pattern, text, re.I))
|
||||
|
||||
def test_package_matrix_names_published_releases_plainly(self):
|
||||
rows = table_rows(section((ROOT / "OVERRIDING.md").read_text(), "Package matrix"))
|
||||
for row in rows:
|
||||
for name, row in package_matrix().items():
|
||||
release = codes(row[6])[0]
|
||||
if release in PUBLISHED:
|
||||
with self.subTest(package=codes(row[0])[0]):
|
||||
with self.subTest(package=name):
|
||||
self.assertEqual(row[6], f"`{release}`")
|
||||
|
||||
def test_contract_adoption_table_marks_releases_published(self):
|
||||
adoption = section(CONTRACT.read_text(), "RelayView adoption of the Tester and Coordinator pairs")
|
||||
for row in table_rows(adoption):
|
||||
for row in table_rows(contract_section("RelayView adoption of the Tester and Coordinator pairs")):
|
||||
release = codes(row[0])[0]
|
||||
if release in PUBLISHED:
|
||||
with self.subTest(release=release):
|
||||
self.assertEqual(row[0], f"`{release}`, published")
|
||||
|
||||
def test_contract_explains_the_shared_v0_16_0_and_v0_17_0_commit(self):
|
||||
releases = flat(section(CONTRACT.read_text(), "Releases are immutable"))
|
||||
releases = flat(contract_section("Releases are immutable"))
|
||||
self.assertIn("`v0.16.0` and `v0.17.0` tag the same commit", releases)
|
||||
self.assertIn("A bundle for either tag takes only the packages that declare it.", releases)
|
||||
|
||||
def test_release_notes_cover_each_published_release_without_a_pending_marker(self):
|
||||
headings = re.findall(r"^## (.+)$", (ROOT / "RELEASE-NOTES.md").read_text(), re.M)
|
||||
notes = (ROOT / "RELEASE-NOTES.md").read_text()
|
||||
headings = VERSION_HEADING.findall(notes)
|
||||
for tag in PUBLISHED:
|
||||
with self.subTest(tag=tag):
|
||||
self.assertIn(tag, headings)
|
||||
self.assertEqual(headings, sorted(headings, key=lambda tag: tuple(map(int, tag[1:].split("."))), reverse=True))
|
||||
for heading in re.findall(r"^## (.+)$", notes, re.M):
|
||||
if heading.split(" ")[0] in PUBLISHED:
|
||||
with self.subTest(heading=heading):
|
||||
self.assertIn(heading, PUBLISHED)
|
||||
|
||||
|
||||
class DesignerAdoptionTests(unittest.TestCase):
|
||||
"""RelayView pins v0.15.0 and assigns specification-designer-default."""
|
||||
|
||||
def test_package_matrix_names_the_pinned_specification_designer_default(self):
|
||||
rows = {codes(row[0])[0]: row[7] for row in
|
||||
table_rows(section((ROOT / "OVERRIDING.md").read_text(), "Package matrix"))}
|
||||
self.assertTrue(rows["specification-designer-default"].startswith("Pinned Designer default"))
|
||||
self.assertFalse(rows["issue-designer-default"].startswith("Pinned Designer default"))
|
||||
rows = package_matrix()
|
||||
self.assertTrue(rows["specification-designer-default"][7].startswith("Pinned Designer default"))
|
||||
self.assertFalse(rows["issue-designer-default"][7].startswith("Pinned Designer default"))
|
||||
|
||||
def test_documents_drop_the_pending_designer_adoption(self):
|
||||
for document in ("README.md", "OVERRIDING.md"):
|
||||
with self.subTest(document=document):
|
||||
self.assertIsNone(re.search(r"until it pins `?v0\.15\.0|not yet pinned", read(document)))
|
||||
adoption = flat(section(CONTRACT.read_text(), "RelayView adoption of the Specification Designer default"))
|
||||
self.assertNotIn("Before RelayView pins", adoption)
|
||||
self.assertIn("first-party-skills/v0.15.0/", adoption)
|
||||
self.assertIsNone(re.search(r"until it pins `?v0\.15\.0|not yet pinned", flat_document(document)))
|
||||
|
||||
def test_designer_methods_are_captured_only_when_assigned(self):
|
||||
adoption = flat(section(CONTRACT.read_text(), "RelayView adoption of the Specification Designer default"))
|
||||
def test_contract_describes_the_designer_adoption(self):
|
||||
adoption = flat(contract_section("RelayView adoption of the Specification Designer default"))
|
||||
self.assertIn("RelayView pins `v0.15.0` in `first-party-skills/v0.15.0/`", adoption)
|
||||
self.assertIn("New Designer Chats receive `specification-designer-default`.", adoption)
|
||||
self.assertIn("captures one only when an Operator assigns it", adoption)
|
||||
|
||||
def test_pair_adoption_names_the_bundled_subset(self):
|
||||
adoption = flat(section(CONTRACT.read_text(), "RelayView adoption of the Tester and Coordinator pairs"))
|
||||
adoption = flat(contract_section("RelayView adoption of the Tester and Coordinator pairs"))
|
||||
self.assertIn("its `v0.15.0` bundle holds only the Designer packages", adoption)
|
||||
self.assertIn("Before RelayView bundles a package declaring either pair", adoption)
|
||||
self.assertNotIn("Before RelayView pins a release containing either pair", adoption)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user