test_identity_graph_service_docstring.py
python
sha256:fe2f636a9c2a691f1ad846907a1829c1d2ae71327ac2c2e0141089c1afe8cf3a
fix: correct IdentityGraphService/QuorumEngine docstrings (…
Sonnet 5
minor
⚠ breaking
2 days ago
| 1 | """musehub#225 — service.py's docstring falsely claimed to be "the unified |
| 2 | surface enforcing all three invariants atomically." It has zero production |
| 3 | callers; the actual enforcement surface is push_validator.py (musehub#230). |
| 4 | |
| 5 | Resolution (confirmed via check-in): IdentityGraphService/QuorumEngine are |
| 6 | NOT dead code to delete -- docs/roadmaps/orgs.md (actively maintained, not |
| 7 | a stale artifact) documents them as built-ahead infrastructure for a |
| 8 | deliberately-deferred "sub-org nesting" feature ("the QuorumEngine |
| 9 | supports it; the CLI does not need to expose it yet"). The fix is |
| 10 | docstring-only: stop claiming current enforcement, accurately describe |
| 11 | them as reserved/unwired infrastructure for that documented future |
| 12 | capability. |
| 13 | """ |
| 14 | from __future__ import annotations |
| 15 | |
| 16 | import re |
| 17 | |
| 18 | |
| 19 | def _claims_enforcement(doc: str) -> bool: |
| 20 | """True if *doc* asserts this module currently enforces/is the |
| 21 | enforcement surface for identity invariants -- as opposed to describing |
| 22 | itself as reserved, unwired, or future infrastructure.""" |
| 23 | return bool(re.search(r"unified surface enforcing", doc, re.IGNORECASE)) |
| 24 | |
| 25 | |
| 26 | def test_service_module_docstring_no_longer_claims_current_enforcement() -> None: |
| 27 | from musehub.graph import service |
| 28 | |
| 29 | doc = service.__doc__ or "" |
| 30 | assert not _claims_enforcement(doc), ( |
| 31 | f"service.py's docstring must not claim to be a currently-enforcing " |
| 32 | f"surface -- IdentityGraphService has zero production callers " |
| 33 | f"(musehub#225). Got: {doc!r}" |
| 34 | ) |
| 35 | |
| 36 | |
| 37 | def test_service_module_docstring_references_roadmap_and_deferred_status() -> None: |
| 38 | from musehub.graph import service |
| 39 | |
| 40 | doc = service.__doc__ or "" |
| 41 | assert "orgs.md" in doc or "roadmap" in doc.lower(), ( |
| 42 | "service.py's docstring should cross-reference docs/roadmaps/orgs.md " |
| 43 | "so a future reader understands this is intentionally-deferred " |
| 44 | "infrastructure, not orphaned code" |
| 45 | ) |
| 46 | assert "225" in doc, "service.py's docstring should cross-reference musehub#225" |
| 47 | |
| 48 | |
| 49 | def test_quorum_module_docstring_references_roadmap_and_deferred_status() -> None: |
| 50 | from musehub.graph import quorum |
| 51 | |
| 52 | doc = quorum.__doc__ or "" |
| 53 | assert "orgs.md" in doc or "roadmap" in doc.lower(), ( |
| 54 | "quorum.py's docstring should cross-reference docs/roadmaps/orgs.md " |
| 55 | "now that musehub#225 has resolved whether this code is kept" |
| 56 | ) |
| 57 | assert "225" in doc, "quorum.py's docstring should cross-reference musehub#225" |
| 58 | # musehub#225 resolved the open question quorum.py's own docstring posed -- |
| 59 | # it must no longer read as an unresolved question. |
| 60 | assert "musehub#225's decision" not in doc |
| 61 | |
| 62 | |
| 63 | def test_graph_package_docstring_does_not_overclaim_quorum() -> None: |
| 64 | """The package docstring listed "quorum soundness" as a current offering |
| 65 | of the graph package -- misleading now that it's documented as deferred, |
| 66 | unwired infrastructure rather than an active capability.""" |
| 67 | import musehub.graph as graph_pkg |
| 68 | |
| 69 | doc = graph_pkg.__doc__ or "" |
| 70 | assert "quorum soundness" not in doc.lower() |
File History
1 commit
sha256:fe2f636a9c2a691f1ad846907a1829c1d2ae71327ac2c2e0141089c1afe8cf3a
fix: correct IdentityGraphService/QuorumEngine docstrings (…
Sonnet 5
minor
⚠
2 days ago