Personal Telegram developer console for GitHub
docs: add reviewed Nexa Studio implementation roadmap
davoodmehraban89 committed
Oct 24, 2026 at 17:00 UTC
f26cbda3f2a211a5a1552a868a52d699f88527f3
1 file changed
+66
docs/roadmap/NEXA_STUDIO_REVIEWED_ROADMAP.md
new
+66
@@ -0,0 +1,66 @@
1
+# Nexa Studio — reviewed roadmap (draft for implementation)
2
+
3
+Status: **PROPOSED / NOT YET APPROVED OR DEPLOYED**
4
+Source: owner-supplied “کتابچه اجرایی Nexa Studio — نسخه ۲٫۰.docx” (the document body calls itself v3.0).
5
+Baseline: main `5d1c083d326db327cc3973a9d3adecc1d8092c91`; existing Phase 2 accepted, 266 tests reported passing.
6
+This roadmap is a review of the supplied specification, **not an unconditional adoption of every requirement**. Production stays unchanged pending tested PRs and owner approval at gates.
7
+
8
+## Goals and preserved invariants
9
+- Evolve the existing Cloudflare Worker, Telegram bot, Durable Objects and Safe Approval; no rewrite.
10
+- Owner-first M0, invite-only M1 (up to 10 users), public M2 only after independent security, operational, legal and availability reviews.
11
+- Real GitHub permissions; tenant isolation; no access based on a pasted repository URL; no secrets/source/draft text in logs, callbacks, approval payloads or audit.
12
+- Keep default-branch writes and force-push disabled; approval-bound writes on new branches only.
13
+- Railway excluded. MVP stack proposed: Cloudflare Workers + Static Assets + D1 + Durable Objects; validate availability from Iran, cost, and operational recovery before commitment.
14
+
15
+## Review corrections / design decisions requiring resolution
16
+1. **Version discrepancy:** uploaded filename says v2.0 while document title says v3.0. Track as owner-supplied revision pending confirmation; preserve original, do not silently re-label.
17
+2. **PAT risk:** Fine-grained PAT is an explicitly requested M0 option, but is a high-value bearer credential. Prefer GitHub App user authorization for broader rollout; PAT must be encrypted at rest, never returned to client, limited in repository scope, and revoked by user on GitHub. Do not treat regex prefix, token-expiration header or token metadata as proof of fine-grained permissions; verify actual API authorization and handle absent headers safely. Validate GitHub's currently supported token format and expiry metadata before coding.
18
+3. **Connection write test:** creating/deleting a branch is a real remote write, not a harmless read. Require explicit, narrowly scoped Safe Approval; provide a read-only onboarding path, no forced mutation just to establish identity. Ensure cleanup failure is visible and auditable.
19
+4. **GitHub identity:** do not conflate a GitHub account with a repository owner or organization. Organization access and collaborator scenarios require explicit grant and authorization checks. GitHub App user token vs installation token must be selected according to GitHub permissions and intended audit identity, not blanket assumptions.
20
+5. **Audit/retention:** retain metadata necessary for security investigations without logging secrets, source or draft text; specify deletion and incident-retention policy before multi-user launch.
21
+6. **Author attribution:** GitHub commit author/co-author must not impersonate the user; use verified identity and an explicitly consented attribution policy. Do not insert an invented Nexa Studio co-author email.
22
+7. **Version, webhook, editor limit:** audit current implementation and tests before asserting any mismatch. Webhook dedupe and response semantics must preserve Telegram retry behavior and avoid acknowledging unpersisted work.
23
+8. **Security requirements:** binding approvals to actor/action/repo/base/digest, key rotation, revision-based concurrency, per-user quotas, session handling, and tenant authorization are mandatory before multi-user writes.
24
+9. **Design tools:** Figma/Canva/MagicPath are optional design-time tools, not runtime dependencies. No need to attach users' design accounts to Nexa. Verify each connection and its permissions before actual design use.
25
+10. **No fabricated verification:** test recordings, production smoke, external agent approvals and availability in Iran must be recorded only after actual execution.
26
+
27
+## Gate G0 — baseline audit and safe refactor
28
+- Read in full: `src/bot.js` or actual bot entrypoints, legacy/menu modules, GitHub/Cloudflare plugins, TOTP, workspace policy, workflows and tests; inventory real paths and bindings.
29
+- Record actual test counts, deployed version, Worker routes, Telegram Mini App auth, webhook handling, current secrets references, and Phase 2 regression baseline.
30
+- Establish regression tests before behavioral changes; resolve inconsistent editor limits/version/health only when demonstrated.
31
+- Add formatter/linter in isolated non-functional change; avoid sweeping formatting without review.
32
+- Produce evidence report: requirement IDs, test outputs, PR, exact SHA, CI and operational risk.
33
+
34
+## Gate G1 — owner-only Mini App MVP
35
+- Mobile-first Persian RTL UI with LTR CodeMirror 6 editor, file tabs, Diff, draft state, revision/If-Match 409 and clear conflict UX.
36
+- Owner-only Telegram auth verified server-side, short-lived session, CSRF and replay protections, CSP without unsafe-inline where practical.
37
+- GitHub connection center: scoped fine-grained PAT onboarding if approved after threat review; encrypted server-side storage, masked display, explicit repo opt-in grants, token rotation/disconnect, user-visible errors.
38
+- No stale save counters: UI reflects successful server persistence immediately.
39
+- Keep old bot workflow operational; staging first; real iOS and Android smoke before gate sign-off.
40
+
41
+## Gate G2 — tenant-safe invited accounts
42
+- D1 schema migrations + rollback, per-user grants, invitations, connection ownership, audit metadata and usage limits.
43
+- Test account A/B isolation and negative IDOR cases, revocation, expiry, replay, concurrent edit conflicts, rate limits and secret redaction.
44
+- GitHub App user authorization flow with state/refresh/webhook validation; do not expose until end-to-end tested.
45
+- Two real GitHub accounts and isolated private repositories required for acceptance.
46
+
47
+## Gate G3 — controlled beta
48
+- Up to 10 invited users, 4 weeks, monitored operational costs and security events, independent **human** security review, recovery test, and documented availability testing on Iranian networks.
49
+- Collect usability feedback and repeat-usage evidence; do not add unrelated AI/Billing/Marketplace features.
50
+
51
+## Gate G4 — public launch decision
52
+- Written owner approval only after cost, legal/terms, sanctions, data protection, security and reliability evidence. No automatic launch.
53
+
54
+## Immediate implementation order
55
+1. Audit repository and produce G0 evidence + risk register.
56
+2. Submit narrowly scoped G0 test/refactor PR; wait for CI and review.
57
+3. Implement G1 incrementally behind feature flag; no production token migration until user-approved cutover.
58
+4. Gate reports must distinguish tested, untested, blocked and owner-required decisions.
59
+
60
+## Acceptance minimum
61
+- No cross-user repository or workspace reads/writes; approval replay produces no second effect.
62
+- No plaintext tokens in client responses, logs, D1, URLs, callback data or Telegram messages.
63
+- No direct default-branch write, force-push or auto-merge.
64
+- Revoked connection blocks subsequent actions; expired sessions fail closed.
65
+- Workspace edits preserve content under concurrent updates; stale revisions return 409.
66
+- Real-device smoke and exact-SHA CI/deploy evidence before calling a phase complete.