Personal Telegram developer console for GitHub
docs: capture repo navigation 404 root cause
davoodmehraban89 committed
Oct 4, 2026 at 06:30 UTC
c224c59159f38ebae3b168ea14d3990f83f8c4be
1 file changed
+27
docs/superpowers/specs/2026-10-04-repository-id-navigation-fallback.md
new
+27
@@ -0,0 +1,27 @@
1
+# Repository ID Navigation Fallback
2
+
3
+## Problem
4
+
5
+Production telemetry recorded `github.repo.detail` failing with `GitHub repository failed: 404 Not Found` when a Telegram `repo:<id>` navigation callback was used from an error/recovery screen. The UI then remained on the error screen, so the visible “Back to project” control appeared broken.
6
+
7
+## Root cause
8
+
9
+Repository navigation uses numeric GitHub repository IDs. `GitHubService.getRepositoryContext()` resolves numeric refs through `GET /repositories/{id}`. In production this endpoint returned 404 for an accessible private repository, even though the repository remained accessible through authenticated repository listings and its canonical `owner/name` endpoint.
10
+
11
+## Required behavior
12
+
13
+For numeric repository refs:
14
+
15
+1. Try the direct numeric lookup first.
16
+2. Only when it returns 404, enumerate repositories accessible to the authenticated token and find an exact numeric ID match.
17
+3. Resolve that match through its canonical `owner/name` endpoint.
18
+4. Do not fall back for non-404 provider failures.
19
+5. Keep all existing owner-only, policy, Safe Approval, and audit behavior unchanged.
20
+
21
+## Acceptance
22
+
23
+- A focused test reproduces the private numeric-ID 404 and fails before implementation.
24
+- The fallback test passes after implementation.
25
+- Existing test suite remains green.
26
+- PR CI is green before merge.
27
+- Post-merge main CI and Cloudflare deployment are verified on the exact merge SHA.