PLAN-68: Implement shorthand disambiguation standard, hs-shorthand-lint, pre-commit gate, and core comment/UI migration
This commit is contained in:
1 parent
32cd771707
commit
9378c594f9
15 files changed
+301
-94
No files matched your search
@@ -213,7 +213,7 @@ def run_public_regression_suite(
|
||||
regressions: list[str] = []
|
||||
gate_results: dict[str, bool] = {}
|
||||
|
||||
# Gate P1: API & MCP Liveness (502 / 5xx Detector)
|
||||
# Gate SMOKE-GATE-P01.STATIC_ROUTES: API & MCP Liveness (502 / 5xx Detector)
|
||||
p1_ok = True
|
||||
api_probes = (
|
||||
"/status",
|
||||
@@ -252,7 +252,7 @@ def run_public_regression_suite(
|
||||
regressions.append(f"Gate P1: GET {mcp_ep} returned HTTP {mcp_code}")
|
||||
gate_results["P1_api_and_mcp_liveness_zero_502"] = p1_ok
|
||||
|
||||
# Gate P2: Internal-vs-External Version & CIDv1 Drift
|
||||
# Gate SMOKE-GATE-P02.VERSION_CID_DRIFT: Internal-vs-External Version & CIDv1 Drift
|
||||
p2_ok = True
|
||||
st_obj = (api_responses.get("/status") or {}).get("data") or {}
|
||||
live_ver = st_obj.get("version")
|
||||
@@ -277,7 +277,7 @@ def run_public_regression_suite(
|
||||
regressions.append(f"Gate P2: {art_route} CIDv1 {live_cid!r} != baseline {exp_cid!r}")
|
||||
gate_results["P2_version_and_cidv1_parity"] = p2_ok
|
||||
|
||||
# Gate P3: Zero-Synthetic-Data & Canary Invariant Audit
|
||||
# Gate SMOKE-GATE-P03.ZERO_SYNTHETIC: Zero-Synthetic-Data & Canary Invariant Audit
|
||||
p3_ok = True
|
||||
nvda_qts = ((api_responses.get("/quant/timeseries?symbol=NVDA") or {}).get("data") or {}).get("instruments") or []
|
||||
if nvda_qts:
|
||||
@@ -304,7 +304,7 @@ def run_public_regression_suite(
|
||||
regressions.append("Gate P3: hs_generate_ticker_stats_card did not return valid PNG magic bytes")
|
||||
gate_results["P3_zero_synthetic_and_canary_invariants"] = p3_ok
|
||||
|
||||
# Gate P4: Web-Linked PDF Stylistic Refresh & SHA-256 Parity
|
||||
# Gate SMOKE-GATE-P04.PDF_PARITY: Web-Linked PDF Stylistic Refresh & SHA-256 Parity
|
||||
p4_ok = True
|
||||
for pdf_route, pdf_meta in baseline["expected_web_pdfs"].items():
|
||||
p_code, p_bytes = _http_fetch(f"{base}{pdf_route}")
|
||||
@@ -319,7 +319,7 @@ def run_public_regression_suite(
|
||||
regressions.append(f"Gate P4: {pdf_route} SHA-256 {live_sha[:12]} != baseline {pdf_meta['sha256'][:12]} (un-refreshed PDF!)")
|
||||
gate_results["P4_web_pdf_dark_mode_and_sha256_parity"] = p4_ok
|
||||
|
||||
# Gate P5: Deep-Link & Citation Target Resolution
|
||||
# Gate SMOKE-GATE-P05.DEEP_LINKS: Deep-Link & Citation Target Resolution
|
||||
p5_ok = True
|
||||
if nvda_qts:
|
||||
drefs = nvda_qts[0].get("doc_references") or {}
|
||||
@@ -332,7 +332,7 @@ def run_public_regression_suite(
|
||||
regressions.append(f"Gate P5: Deep link {rlk} returned HTTP {rc}")
|
||||
gate_results["P5_deep_link_resolution"] = p5_ok
|
||||
|
||||
# Gate P6: HTML / CSS Visual & Content Regression
|
||||
# Gate SMOKE-GATE-P06.NAV_STYLE_PARITY: HTML / CSS Visual & Content Regression
|
||||
p6_ok = True
|
||||
for h_route, h_meta in baseline["expected_html_surfaces"].items():
|
||||
hc, h_bytes = _http_fetch(f"{base}{h_route}")
|
||||
@@ -384,7 +384,7 @@ def verify_ui_style_and_navigation_consistency(workspace_root: str | Path | None
|
||||
chamfer_css_p = core / "site" / "assets" / "hs-group3-basalt-chamfer.css"
|
||||
chamfer_css = chamfer_css_p.read_text(encoding="utf-8") if chamfer_css_p.is_file() else ""
|
||||
|
||||
# Gate S1: Zero Spurious rgb(30, 41, 59) / #1e293b Background Invariant on Subpages & Group 3 CSS
|
||||
# Gate STYLE-GATE-S01.NO_SLATE_BG: Zero Spurious rgb(30, 41, 59) / #1e293b Background Invariant on Subpages & Group 3 CSS
|
||||
if re.search(r"#1e293b|rgb\(\s*30\s*,\s*41\s*,\s*59\s*\)", chamfer_css, flags=re.I):
|
||||
errors.append("Gate S1: Forbidden #1e293b / rgb(30, 41, 59) found in hs-group3-basalt-chamfer.css")
|
||||
|
||||
@@ -422,7 +422,7 @@ def verify_ui_style_and_navigation_consistency(workspace_root: str | Path | None
|
||||
):
|
||||
errors.append("Gate S1/S3: .hs-nav-btn in calc/styles.css contains #1e293b or !important color/border overrides")
|
||||
|
||||
# Gate S2: Intra-Page Font-Family Uniformity Invariant
|
||||
# Gate STYLE-GATE-S02.DEJAVU_FONT: Intra-Page Font-Family Uniformity Invariant
|
||||
if "--font-mono:" not in chamfer_css or "button," not in chamfer_css or "select," not in chamfer_css:
|
||||
errors.append("Gate S2: hs-group3-basalt-chamfer.css missing --font-mono inheritance on button/input/select/textarea")
|
||||
for sname in ("graph", "quant", "learn", "engineering_hub", "engineering_e1", "math_hub", "math_m1", "donate", "gallery"):
|
||||
@@ -432,7 +432,7 @@ def verify_ui_style_and_navigation_consistency(workspace_root: str | Path | None
|
||||
if sname == "graph" and "font-family: monospace;" in stxt:
|
||||
errors.append(f"Gate S2: Bare 'font-family: monospace;' without --font-mono found in /graph/")
|
||||
|
||||
# Gate S3: Cross-Page Navigation UI & Header Style Parity Invariant
|
||||
# Gate STYLE-GATE-S03.HEADER_PARITY: Cross-Page Navigation UI & Header Style Parity Invariant
|
||||
home_txt = (core / "site" / "index.html").read_text(encoding="utf-8")
|
||||
if '<div class="meta-badges">' not in home_txt:
|
||||
errors.append("Gate S3: Homepage site/index.html <div class=\"meta-badges\"> was modified!")
|
||||
@@ -452,7 +452,7 @@ def verify_ui_style_and_navigation_consistency(workspace_root: str | Path | None
|
||||
if any(pos == -1 for pos in positions) or positions != sorted(positions):
|
||||
errors.append(f"Gate S3: Canonical navigation link order mismatch in {sname}: {positions}")
|
||||
|
||||
# Gate S4 (Plan #66): Adaptive Mobile Device Detection & Mobile UI Ergonomics (Strategies 1A, 2A, 3A, 4A)
|
||||
# Gate STYLE-GATE-S04.MOBILE_UI (Plan #66): Adaptive Mobile Device Detection & Mobile UI Ergonomics (Strategies 1A, 2A, 3A, 4A)
|
||||
mob_js_p = core / "site" / "assets" / "hs-mobile-ui.js"
|
||||
if not mob_js_p.is_file():
|
||||
errors.append("Gate S4: Missing site/assets/hs-mobile-ui.js")
|
||||
|
||||
Reference in new issue
Block a user