Personal Telegram developer console for GitHub
fix: clarify Issues permission and empty Releases state (#20)
Live owner-device smoke hardening: make Issues 403 guidance least-privilege and explicit, clarify successful empty Releases state, add regression coverage, and update the durable project checkpoint.
davoodmehraban89 committed
Oct 3, 2026 at 11:03 UTC
7c0df4c8616c6859a2dfc4c35b0e22d6e47215bc
4 files changed
+94
-20
PROJECT_MEMORY.md
+38
-18
@@ -71,11 +71,15 @@ Conclusion:
71
- GitHub Actions WRITE authorization and provider POST: VERIFIED.
72
- Telegram success feedback after accepted provider WRITE: VERIFIED.
73
74
-## Current Work — PR #19 GitHub Advanced READ
75
-- Branch: `feat/github-advanced-read`.
74
+## GitHub Advanced READ Rollout — PR #19
75
- Design: `docs/superpowers/specs/2026-10-03-github-advanced-read-design.md`.
76
- Plan: `docs/superpowers/plans/2026-10-03-github-advanced-read.md`.
78
-- Scope is READ-only: workflow job detail/log tail, artifacts metadata, branches/compare, PR detail/files/checks, issues, releases and bounded pagination. No new provider mutation is added in this slice.
77
+- Scope is READ-only: workflow job detail/log tail, artifacts metadata, branches/compare, PR detail/files/checks, issues, releases and bounded pagination. No new provider mutation was added in this slice.
78
+- PR #19 merged to `main` at `ff270005fca1eda601df0a615ca81033c7340b3a`.
79
+- Post-merge CI #172 / run `37102293956` succeeded on that exact SHA with 22 test files and 97/97 tests passing, 0 fail/skip/cancelled.
80
+- Deploy #108 / run `37102308006` succeeded from that exact SHA.
81
+- Active Cloudflare production version after deploy: `bc23d9e5-1490-429c-9369-4e751f173df5` at 100% traffic.
82
+- Cloudflare Observability issue summary after deploy showed 0 active issues and 0 active occurrences.
83
84
### TDD evidence
85
- Provider RED CI #156 / run `37100585034`: 87 tests total, 82 pass / 5 expected failures for missing Advanced provider readers.
@@ -86,7 +90,7 @@ Conclusion:
90
- Review hardening RED CI #164 / run `37101390354`: 95 tests total, 92 pass / 3 expected failures for artifact pagination, PR diff pagination and visible READ-provider errors.
91
- Review hardening GREEN CI #166 / run `37101635682`: 21 test files, 95/95 pass, 0 fail/skip/cancelled.
92
- Mixed Issue/PR pagination RED CI #167 / run `37101783124`: 97 tests total, 95 pass / 2 expected failures.
89
-- Final GREEN CI #170 / run `37102060845` at head `9fbd33f3ad436c9519d521d704b6f7b882a2bbdd`: 22 test files, 97/97 pass, 0 fail/skip/cancelled.
93
+- Final pre-merge GREEN CI #170 / run `37102060845`: 22 test files, 97/97 pass, 0 fail/skip/cancelled.
94
95
### Implemented in PR #19
96
- Bounded raw workflow-job log tail with HTML escaping and visible truncation state.
@@ -97,25 +101,41 @@ Conclusion:
101
- Issues and releases views; Issue pagination preserves GitHub raw-page continuation even when PR entries are filtered out.
102
- Pagination is clamped to page 1..100 and page size <=20 where list pagination is exposed.
103
- New READ callbacks resolve without provider calls before central policy evaluation; callback lengths are regression-tested against Telegram limits.
100
-- READ provider failures now visibly update Telegram, including least-privilege guidance for provider 403, instead of appearing silent.
104
+- READ provider failures visibly update Telegram instead of appearing silent.
105
+
106
+### Owner-device production smoke findings
107
+- Owner exercised the new Advanced READ menu on Telegram after production deploy; most tested paths rendered and navigated as expected.
108
+- `Issues` failed live with GitHub `403 Resource not accessible by personal access token`.
109
+- Cloudflare production audit confirmed `github.issues.list` passed central READ policy and then failed only at the GitHub provider boundary with that 403.
110
+- Root cause: the existing fine-grained PAT does not currently grant Repository permissions -> Issues -> Read. Existing visible permissions include Metadata Read plus Actions/Code/Pull requests Read and Write.
111
+- `Releases` did not fail: a direct GitHub releases read returned an empty list `[]`, proving this repository currently has no GitHub Releases. The old Telegram empty-state wording was merely ambiguous.
112
+
113
+## Current Work — PR #20 Live-Smoke Findings Hardening
114
+- Branch: `fix/issues-permission-release-empty-ux`.
115
+- Draft PR #20: `fix: clarify Issues permission and empty Releases state`.
116
+- Scope is UI/error-guidance only; no new provider mutation is added.
117
+- Issues 403 feedback now tells the owner the exact least-privilege setting required: Fine-grained token -> Repository permissions -> Issues -> Read.
118
+- Empty Releases view now explicitly says that no GitHub Release is published for the repository instead of presenting an ambiguous not-found message.
119
102
-### Review evidence
103
-- PR patch reviewed after hardening: no new provider mutation endpoint was added; only the pre-existing approval-gated workflow rerun/cancel POSTs remain.
104
-- Secret-pattern scan over the PR patch found no `ghp_` or `github_pat_` material.
105
-- Callback/data bounds, raw-log bounds, patch bounds and pagination gaps are regression-tested.
120
+### TDD evidence
121
+- RED CI #173 / run `37106220231`: 23 test files, 99 tests total, 97 pass / exactly 2 expected failures for the live Issues-permission guidance and empty Releases wording.
122
+- GREEN CI #175 / run `37106470008` at implementation head `d779c746dd4c0dadb652f9d2375ba7765ff5803b`: 23 test files, 99/99 pass, 0 fail/skip/cancelled.
123
+- A fresh final CI is still required after this memory checkpoint because this documentation commit moves the PR head.
124
125
### Not yet production-accepted
108
-- PR #19 is not merged at this checkpoint.
109
-- Exact post-merge `main` CI and Cloudflare deploy are NOT VERIFIED.
110
-- Owner-device production smoke for the new Advanced READ paths is NOT VERIFIED until after deploy.
126
+- PR #20 is not merged/deployed at this checkpoint.
127
+- Exact post-merge `main` CI and Cloudflare deployment for PR #20 are NOT VERIFIED.
128
+- Issues live success remains NOT VERIFIED until the owner adds only `Issues: Read` to the existing fine-grained token and repeats the Telegram Issues read.
129
+- Releases source-backed empty state is verified at the GitHub API boundary, but the revised Telegram wording is NOT VERIFIED on the owner device until PR #20 is deployed.
130
131
## Next Executable Actions
113
-1. Run one fresh final PR CI after this memory checkpoint, mark ready and squash-merge the exact reviewed head only if green.
114
-2. Verify exact post-merge `main` CI, deploy, active Cloudflare version and current-version telemetry.
115
-3. Perform owner-device READ smoke through Telegram for Branches/Compare, PR detail/files/checks, CI Run/Jobs/failed log/artifacts, Issues and Releases.
116
-4. If live Checks or Issues return 403, add only the specific missing fine-grained PAT READ permission; do not rotate the token unnecessarily.
117
-5. Then implement remaining GitHub Advanced WRITE items only where useful (workflow dispatch and/or specific-job rerun) as a separate Safe Approval slice.
118
-6. Continue to the Cloudflare Ops plugin and the broader roadmap.
132
+1. Run fresh final PR #20 CI after this checkpoint; review the exact diff and secret patterns.
133
+2. Mark PR #20 ready and squash-merge only the exact reviewed green head.
134
+3. Verify exact post-merge `main` CI, deploy, active Cloudflare version and production runtime/telemetry.
135
+4. Owner adds only `Repository permissions -> Issues -> Read` to the existing fine-grained GitHub token; do not regenerate or rotate the token unnecessarily.
136
+5. Owner repeats Telegram `Issues` and `Releases`; verify production audit records provider success for both reads.
137
+6. Close GitHub Advanced READ production acceptance only after that owner-device/runtime verification.
138
+7. Then implement remaining GitHub Advanced WRITE items only where operationally useful and always through Safe Approval, followed by Cloudflare Ops.
139
140
## Remaining Roadmap
141
1. Finish GitHub Advanced production acceptance; add workflow dispatch/specific-job rerun only if operationally useful and always via Safe Approval.
src/bot.js
+4
-1
@@ -104,8 +104,11 @@ function callbackReadFailedView(data, error) {
104
const permissionDenied = /403|resource not accessible by personal access token/i.test(reason);
105
const repoMatch = String(data || '').match(/^[^:]+:(\d+)/);
106
const fallback = repoMatch ? `repo:${repoMatch[1]}` : 'menu:main';
107
+ const isIssues = String(data || '').startsWith('issues:');
108
const detail = permissionDenied
108
- ? 'GitHub این درخواست خواندنی را با خطای 403 رد کرد. مجوز Read مربوط به این بخش در توکن فعلی کافی نیست.'
109
+ ? isIssues
110
+ ? 'GitHub درخواست Issues را با خطای 403 رد کرد. در Fine-grained token، مجوز Repository permissions → Issues را روی Read قرار دهید.'
111
+ : 'GitHub این درخواست خواندنی را با خطای 403 رد کرد. مجوز Read مربوط به این بخش در توکن فعلی کافی نیست.'
112
: 'دریافت اطلاعات از سرویس با خطا مواجه شد. هیچ تغییری انجام نشد.';
113
114
return {
src/plugins/github/plugin.js
+1
-1
@@ -375,7 +375,7 @@ async function releasesView(github, repoId, page = 1) {
375
const [repo, releases] = await Promise.all([github.getRepository(repoId), github.listReleases(repoId, { perPage: 10, page })]);
376
const body = releases.length
377
? releases.slice(0, 10).map(release => `🏷 <b>${escapeHtml(release.tag || release.name)}</b>${release.prerelease ? ' · pre-release' : ''}${release.draft ? ' · draft' : ''}\n ${escapeHtml(short(release.name, 110))}\n ${escapeHtml(release.publishedAt || '-')}`).join('\n\n')
378
- : '<i>Releaseی یافت نشد.</i>';
378
+ : '<i>هیچ Release منتشرشدهای برای این مخزن در GitHub وجود ندارد.</i>';
379
return {
380
text: `🏷 <b>Releases — ${escapeHtml(repo.name)}</b>\nصفحه: <b>${page}</b>\n➖➖➖➖➖➖➖➖➖➖\n${body}`,
381
reply_markup: { inline_keyboard: [...listPagination('releases', repoId, page, releases.length, 10), [{ text: '🔙 پروژه', callback_data: `repo:${repoId}` }]] }
test/github-live-findings.test.js
new
+51
@@ -0,0 +1,51 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { NexaDevBot } from '../src/bot.js';
4
+import { createGitHubPlugin } from '../src/plugins/github/plugin.js';
5
+
6
+test('Issues 403 tells the owner the exact fine-grained permission required', async () => {
7
+ const bot = new NexaDevBot({
8
+ TELEGRAM_BOT_TOKEN: 'telegram-test-token',
9
+ TELEGRAM_WEBHOOK_SECRET: 'webhook-test-secret',
10
+ GITHUB_TOKEN: 'github-test-token'
11
+ });
12
+ const edits = [];
13
+ bot.telegram.answerCallbackQuery = async () => ({ ok: true });
14
+ bot.telegram.editMessageText = async (chatId, messageId, text, replyMarkup) => {
15
+ edits.push({ chatId, messageId, text, replyMarkup });
16
+ return { ok: true };
17
+ };
18
+ bot.router.dispatchCallback = async () => {
19
+ throw new Error('GitHub issues failed: 403 Resource not accessible by personal access token');
20
+ };
21
+
22
+ const result = await bot.handleCallbackQuery({
23
+ id: 'cb-issues-permission',
24
+ data: 'issues:123',
25
+ from: { id: 42 },
26
+ message: { chat: { id: 42 }, message_id: 99 }
27
+ });
28
+
29
+ assert.equal(result.ok, false);
30
+ assert.equal(result.edited, true);
31
+ assert.equal(edits.length, 1);
32
+ assert.match(edits[0].text, /Issues/i);
33
+ assert.match(edits[0].text, /Read/i);
34
+ assert.match(edits[0].text, /fine-grained|Fine-grained/i);
35
+});
36
+
37
+test('empty Releases view clearly states that GitHub has no releases for the repository', async () => {
38
+ const github = {
39
+ async getRepository(id) { return { id: String(id), name: 'nexa-dev-bot', defaultBranch: 'main' }; },
40
+ async listReleases() { return []; }
41
+ };
42
+ const menu = {
43
+ async getReposListView() { return { text: 'repos', reply_markup: { inline_keyboard: [] } }; },
44
+ async renderByCallback() { return { text: 'menu', reply_markup: { inline_keyboard: [] } }; }
45
+ };
46
+ const plugin = createGitHubPlugin({ github, menu });
47
+ const view = await plugin.resolveCallback('releases:123').execute();
48
+
49
+ assert.match(view.text, /هیچ Release منتشرشدهای برای این مخزن در GitHub وجود ندارد/);
50
+ assert.doesNotMatch(view.text, /Releaseی یافت نشد/);
51
+});