Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(ratchets): regenerate the boundary baseline and the migration inventory

Juan Denis550dd4758563
diff --git a/backend/tests/api_controller_boundary_baseline.json b/backend/tests/api_controller_boundary_baseline.json
index 5f454f13..46559443 100644
--- a/backend/tests/api_controller_boundary_baseline.json
+++ b/backend/tests/api_controller_boundary_baseline.json
@@ -239,7 +239,7 @@
"api/ai.py::_persist_assistant_message::persistence::db.session.add(msg)::1",
"api/ai.py::_persist_assistant_message::persistence::db.session.commit()::1",
"api/ai.py::_persist_assistant_message::persistence::db.session.rollback()::1",
- "api/ai.py::_persist_user_message::persistence::db.session.add(AiMessage(conversation_id=row.id, role=AiMessage.ROLE_USER, content=content))::1",
+ "api/ai.py::_persist_user_message::persistence::db.session.add(message)::1",
"api/ai.py::_persist_user_message::persistence::db.session.commit()::1",
"api/ai.py::_persist_user_message::persistence::db.session.rollback()::1",
"api/ai.py::chat_confirm::persistence::db.session.get(AiPendingAction, token)::1",
diff --git a/backend/tests/test_migration_inventory.py b/backend/tests/test_migration_inventory.py
index e366ad8d..8523bd4e 100644
--- a/backend/tests/test_migration_inventory.py
+++ b/backend/tests/test_migration_inventory.py
@@ -8,13 +8,13 @@ regenerating the document is part of the commit::
python scripts/generate-migration-inventory.py
-Skipped when node is unavailable — the generator shells out to the frontend
-boundary checker for its half of the rows.
+Skipped only when no node binary is reachable at all — the generator shells
+out to the frontend boundary checker for its half of the rows, and resolves
+``$NODE`` / ``node`` / ``node.exe`` so a WSL run still covers it.
"""
import importlib.util
import os
-import shutil
import subprocess
import sys
@@ -27,8 +27,6 @@ DOC = os.path.join(REPO, 'docs', 'MIGRATION_INVENTORY.md')
def test_the_committed_inventory_matches_the_measured_state():
- if shutil.which('node') is None:
- pytest.skip('node is not available to run the frontend half')
assert os.path.exists(DOC), (
'docs/MIGRATION_INVENTORY.md is missing; run '
'python scripts/generate-migration-inventory.py')
@@ -37,6 +35,11 @@ def test_the_committed_inventory_matches_the_measured_state():
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
+ # Same resolution the generator uses, so WSL (where the Windows nvm dir
+ # exposes only node.exe) runs this instead of skipping it.
+ if mod.node_command() is None:
+ pytest.skip('node is not available to run the frontend half')
+
expected = mod.render()
with open(DOC, encoding='utf-8') as f:
committed = f.read()
diff --git a/docs/MIGRATION_INVENTORY.md b/docs/MIGRATION_INVENTORY.md
index d0fc20c7..18dd1bbd 100644
--- a/docs/MIGRATION_INVENTORY.md
+++ b/docs/MIGRATION_INVENTORY.md
@@ -13,7 +13,7 @@ debt. Regenerate with `python scripts/generate-migration-inventory.py`.
| Concern | Door | Remaining | Ceiling | Policy |
|---|---|---:|---:|---|
| Identity lookups outside rbac.get_current_user() | rbac.get_current_user() | 69 | 69 | JWT-only routes; the API-key-capable population is held at 0 by a companion assertion |
-| Routes on bare @jwt_required() | auth_required() / role decorators | 577 | 577 | REGISTERED EXCEPTION: JWT-only is the deliberate default; conversion grants API-key access and happens per route, on decision |
+| Routes on bare @jwt_required() | auth_required() / role decorators | 576 | 577 | REGISTERED EXCEPTION: JWT-only is the deliberate default; conversion grants API-key access and happens per route, on decision |
| HTTP statuses chosen by sniffing error text | typed errors from app.exceptions | 0 | 0 | INVARIANT at 0 - migration completed 2026-08-19 |
| API crashes swallowed without recording | app.error_reporting | 0 | 0 | INVARIANT at 0 |
| Hand-shaped {'error': ...} bodies in app/api | typed errors + the global handler | 1144 | 1144 | migrate when touched; new endpoints raise |
@@ -23,8 +23,8 @@ debt. Regenerate with `python scripts/generate-migration-inventory.py`.
| per-page toast.error extractions in pages/ | E1: query-layer error presentation | 264 | 264 | migrate when touched |
| hand-rolled form-group blocks | F2: FormField/useForm | 343 | 343 | migrate when touched |
| unencoded ?k=${v} query interpolations in services/api | C4: buildQuery/encoding template | 97 | 97 | migrate when touched |
-| raw setInterval pollers | E2: usePolling/refetchInterval | 10 | 10 | DELIBERATE RESIDUE: clock ticks, socket-fallback hooks, and sibling-repo extension timers - each listed per file |
+| raw setInterval pollers | E2: usePolling/refetchInterval | 9 | 9 | DELIBERATE RESIDUE: clock ticks, socket-fallback hooks, and sibling-repo extension timers - each listed per file |
| direct navigator.clipboard call sites | F3: copyToClipboard | 0 | 0 | INVARIANT at 0 |
-| hex colour literals outside token files | G: var(--token) | 151 | 151 | migrate when touched |
+| hex colour literals outside token files | G: var(--token) | 150 | 150 | migrate when touched |
| SCSS class names defined in multiple files | single-owner partials | 114 | 114 | needs eyes on pages (no byte-identical proof available) |
diff --git a/scripts/generate-migration-inventory.py b/scripts/generate-migration-inventory.py
index 1ee80f0f..f798fbf6 100644
--- a/scripts/generate-migration-inventory.py
+++ b/scripts/generate-migration-inventory.py
@@ -20,6 +20,7 @@ import importlib
import io
import json
import os
+import shutil
import subprocess
import sys
@@ -66,9 +67,26 @@ def _controller_boundary_row():
'service layer extraction', n, n, 'migrate when touched (first-wave ratchet)')
+def node_command():
+ """Resolve the node binary: ``$NODE``, then ``node``, then ``node.exe``.
+
+ Hardcoding ``node`` made this generator unavailable under WSL, where the
+ Windows nvm directory is on PATH but only exposes ``node.exe`` -- so
+ test_migration_inventory.py skipped on the dev box, and the inventory
+ reached CI stale with nothing local able to say so.
+ """
+ for candidate in (os.environ.get('NODE'), 'node', 'node.exe'):
+ if candidate and shutil.which(candidate):
+ return candidate
+ return None
+
+
def _frontend_rows():
+ node = node_command()
+ if node is None:
+ raise SystemExit('node is required for the frontend rows (set NODE=/path/to/node)')
result = subprocess.run(
- ['node', os.path.join('frontend', 'scripts', 'check-frontend-boundaries.mjs'),
+ [node, os.path.join('frontend', 'scripts', 'check-frontend-boundaries.mjs'),
'--inventory'],
capture_output=True, text=True, cwd=REPO)
if result.returncode != 0: