mvp-ai's picture
download
raw
10.3 kB
from __future__ import annotations
import hashlib
import re
import struct
import unittest
import urllib.parse
from pathlib import Path
class CurrentDocumentationTests(unittest.TestCase):
ROOT = Path(__file__).resolve().parents[1]
CURRENT_SURFACES = (
"README.md",
"README.zh-CN.md",
"CONTRIBUTING.md",
"ROADMAP.md",
"docs/QUICKSTART.md",
"docs/FAQ.md",
"docs/WEBSITE-LAUNCH-COPY.md",
"docs/alpha-tester-guide.md",
"docs/architecture.md",
"docs/codex-setup.md",
"docs/error-codes.md",
"docs/external-alpha-checklist.md",
"docs/hosted-mcp.md",
"docs/openai-plugin-submission.md",
"docs/security-and-privacy.md",
)
def test_current_surfaces_do_not_restore_pre_v030_counts_or_broken_url(self) -> None:
forbidden = (
re.compile(r"\bsix read-only (?:MCP )?tools\b", re.IGNORECASE),
re.compile(r"\bsix-tool (?:product|live|Codex|surface)\b", re.IGNORECASE),
re.compile(r"\bthree reusable Skills\b", re.IGNORECASE),
re.compile(r"\bprivate-alpha capable\b", re.IGNORECASE),
re.compile(r"六个只读工具"),
re.compile(r"https://useaistation\.com/githubai/terms/"),
)
failures: list[str] = []
for relative in self.CURRENT_SURFACES:
content = (self.ROOT / relative).read_text(encoding="utf-8")
for pattern in forbidden:
if pattern.search(content):
failures.append(f"{relative}: {pattern.pattern}")
self.assertEqual(failures, [])
def test_quickstart_covers_current_install_paths(self) -> None:
content = (self.ROOT / "docs/QUICKSTART.md").read_text(encoding="utf-8")
self.assertIn("https://mcp.aiworkstation.cn/mcp", content)
self.assertIn("Authentication: No Authentication", content)
self.assertIn("aiworkstation-open-source-intelligence[mcp]==0.3.3", content)
self.assertIn("codex plugin marketplace add", content)
self.assertIn("get_radar_overview", content)
self.assertIn("browse_radar_projects", content)
self.assertIn("browse_radar_skills", content)
self.assertIn("single install includes both", content)
self.assertIn("--ref v0.3.3", content)
def test_current_package_documents_one_install_without_rewriting_v030(self) -> None:
manifest = (self.ROOT / ".codex-plugin" / "plugin.json").read_text(encoding="utf-8")
packaging = (self.ROOT / "docs/plugin-packaging.md").read_text(encoding="utf-8")
self.assertIn('"mcpServers": "./.mcp.json"', manifest)
self.assertIn("hosted_mcp_config_bundled=true", packaging)
self.assertIn("agents/openai.yaml", packaging)
self.assertIn("v0.3.0", packaging)
self.assertIn("immutable", packaging)
def test_current_docs_distinguish_hosted_runtime_from_directory_approval(self) -> None:
faq = (self.ROOT / "docs/FAQ.md").read_text(encoding="utf-8")
submission = (self.ROOT / "docs/openai-plugin-submission.md").read_text(encoding="utf-8")
self.assertIn("Yes. `v0.3.3` is deployed", faq)
self.assertIn("not yet submitted or approved", submission)
def test_submission_pack_tracks_current_official_skill_and_review_contract(self) -> None:
submission = (self.ROOT / "docs/openai-plugin-submission.md").read_text(
encoding="utf-8"
)
for expected in (
"rechecked on 2026-08-28",
"api.apps.write",
"api.apps.read",
"global data residency",
"agents/openai.yaml",
"readOnlyHint=true",
"destructiveHint=false",
"idempotentHint=true",
"openWorldHint=true",
"do not upload UI screenshots",
"Simplified Chinese",
"Scan Tools",
):
self.assertIn(expected, submission)
def test_bilingual_readmes_use_dated_production_radar_screenshots(self) -> None:
expected = {
"radar-home-en.png": "61f2687d464c2bab02c7d8aa15cdbef4ae1cee255f4785daaa5a7fb093f8ff9a",
"radar-home-zh.png": "1fba8080aac6671a896b469f1ee071fc8ea6a5ae0479bce58c6e91f510ba61bd",
}
readmes = {
"README.md": ("assets/radar-home-en.png", "captured 2026-08-29"),
"README.zh-CN.md": ("assets/radar-home-zh.png", "实拍于 2026-08-29"),
}
for relative, (asset, dated_copy) in readmes.items():
content = (self.ROOT / relative).read_text(encoding="utf-8")
self.assertIn(asset, content)
self.assertIn(dated_copy, content)
for filename, sha256 in expected.items():
data = (self.ROOT / "assets" / filename).read_bytes()
self.assertTrue(data.startswith(b"\x89PNG\r\n\x1a\n"))
self.assertEqual(struct.unpack(">II", data[16:24]), (1280, 640))
self.assertEqual(hashlib.sha256(data).hexdigest(), sha256)
def test_publishing_history_uses_exact_production_identity_and_ci_matrix(self) -> None:
publishing = (self.ROOT / "docs/GITHUB-PUBLISHING.md").read_text(encoding="utf-8")
self.assertIn("Commit: 7b92e463a1da567afd5d1310601afdf1c6674646", publishing)
self.assertIn("490c8ee85cb3cd00dbd1ad9644b2e8e3bff358cd", publishing)
self.assertIn("c2786c4e58ffd391b8424d0ad67987d7c2ffe564", publishing)
self.assertIn(
"sha256:6b1d3244d0040f51c4089371e1b00bb6ef0c0418ba3792b5517fb085c4381e48",
publishing,
)
self.assertIn("CI 3.10/3.11/3.12 green", publishing)
def test_hosted_privacy_copy_states_actual_logging_and_deletion_boundary(self) -> None:
privacy = (self.ROOT / "PRIVACY.md").read_text(encoding="utf-8")
self.assertIn("omits IP", privacy)
self.assertIn("rotate daily and retain 14 rotations", privacy)
self.assertIn("five 10 MiB", privacy)
self.assertIn("privacy or deletion request", privacy)
def test_monitoring_baseline_is_identity_bound_and_does_not_overclaim(self) -> None:
baseline = (self.ROOT / "docs/production-monitoring-baseline.md").read_text(
encoding="utf-8"
)
self.assertIn("7b92e463a1da567afd5d1310601afdf1c6674646", baseline)
self.assertIn(
"sha256:ca97a9192fa0b6bdd9b62628acc48c74f7cb6b127ef88fcbacaaa6e6f5aed849",
baseline,
)
self.assertIn("HTTP 429: 0", baseline)
self.assertIn("HTTP 5xx: 0", baseline)
self.assertIn("availability objective", baseline)
self.assertIn("real-user traffic", baseline)
self.assertIn("max-size 10m, max-file 5", baseline)
self.assertIn("5/5` in English and `5/5` in", baseline)
self.assertIn("Assign a named incident and rollback owner", baseline)
def test_release_docs_bind_pr26_milestone_to_exact_published_identity(self) -> None:
checklist = (self.ROOT / "docs/external-alpha-checklist.md").read_text(
encoding="utf-8"
)
self.assertIn("6f53bb68536add061afde8ccd8ee5b7b1eb31671", checklist)
self.assertIn("c2786c4e58ffd391b8424d0ad67987d7c2ffe564", checklist)
self.assertIn("33198421066", checklist)
self.assertIn("previous `v0.3.2` image is the immediate rollback target", checklist)
self.assertIn("exact released SHA", checklist)
self.assertIn("PUBLIC DIRECTORY SUBMISSION STILL PENDING", checklist)
self.assertNotIn("release/publishing/deployment evidence is complete", checklist)
def test_submission_pack_records_fresh_release_evidence_without_approval_claim(self) -> None:
submission = (self.ROOT / "docs/openai-plugin-submission.md").read_text(
encoding="utf-8"
)
self.assertIn("Current production and release evidence", submission)
self.assertIn("fresh external checks returned `200`", submission)
self.assertIn("workflow `33198421066`", submission)
self.assertIn("not yet submitted or approved", submission)
self.assertIn(
"- [x] Website and Radar URLs pass a fresh unauthenticated external check",
submission,
)
self.assertIn(
"- [x] Hosted MCP passes fresh candidate-bound English and Chinese remote smoke",
submission,
)
def test_website_copy_contains_service_specific_privacy_fields(self) -> None:
website = (self.ROOT / "docs/WEBSITE-LAUNCH-COPY.md").read_text(
encoding="utf-8"
)
for expected in (
"project queries or identifiers",
"does not create a database of MCP inputs or results",
"omits IP address, URI/query",
"rotate daily and retain 14 rotations",
"zxhwolfe@gmail.com",
):
self.assertIn(expected, website)
def test_release_markdown_has_no_broken_relative_links(self) -> None:
markdown_files = [*self.ROOT.glob("*.md"), *self.ROOT.glob("docs/*.md")]
broken: list[str] = []
for path in markdown_files:
content = path.read_text(encoding="utf-8")
for match in re.finditer(r"(?<!!)\[[^\]]*\]\(([^)]+)\)", content):
raw_target = match.group(1).strip()
if raw_target.startswith("<") and raw_target.endswith(">"):
raw_target = raw_target[1:-1]
target = raw_target.split("#", 1)[0].strip()
if not target or re.match(
r"^[a-zA-Z][a-zA-Z0-9+.-]*:", target
):
continue
candidate = (
path.parent / urllib.parse.unquote(target)
).resolve()
try:
candidate.relative_to(self.ROOT)
except ValueError:
broken.append(f"{path.relative_to(self.ROOT)}: escapes root: {target}")
continue
if not candidate.exists():
broken.append(f"{path.relative_to(self.ROOT)}: missing: {target}")
self.assertEqual(broken, [])
if __name__ == "__main__":
unittest.main()

Xet Storage Details

Size:
10.3 kB
·
Xet hash:
318a7c0b13837adee72f6afd4427d3f25e1bcf9ac783abed84a6ebf971839989

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.