Personal Telegram developer console for GitHub

feat/cp3-github-write-final
audit/commit-drilldown audit/finalize-workspace-menu-security audit/ops-actionability audit/pr-menu-consolidation audit/status-menu-consolidation audit/telegram-menu-e2e audit/telegram-menu-e2e-wave2 chore/actions-node24-runtime cleanup/remove-diag design/cloudflare-ops-read docs/control-plane-2-7-design docs/guide-v2-1-sync docs/menu-audit-final-sync docs/phase2-acceptance-closeout docs/phase2-multifile-design feat/bootstrap-worker feat/cloudflare-ops-read feat/cp2-multifile-final feat/cp2-multifile-workspace feat/cp3-github-write-final feat/cp4-cloudflare-ops-final feat/cp5-cicd-control-plane feat/cp6-incident-manager feat/cp7-automation-engine feat/deep-file-browser feat/final-delivery-16-20 feat/github-advanced-read feat/in-app-guide-v2 feat/navigation-recovery-ux-v2 feat/ops-console-v2-1 feat/persistent-menu-code-input feat/phase2-multifile-workspace feat/phase2-multifile-workspace-v2 feat/plugin-foundation-v1 feat/safe-github-ops feat/self-register-webhook feat/studio-g0-foundation feat/telegram-main-inline-menu feat/telegram-pr-merge feat/ux-platform-8-12 feat/v3a-readonly-copilot feat/workspace-file-upload feature/mobile-repo-browser feature/multi-file-change-set fix/approval-expiry-feedback fix/callback-resilience-and-docs fix/ci-actions-pagination fix/cloudflare-fetch-binding fix/editor-request-body-cap fix/editor-safe-file-options fix/issues-permission-release-empty-ux fix/main-menu-callback-fallback fix/phase2-file-editor-selection fix/phase2-final-ux fix/phase2-workspace-ref-persistence fix/production-auto-deploy fix/provider-write-error-feedback fix/repository-id-navigation-fallback fix/repository-pr-navigation fix/telegram-callback-updates fix/telegram-runtime-diagnostics fix/workspace-editor-flow-v2 fix/workspace-recovery-validation hardening/ci-zero-test-telegram-token hardening/pr1-destructive-totp hardening/pr2-kill-switch main multifile-workspace nexa/edit-BwJEIIY3PW nexa/edit-IPHT8irO7b nexa/edit-b4Od3BIMYd p2-multifile phase2-20261005 phase2-20261005-a phase2-20261005-b phase2-20261005-c phase2-20261005-d phase2-20261005-e phase2-20261005-f phase2-20261005-g phase2-20261005-h phase2-20261005-i phase2-20261005-j phase2-20261005-k phase2-20261005-l phase2-20261005-m phase2-20261005-n phase2-20261005-o phase2-20261005-p phase2-20261005-q phase2-20261005-r phase2-20261005-s phase2-20261005-t phase2-20261005-u phase2-20261005-v phase2-20261005-w phase2-20261005-x phase2-20261005-y phase2-20261005-z phase2-acceptance-closeout phase2-add-file-hotfix phase2-change-set phase2-design-20261005 phase2-design-final phase2-implementation phase2-multifile-implementation phase2-multifile-spec phase2-spec-final phase2-workspace phase2/multifile-workspace plan/nexa-studio-v2-reviewed security/remove-telegram-setup spec/repository-workspace-editor v3a/multifile work/multifile
md 56 lines 6.46 KB
Rendered Raw
1 # Nexa Dev Bot — Control Plane Completion Design (Roadmap 2–7)
2
3 ## Intent
4 Complete the next six roadmap capabilities without weakening the existing owner-only, Safe Approval, durable replay, branch-only Workspace, public `/status`, or Production/Preview isolation boundaries.
5
6 ## Delivery decomposition
7 This architectural program is delivered as six independently reviewable subprojects in dependency order. Each subproject must ship working, tested software before the next relies on it.
8
9 ### CP2 — Multi-file Repository Workspace
10 Extend the existing durable Workspace from one editable file to a bounded set of text files. A Workspace records repository/base SHA plus per-file base SHA, path and draft material. Diff and Ready intent cover the complete immutable file set. Commit remains a single atomic Git tree/commit on a `nexa/edit-*` branch; `main` is never directly mutated. Any base/material change invalidates Ready intent. Sensitive/binary/LFS/oversize policies apply per file and to an aggregate bounded payload.
11
12 Acceptance: add/remove/replace draft files, aggregate diff, immutable Ready intent, stale-base rejection, one Safe Approval, one atomic branch commit, idempotent retry/reconciliation, recovery UI, and regression coverage proving no direct-main write.
13
14 ### CP3 — GitHub Advanced WRITE completion
15 Keep GitHub mutation behind the central action policy. Add only high-value Actions controls not already present: workflow dispatch and job rerun where the provider supports them. Existing rerun-failed, cancel and exact-head PR merge remain unchanged. Approval targets bind repository + immutable operation target; provider permission failures are explicit and never reported as success.
16
17 Acceptance: source-backed eligibility, DESTRUCTIVE/WRITE classification as appropriate, compact approval callback under Telegram limits, durable replay rejection, provider mutation only after approval, and exact provider-error feedback.
18
19 ### CP4 — Cloudflare Ops Plugin completion
20 Extend the existing Cloudflare READ foundation into a first-class plugin. READ surfaces current Worker deployments/versions, traffic, bindings by name/type only, observability state and recent safe runtime error summaries. Mutations are intentionally limited to redeploy/rollback to a known version; they require Safe Approval, exact target version/deployment binding and post-action runtime verification. Secret values are never returned or audited.
21
22 Acceptance: Production/Preview distinction, source-backed READ, fail-closed mutation, rollback/redeploy approval, exact target verification, and independent post-action version/traffic/binding verification.
23
24 ### CP5 — CI/CD Control Plane
25 Compose GitHub Actions and Cloudflare deployment state into one owner-only view. The view correlates repository, exact commit SHA, CI run/jobs, deploy workflow and active Cloudflare version. It diagnoses mismatches rather than declaring success from a single green run. Actions delegate to CP3/CP4 policy-protected operations rather than bypassing them.
26
27 Acceptance: exact-SHA correlation, clear pending/failed/success/mismatch states, drill-down and recovery, no invented SLA/latency, and deploy acceptance only when GitHub and Cloudflare evidence agree.
28
29 ### CP6 — Monitoring & Incident Manager
30 Create durable incident records only from source-backed failures: failed CI/deploy, Cloudflare runtime/provider failure, or explicit health degradation. Incidents have deterministic fingerprints for deduplication, severity, evidence references, status and investigation notes. Sensitive logs/source are redacted before persistence. Owner notifications are informative; remediation actions route through existing policy/approval paths.
31
32 Acceptance: create/dedupe/update/resolve incidents, evidence redaction, provider-outage handling, recovery navigation and tests for repeated events and false-success prevention.
33
34 ### CP7 — Automation Engine
35 Add a durable, resumable orchestration layer for bounded developer workflows. An automation is a versioned state machine with idempotency key, step status, attempts and durable checkpoints. READ steps may run automatically; WRITE/DESTRUCTIVE steps pause for Safe Approval and resume only with a matching one-time approval. Retries never duplicate provider mutation; terminal failure is explicit. Initial recipes are deliberately limited to existing capabilities (for example diagnose failed CI, prepare recovery action, wait for approval, execute, verify).
36
37 Acceptance: durable resume after Worker restart, idempotent retry, approval pause/resume, cancellation, terminal failure, audit-safe event trail, and no direct Production bypass.
38
39 ## Shared architecture
40 - Telegram remains the owner control surface; Mini App is used only where richer Workspace editing is needed.
41 - Plugin manifests declare actions and risk; central policy remains authoritative.
42 - `ApprovalReplayGuard` remains the one-time approval boundary and fails closed for mutations.
43 - `WorkspaceStore` may be extended with versioned multi-file schema; migration must preserve existing single-file drafts or fail explicitly without data corruption.
44 - Automation/incident durable state uses dedicated Durable Object classes/bindings rather than mixing unrelated state into approval replay.
45 - Provider adapters contain API mechanics; orchestration never embeds secrets or bypasses adapters.
46 - Public `GET /status` stays minimal health-only. Operational diagnostics remain owner-only in Telegram.
47 - Production and Preview Durable Object namespaces remain isolated.
48
49 ## Security and risk
50 All provider mutations must be target-bound, expiry-bound, owner-bound and replay-safe. Cloudflare rollback/redeploy and any operation changing deployed code are DESTRUCTIVE. GitHub workflow dispatch/rerun are WRITE unless the concrete action is later shown to have destructive semantics. Logs, source code bodies, drafts, tokens, signed approvals and secret values are excluded from incident/audit persistence.
51
52 ## Verification strategy
53 Every subproject follows RED → GREEN → relevant tests → full `npm test` → diff/security review → PR CI → Preview where applicable → locked-head merge → post-merge main CI → exact-SHA deploy → independent Cloudflare runtime verification. A subproject is not complete on documentation or mocks alone.
54
55 ## Non-goals for this program
56 AI Copilot, Browser QA as a new subsystem, broad third-party plugin marketplace and general multi-project tenancy remain later roadmap items. CP2–CP7 must leave extension points but must not implement those later phases opportunistically.