Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): canonicalize GitHub's ssh.* alias in githubRepoSpec
[._.]/ Adam Eivy76ea081a02e7
diff --git a/server/lib/workTracker.js b/server/lib/workTracker.jsindex b3b82599f7..d0d66b77d5 100644--- a/server/lib/workTracker.js+++ b/server/lib/workTracker.js@@ -78,12 +78,19 @@ export function isGithubHost(host) {* definition of "a resolvable GitHub repo" instead of three hand-copied ones.* (No separate `hasOrigin` check: isGithubHost is true only for a real GitHub* host string, which getOriginInfo returns only when an origin exists.)+ *+ * Canonicalizes GitHub's SSH-over-443 alias: a `[email protected]:443/owner/repo`+ * remote parses to host `ssh.github.com`, but `gh --repo` reads the `HOST/` prefix+ * as the API host, so `ssh.github.com/owner/repo` would query the SSH endpoint and+ * silently return nothing. Strip a leading `ssh.` so the selector names the real+ * API host (`ssh.github.com`→`github.com`, `ssh.github.example.com`→`github.example.com`).* @param {{host?:string|null, fullName?:string|null}} origin* @returns {string|null}*/export function githubRepoSpec(origin) {if (!origin?.fullName || !isGithubHost(origin.host)) return null;- return `${origin.host}/${origin.fullName}`;+ const apiHost = origin.host.replace(/^ssh\./i, '');+ return `${apiHost}/${origin.fullName}`;}/**diff --git a/server/lib/workTracker.test.js b/server/lib/workTracker.test.jsindex 4fab97db09..4d3e33a07c 100644--- a/server/lib/workTracker.test.js+++ b/server/lib/workTracker.test.js@@ -64,6 +64,14 @@ describe('githubRepoSpec', () => {expect(githubRepoSpec({ host: 'github.acme.example', fullName: 'acme/app' })).toBe('github.acme.example/acme/app');});+ it('canonicalizes the SSH-over-443 alias to the API host', () => {+ // [email protected]:443/owner/repo → getOriginInfo host 'ssh.github.com';+ // gh --repo reads the HOST/ prefix as the API host, so it must be github.com.+ expect(githubRepoSpec({ host: 'ssh.github.com', fullName: 'atomantic/PortOS' }))+ .toBe('github.com/atomantic/PortOS');+ expect(githubRepoSpec({ host: 'ssh.github.example.com', fullName: 'acme/app' }))+ .toBe('github.example.com/acme/app');+ });it('returns null for a non-GitHub host, a missing owner/repo, or no origin', () => {expect(githubRepoSpec({ host: 'gitlab.com', fullName: 'group/proj' })).toBeNull();expect(githubRepoSpec({ host: 'bitbucket.org', fullName: 'team/proj' })).toBeNull();