Bastion Deploy

Bastion Deploy

Bastion Deploy is the deploy pillar of the product. It is a separate pillar from Bastion AI but shares SSH, hosts, the Plan Card, and optional AI assist. This page is the long-form reference; the marketing version is the short form.

Status: In 1.1.0. This page keeps the design notes. Rollback is a git push of a previous revision for git-push profiles. Other sync methods are refused. It does not restore a whole server.

Positioning

Do not market Bastion Deploy as another CI/CD SaaS or a GitHub replacement. Market it as: push from your machine to your server, with version control and approval gates built into the terminal you already use.

Architecture

UI (React): Deploy panel
   ↓ typed Tauri IPC (src/lib/deploy.ts)
Deploy Orchestrator
   ↓
├── Local Git reader        (status, log, diff: read-only)
├── Remote revision reader  (SSH exec: read-only)
├── Sync engine             (rsync / git push / SFTP)
├── Deploy runner           (multi-step → Plan Card)
└── Deploy audit log        (SQLite)
   ↓
SSH service · Local shell · SFTP · Hosts DB · Snippets · AI Plan Card

Mutating steps always go through the same Plan Card contract as Bastion AI executes.

Surface

Bastion Deploy
├── Link Project          Local folder ↔ host ↔ remote path
├── Status                Local commit vs server deployed revision
├── Diff                  What would go live
├── Sync                  rsync / git push / SFTP (policy per profile)
├── Deploy                Build + restart + health check (Plan Card)
├── History               Deploy log + rollback pointer
└── AI Assist (optional)  Setup hooks, explain diff, diagnose failures

Deploy lives in the main Bastion shell (sidebar panel or host-scoped tab), not inside the AI chat only. AI is a copilot on top; Deploy works with AI disabled.

Waves

WaveCodenameOutcome
D0Profiles & statusLink local project to host; show local vs server revision
D1Sync MVPrsync / scp deploy path; deploy audit; basic Plan Card pipeline
D2Git-nativeBare repo on server, push + post-receive hook, rollback
D3Polish + AIDeploy mode in AI, health checks, workspace binding (A5 seam)

Dependency note: D1 can ship with rsync via local shell before v1.1 SFTP. SFTP improves browse and partial sync UX but is not strictly required for the rsync-based MVP.

Non-negotiables

  1. Local-first: deploy profiles, history, and diffs stay on-device; no Bastion cloud account required.
  2. No secret leakage: .env, keys, and credentials in sync paths are excluded by default; redaction on diff previews sent to AI.
  3. Trust before mutate: sync, build, restart, and hook installs require explicit approval (batch or step-by-step).
  4. Reuse v1 surfaces: hosts, SSH sessions, snippets, keychain, SQLite, Plan Card. No second deploy product.
  5. Phase gates: do not start the next Deploy wave until the current wave's exit criteria pass.
  6. No silent production deploy: production targets require stronger gates.