From 9378c594f997522a072fc14797e0a93d943d1339 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 2 Dec 2026 08:19:03 +0000 Subject: [PATCH] PLAN-68: Implement shorthand disambiguation standard, hs-shorthand-lint, pre-commit gate, and core comment/UI migration --- README.md | 4 +- docs/SHORTHAND-DISAMBIGUATION-STANDARD.md | 54 ++++ pyproject.toml | 1 + site/assets/hs-matrix-coderain.js | 4 +- site/learn/index.html | 12 +- site/learn/learn-app.js | 2 +- ...TORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.pdf | Bin 94859 -> 94859 bytes .../ci/deploy_scripts_sync.py | 14 +- .../ci/public_regression.py | 20 +- src/hyperstitionstud_io/ci/shorthand_lint.py | 259 ++++++++++++++---- src/hyperstitionstud_io/lenses/__init__.py | 12 +- .../publishing/architecture_atlas.py | 2 +- .../publishing/closeups_sync.py | 4 +- .../publishing/readme_sync.py | 3 +- tests/test_core_suite.py | 4 +- 15 files changed, 301 insertions(+), 94 deletions(-) create mode 100644 docs/SHORTHAND-DISAMBIGUATION-STANDARD.md diff --git a/README.md b/README.md index 84a1631..2ccfe77 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)** > - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots → [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/) -> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 19 tracked module/artifact surface(s) -> - **Touched Files / Surfaces:** `deploy/push-all-to-git-libre-audio.sh`, `deploy/sync-vps-repos.sh`, `package.json`, `packages-js/ciphers-aq/package.json`, `pyproject.toml`, `scripts/build_gallery_manifest.py`, `site/donate/index.html`, `site/gallery/index.html` (+11 more) +> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 14 tracked module/artifact surface(s) +> - **Touched Files / Surfaces:** `docs/SHORTHAND-DISAMBIGUATION-STANDARD.md`, `pyproject.toml`, `site/assets/hs-matrix-coderain.js`, `site/learn/index.html`, `site/learn/learn-app.js`, `site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.pdf`, `src/hyperstitionstud_io/ci/deploy_scripts_sync.py`, `src/hyperstitionstud_io/ci/public_regression.py` (+6 more) > - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data diff --git a/docs/SHORTHAND-DISAMBIGUATION-STANDARD.md b/docs/SHORTHAND-DISAMBIGUATION-STANDARD.md new file mode 100644 index 0000000..e3e239c --- /dev/null +++ b/docs/SHORTHAND-DISAMBIGUATION-STANDARD.md @@ -0,0 +1,54 @@ +# Global `[A-Z][0-9]` Shorthand Disambiguation Standard (`.`) + +**Document ID:** `SHORTHAND-DISAMBIGUATION-STANDARD` +**Plan Reference:** `PLAN-HUMAN-TEXT-AND-COMMENT-SHORTHAND-DISAMBIGUATION` (`Plan #68`) +**Scope:** All human-read documentation (`README.md`, `docs/*.md`, plans, manuals, encyclopedias), non-executable source comments (`#`, `//`, `/* ... */`, ``), and web UI prose across all `6` `hyperstitionstud.io` repositories. + +--- + +## 1. Global Executable Code Exemption & `ast.dump` Invariance + +Executable code is **globally exempt** so software functionality is 100% unimpacted: +- **Never alter:** variable/function/class/constant names, imports, expressions, control flow, CLI flags, HTTP routes, JSON/TOML keys, schema enums, CSS selectors/classes, HTML element IDs, regexes, or runtime-asserted strings. +- **`ast.dump` Parity Guarantee:** Any `.py` file modified for shorthand disambiguation must only alter `#` comment tokens and must satisfy `ast.dump(ast.parse(before)) == ast.dump(ast.parse(after))`. +- **DOM/CSS Safety:** HTML/CSS anchors remain lowercase hyphenated (`#g01-quant`, `#unit-e03-quant-brief`) so `.` never breaks CSS selectors. +- **Locked JSON Keys:** When referencing SHA-256-locked JSON keys (`ReadOnlyIsolationGuard` in `taxonomy/glossary-registry.json` and `encyclopedia/encyclopedia-manifest.json`), use disambiguated canonical tags in prose without altering JSON keys or locked digests. + +--- + +## 2. Canonical Disambiguation Table (`.`) + +| Subsystem / Category | Legacy Bare Form | Canonical Disambiguated Form (`.`) | +| :--- | :--- | :--- | +| **Architecture Atlas Tool Groups** | `G1..G8` | `G01.QUANT`, `G02.CALC_CI`, `G03.GRAPH`, `G04.ZOOLOGY`, `G05.ARCHIVE`, `G06.ENG_MATH`, `G07.PORTAL_LEARN`, `G08.MCP_DEPLOY` | +| **Orthographic Generations** | `G0`, `G1` | `GEN-00.ENGLISH`, `GEN-01.INGGLISH` | +| **Cipher & Phonemic Rules / Vectors** | `G1..G6` | `RULE-G01.COLLAPSE`, `RULE-G02.CROSS_GEN_TWIN`, `RULE-G03.STRUCTURAL`, `RULE-G04.ISOMETRIC`, `RULE-G05.TWIN_PRIME`, `RULE-G06.COMPOSITE` | +| **Engineering Plan Binary Gates** | `G1..G4` | `PLAN-GATE-G01.EXTANT_DATA`, `PLAN-GATE-G02.ZERO_LLM`, `PLAN-GATE-G03.EROFS_SAFE`, `PLAN-GATE-G04.EXPORTABLE` | +| **Deploy Script Gates** | `D1..D8` | `DEPLOY-GATE-D01.MIRROR_PARITY` .. `DEPLOY-GATE-D08.PRE_COMMIT_STAGE` | +| **Public Smoke Gates** | `P1..P6` | `SMOKE-GATE-P01.STATIC_ROUTES` .. `SMOKE-GATE-P06.NAV_STYLE_PARITY` | +| **Style & Mobile Regression Gates** | `S1..S4` | `STYLE-GATE-S01.NO_SLATE_BG`, `STYLE-GATE-S02.DEJAVU_FONT`, `STYLE-GATE-S03.HEADER_PARITY`, `STYLE-GATE-S04.MOBILE_UI` | +| **Engineering Hub Units** | `E0..E5` | `UNIT-E00.HUB`, `UNIT-E01.CIPHERS`, `UNIT-E02.GRAPH_SQLITE`, `UNIT-E03.QUANT_BRIEF`, `UNIT-E04.MCP_REST_IPLD`, `UNIT-E05.CICD_VPS` | +| **Applied Math Hub Units** | `M0..M5` | `UNIT-M00.HUB`, `UNIT-M01.BASE36_AQ`, `UNIT-M02.PHONETICS_ENTROPY`, `UNIT-M03.GRAPH_SPECTRAL`, `UNIT-M04.Z_CALCULUS`, `UNIT-M05.MACRO_BAYESIAN` | +| **`/learn/` Track Folios** | `M01..M06` | `LEARN-M01.CABBALA`, `LEARN-M02.PARASITE`, `LEARN-M03.SERIES`, `LEARN-M04.STRATA`, `LEARN-M05.RHIZOME`, `LEARN-M06.GEOMANCY` | +| **Singularity Classes** | `S1..S6` | `CLASS-S01.SILICON`, `CLASS-S02.TEMPLEX`, `CLASS-S03.WAR_MACHINE`, `CLASS-S04.CARRIER_WAVE`, `CLASS-S05.BWO`, `CLASS-S06.AGI` | +| **Memetic Superclasses** | `M1..M7+` | `CLASS-M01.ENTROPIC`, `CLASS-M02.KINETIC`, `CLASS-M03.LEVIATHAN`, `CLASS-M04.MIMETIC`, `CLASS-M05.ORACLE`, `CLASS-M06.ABYSSAL`, `CLASS-M07.HYPERSTITIONAL` | +| **Confluence Dose & Regimes** | `D0..D4`, `R1..R3` | `DOSE-D00.NONE` .. `DOSE-D04.FULL_LOCK`; `REGIME-R01.BULL`, `REGIME-R02.PINNED_ISOMETRIC`, `REGIME-R03.TAIL_DRAWDOWN` | +| **Polyglot Sandbox Security Rings** | `R1..R4` | `RING-R01.AST_WHITELIST`, `RING-R02.ZERO_EVAL`, `RING-R03.BOUNDED_FUEL`, `RING-R04.PURE_SUBSET` | +| **Ingglish AQ Curve Grading** | `D1..D5` | `CURVE-D01.LINEAR`, `CURVE-D02.LOG_COMPRESSION`, `CURVE-D03.QUANTILE`, `CURVE-D04.SIGMOID`, `CURVE-D05.HYBRID_ZSCORE` | + +--- + +## 3. Explicit Non-Shorthand Allowlist + +The following tokens are standard technical/domain identifiers and are explicitly exempt from disambiguation: +- HTTP / Protocol / Runtime: `H1`, `H2`, `H3`, `V8` (Yahoo Finance v8 API) +- Monetary Aggregates: `M1`, `M2` (when referring to FRED `M1`/`M2` money supply) +- Statistical Percentiles: `P20`, `P50`, `P90` +- Harvest Keys & Encodings: `H01..H39`, `UTF-8`, `CIDv1`, `SHA-256`, `EUV`, `AI` + +--- + +## 4. Automated Verification (`hs-shorthand-lint`) + +- **Full 6-Repo Audit:** `hs-shorthand-lint` (or `python3 -m hyperstitionstud_io.ci.shorthand_lint --check-all`) +- **Pre-Commit Staged Gate:** `python3 -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo ` (wired into `.git/hooks/pre-commit` across all `6` repositories via `hs-readme-sync --install-hooks`). diff --git a/pyproject.toml b/pyproject.toml index e167cc7..cddfb31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ hs-readme-sync = "hyperstitionstud_io.publishing.readme_sync:main" hs-closeups-sync = "hyperstitionstud_io.publishing.closeups_sync:main" hs-quant-voice-build = "hyperstitionstud_io.publishing.quant_voice:main" hs-deploy-scripts-sync = "hyperstitionstud_io.ci.deploy_scripts_sync:main" +hs-shorthand-lint = "hyperstitionstud_io.ci.shorthand_lint:main" [tool.setuptools.packages.find] where = ["src"] diff --git a/site/assets/hs-matrix-coderain.js b/site/assets/hs-matrix-coderain.js index abf4ef2..78ae721 100644 --- a/site/assets/hs-matrix-coderain.js +++ b/site/assets/hs-matrix-coderain.js @@ -27,9 +27,9 @@ "\u2644", // ♄ Saturn (Chronos / Time-Series & Cold Archive) "\u269A", // ⚚ Staff of Hermes (MCP / REST Conduit) "\u269B", // ⚛ Cybernetic Kernel (Wiener Feedback / EROFS) - "\u25C8", // ◈ Isometric Lattice Node (G4 Fixed Point) + "\u25C8", // ◈ Isometric Lattice Node (RULE-G04.ISOMETRIC Fixed Point) "\u2206", // ∆ Alchemical / Variance-Collapse Delta - "\u2297", // ⊗ Double Articulation (S x S6) + "\u2297", // ⊗ Double Articulation (CLASS-S01.SILICON..CLASS-S05.BWO x CLASS-S06.AGI) "\u03BB", // λ Church / Z-Combinator Lambda "\u03A6", // Φ Phonemic Projection "\u03A9", // Ω Terminal Attractor diff --git a/site/learn/index.html b/site/learn/index.html index ca81368..b5b9abd 100644 --- a/site/learn/index.html +++ b/site/learn/index.html @@ -259,7 +259,7 @@
- +
@@ -280,7 +280,7 @@
- +
@@ -311,7 +311,7 @@
- +
@@ -339,7 +339,7 @@
- +
@@ -363,7 +363,7 @@
- +
@@ -391,7 +391,7 @@
- +
diff --git a/site/learn/learn-app.js b/site/learn/learn-app.js index bdc2726..7cca9b3 100644 --- a/site/learn/learn-app.js +++ b/site/learn/learn-app.js @@ -2,7 +2,7 @@ * /workspace/hyperstitionstudio-core/site/learn/learn-app.js * Self-Paced 6-Module Interactive Onboarding Track & Anonymous Local State Engine (v2.0.0) * Supports: - * - 6 interactive micro-sandboxes (M01..M06) + * - 6 interactive micro-sandboxes (LEARN-M01.CABBALA..LEARN-M06.GEOMANCY) * - Automatic localStorage checkpointing ("hs_learn_state_v2") * - State Download (.json) with canonical IPLD dag-json (0x0129) SHA-256 & CIDv1 ("baguqeera...") * - State Upload (.json) via file picker & drag-and-drop with Replace/Merge modes & zero-XSS rendering diff --git a/site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.pdf b/site/quant/OPERATORS-MANUAL-QUANT-TIMESERIES-WORKBENCH.pdf index 3b747578e3cc7c1b517d31647c35697f71bb90d6..614e674883cd5d2d6fbaf89359dbd229ed8123a2 100644 GIT binary patch delta 106 zcmeBv%G&*uwP6e6esfj}LvsU*=|{{N-5|{E{1%J{ES)S8Ez>MbP0dX#ElrbBl8lVf c43kq56O+@DOpVP' not in home_txt: errors.append("Gate S3: Homepage site/index.html
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") diff --git a/src/hyperstitionstud_io/ci/shorthand_lint.py b/src/hyperstitionstud_io/ci/shorthand_lint.py index 02ce8ab..71c99af 100644 --- a/src/hyperstitionstud_io/ci/shorthand_lint.py +++ b/src/hyperstitionstud_io/ci/shorthand_lint.py @@ -6,25 +6,32 @@ Enforces Plan #68: Human-Read Text & Comment Shorthand Disambiguation (< with strict global exemption for executable code, strings, tests, and runtime data structures. """ -import sys +from __future__ import annotations + +import argparse +import io import os import re +import subprocess +import sys import tokenize -import io from pathlib import Path -from typing import List, Tuple, Dict, Any +from typing import List, Tuple CANONICAL_ALLOWLIST = { - "HTTP", "HTTPS", "API", "REST", "JSON", "MCP", "TCP", "UDP", "SSH", "HTML", "CSS", "SVG", "URL", "URI", - "SHA", "CID", "CPU", "RAM", "SSD", "RPM", "CLI", "UI", "UX", "EOF", "UTF", "AI", "EUV", "FRED", "USD", "BPS", - "H1", "H2", "H3", "V8", "M1", "M2", "P20", "P50", "P90" + "H1", "H2", "H3", "V8", "M1", "M2", "P20", "P50", "P90", + "H01", "H02", "H03", "H04", "H05", "H06", "H07", "H08", "H09", } -# Regex for un-disambiguated bare shorthands like G1..G8, M0..M7, S1..S7, E0..E5, D0..D8, P1..P6, R1..R6 +# Regex for un-disambiguated bare shorthands (bare [GDMESPR][0-9]{1,2} tokens without a . qualifier) BARE_SHORTHAND_PATTERN = re.compile(r"\b([GDMESPR])([0-9]{1,2})\b") +DATA_URI_BASE64_RE = re.compile(r"data:image/[a-zA-Z0-9+.-]+;base64,[A-Za-z0-9+/=]+") +MD_LINK_URL_RE = re.compile(r"\]\([^)]*\)") +SUPPORTED_EXTS = {".py", ".md", ".js", ".mjs", ".ts", ".css", ".html", ".svg", ".sh", ".toml", ".yaml", ".yml"} + def extract_python_comments(source_code: str) -> List[Tuple[int, str]]: - comments = [] + comments: List[Tuple[int, str]] = [] try: tokens = tokenize.generate_tokens(io.StringIO(source_code).readline) for tok in tokens: @@ -34,43 +41,139 @@ def extract_python_comments(source_code: str) -> List[Tuple[int, str]]: pass return comments + def extract_markdown_prose_lines(markdown_text: str) -> List[Tuple[int, str]]: lines = markdown_text.splitlines() - prose_lines = [] + prose_lines: List[Tuple[int, str]] = [] in_fence = False for idx, line in enumerate(lines, start=1): stripped = line.strip() - if stripped.startswith("```"): + if stripped.startswith("```") or stripped.startswith("~~~"): in_fence = not in_fence continue if in_fence: continue - # Remove inline backtick code spans + # Remove inline backtick code spans and markdown link target URLs clean_line = re.sub(r"`[^`]*`", "", line) + clean_line = MD_LINK_URL_RE.sub("]()", clean_line) prose_lines.append((idx, clean_line)) return prose_lines + +def extract_sh_comments(text: str) -> List[Tuple[int, str]]: + comments: List[Tuple[int, str]] = [] + for idx, line in enumerate(text.splitlines(), start=1): + in_sq = False + in_dq = False + esc = False + for i, ch in enumerate(line): + if esc: + esc = False + continue + if ch == "\\" and not in_sq: + esc = True + continue + if ch == "'" and not in_dq: + in_sq = not in_sq + elif ch == '"' and not in_sq: + in_dq = not in_dq + elif ch == "#" and not in_sq and not in_dq: + if i == 0 or line[i - 1].isspace(): + comments.append((idx, line[i:])) + break + return comments + + def extract_js_css_comments(text: str) -> List[Tuple[int, str]]: - # Extracts // ... and /* ... */ and - lines = text.splitlines() - extracted = [] - in_block = False - for idx, line in enumerate(lines, start=1): - stripped = line.strip() - if "/*" in stripped: - in_block = True - if "*/" in stripped: - in_block = False + """Extract // and /* ... */ comments while skipping string/template literals.""" + comments: List[Tuple[int, str]] = [] + i = 0 + n = len(text) + line = 1 + in_sq = False + in_dq = False + in_bt = False + while i < n: + ch = text[i] + if ch == "\n": + line += 1 + i += 1 continue - if in_block: - extracted.append((idx, line)) + if in_sq: + if ch == "\\" and i + 1 < n: + i += 2 + continue + if ch == "'": + in_sq = False + i += 1 continue - if stripped.startswith("//") or stripped.startswith("", idx + 4) + if end == -1: + comments.append((line, text[idx:])) + break + block = text[idx : end + 3] + comments.append((line, block)) + line += block.count("\n") + i = end + 3 + return comments + def scan_file_for_bare_shorthands(file_path: Path) -> List[str]: - violations = [] + violations: List[str] = [] try: content = file_path.read_text(encoding="utf-8", errors="ignore") except Exception: @@ -83,56 +186,104 @@ def scan_file_for_bare_shorthands(file_path: Path) -> List[str]: target_lines = extract_python_comments(content) elif suffix == ".md": target_lines = extract_markdown_prose_lines(content) - elif suffix in (".js", ".mjs", ".ts", ".css", ".html", ".sh"): + elif suffix in (".sh", ".toml", ".yaml", ".yml"): + target_lines = extract_sh_comments(content) + elif suffix in (".js", ".mjs", ".ts", ".css"): target_lines = extract_js_css_comments(content) + elif suffix in (".html", ".svg"): + target_lines = extract_html_comments(content) else: - # Default text/doc scan outside code blocks - for idx, line in enumerate(content.splitlines(), start=1): - target_lines.append((idx, line)) + return violations for lineno, text in target_lines: - for match in BARE_SHORTHAND_PATTERN.finditer(text): + clean_text = DATA_URI_BASE64_RE.sub("", text) + for match in BARE_SHORTHAND_PATTERN.finditer(clean_text): token = match.group(0) if token in CANONICAL_ALLOWLIST: continue # Check if immediately followed by a domain tag like .QUANT, .ENTROPIC, etc. start_pos = match.end() - if start_pos < len(text) and text[start_pos] == ".": - # Has a domain tag extension, check if it forms a canonical tag + if start_pos < len(clean_text) and clean_text[start_pos] == ".": continue - violations.append(f"{file_path}:{lineno}: Bare shorthand '{token}' detected without canonical . domain tag.") + violations.append( + f"{file_path}:{lineno}: Bare shorthand '{token}' detected without canonical . domain tag." + ) return violations -def main() -> int: - workspace_root = Path(os.environ.get("WORKSPACE_DIR", "/workspace")) - repos = [ - "hyperstitionstudio-core", - "ingglish-hyperdope-gematria", - "technocapital-singularity-zoology", - "encyclopedia-knowledge-graph", - "haiperdohp-jemaytreeah", - "hyperdope-ci-build" - ] - all_violations = [] - for r in repos: - rdir = workspace_root / r - if not rdir.is_dir(): + +def _staged_files_for_repo(repo_dir: Path) -> List[Path]: + res = subprocess.run( + ["git", "-C", str(repo_dir), "diff", "--cached", "--name-only", "--diff-filter=ACM"], + capture_output=True, + text=True, + check=False, + ) + if res.returncode != 0: + return [] + files: List[Path] = [] + for rel in res.stdout.splitlines(): + rel_s = rel.strip() + if not rel_s: continue - for p in rdir.rglob("*"): + p = repo_dir / rel_s + if p.is_file() and p.suffix.lower() in SUPPORTED_EXTS: + files.append(p) + return files + + +def main(argv: list[str] | None = None) -> int: + ap = argparse.ArgumentParser( + prog="hs-shorthand-lint", + description="Tokenizer-based shorthand disambiguation linter (Plan #68).", + ) + ap.add_argument("--check-all", action="store_true", help="Scan all 6 repositories (default).") + ap.add_argument("--staged-diff", action="store_true", help="Scan only git-staged files in --repo.") + ap.add_argument("--repo", default=None, help="Repository path to scan.") + args = ap.parse_args(argv) + + workspace_root = Path(os.environ.get("WORKSPACE_DIR", "/workspace")) + all_violations: List[str] = [] + + if args.staged_diff: + repo_dir = Path(args.repo).resolve() if args.repo else Path.cwd() + for p in _staged_files_for_repo(repo_dir): + all_violations.extend(scan_file_for_bare_shorthands(p)) + elif args.repo: + rdir = Path(args.repo).resolve() + if not rdir.is_dir(): + rdir = workspace_root / args.repo + for p in sorted(rdir.rglob("*")): if p.is_file() and not any(part.startswith(".") or part in ("node_modules", ".venv", "__pycache__") for part in p.parts): - if p.suffix.lower() in (".py", ".md", ".js", ".ts", ".css", ".html", ".sh"): - v = scan_file_for_bare_shorthands(p) - all_violations.extend(v) + if p.suffix.lower() in SUPPORTED_EXTS: + all_violations.extend(scan_file_for_bare_shorthands(p)) + else: + repos = [ + "hyperstitionstudio-core", + "ingglish-hyperdope-gematria", + "technocapital-singularity-zoology", + "encyclopedia-knowledge-graph", + "haiperdohp-jemaytreeah", + "hyperdope-ci-build", + ] + for r in repos: + rdir = workspace_root / r + if not rdir.is_dir(): + continue + for p in sorted(rdir.rglob("*")): + if p.is_file() and not any(part.startswith(".") or part in ("node_modules", ".venv", "__pycache__") for part in p.parts): + if p.suffix.lower() in SUPPORTED_EXTS: + all_violations.extend(scan_file_for_bare_shorthands(p)) if all_violations: print(f"[ERROR] Shorthand linting found {len(all_violations)} bare shorthand violation(s) (Plan #68):", file=sys.stderr) for vio in all_violations[:50]: print(f" - {vio}", file=sys.stderr) return 1 - + print("[OK] Shorthand linting passed with 0 violations across all repositories.") return 0 + if __name__ == "__main__": sys.exit(main()) diff --git a/src/hyperstitionstud_io/lenses/__init__.py b/src/hyperstitionstud_io/lenses/__init__.py index 7100fd5..88d8a07 100644 --- a/src/hyperstitionstud_io/lenses/__init__.py +++ b/src/hyperstitionstud_io/lenses/__init__.py @@ -23,11 +23,11 @@ ENABLED_LENSES: tuple[str, ...] = ( # 12 Canonical Lens-Neutral Mathematical Keys: # Structural Combine (6): -# 1. struct_isometric_armor (G4 Isometric Chokepoint Ratio, 0-100) -# 2. struct_drift_velocity (G3 Inverse Phonemic Drift & Quantized Steps, 0-100) -# 3. struct_variance_collapse (G1 Log Gen 0 -> Gen 1 Variance Collapse, 0-100) -# 4. struct_trophic_capture (S[1-5]xS6 Double-Articulation & Cross-Guild Degree, 0-100) -# 5. struct_prime_density (G5 Prime & Twin-Prime Mutation Density, 0-100) +# 1. struct_isometric_armor (RULE-G04.ISOMETRIC Chokepoint Ratio, 0-100) +# 2. struct_drift_velocity (RULE-G03.STRUCTURAL Inverse Phonemic Drift & Quantized Steps, 0-100) +# 3. struct_variance_collapse (RULE-G01.COLLAPSE Log GEN-00.ENGLISH -> GEN-01.INGGLISH Variance Collapse, 0-100) +# 4. struct_trophic_capture (CLASS-S01.SILICON..CLASS-S05.BWO x CLASS-S06.AGI Double-Articulation & Cross-Guild Degree, 0-100) +# 5. struct_prime_density (RULE-G05.TWIN_PRIME Mutation Density, 0-100) # 6. struct_repricing_resilience (Tri-Modal Repricing & State-Gate Closure, 0-100) # Longitudinal Time-Series Moments (6): # 7. ts_duty_cycle_pct (Pr[X_t > 0] Active Lock/Wire Duty Cycle %) @@ -35,7 +35,7 @@ ENABLED_LENSES: tuple[str, ...] = ( # 9. ts_excess_over_replacement (Value Over Baseline Tier D Replacement) # 10. ts_quantile_profile ({p20_floor, p90_ceiling, boom_pct, bust_pct, cv}) # 11. ts_optimal_lag_days (Peak Cross-Correlation Lead-Lag tau* in [-5..+5] days) -# 12. ts_regime_splits (Conditional Regime Delta {M1, M2, M3}) +# 12. ts_regime_splits (Conditional Regime Delta {CLASS-M01.ENTROPIC, CLASS-M02.KINETIC, CLASS-M03.LEVIATHAN}) LENS_REGISTRY: dict[str, dict[str, Any]] = { "neutral_math": { diff --git a/src/hyperstitionstud_io/publishing/architecture_atlas.py b/src/hyperstitionstud_io/publishing/architecture_atlas.py index f6dd663..1d88ad3 100644 --- a/src/hyperstitionstud_io/publishing/architecture_atlas.py +++ b/src/hyperstitionstud_io/publishing/architecture_atlas.py @@ -112,7 +112,7 @@ ATLAS_HTML_TEMPLATE = """
- +

G01.QUANT (/quant/)

    diff --git a/src/hyperstitionstud_io/publishing/closeups_sync.py b/src/hyperstitionstud_io/publishing/closeups_sync.py index 6d416fd..17be6a8 100644 --- a/src/hyperstitionstud_io/publishing/closeups_sync.py +++ b/src/hyperstitionstud_io/publishing/closeups_sync.py @@ -907,7 +907,7 @@ def render_all_quadrant_closeups( im.save(out_dir / "quadrant-4-operators-deployment-vps.png", "PNG") tracked_draws["quadrant-4-operators-deployment-vps.png"] = d - # 10. Quadrant 04 Tab 2: Unit E4 MCP, REST & ETag 304 Probe + # 10. Quadrant 04 Tab 2: UNIT-E04.MCP_REST_IPLD MCP, REST & ETag 304 Probe im, d = _new_canvas() _draw_chamfer_box(d, (10, 10, 670, 250), PLATE, BORDER, chamfer=10, pip=ROSE) d.text((24, 18), "STATELESS MCP (/mcp), REST v1 (/api/v1/*) & LIVE ETAG 304 PROBE", font=f_hdr, fill=ROSE) @@ -950,7 +950,7 @@ def render_all_quadrant_closeups( im.save(out_dir / "quadrant-4-tab-2-mcp-etag.png", "PNG") tracked_draws["quadrant-4-tab-2-mcp-etag.png"] = d - # 11. Quadrant 04 Tab 3: /ci/ 4-Gate Pipeline & P1-P6 Smoke + # 11. Quadrant 04 Tab 3: /ci/ 4-Gate Pipeline & SMOKE-GATE-P01.STATIC_ROUTES..SMOKE-GATE-P06.NAV_STYLE_PARITY Smoke im, d = _new_canvas() _draw_chamfer_box(d, (10, 10, 670, 250), PLATE, BORDER, chamfer=10, pip=ROSE) d.text((24, 18), "4-GATE INGGLISH CI PIPELINE (/ci/) & 6-GATE PUBLIC SMOKE SUITE", font=f_hdr, fill=ROSE) diff --git a/src/hyperstitionstud_io/publishing/readme_sync.py b/src/hyperstitionstud_io/publishing/readme_sync.py index bd38e62..41e872b 100644 --- a/src/hyperstitionstud_io/publishing/readme_sync.py +++ b/src/hyperstitionstud_io/publishing/readme_sync.py @@ -514,6 +514,7 @@ if [[ -d "${CORE_SRC}" ]]; then git -C "${REPO_ROOT}" add site/assets/closeups/ fi python3 -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage + python3 -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}" fi """ @@ -559,7 +560,7 @@ def install_git_pre_commit_hooks(ws_root: Path | None = None, check_only: bool = if not hooks_dir.is_dir(): continue for h_name, h_script, markers in ( - ("pre-commit", PRE_COMMIT_HOOK_SCRIPT, ("readme_sync", "closeups_sync", "deploy_scripts_sync")), + ("pre-commit", PRE_COMMIT_HOOK_SCRIPT, ("readme_sync", "closeups_sync", "deploy_scripts_sync", "shorthand_lint")), ("commit-msg", COMMIT_MSG_HOOK_SCRIPT, ("COMMIT-MSG GATE",)), ): hook_path = hooks_dir / h_name diff --git a/tests/test_core_suite.py b/tests/test_core_suite.py index 79c7e11..4a58bb3 100644 --- a/tests/test_core_suite.py +++ b/tests/test_core_suite.py @@ -1334,7 +1334,7 @@ def test_ipld_quant_and_mcp_server() -> None: ): assert ci_prov_mirror.read_text(encoding="utf-8") == ci_prov_txt, f"Out-of-sync ci_provision_ingglish.py mirror: {ci_prov_mirror}" - # Verify Plan #58: Pre-Commit Preparation & Gates D1-D8 for push-all-to-git-libre-audio.sh & deploy/sync-vps-repos.sh + # Verify Plan #58: Pre-Commit Preparation & Gates DEPLOY-GATE-D01.MIRROR_PARITY..DEPLOY-GATE-D08.PRE_COMMIT_STAGE for push-all-to-git-libre-audio.sh & deploy/sync-vps-repos.sh from hyperstitionstud_io.ci.deploy_scripts_sync import prepare_and_verify_deploy_scripts dep_sync = prepare_and_verify_deploy_scripts(workspace_root=cfg.workspace_root, check_only=False) @@ -1383,7 +1383,7 @@ def test_ipld_quant_and_mcp_server() -> None: assert geom_audit.get("border_crossing_count") == 0 assert geom_audit.get("text_overlap_count") == 0 - # Verify Plan #63 & Plan #65: Homepage Navigation Immutability + Intra-Page & Cross-Page UI Style/Font/Background Parity (Gates S1-S3) + # Verify Plan #63 & Plan #65: Homepage Navigation Immutability + Intra-Page & Cross-Page UI Style/Font/Background Parity (STYLE-GATE-S01.NO_SLATE_BG..STYLE-GATE-S03.HEADER_PARITY) from hyperstitionstud_io.ci.public_regression import verify_ui_style_and_navigation_consistency style_audit = verify_ui_style_and_navigation_consistency(workspace_root=cfg.workspace_root)