Skip to content

Commit 3ab8209

Browse files
committed
fix(cli): narrow auto_setup gate — broad gate made every command-test auto-scan (CI hang)
1 parent 3d8e0ee commit 3ab8209

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

scripts/codelens.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,16 +1445,21 @@ def main():
14451445
)
14461446

14471447
# ─── Auto-setup: if command needs registry and none exists, bootstrap it ────
1448-
# `scan` BUILDS the registry; `plugin`/`lsp` don't read it. Every other
1449-
# command — visible umbrella OR hidden leaf (list, query, ...) — consumes the
1450-
# registry and benefits from auto-setup when it's absent. Deriving the gate
1451-
# from this small exclusion set (rather than a hand-maintained allowlist)
1452-
# avoids the stale-list bug that let audit/security/deps/doctor and the hidden
1453-
# leaf commands slip through the gate (issue #244).
1454-
_NON_REGISTRY_COMMANDS = {"scan", "plugin", "lsp"}
1448+
# The 11 registry-consuming umbrellas (all except `scan`, which BUILDS it) plus
1449+
# the hidden leaf commands that read the registry directly (list/query/symbols).
1450+
# NOTE: keep this an explicit allowlist, NOT "every command except a few" — an
1451+
# over-broad gate makes EVERY command invocation auto-scan its workspace, which
1452+
# ballooned the test suite from ~164s to hours (each command-test scanning its
1453+
# fixture). #244 needed the umbrellas added; it did not need the whole hidden
1454+
# surface (check/analyze/entrypoints/...) to trigger scans.
1455+
_REGISTRY_COMMANDS = {
1456+
"search", "context", "deps", "audit", "security",
1457+
"summary", "impact", "api-map", "doctor", "history", "graph",
1458+
"list", "query", "symbols",
1459+
}
14551460

14561461
auto_setup_info = None
1457-
if args.command not in _NON_REGISTRY_COMMANDS and not _registry_exists(workspace):
1462+
if args.command in _REGISTRY_COMMANDS and not _registry_exists(workspace):
14581463
auto_setup_result = _auto_setup(workspace)
14591464
if auto_setup_result.get("auto_setup") == "ok":
14601465
auto_setup_info = {

0 commit comments

Comments
 (0)