chore: finalize repo audit hygiene (#257)

This commit is contained in:
Elliot Chen
2026-06-06 13:59:12 +08:00
committed by GitHub
parent ab23e40b28
commit 00f1dfaec5
27 changed files with 459 additions and 199 deletions

View File

@ -41,6 +41,9 @@ def test_default_writes_dotenv_in_cwd(runner: CliRunner, in_tmp: Path) -> None:
assert written.exists()
assert written.stat().st_size > 0
assert "EVEROS_LLM__API_KEY" in written.read_text()
assert "https://github.com/EverMind-AI/EverOS/blob/main/QUICKSTART.md" in (
result.output
)
def test_default_file_permissions_are_0600(runner: CliRunner, in_tmp: Path) -> None:

View File

@ -163,7 +163,7 @@ async def test_merges_into_existing_cluster_when_algo_matches() -> None:
preview=["earlier intent"],
members=["ac_20260517_0000"],
)
# Simulate evercore _merge: id passes through from existing, members appended.
# Simulate merge behavior: id passes through from existing, members appended.
merged_cluster = AlgoCluster(
id="cl_existing0001",
centroid=np.array([0.17] * 1024, dtype=np.float32),

View File

@ -0,0 +1,59 @@
"""Self-tests for ``scripts/check_deprecated_names.py``."""
from __future__ import annotations
import importlib.util
import sys
from pathlib import Path
_REPO_ROOT = Path(__file__).resolve().parents[3]
_CHECKER_PATH = _REPO_ROOT / "scripts" / "check_deprecated_names.py"
def _load_checker():
assert _CHECKER_PATH.exists(), "deprecated-name checker should exist"
spec = importlib.util.spec_from_file_location(
"_deprecated_name_checker", _CHECKER_PATH
)
assert spec and spec.loader
mod = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = mod
spec.loader.exec_module(mod)
return mod
def test_clean_text_is_allowed() -> None:
checker = _load_checker()
violations = checker.find_violations(
[("README.md", "EverOS is the public project name.\n")]
)
assert violations == []
def test_deprecated_name_variants_are_blocked() -> None:
checker = _load_checker()
compact_name = "Ever" + "Core"
spaced_name = "ever" + " core"
hyphenated_name = "ever" + "-core"
violations = checker.find_violations(
[
("README.md", f"{compact_name} should not appear.\n"),
("docs/example.md", f"{spaced_name} should not appear.\n"),
("src/example.py", f"{hyphenated_name} should not appear.\n"),
]
)
assert [(violation.path, violation.line_number) for violation in violations] == [
("README.md", 1),
("docs/example.md", 1),
("src/example.py", 1),
]
def test_real_repo_has_no_deprecated_names() -> None:
checker = _load_checker()
assert checker.main() == 0