From 7614837fccdab9bacb6cb980a921db7f883712f4 Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 11:23:34 +0800 Subject: [PATCH 1/9] docs: specify RSIHub website migration --- ...26-08-12-rsihub-rename-migration-design.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md diff --git a/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md b/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md new file mode 100644 index 0000000..30e155b --- /dev/null +++ b/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md @@ -0,0 +1,76 @@ +# RSIHub Rename and Link Migration Design + +## Goal + +Rename the website's EvolveX presentation to RSIHub and migrate its links and +search metadata without changing the project's positioning, capabilities, or +substantive copy. + +## Public URLs + +- The website overview page moves from `https://simpleagentlab.com/evolvex/` + to `https://simpleagentlab.com/rsihub/`. +- The documentation action points to the distinct, case-sensitive URL + `https://simpleagentlab.com/RSIHub/`. +- Code and repository deep links point to + `https://github.com/simple-agent-lab/RSIHub`. +- The old `/evolvex/` path remains as a compatibility redirect to `/rsihub/`. + +GitHub Pages cannot return a custom HTTP 301 for a static HTML route. The old +page will therefore use an immediate client-side redirect, declare `/rsihub/` +as its canonical URL, and provide a visible fallback link. + +## Content Migration + +The homepage will: + +- replace the EvolveX name with RSIHub in visible English and Chinese content; +- link the project summary to `/rsihub/`; +- link the Code action to the RSIHub GitHub repository; and +- link the Docs action to `https://simpleagentlab.com/RSIHub/`. + +The existing project page and its assets will move from `evolvex/` to +`rsihub/`. All EvolveX names, accessibility labels, SVG titles, and repository +links will become RSIHub equivalents. This is a rename and link migration +only: descriptions of the framework, its architecture, maturity, workflows, +and capabilities will remain substantively unchanged. + +## Metadata and Discovery + +The migration will update: + +- HTML titles, descriptions, keywords, and canonical links; +- Open Graph and Twitter metadata; +- JSON-LD names, identifiers, URLs, repository links, and `sameAs` values; +- the XML sitemap, replacing `/evolvex/` with `/rsihub/`; +- image titles and alternative text that contain the old name. + +The canonical website page is lowercase `/rsihub/`. The uppercase `/RSIHub/` +path is reserved for the separately published documentation. + +## Compatibility and Failure Handling + +Visitors reaching `/evolvex/` will be sent to `/rsihub/`. If automatic +redirect behavior is disabled or unavailable, the compatibility page will +show a direct link to the new page. No other website routes or projects will +change. + +## Verification + +Verification will: + +1. scan tracked text files for obsolete `EvolveX` names and old repository or + documentation URLs, allowing only the compatibility route where necessary; +2. validate the homepage links, the lowercase overview canonical URL, the + uppercase documentation link, and the old-route redirect; +3. serve the static site locally and inspect the homepage, `/rsihub/`, and + `/evolvex/`; and +4. exercise English and Chinese presentation plus light and dark themes to + ensure the directory move does not break shared scripts, styles, or assets. + +## Out of Scope + +- Repositioning RSIHub or changing capability claims. +- Redesigning the homepage or project page. +- Changing the shared language or theme behavior. +- Changing the separately deployed RSIHub documentation site. From 172d7f3ed0a6448c25b0a375b95df17e32d20ee9 Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 11:28:09 +0800 Subject: [PATCH 2/9] docs: plan RSIHub website migration --- .../2026-08-12-rsihub-rename-migration.md | 424 ++++++++++++++++++ 1 file changed, 424 insertions(+) create mode 100644 docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md diff --git a/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md b/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md new file mode 100644 index 0000000..1319788 --- /dev/null +++ b/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md @@ -0,0 +1,424 @@ +# RSIHub Rename and Link Migration Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Rename the website's EvolveX presentation to RSIHub, migrate all code and documentation links, and preserve the old overview route as a compatibility redirect. + +**Architecture:** Keep the existing plain HTML/CSS/JavaScript structure. Move the project overview and its colocated assets to lowercase `rsihub/`, reserve uppercase `/RSIHub/` for the separately deployed documentation, and replace `evolvex/index.html` with a static redirect page. Add standard-library regression tests that parse tracked text and HTML without introducing a dependency or build step. + +**Tech Stack:** Static HTML5, CSS, vanilla JavaScript, SVG, XML sitemap, Python 3 `unittest` and `html.parser`, GitHub Pages. + +## Global Constraints + +- This is a rename and link migration only; do not alter RSIHub positioning, capability claims, architecture descriptions, maturity statements, or substantive project copy. +- Use `RSIHub` for the product name everywhere. +- Use `https://github.com/simple-agent-lab/RSIHub` as the repository base URL. +- Use `https://simpleagentlab.com/RSIHub/` as the case-sensitive documentation URL. +- Use `https://simpleagentlab.com/rsihub/` as the canonical website overview URL. +- Preserve `https://simpleagentlab.com/evolvex/` as a compatibility route that redirects to `/rsihub/` and provides a clickable fallback. +- Do not redesign pages or change shared language and theme behavior. + +--- + +## File Structure + +- `tests/test_rsihub_migration.py`: dependency-free regression checks for naming, links, canonical metadata, sitemap entries, and redirect behavior. +- `rsihub/index.html`: canonical RSIHub overview page, moved from `evolvex/index.html` and mechanically renamed. +- `rsihub/assets/*`: project illustrations moved with the overview page; SVG accessible titles use RSIHub. +- `index.html`: homepage visible name, overview link, actions, metadata, and JSON-LD. +- `evolvex/index.html`: compatibility-only redirect page; it contains no project presentation. +- `sitemap.xml`: lists the canonical `/rsihub/` route and excludes `/evolvex/`. + +### Task 1: Establish the canonical RSIHub project page + +**Files:** +- Create: `tests/test_rsihub_migration.py` +- Move: `evolvex/assets/architecture.svg` → `rsihub/assets/architecture.svg` +- Move: `evolvex/assets/benchmark-results.svg` → `rsihub/assets/benchmark-results.svg` +- Move: `evolvex/assets/evolve-lineage.svg` → `rsihub/assets/evolve-lineage.svg` +- Move: `evolvex/assets/paper-poster-lora-gen0.png` → `rsihub/assets/paper-poster-lora-gen0.png` +- Move: `evolvex/assets/paper-poster-lora-gen2.png` → `rsihub/assets/paper-poster-lora-gen2.png` +- Move and modify: `evolvex/index.html` → `rsihub/index.html` + +**Interfaces:** +- Consumes: shared `../assets/styles.css`, `../assets/site.js`, and `../assets/favicon.svg` at the same relative depth as the old page. +- Produces: canonical overview route `/rsihub/`, repository base `https://github.com/simple-agent-lab/RSIHub`, and documentation action `https://simpleagentlab.com/RSIHub/` for later homepage and redirect work. + +- [ ] **Step 1: Write focused failing project-page tests** + +Create `tests/test_rsihub_migration.py` with: + +```python +from html.parser import HTMLParser +from pathlib import Path +import unittest + + +ROOT = Path(__file__).resolve().parents[1] +REPO_URL = "https://github.com/simple-agent-lab/RSIHub" +DOCS_URL = "https://simpleagentlab.com/RSIHub/" +OVERVIEW_URL = "https://simpleagentlab.com/rsihub/" + + +class LinkParser(HTMLParser): + def __init__(self): + super().__init__() + self.links = [] + self.canonicals = [] + self.refreshes = [] + + def handle_starttag(self, tag, attrs): + values = dict(attrs) + if tag == "a" and "href" in values: + self.links.append(values["href"]) + if tag == "link" and values.get("rel") == "canonical": + self.canonicals.append(values.get("href")) + if tag == "meta" and values.get("http-equiv", "").lower() == "refresh": + self.refreshes.append(values.get("content")) + + +def parse_html(relative_path): + parser = LinkParser() + parser.feed((ROOT / relative_path).read_text(encoding="utf-8")) + return parser + + +class RSIHubProjectPageTests(unittest.TestCase): + def test_canonical_project_page_uses_new_identity_and_urls(self): + page_path = ROOT / "rsihub/index.html" + self.assertTrue(page_path.is_file()) + text = page_path.read_text(encoding="utf-8") + parser = parse_html("rsihub/index.html") + self.assertIn("RSIHub", text) + self.assertNotIn("EvolveX", text) + self.assertNotIn("simple-agent-lab/EvolveX", text) + self.assertNotIn("simple-agent-lab.github.io/EvolveX", text) + self.assertEqual(parser.canonicals, [OVERVIEW_URL]) + self.assertIn(REPO_URL, parser.links) + self.assertIn(DOCS_URL, parser.links) + + def test_project_assets_moved_and_svg_titles_renamed(self): + assets = ROOT / "rsihub/assets" + expected = { + "architecture.svg", + "benchmark-results.svg", + "evolve-lineage.svg", + "paper-poster-lora-gen0.png", + "paper-poster-lora-gen2.png", + } + self.assertEqual({path.name for path in assets.iterdir()}, expected) + for svg in assets.glob("*.svg"): + self.assertNotIn("EvolveX", svg.read_text(encoding="utf-8")) +``` + +- [ ] **Step 2: Run the focused tests and verify the new route is absent** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration.RSIHubProjectPageTests -v +``` + +Expected: FAIL because `rsihub/index.html` and `rsihub/assets/` do not exist. + +- [ ] **Step 3: Move the page and assets without changing their relative layout** + +Run: + +```bash +mv evolvex rsihub +``` + +In `rsihub/index.html`, apply these exact mechanical substitutions throughout visible copy, accessibility text, metadata, JSON-LD, and links: + +```text +EvolveX → RSIHub +https://simpleagentlab.com/evolvex/ → https://simpleagentlab.com/rsihub/ +https://github.com/simple-agent-lab/EvolveX → https://github.com/simple-agent-lab/RSIHub +https://simple-agent-lab.github.io/EvolveX/ → https://simpleagentlab.com/RSIHub/ +``` + +In `rsihub/assets/architecture.svg` and `rsihub/assets/benchmark-results.svg`, replace `EvolveX` with `RSIHub` in the `` text. Do not change illustration geometry, labels unrelated to the product name, or raster assets. + +- [ ] **Step 4: Run focused tests and inspect the rename diff** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration.RSIHubProjectPageTests -v +git diff --check +git diff --find-renames -- rsihub evolvex tests/test_rsihub_migration.py +``` + +Expected: both tests PASS; `git diff --check` emits nothing; the page diff consists only of the directory move and approved name/URL substitutions. + +- [ ] **Step 5: Commit the canonical project page** + +```bash +git add rsihub evolvex tests/test_rsihub_migration.py +git commit -m "feat: migrate EvolveX page to RSIHub" +``` + +### Task 2: Migrate homepage presentation and discovery metadata + +**Files:** +- Modify: `tests/test_rsihub_migration.py` +- Modify: `index.html` + +**Interfaces:** +- Consumes: `/rsihub/`, `https://github.com/simple-agent-lab/RSIHub`, and `https://simpleagentlab.com/RSIHub/` from Task 1. +- Produces: homepage navigation and structured discovery data consistently pointing to the canonical RSIHub identity. + +- [ ] **Step 1: Add failing homepage tests** + +Append this class to `tests/test_rsihub_migration.py`: + +```python +class RSIHubHomepageTests(unittest.TestCase): + def test_homepage_uses_rsihub_name_and_actions(self): + text = (ROOT / "index.html").read_text(encoding="utf-8") + parser = parse_html("index.html") + self.assertIn("RSIHub", text) + self.assertNotIn("EvolveX", text) + self.assertIn("./rsihub/", parser.links) + self.assertIn(REPO_URL, parser.links) + self.assertIn(DOCS_URL, parser.links) + + def test_homepage_structured_data_uses_canonical_rsihub_urls(self): + text = (ROOT / "index.html").read_text(encoding="utf-8") + self.assertIn(f'"@id": "{OVERVIEW_URL}#software"', text) + self.assertIn(f'"url": "{OVERVIEW_URL}"', text) + self.assertIn(f'"codeRepository": "{REPO_URL}"', text) + self.assertNotIn("simpleagentlab.com/evolvex/", text) + self.assertNotIn("simple-agent-lab/EvolveX", text) + self.assertNotIn("simple-agent-lab.github.io/EvolveX", text) +``` + +- [ ] **Step 2: Run the homepage tests and verify they reject the old identity** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration.RSIHubHomepageTests -v +``` + +Expected: FAIL because the homepage still contains EvolveX names and URLs. + +- [ ] **Step 3: Update homepage copy, actions, metadata, and JSON-LD** + +In `index.html`, apply these exact substitutions: + +```text +EvolveX → RSIHub +./evolvex/ → ./rsihub/ +https://simpleagentlab.com/evolvex/ → https://simpleagentlab.com/rsihub/ +https://github.com/simple-agent-lab/EvolveX → https://github.com/simple-agent-lab/RSIHub +https://simple-agent-lab.github.io/EvolveX/ → https://simpleagentlab.com/RSIHub/ +``` + +Preserve all surrounding descriptions, keyword ordering, bilingual text, markup structure, and action labels. + +- [ ] **Step 4: Run homepage and project-page tests** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration -v +git diff --check +git diff -- index.html tests/test_rsihub_migration.py +``` + +Expected: all tests currently defined PASS; `git diff --check` emits nothing; the homepage diff contains only approved name and URL substitutions. + +- [ ] **Step 5: Commit the homepage migration** + +```bash +git add index.html tests/test_rsihub_migration.py +git commit -m "feat: feature RSIHub on homepage" +``` + +### Task 3: Preserve the legacy route and update the sitemap + +**Files:** +- Modify: `tests/test_rsihub_migration.py` +- Create: `evolvex/index.html` +- Modify: `sitemap.xml` + +**Interfaces:** +- Consumes: canonical `/rsihub/` overview from Task 1. +- Produces: browser-compatible `/evolvex/` redirect, fallback navigation, and canonical sitemap discovery. + +- [ ] **Step 1: Add failing redirect, sitemap, and repository-wide regression tests** + +Append this class to `tests/test_rsihub_migration.py`: + +```python +class RSIHubCompatibilityTests(unittest.TestCase): + def test_legacy_page_redirects_and_has_fallback(self): + parser = parse_html("evolvex/index.html") + self.assertEqual(parser.canonicals, [OVERVIEW_URL]) + self.assertIn("0; url=/rsihub/", parser.refreshes) + self.assertIn("/rsihub/", parser.links) + + def test_sitemap_contains_only_the_canonical_project_route(self): + text = (ROOT / "sitemap.xml").read_text(encoding="utf-8") + self.assertIn("<loc>https://simpleagentlab.com/rsihub/</loc>", text) + self.assertNotIn("<loc>https://simpleagentlab.com/evolvex/</loc>", text) + + def test_old_identity_remains_only_in_migration_docs(self): + allowed = { + Path("docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md"), + Path("docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md"), + Path("tests/test_rsihub_migration.py"), + } + forbidden = ( + "EvolveX", + "simple-agent-lab/EvolveX", + "simple-agent-lab.github.io/EvolveX", + ) + for path in ROOT.rglob("*"): + relative = path.relative_to(ROOT) + if not path.is_file() or ".git" in relative.parts or relative in allowed: + continue + if path.suffix.lower() in {".png", ".jpg", ".jpeg", ".gif", ".webp"}: + continue + text = path.read_text(encoding="utf-8") + for old_value in forbidden: + self.assertNotIn(old_value, text, f"{old_value!r} remains in {relative}") +``` + +- [ ] **Step 2: Run compatibility tests and verify the legacy page is absent** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration.RSIHubCompatibilityTests -v +``` + +Expected: ERROR for missing `evolvex/index.html` and FAIL because the sitemap still lists `/evolvex/`. + +- [ ] **Step 3: Add the static compatibility redirect** + +Create `evolvex/index.html` with exactly: + +```html +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <title>RSIHub has moved | Simple Agent Lab + + + + + + +

RSIHub has moved to its new project page.

+ + +``` + +The script preserves query parameters and fragments; the meta refresh and link cover disabled or failed JavaScript. + +- [ ] **Step 4: Replace the sitemap project URL and refresh its date** + +In `sitemap.xml`, replace: + +```xml + https://simpleagentlab.com/evolvex/ + 2026-08-09 +``` + +with: + +```xml + https://simpleagentlab.com/rsihub/ + 2026-08-12 +``` + +Also update the homepage `` to `2026-08-12`, because Task 2 changes homepage content. + +- [ ] **Step 5: Run all migration tests and static sanity checks** + +Run: + +```bash +python3 -m unittest tests.test_rsihub_migration -v +git diff --check +git status --short +``` + +Expected: all tests PASS; `git diff --check` emits nothing; only the redirect, sitemap, and test additions from this task remain uncommitted. + +- [ ] **Step 6: Serve and inspect all affected routes** + +Start the documented preview server: + +```bash +uv run python -m http.server 3000 +``` + +In a browser, verify: + +1. `http://localhost:3000/` shows RSIHub and its three links resolve to `/rsihub/`, the RSIHub GitHub repository, and `https://simpleagentlab.com/RSIHub/`. +2. `http://localhost:3000/rsihub/` loads shared CSS, JavaScript, favicon, and all five project images; English/Chinese and light/dark toggles still work. +3. `http://localhost:3000/evolvex/` immediately arrives at `/rsihub/`. +4. Browser console and network panels show no local 404s or JavaScript errors on the homepage or project page. + +Expected: all four checks succeed. Stop the server with `Ctrl-C` after inspection. + +- [ ] **Step 7: Commit compatibility and search discovery changes** + +```bash +git add evolvex/index.html sitemap.xml tests/test_rsihub_migration.py +git commit -m "feat: redirect EvolveX page to RSIHub" +``` + +### Task 4: Final verification + +**Files:** +- Verify only; no expected modifications. + +**Interfaces:** +- Consumes: completed Tasks 1–3. +- Produces: evidence that the approved migration is internally consistent and ready to publish. + +- [ ] **Step 1: Run the full dependency-free regression suite** + +```bash +python3 -m unittest discover -s tests -v +``` + +Expected: every discovered test PASS. + +- [ ] **Step 2: Verify the repository state and final diff** + +```bash +git diff --check origin/main...HEAD +git status --short --branch +git log --oneline --decorate origin/main..HEAD +``` + +Expected: no whitespace errors; clean worktree; the branch contains the approved design, implementation plan, and three focused migration commits. + +- [ ] **Step 3: Confirm the exact public targets one final time** + +```bash +python3 - <<'PY' +from pathlib import Path + +root = Path.cwd() +homepage = (root / "index.html").read_text() +project = (root / "rsihub/index.html").read_text() +redirect = (root / "evolvex/index.html").read_text() + +assert "https://github.com/simple-agent-lab/RSIHub" in homepage and "https://github.com/simple-agent-lab/RSIHub" in project +assert "https://simpleagentlab.com/RSIHub/" in homepage and "https://simpleagentlab.com/RSIHub/" in project +assert "https://simpleagentlab.com/rsihub/" in project +assert 'url=/rsihub/' in redirect +print("RSIHub migration targets verified") +PY +``` + +Expected: prints `RSIHub migration targets verified`. From e8db8b802d4a113885ef2f062fc6df2e2000122b Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 11:33:08 +0800 Subject: [PATCH 3/9] chore: ignore local worktrees --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e43b0f9..b24428d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.worktrees/ From 2a3e7bde4277228693464a5cd57e627c4a2077fe Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 11:38:36 +0800 Subject: [PATCH 4/9] feat: migrate EvolveX page to RSIHub --- {evolvex => rsihub}/assets/architecture.svg | 2 +- .../assets/benchmark-results.svg | 2 +- {evolvex => rsihub}/assets/evolve-lineage.svg | 0 .../assets/paper-poster-lora-gen0.png | Bin .../assets/paper-poster-lora-gen2.png | Bin {evolvex => rsihub}/index.html | 100 +++++++++--------- tests/test_rsihub_migration.py | 60 +++++++++++ 7 files changed, 112 insertions(+), 52 deletions(-) rename {evolvex => rsihub}/assets/architecture.svg (99%) rename {evolvex => rsihub}/assets/benchmark-results.svg (99%) rename {evolvex => rsihub}/assets/evolve-lineage.svg (100%) rename {evolvex => rsihub}/assets/paper-poster-lora-gen0.png (100%) rename {evolvex => rsihub}/assets/paper-poster-lora-gen2.png (100%) rename {evolvex => rsihub}/index.html (84%) create mode 100644 tests/test_rsihub_migration.py diff --git a/evolvex/assets/architecture.svg b/rsihub/assets/architecture.svg similarity index 99% rename from evolvex/assets/architecture.svg rename to rsihub/assets/architecture.svg index ada59bd..17c02b4 100644 --- a/evolvex/assets/architecture.svg +++ b/rsihub/assets/architecture.svg @@ -1,5 +1,5 @@ - EvolveX architecture + RSIHub architecture Evolution methods such as Hill Climb, A-Evolve, AHE, GEPA and HyperAgents plug into one loop of select, rollout, analyze, mutate, gate and record. The loop and the agent it improves sit inside a declared mutable surface. Recipes select permitted targets, operators, and stages. Only the substrate below stays frozen: the evaluator, the runtime, the surface check and the stamped evidence. - EvolveX | Self-Evolving Agent Framework by Simple Agent Lab + RSIHub | Self-Evolving Agent Framework by Simple Agent Lab - + - + - + - + - + - + + + +

RSIHub has moved to its new project page.

+ + diff --git a/sitemap.xml b/sitemap.xml index 185a6ea..9af610d 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,10 +2,10 @@ https://simpleagentlab.com/ - 2026-08-09 + 2026-08-12 - https://simpleagentlab.com/evolvex/ - 2026-08-09 + https://simpleagentlab.com/rsihub/ + 2026-08-12 diff --git a/tests/test_rsihub_migration.py b/tests/test_rsihub_migration.py index 7d997e3..488a5cb 100644 --- a/tests/test_rsihub_migration.py +++ b/tests/test_rsihub_migration.py @@ -78,3 +78,42 @@ def test_homepage_structured_data_uses_canonical_rsihub_urls(self): self.assertNotIn("simpleagentlab.com/evolvex/", text) self.assertNotIn("simple-agent-lab/EvolveX", text) self.assertNotIn("simple-agent-lab.github.io/EvolveX", text) + + +class RSIHubCompatibilityTests(unittest.TestCase): + def test_legacy_page_redirects_and_has_fallback(self): + parser = parse_html("evolvex/index.html") + self.assertEqual(parser.canonicals, [OVERVIEW_URL]) + self.assertIn("0; url=/rsihub/", parser.refreshes) + self.assertIn("/rsihub/", parser.links) + + def test_sitemap_contains_only_the_canonical_project_route(self): + text = (ROOT / "sitemap.xml").read_text(encoding="utf-8") + self.assertIn("https://simpleagentlab.com/rsihub/", text) + self.assertNotIn("https://simpleagentlab.com/evolvex/", text) + + def test_old_identity_remains_only_in_migration_docs(self): + allowed = { + Path("docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md"), + Path("docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md"), + Path("tests/test_rsihub_migration.py"), + } + forbidden = ( + "EvolveX", + "simple-agent-lab/EvolveX", + "simple-agent-lab.github.io/EvolveX", + ) + for path in ROOT.rglob("*"): + relative = path.relative_to(ROOT) + if ( + not path.is_file() + or ".git" in relative.parts + or ".superpowers" in relative.parts + or relative in allowed + ): + continue + if path.suffix.lower() in {".png", ".jpg", ".jpeg", ".gif", ".webp"}: + continue + text = path.read_text(encoding="utf-8") + for old_value in forbidden: + self.assertNotIn(old_value, text, f"{old_value!r} remains in {relative}") From a963eb30cb80b7c0ed010decc36cd67dd788e561 Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 12:13:13 +0800 Subject: [PATCH 7/9] test: scan tracked files for legacy identity --- .gitignore | 1 + tests/test_rsihub_migration.py | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b24428d..edf0661 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +__pycache__/ .worktrees/ diff --git a/tests/test_rsihub_migration.py b/tests/test_rsihub_migration.py index 488a5cb..9ddc1ae 100644 --- a/tests/test_rsihub_migration.py +++ b/tests/test_rsihub_migration.py @@ -1,5 +1,6 @@ from html.parser import HTMLParser from pathlib import Path +import subprocess import unittest @@ -103,14 +104,15 @@ def test_old_identity_remains_only_in_migration_docs(self): "simple-agent-lab/EvolveX", "simple-agent-lab.github.io/EvolveX", ) - for path in ROOT.rglob("*"): - relative = path.relative_to(ROOT) - if ( - not path.is_file() - or ".git" in relative.parts - or ".superpowers" in relative.parts - or relative in allowed - ): + tracked = subprocess.check_output( + ["git", "ls-files", "-z"], cwd=ROOT + ).decode("utf-8").split("\0") + for tracked_path in tracked: + if not tracked_path: + continue + relative = Path(tracked_path) + path = ROOT / relative + if relative in allowed: continue if path.suffix.lower() in {".png", ".jpg", ".jpeg", ".gif", ".webp"}: continue From 30c81cb4cf53dee41faee518be4a8158267a4687 Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 14:12:29 +0800 Subject: [PATCH 8/9] chore: remove internal migration docs --- .../2026-08-12-rsihub-rename-migration.md | 424 ------------------ ...26-08-12-rsihub-rename-migration-design.md | 76 ---- tests/test_rsihub_migration.py | 4 +- 3 files changed, 1 insertion(+), 503 deletions(-) delete mode 100644 docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md delete mode 100644 docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md diff --git a/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md b/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md deleted file mode 100644 index 1319788..0000000 --- a/docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md +++ /dev/null @@ -1,424 +0,0 @@ -# RSIHub Rename and Link Migration Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Goal:** Rename the website's EvolveX presentation to RSIHub, migrate all code and documentation links, and preserve the old overview route as a compatibility redirect. - -**Architecture:** Keep the existing plain HTML/CSS/JavaScript structure. Move the project overview and its colocated assets to lowercase `rsihub/`, reserve uppercase `/RSIHub/` for the separately deployed documentation, and replace `evolvex/index.html` with a static redirect page. Add standard-library regression tests that parse tracked text and HTML without introducing a dependency or build step. - -**Tech Stack:** Static HTML5, CSS, vanilla JavaScript, SVG, XML sitemap, Python 3 `unittest` and `html.parser`, GitHub Pages. - -## Global Constraints - -- This is a rename and link migration only; do not alter RSIHub positioning, capability claims, architecture descriptions, maturity statements, or substantive project copy. -- Use `RSIHub` for the product name everywhere. -- Use `https://github.com/simple-agent-lab/RSIHub` as the repository base URL. -- Use `https://simpleagentlab.com/RSIHub/` as the case-sensitive documentation URL. -- Use `https://simpleagentlab.com/rsihub/` as the canonical website overview URL. -- Preserve `https://simpleagentlab.com/evolvex/` as a compatibility route that redirects to `/rsihub/` and provides a clickable fallback. -- Do not redesign pages or change shared language and theme behavior. - ---- - -## File Structure - -- `tests/test_rsihub_migration.py`: dependency-free regression checks for naming, links, canonical metadata, sitemap entries, and redirect behavior. -- `rsihub/index.html`: canonical RSIHub overview page, moved from `evolvex/index.html` and mechanically renamed. -- `rsihub/assets/*`: project illustrations moved with the overview page; SVG accessible titles use RSIHub. -- `index.html`: homepage visible name, overview link, actions, metadata, and JSON-LD. -- `evolvex/index.html`: compatibility-only redirect page; it contains no project presentation. -- `sitemap.xml`: lists the canonical `/rsihub/` route and excludes `/evolvex/`. - -### Task 1: Establish the canonical RSIHub project page - -**Files:** -- Create: `tests/test_rsihub_migration.py` -- Move: `evolvex/assets/architecture.svg` → `rsihub/assets/architecture.svg` -- Move: `evolvex/assets/benchmark-results.svg` → `rsihub/assets/benchmark-results.svg` -- Move: `evolvex/assets/evolve-lineage.svg` → `rsihub/assets/evolve-lineage.svg` -- Move: `evolvex/assets/paper-poster-lora-gen0.png` → `rsihub/assets/paper-poster-lora-gen0.png` -- Move: `evolvex/assets/paper-poster-lora-gen2.png` → `rsihub/assets/paper-poster-lora-gen2.png` -- Move and modify: `evolvex/index.html` → `rsihub/index.html` - -**Interfaces:** -- Consumes: shared `../assets/styles.css`, `../assets/site.js`, and `../assets/favicon.svg` at the same relative depth as the old page. -- Produces: canonical overview route `/rsihub/`, repository base `https://github.com/simple-agent-lab/RSIHub`, and documentation action `https://simpleagentlab.com/RSIHub/` for later homepage and redirect work. - -- [ ] **Step 1: Write focused failing project-page tests** - -Create `tests/test_rsihub_migration.py` with: - -```python -from html.parser import HTMLParser -from pathlib import Path -import unittest - - -ROOT = Path(__file__).resolve().parents[1] -REPO_URL = "https://github.com/simple-agent-lab/RSIHub" -DOCS_URL = "https://simpleagentlab.com/RSIHub/" -OVERVIEW_URL = "https://simpleagentlab.com/rsihub/" - - -class LinkParser(HTMLParser): - def __init__(self): - super().__init__() - self.links = [] - self.canonicals = [] - self.refreshes = [] - - def handle_starttag(self, tag, attrs): - values = dict(attrs) - if tag == "a" and "href" in values: - self.links.append(values["href"]) - if tag == "link" and values.get("rel") == "canonical": - self.canonicals.append(values.get("href")) - if tag == "meta" and values.get("http-equiv", "").lower() == "refresh": - self.refreshes.append(values.get("content")) - - -def parse_html(relative_path): - parser = LinkParser() - parser.feed((ROOT / relative_path).read_text(encoding="utf-8")) - return parser - - -class RSIHubProjectPageTests(unittest.TestCase): - def test_canonical_project_page_uses_new_identity_and_urls(self): - page_path = ROOT / "rsihub/index.html" - self.assertTrue(page_path.is_file()) - text = page_path.read_text(encoding="utf-8") - parser = parse_html("rsihub/index.html") - self.assertIn("RSIHub", text) - self.assertNotIn("EvolveX", text) - self.assertNotIn("simple-agent-lab/EvolveX", text) - self.assertNotIn("simple-agent-lab.github.io/EvolveX", text) - self.assertEqual(parser.canonicals, [OVERVIEW_URL]) - self.assertIn(REPO_URL, parser.links) - self.assertIn(DOCS_URL, parser.links) - - def test_project_assets_moved_and_svg_titles_renamed(self): - assets = ROOT / "rsihub/assets" - expected = { - "architecture.svg", - "benchmark-results.svg", - "evolve-lineage.svg", - "paper-poster-lora-gen0.png", - "paper-poster-lora-gen2.png", - } - self.assertEqual({path.name for path in assets.iterdir()}, expected) - for svg in assets.glob("*.svg"): - self.assertNotIn("EvolveX", svg.read_text(encoding="utf-8")) -``` - -- [ ] **Step 2: Run the focused tests and verify the new route is absent** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration.RSIHubProjectPageTests -v -``` - -Expected: FAIL because `rsihub/index.html` and `rsihub/assets/` do not exist. - -- [ ] **Step 3: Move the page and assets without changing their relative layout** - -Run: - -```bash -mv evolvex rsihub -``` - -In `rsihub/index.html`, apply these exact mechanical substitutions throughout visible copy, accessibility text, metadata, JSON-LD, and links: - -```text -EvolveX → RSIHub -https://simpleagentlab.com/evolvex/ → https://simpleagentlab.com/rsihub/ -https://github.com/simple-agent-lab/EvolveX → https://github.com/simple-agent-lab/RSIHub -https://simple-agent-lab.github.io/EvolveX/ → https://simpleagentlab.com/RSIHub/ -``` - -In `rsihub/assets/architecture.svg` and `rsihub/assets/benchmark-results.svg`, replace `EvolveX` with `RSIHub` in the `` text. Do not change illustration geometry, labels unrelated to the product name, or raster assets. - -- [ ] **Step 4: Run focused tests and inspect the rename diff** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration.RSIHubProjectPageTests -v -git diff --check -git diff --find-renames -- rsihub evolvex tests/test_rsihub_migration.py -``` - -Expected: both tests PASS; `git diff --check` emits nothing; the page diff consists only of the directory move and approved name/URL substitutions. - -- [ ] **Step 5: Commit the canonical project page** - -```bash -git add rsihub evolvex tests/test_rsihub_migration.py -git commit -m "feat: migrate EvolveX page to RSIHub" -``` - -### Task 2: Migrate homepage presentation and discovery metadata - -**Files:** -- Modify: `tests/test_rsihub_migration.py` -- Modify: `index.html` - -**Interfaces:** -- Consumes: `/rsihub/`, `https://github.com/simple-agent-lab/RSIHub`, and `https://simpleagentlab.com/RSIHub/` from Task 1. -- Produces: homepage navigation and structured discovery data consistently pointing to the canonical RSIHub identity. - -- [ ] **Step 1: Add failing homepage tests** - -Append this class to `tests/test_rsihub_migration.py`: - -```python -class RSIHubHomepageTests(unittest.TestCase): - def test_homepage_uses_rsihub_name_and_actions(self): - text = (ROOT / "index.html").read_text(encoding="utf-8") - parser = parse_html("index.html") - self.assertIn("RSIHub", text) - self.assertNotIn("EvolveX", text) - self.assertIn("./rsihub/", parser.links) - self.assertIn(REPO_URL, parser.links) - self.assertIn(DOCS_URL, parser.links) - - def test_homepage_structured_data_uses_canonical_rsihub_urls(self): - text = (ROOT / "index.html").read_text(encoding="utf-8") - self.assertIn(f'"@id": "{OVERVIEW_URL}#software"', text) - self.assertIn(f'"url": "{OVERVIEW_URL}"', text) - self.assertIn(f'"codeRepository": "{REPO_URL}"', text) - self.assertNotIn("simpleagentlab.com/evolvex/", text) - self.assertNotIn("simple-agent-lab/EvolveX", text) - self.assertNotIn("simple-agent-lab.github.io/EvolveX", text) -``` - -- [ ] **Step 2: Run the homepage tests and verify they reject the old identity** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration.RSIHubHomepageTests -v -``` - -Expected: FAIL because the homepage still contains EvolveX names and URLs. - -- [ ] **Step 3: Update homepage copy, actions, metadata, and JSON-LD** - -In `index.html`, apply these exact substitutions: - -```text -EvolveX → RSIHub -./evolvex/ → ./rsihub/ -https://simpleagentlab.com/evolvex/ → https://simpleagentlab.com/rsihub/ -https://github.com/simple-agent-lab/EvolveX → https://github.com/simple-agent-lab/RSIHub -https://simple-agent-lab.github.io/EvolveX/ → https://simpleagentlab.com/RSIHub/ -``` - -Preserve all surrounding descriptions, keyword ordering, bilingual text, markup structure, and action labels. - -- [ ] **Step 4: Run homepage and project-page tests** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration -v -git diff --check -git diff -- index.html tests/test_rsihub_migration.py -``` - -Expected: all tests currently defined PASS; `git diff --check` emits nothing; the homepage diff contains only approved name and URL substitutions. - -- [ ] **Step 5: Commit the homepage migration** - -```bash -git add index.html tests/test_rsihub_migration.py -git commit -m "feat: feature RSIHub on homepage" -``` - -### Task 3: Preserve the legacy route and update the sitemap - -**Files:** -- Modify: `tests/test_rsihub_migration.py` -- Create: `evolvex/index.html` -- Modify: `sitemap.xml` - -**Interfaces:** -- Consumes: canonical `/rsihub/` overview from Task 1. -- Produces: browser-compatible `/evolvex/` redirect, fallback navigation, and canonical sitemap discovery. - -- [ ] **Step 1: Add failing redirect, sitemap, and repository-wide regression tests** - -Append this class to `tests/test_rsihub_migration.py`: - -```python -class RSIHubCompatibilityTests(unittest.TestCase): - def test_legacy_page_redirects_and_has_fallback(self): - parser = parse_html("evolvex/index.html") - self.assertEqual(parser.canonicals, [OVERVIEW_URL]) - self.assertIn("0; url=/rsihub/", parser.refreshes) - self.assertIn("/rsihub/", parser.links) - - def test_sitemap_contains_only_the_canonical_project_route(self): - text = (ROOT / "sitemap.xml").read_text(encoding="utf-8") - self.assertIn("<loc>https://simpleagentlab.com/rsihub/</loc>", text) - self.assertNotIn("<loc>https://simpleagentlab.com/evolvex/</loc>", text) - - def test_old_identity_remains_only_in_migration_docs(self): - allowed = { - Path("docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md"), - Path("docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md"), - Path("tests/test_rsihub_migration.py"), - } - forbidden = ( - "EvolveX", - "simple-agent-lab/EvolveX", - "simple-agent-lab.github.io/EvolveX", - ) - for path in ROOT.rglob("*"): - relative = path.relative_to(ROOT) - if not path.is_file() or ".git" in relative.parts or relative in allowed: - continue - if path.suffix.lower() in {".png", ".jpg", ".jpeg", ".gif", ".webp"}: - continue - text = path.read_text(encoding="utf-8") - for old_value in forbidden: - self.assertNotIn(old_value, text, f"{old_value!r} remains in {relative}") -``` - -- [ ] **Step 2: Run compatibility tests and verify the legacy page is absent** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration.RSIHubCompatibilityTests -v -``` - -Expected: ERROR for missing `evolvex/index.html` and FAIL because the sitemap still lists `/evolvex/`. - -- [ ] **Step 3: Add the static compatibility redirect** - -Create `evolvex/index.html` with exactly: - -```html -<!doctype html> -<html lang="en"> - <head> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <title>RSIHub has moved | Simple Agent Lab - - - - - - -

RSIHub has moved to its new project page.

- - -``` - -The script preserves query parameters and fragments; the meta refresh and link cover disabled or failed JavaScript. - -- [ ] **Step 4: Replace the sitemap project URL and refresh its date** - -In `sitemap.xml`, replace: - -```xml - https://simpleagentlab.com/evolvex/ - 2026-08-09 -``` - -with: - -```xml - https://simpleagentlab.com/rsihub/ - 2026-08-12 -``` - -Also update the homepage `` to `2026-08-12`, because Task 2 changes homepage content. - -- [ ] **Step 5: Run all migration tests and static sanity checks** - -Run: - -```bash -python3 -m unittest tests.test_rsihub_migration -v -git diff --check -git status --short -``` - -Expected: all tests PASS; `git diff --check` emits nothing; only the redirect, sitemap, and test additions from this task remain uncommitted. - -- [ ] **Step 6: Serve and inspect all affected routes** - -Start the documented preview server: - -```bash -uv run python -m http.server 3000 -``` - -In a browser, verify: - -1. `http://localhost:3000/` shows RSIHub and its three links resolve to `/rsihub/`, the RSIHub GitHub repository, and `https://simpleagentlab.com/RSIHub/`. -2. `http://localhost:3000/rsihub/` loads shared CSS, JavaScript, favicon, and all five project images; English/Chinese and light/dark toggles still work. -3. `http://localhost:3000/evolvex/` immediately arrives at `/rsihub/`. -4. Browser console and network panels show no local 404s or JavaScript errors on the homepage or project page. - -Expected: all four checks succeed. Stop the server with `Ctrl-C` after inspection. - -- [ ] **Step 7: Commit compatibility and search discovery changes** - -```bash -git add evolvex/index.html sitemap.xml tests/test_rsihub_migration.py -git commit -m "feat: redirect EvolveX page to RSIHub" -``` - -### Task 4: Final verification - -**Files:** -- Verify only; no expected modifications. - -**Interfaces:** -- Consumes: completed Tasks 1–3. -- Produces: evidence that the approved migration is internally consistent and ready to publish. - -- [ ] **Step 1: Run the full dependency-free regression suite** - -```bash -python3 -m unittest discover -s tests -v -``` - -Expected: every discovered test PASS. - -- [ ] **Step 2: Verify the repository state and final diff** - -```bash -git diff --check origin/main...HEAD -git status --short --branch -git log --oneline --decorate origin/main..HEAD -``` - -Expected: no whitespace errors; clean worktree; the branch contains the approved design, implementation plan, and three focused migration commits. - -- [ ] **Step 3: Confirm the exact public targets one final time** - -```bash -python3 - <<'PY' -from pathlib import Path - -root = Path.cwd() -homepage = (root / "index.html").read_text() -project = (root / "rsihub/index.html").read_text() -redirect = (root / "evolvex/index.html").read_text() - -assert "https://github.com/simple-agent-lab/RSIHub" in homepage and "https://github.com/simple-agent-lab/RSIHub" in project -assert "https://simpleagentlab.com/RSIHub/" in homepage and "https://simpleagentlab.com/RSIHub/" in project -assert "https://simpleagentlab.com/rsihub/" in project -assert 'url=/rsihub/' in redirect -print("RSIHub migration targets verified") -PY -``` - -Expected: prints `RSIHub migration targets verified`. diff --git a/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md b/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md deleted file mode 100644 index 30e155b..0000000 --- a/docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md +++ /dev/null @@ -1,76 +0,0 @@ -# RSIHub Rename and Link Migration Design - -## Goal - -Rename the website's EvolveX presentation to RSIHub and migrate its links and -search metadata without changing the project's positioning, capabilities, or -substantive copy. - -## Public URLs - -- The website overview page moves from `https://simpleagentlab.com/evolvex/` - to `https://simpleagentlab.com/rsihub/`. -- The documentation action points to the distinct, case-sensitive URL - `https://simpleagentlab.com/RSIHub/`. -- Code and repository deep links point to - `https://github.com/simple-agent-lab/RSIHub`. -- The old `/evolvex/` path remains as a compatibility redirect to `/rsihub/`. - -GitHub Pages cannot return a custom HTTP 301 for a static HTML route. The old -page will therefore use an immediate client-side redirect, declare `/rsihub/` -as its canonical URL, and provide a visible fallback link. - -## Content Migration - -The homepage will: - -- replace the EvolveX name with RSIHub in visible English and Chinese content; -- link the project summary to `/rsihub/`; -- link the Code action to the RSIHub GitHub repository; and -- link the Docs action to `https://simpleagentlab.com/RSIHub/`. - -The existing project page and its assets will move from `evolvex/` to -`rsihub/`. All EvolveX names, accessibility labels, SVG titles, and repository -links will become RSIHub equivalents. This is a rename and link migration -only: descriptions of the framework, its architecture, maturity, workflows, -and capabilities will remain substantively unchanged. - -## Metadata and Discovery - -The migration will update: - -- HTML titles, descriptions, keywords, and canonical links; -- Open Graph and Twitter metadata; -- JSON-LD names, identifiers, URLs, repository links, and `sameAs` values; -- the XML sitemap, replacing `/evolvex/` with `/rsihub/`; -- image titles and alternative text that contain the old name. - -The canonical website page is lowercase `/rsihub/`. The uppercase `/RSIHub/` -path is reserved for the separately published documentation. - -## Compatibility and Failure Handling - -Visitors reaching `/evolvex/` will be sent to `/rsihub/`. If automatic -redirect behavior is disabled or unavailable, the compatibility page will -show a direct link to the new page. No other website routes or projects will -change. - -## Verification - -Verification will: - -1. scan tracked text files for obsolete `EvolveX` names and old repository or - documentation URLs, allowing only the compatibility route where necessary; -2. validate the homepage links, the lowercase overview canonical URL, the - uppercase documentation link, and the old-route redirect; -3. serve the static site locally and inspect the homepage, `/rsihub/`, and - `/evolvex/`; and -4. exercise English and Chinese presentation plus light and dark themes to - ensure the directory move does not break shared scripts, styles, or assets. - -## Out of Scope - -- Repositioning RSIHub or changing capability claims. -- Redesigning the homepage or project page. -- Changing the shared language or theme behavior. -- Changing the separately deployed RSIHub documentation site. diff --git a/tests/test_rsihub_migration.py b/tests/test_rsihub_migration.py index 9ddc1ae..cca66f1 100644 --- a/tests/test_rsihub_migration.py +++ b/tests/test_rsihub_migration.py @@ -93,10 +93,8 @@ def test_sitemap_contains_only_the_canonical_project_route(self): self.assertIn("https://simpleagentlab.com/rsihub/", text) self.assertNotIn("https://simpleagentlab.com/evolvex/", text) - def test_old_identity_remains_only_in_migration_docs(self): + def test_old_identity_is_absent_from_published_files(self): allowed = { - Path("docs/superpowers/specs/2026-08-12-rsihub-rename-migration-design.md"), - Path("docs/superpowers/plans/2026-08-12-rsihub-rename-migration.md"), Path("tests/test_rsihub_migration.py"), } forbidden = ( From 7f40f703e0e09d00815d05d4c15632be9f7c9bc5 Mon Sep 17 00:00:00 2001 From: zimuwang Date: Wed, 12 Aug 2026 14:37:06 +0800 Subject: [PATCH 9/9] test: tolerate binary tracked files --- tests/test_rsihub_migration.py | 35 ++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/tests/test_rsihub_migration.py b/tests/test_rsihub_migration.py index cca66f1..84dfbab 100644 --- a/tests/test_rsihub_migration.py +++ b/tests/test_rsihub_migration.py @@ -1,6 +1,7 @@ from html.parser import HTMLParser from pathlib import Path import subprocess +import tempfile import unittest @@ -33,6 +34,30 @@ def parse_html(relative_path): return parser +def read_tracked_text(path): + if not path.is_file(): + return None + try: + return path.read_text(encoding="utf-8") + except UnicodeDecodeError: + return None + + +class TrackedTextTests(unittest.TestCase): + def test_read_tracked_text_skips_missing_and_non_utf8_paths(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + readable = root / "page.html" + binary = root / "font.woff2" + readable.write_text("RSIHub", encoding="utf-8") + binary.write_bytes(b"\xff\xfe\x00\x01") + + self.assertEqual(read_tracked_text(readable), "RSIHub") + self.assertIsNone(read_tracked_text(binary)) + self.assertIsNone(read_tracked_text(root / "deleted.html")) + self.assertIsNone(read_tracked_text(root)) + + class RSIHubProjectPageTests(unittest.TestCase): def test_canonical_project_page_uses_new_identity_and_urls(self): page_path = ROOT / "rsihub/index.html" @@ -97,11 +122,7 @@ def test_old_identity_is_absent_from_published_files(self): allowed = { Path("tests/test_rsihub_migration.py"), } - forbidden = ( - "EvolveX", - "simple-agent-lab/EvolveX", - "simple-agent-lab.github.io/EvolveX", - ) + forbidden = ("EvolveX",) tracked = subprocess.check_output( ["git", "ls-files", "-z"], cwd=ROOT ).decode("utf-8").split("\0") @@ -114,6 +135,8 @@ def test_old_identity_is_absent_from_published_files(self): continue if path.suffix.lower() in {".png", ".jpg", ".jpeg", ".gif", ".webp"}: continue - text = path.read_text(encoding="utf-8") + text = read_tracked_text(path) + if text is None: + continue for old_value in forbidden: self.assertNotIn(old_value, text, f"{old_value!r} remains in {relative}")