kodingo-cli 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/repo-identity.test.js +120 -0
- package/dist/commands/init.js +11 -10
- package/dist/commands/scan-git.js +3 -3
- package/dist/commands/scan-repo.js +2 -1
- package/dist/commands/security-scan.js +2 -1
- package/dist/commands/sync-dependencies.js +2 -5
- package/dist/utils/repo-identity.js +83 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Real tests for repo-identity.ts — build brief "Fix repo-label
|
|
4
|
+
* contamination at the source, platform-wide" (2026-09-30).
|
|
5
|
+
*
|
|
6
|
+
* Uses real temporary git repos (real `git remote add`, real .git dirs)
|
|
7
|
+
* rather than mocking simple-git, matching this repo's own testing style
|
|
8
|
+
* (see vendoredCodeDetector.test.ts). Only the network call to the API is
|
|
9
|
+
* mocked, since there's no real server to hit in a unit test — the
|
|
10
|
+
* server-side resolve/register logic itself is covered in kodingo-api's
|
|
11
|
+
* repoIdentityResolve.test.ts.
|
|
12
|
+
*/
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const node_test_1 = require("node:test");
|
|
18
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
19
|
+
const node_child_process_1 = require("node:child_process");
|
|
20
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
21
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
22
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
23
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
24
|
+
function makeTempDir() {
|
|
25
|
+
return node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), "kodingo-repo-identity-"));
|
|
26
|
+
}
|
|
27
|
+
(0, node_test_1.describe)("parseRepoNameFromRemote", () => {
|
|
28
|
+
for (const [url, expected] of [
|
|
29
|
+
["git@github.com:abokidev/kodingo-cli.git", "kodingo-cli"],
|
|
30
|
+
["https://github.com/abokidev/kodingo-cli.git", "kodingo-cli"],
|
|
31
|
+
["https://github.com/abokidev/kodingo-cli", "kodingo-cli"],
|
|
32
|
+
["ssh://git@github.com/abokidev/veriport.git", "veriport"],
|
|
33
|
+
["https://github.com/abokidev/NDDC-BoardRoom.git/", "NDDC-BoardRoom"],
|
|
34
|
+
]) {
|
|
35
|
+
(0, node_test_1.it)(`extracts "${expected}" from ${url}`, () => {
|
|
36
|
+
strict_1.default.equal((0, repo_identity_1.parseRepoNameFromRemote)(url), expected);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
(0, node_test_1.describe)("getRemoteUrl — against real temporary git repos", () => {
|
|
41
|
+
let dir;
|
|
42
|
+
(0, node_test_1.beforeEach)(() => {
|
|
43
|
+
dir = makeTempDir();
|
|
44
|
+
(0, node_child_process_1.execSync)("git init -q", { cwd: dir });
|
|
45
|
+
});
|
|
46
|
+
(0, node_test_1.afterEach)(() => {
|
|
47
|
+
node_fs_1.default.rmSync(dir, { recursive: true, force: true });
|
|
48
|
+
});
|
|
49
|
+
(0, node_test_1.it)("returns the real origin fetch URL when one is configured", async () => {
|
|
50
|
+
(0, node_child_process_1.execSync)("git remote add origin git@github.com:abokidev/achieva.git", { cwd: dir });
|
|
51
|
+
const url = await (0, repo_identity_1.getRemoteUrl)(dir);
|
|
52
|
+
strict_1.default.equal(url, "git@github.com:abokidev/achieva.git");
|
|
53
|
+
});
|
|
54
|
+
(0, node_test_1.it)("returns null when the repo has no remote at all", async () => {
|
|
55
|
+
const url = await (0, repo_identity_1.getRemoteUrl)(dir);
|
|
56
|
+
strict_1.default.equal(url, null);
|
|
57
|
+
});
|
|
58
|
+
(0, node_test_1.it)("returns null for a path that isn't a git repo", async () => {
|
|
59
|
+
const bare = makeTempDir();
|
|
60
|
+
try {
|
|
61
|
+
const url = await (0, repo_identity_1.getRemoteUrl)(bare);
|
|
62
|
+
strict_1.default.equal(url, null);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
node_fs_1.default.rmSync(bare, { recursive: true, force: true });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
(0, node_test_1.describe)("deriveCandidateRepoName", () => {
|
|
70
|
+
let dir;
|
|
71
|
+
(0, node_test_1.beforeEach)(() => {
|
|
72
|
+
dir = makeTempDir();
|
|
73
|
+
(0, node_child_process_1.execSync)("git init -q", { cwd: dir });
|
|
74
|
+
});
|
|
75
|
+
(0, node_test_1.afterEach)(() => {
|
|
76
|
+
node_fs_1.default.rmSync(dir, { recursive: true, force: true });
|
|
77
|
+
});
|
|
78
|
+
(0, node_test_1.it)("prefers the git-remote-derived name over the local folder name — this is the whole fix", async () => {
|
|
79
|
+
(0, node_child_process_1.execSync)("git remote add origin https://github.com/abokidev/veriport.git", { cwd: dir });
|
|
80
|
+
// The local folder name is deliberately unrelated to the real repo name —
|
|
81
|
+
// this is exactly the VeriPort/"mac" shape of the original bug.
|
|
82
|
+
const { candidateName, hasRemote } = await (0, repo_identity_1.deriveCandidateRepoName)(dir);
|
|
83
|
+
strict_1.default.equal(candidateName, "veriport");
|
|
84
|
+
strict_1.default.equal(hasRemote, true);
|
|
85
|
+
strict_1.default.notEqual(candidateName, node_path_1.default.basename(dir));
|
|
86
|
+
});
|
|
87
|
+
(0, node_test_1.it)("falls back to the local folder name only when there's truly no remote", async () => {
|
|
88
|
+
const { candidateName, hasRemote } = await (0, repo_identity_1.deriveCandidateRepoName)(dir);
|
|
89
|
+
strict_1.default.equal(candidateName, node_path_1.default.basename(dir));
|
|
90
|
+
strict_1.default.equal(hasRemote, false);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
(0, node_test_1.describe)("resolveCanonicalRepoName", () => {
|
|
94
|
+
let dir;
|
|
95
|
+
const originalFetch = globalThis.fetch;
|
|
96
|
+
(0, node_test_1.beforeEach)(() => {
|
|
97
|
+
dir = makeTempDir();
|
|
98
|
+
(0, node_child_process_1.execSync)("git init -q", { cwd: dir });
|
|
99
|
+
(0, node_child_process_1.execSync)("git remote add origin https://github.com/abokidev/fot.git", { cwd: dir });
|
|
100
|
+
});
|
|
101
|
+
(0, node_test_1.afterEach)(() => {
|
|
102
|
+
node_fs_1.default.rmSync(dir, { recursive: true, force: true });
|
|
103
|
+
globalThis.fetch = originalFetch;
|
|
104
|
+
});
|
|
105
|
+
(0, node_test_1.it)("returns the server's resolved canonical name", async () => {
|
|
106
|
+
globalThis.fetch = (async () => new Response(JSON.stringify({ repoName: "fot", registered: false, matched: "single-registered" }), { status: 200 }));
|
|
107
|
+
const result = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot: dir, apiUrl: "https://example.invalid", token: "t" });
|
|
108
|
+
strict_1.default.equal(result, "fot");
|
|
109
|
+
});
|
|
110
|
+
(0, node_test_1.it)("fails open to the local candidate when the server errors", async () => {
|
|
111
|
+
globalThis.fetch = (async () => new Response("", { status: 500 }));
|
|
112
|
+
const result = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot: dir, apiUrl: "https://example.invalid", token: "t" });
|
|
113
|
+
strict_1.default.equal(result, "fot"); // git-remote-derived candidate, still better than the old folder-name behaviour
|
|
114
|
+
});
|
|
115
|
+
(0, node_test_1.it)("fails open to the local candidate when the server is unreachable", async () => {
|
|
116
|
+
globalThis.fetch = (async () => { throw new Error("network down"); });
|
|
117
|
+
const result = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot: dir, apiUrl: "https://example.invalid", token: "t" });
|
|
118
|
+
strict_1.default.equal(result, "fot");
|
|
119
|
+
});
|
|
120
|
+
});
|
package/dist/commands/init.js
CHANGED
|
@@ -49,6 +49,7 @@ const path = __importStar(require("path"));
|
|
|
49
49
|
const os = __importStar(require("os"));
|
|
50
50
|
// open is imported dynamically to avoid ESM/CJS compatibility issues on Windows
|
|
51
51
|
const persistence_config_1 = require("../utils/persistence-config");
|
|
52
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
52
53
|
const API_BASE = "https://kodingo-api.onrender.com";
|
|
53
54
|
const APP_URL = "https://kodingo.xyz";
|
|
54
55
|
const CONFIG_DIR = path.join(os.homedir(), ".kodingo");
|
|
@@ -271,17 +272,17 @@ function registerInitCommand(program) {
|
|
|
271
272
|
(0, persistence_config_1.writeConfig)({ ...existingConfig, mode: "cloud", apiUrl, machineId });
|
|
272
273
|
(0, persistence_config_1.writeWorkspaceConfig)(repoRoot, { mode: "cloud", apiUrl, token: selectedProject.token });
|
|
273
274
|
ensureGitignoreEntry(repoRoot, ".kortex/");
|
|
274
|
-
// Register this repo with the project on the API
|
|
275
|
-
// This is the authoritative binding that prevents cross-project
|
|
275
|
+
// Register this repo with the project on the API.
|
|
276
|
+
// This is the authoritative binding that prevents cross-project
|
|
277
|
+
// contamination — resolved from the git remote (stable across
|
|
278
|
+
// machines and folder names), not the local folder name itself,
|
|
279
|
+
// so the registration this creates is trustworthy for every future
|
|
280
|
+
// scan to resolve against.
|
|
276
281
|
try {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
"Content-Type": "application/json",
|
|
282
|
-
"Authorization": `Bearer ${authToken}`,
|
|
283
|
-
},
|
|
284
|
-
body: JSON.stringify({ repoName }),
|
|
282
|
+
await (0, repo_identity_1.resolveCanonicalRepoName)({
|
|
283
|
+
repoRoot,
|
|
284
|
+
apiUrl,
|
|
285
|
+
token: selectedProject.token,
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
288
|
catch { }
|
|
@@ -14,6 +14,7 @@ const git_listener_1 = require("../adapters/git-adapter/git-listener");
|
|
|
14
14
|
const db_event_port_1 = require("../ports/db-event-port");
|
|
15
15
|
const cloud_event_port_1 = require("../ports/cloud-event-port");
|
|
16
16
|
const persistence_config_2 = require("../utils/persistence-config");
|
|
17
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
17
18
|
const API_BASE_DEFAULT = "https://kodingo-api.onrender.com";
|
|
18
19
|
function getCredentials(repoRoot) {
|
|
19
20
|
const config = (0, persistence_config_1.readConfig)();
|
|
@@ -29,11 +30,10 @@ function getCredentials(repoRoot) {
|
|
|
29
30
|
const apiUrl = wsEntry?.apiUrl ?? config.apiUrl ?? API_BASE_DEFAULT;
|
|
30
31
|
return { token, apiUrl };
|
|
31
32
|
}
|
|
32
|
-
async function detectContextDecay(repoRoot, changedFiles) {
|
|
33
|
+
async function detectContextDecay(repoRoot, changedFiles, repoName) {
|
|
33
34
|
const { token, apiUrl } = getCredentials(repoRoot);
|
|
34
35
|
if (!token)
|
|
35
36
|
return;
|
|
36
|
-
const repoName = path_1.default.basename(repoRoot);
|
|
37
37
|
for (const filePath of changedFiles) {
|
|
38
38
|
if (!fs_1.default.existsSync(filePath))
|
|
39
39
|
continue;
|
|
@@ -110,7 +110,7 @@ async function scanGitCommand(options) {
|
|
|
110
110
|
const diffOutput = await git.diff([`${commitHash}^`, commitHash, '--name-only']).catch(() => '');
|
|
111
111
|
const commitChangedFiles = diffOutput.split('\n').filter(Boolean).map((f) => path_1.default.join(repoRoot, f)).filter((f) => /\.(ts|tsx|js|jsx|py|go|rs|php|java|kt|rb)$/.test(f));
|
|
112
112
|
if (token && commitChangedFiles.length > 0) {
|
|
113
|
-
const repoName =
|
|
113
|
+
const repoName = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot, apiUrl, token });
|
|
114
114
|
for (const filePath of commitChangedFiles) {
|
|
115
115
|
if (!fs_1.default.existsSync(filePath))
|
|
116
116
|
continue;
|
|
@@ -60,6 +60,7 @@ const ast_parser_1 = require("../utils/ast-parser");
|
|
|
60
60
|
const graph_builder_1 = require("../utils/graph-builder");
|
|
61
61
|
const context_assembler_1 = require("../utils/context-assembler");
|
|
62
62
|
const vendoredCodeDetector_1 = require("../utils/vendoredCodeDetector");
|
|
63
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
63
64
|
const API_BASE = "https://kodingo-api.onrender.com";
|
|
64
65
|
const SUPPORTED_EXTENSIONS = [
|
|
65
66
|
".ts", ".tsx", ".js", ".jsx",
|
|
@@ -253,7 +254,7 @@ async function scanRepoCommand(options = {}) {
|
|
|
253
254
|
const repoRoot = options.repo
|
|
254
255
|
? path_1.default.resolve(options.repo)
|
|
255
256
|
: findRepoRoot(process.cwd());
|
|
256
|
-
const repoName =
|
|
257
|
+
const repoName = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot, apiUrl, token });
|
|
257
258
|
if (!options.silent) {
|
|
258
259
|
console.log(`\n🔍 Kortex — scanning ${repoName} for existing functions...\n`);
|
|
259
260
|
}
|
|
@@ -18,6 +18,7 @@ const graph_builder_1 = require("../utils/graph-builder");
|
|
|
18
18
|
const security_code_analyzer_1 = require("../utils/security-code-analyzer");
|
|
19
19
|
const context_assembler_1 = require("../utils/context-assembler");
|
|
20
20
|
const ast_parser_1 = require("../utils/ast-parser");
|
|
21
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
21
22
|
const IGNORED_DIRS = new Set(["node_modules", ".git", ".kortex", "dist", "build", "vendor", "out", ".next", ".venv", "venv", "env", "site-packages", "virtualenv", ".tox", "target", ".gradle", ".idea", ".vscode", "bin", "obj"]);
|
|
22
23
|
const SUPPORTED_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs", ".php", ".java", ".kt", ".rb", ".c", ".cpp", ".html", ".phtml", ".twig", ".blade.php"];
|
|
23
24
|
function walkFiles(dir) {
|
|
@@ -53,7 +54,7 @@ async function securityScanCommand(options = {}) {
|
|
|
53
54
|
console.error("✖ This repo is not connected to Kodingo. Run `kodingo init` first.");
|
|
54
55
|
return false;
|
|
55
56
|
}
|
|
56
|
-
const repoName =
|
|
57
|
+
const repoName = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot, apiUrl, token });
|
|
57
58
|
if (!options.silent)
|
|
58
59
|
console.log(`\n🔒 Kortex Security — scanning ${repoName} for known vulnerabilities...\n`);
|
|
59
60
|
try {
|
|
@@ -7,15 +7,12 @@
|
|
|
7
7
|
* Run this before 'kodingo security-scan' — the scan works off whatever was
|
|
8
8
|
* last synced here.
|
|
9
9
|
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
11
|
exports.syncDependenciesCommand = syncDependenciesCommand;
|
|
15
|
-
const path_1 = __importDefault(require("path"));
|
|
16
12
|
const persistence_config_1 = require("../utils/persistence-config");
|
|
17
13
|
const repo_scope_1 = require("../utils/repo-scope");
|
|
18
14
|
const dependency_parser_1 = require("../utils/dependency-parser");
|
|
15
|
+
const repo_identity_1 = require("../utils/repo-identity");
|
|
19
16
|
async function syncDependenciesCommand(options = {}) {
|
|
20
17
|
const repoRoot = (0, repo_scope_1.resolveRepoScope)(options.repo ? { repo: options.repo } : {}) ?? process.cwd();
|
|
21
18
|
const config = (0, persistence_config_1.readConfig)();
|
|
@@ -27,7 +24,7 @@ async function syncDependenciesCommand(options = {}) {
|
|
|
27
24
|
console.error("✖ This repo is not connected to Kodingo. Run `kodingo init` first.");
|
|
28
25
|
return false;
|
|
29
26
|
}
|
|
30
|
-
const repoName =
|
|
27
|
+
const repoName = await (0, repo_identity_1.resolveCanonicalRepoName)({ repoRoot, apiUrl, token });
|
|
31
28
|
if (!options.silent)
|
|
32
29
|
console.log(`\n🔒 Kortex Security — scanning dependencies for ${repoName}...\n`);
|
|
33
30
|
const deps = (0, dependency_parser_1.extractDependencies)(repoRoot);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseRepoNameFromRemote = parseRepoNameFromRemote;
|
|
7
|
+
exports.getRemoteUrl = getRemoteUrl;
|
|
8
|
+
exports.deriveCandidateRepoName = deriveCandidateRepoName;
|
|
9
|
+
exports.resolveCanonicalRepoName = resolveCanonicalRepoName;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the canonical `repo` identity sent to the server, instead of
|
|
12
|
+
* every scan command inventing its own label from the local checkout.
|
|
13
|
+
*
|
|
14
|
+
* Root cause (build brief "Fix repo-label contamination at the source,
|
|
15
|
+
* platform-wide", 2026-09-30): every local capture path — scan-repo,
|
|
16
|
+
* security-scan, sync-dependencies, scan-git, and `kodingo init`'s own
|
|
17
|
+
* repo-registration call — independently computed `path.basename(repoRoot)`
|
|
18
|
+
* as the repo label. That's the local folder name, never a stable
|
|
19
|
+
* identifier: two developers with two different folder names for the same
|
|
20
|
+
* clone produce two different labels for the same real repo, and `init`
|
|
21
|
+
* seeded `kodingo_project_repos` (the intended source of truth) with that
|
|
22
|
+
* same unstable value, contaminating it at the first write.
|
|
23
|
+
*
|
|
24
|
+
* Fix: derive a candidate name from the git remote URL (stable across
|
|
25
|
+
* machines and folder names) and resolve it against the server's real,
|
|
26
|
+
* registered repos for this project via POST /cli/repo/resolve — which
|
|
27
|
+
* owns the single-repo / multi-repo / first-registration disambiguation.
|
|
28
|
+
* Falls back to the local folder name only when there's truly no git
|
|
29
|
+
* remote to read (e.g. a brand-new local-only repo).
|
|
30
|
+
*/
|
|
31
|
+
const path_1 = __importDefault(require("path"));
|
|
32
|
+
const simple_git_1 = __importDefault(require("simple-git"));
|
|
33
|
+
function parseRepoNameFromRemote(remoteUrl) {
|
|
34
|
+
const cleaned = remoteUrl.trim().replace(/\/+$/, "").replace(/\.git$/, "");
|
|
35
|
+
const match = cleaned.match(/[/:]([^/:]+)$/);
|
|
36
|
+
return match?.[1] || null;
|
|
37
|
+
}
|
|
38
|
+
async function getRemoteUrl(repoRoot) {
|
|
39
|
+
try {
|
|
40
|
+
const git = (0, simple_git_1.default)(repoRoot);
|
|
41
|
+
const remotes = await git.getRemotes(true);
|
|
42
|
+
if (!remotes.length)
|
|
43
|
+
return null;
|
|
44
|
+
const origin = remotes.find(r => r.name === "origin") ?? remotes[0];
|
|
45
|
+
return origin?.refs?.fetch || null;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function deriveCandidateRepoName(repoRoot) {
|
|
52
|
+
const remoteUrl = await getRemoteUrl(repoRoot);
|
|
53
|
+
const fromRemote = remoteUrl ? parseRepoNameFromRemote(remoteUrl) : null;
|
|
54
|
+
if (fromRemote)
|
|
55
|
+
return { candidateName: fromRemote, hasRemote: true };
|
|
56
|
+
return { candidateName: path_1.default.basename(repoRoot), hasRemote: false };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns the canonical repo label to send with this scan. Fails open to
|
|
60
|
+
* the locally derived candidate if the server is unreachable — a scan
|
|
61
|
+
* should never be blocked by this resolution, and the git-remote-derived
|
|
62
|
+
* candidate is already more stable than the old folder-basename behaviour
|
|
63
|
+
* even without a round-trip to the server.
|
|
64
|
+
*/
|
|
65
|
+
async function resolveCanonicalRepoName(params) {
|
|
66
|
+
const { candidateName, hasRemote } = await deriveCandidateRepoName(params.repoRoot);
|
|
67
|
+
try {
|
|
68
|
+
const res = await fetch(`${params.apiUrl}/cli/repo/resolve`, {
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: { "Content-Type": "application/json", "X-Kodingo-Token": params.token },
|
|
71
|
+
body: JSON.stringify({ candidateName, hasRemote }),
|
|
72
|
+
});
|
|
73
|
+
if (res.ok) {
|
|
74
|
+
const data = (await res.json());
|
|
75
|
+
if (data.repoName)
|
|
76
|
+
return data.repoName;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// offline / server unreachable — fail open below
|
|
81
|
+
}
|
|
82
|
+
return candidateName;
|
|
83
|
+
}
|