An open API service indexing awesome lists of open source software.

https://github.com/edycutjong/shipghost

๐Ÿ‘ป Confidential Git PR Ghostwriter and Cryptographic Release Automator built for the Anna Hackathon
https://github.com/edycutjong/shipghost

anna-app git-agent hackathon security

Last synced: 7 days ago
JSON representation

๐Ÿ‘ป Confidential Git PR Ghostwriter and Cryptographic Release Automator built for the Anna Hackathon

Awesome Lists containing this project

README

          


ShipGhost Icon

ShipGhost ๐Ÿ‘ป


Git PR Ghostwriter โ€” Encrypted diff analysis, conventional commit cleanup, GPG clearsigning, APS KV persistence, and R2 upload


ShipGhost Hero Banner


[![Live Demo](https://img.shields.io/badge/๐Ÿš€_Live-Demo-06b6d4?style=for-the-badge)](https://github.com/edycutjong/shipghost)
[![Pitch Video](https://img.shields.io/badge/๐ŸŽฌ_Pitch-Video-ef4444?style=for-the-badge)](https://youtu.be/d-Tq3Fl8agc)
[![Pitch Deck](https://img.shields.io/badge/๐Ÿ“Š_Pitch-Deck-f59e0b?style=for-the-badge)](https://edycutjong.github.io/shipghost/public/pitch.html)
[![Built for Anna AI-Native Hackathon](https://img.shields.io/badge/DoraHacks-Anna_Hackathon-8b5cf6?style=for-the-badge)](https://dorahacks.io/hackathon/2204)


![Python 3.11](https://img.shields.io/badge/Python_3.11-3776AB?style=flat&logo=python&logoColor=white)
![Node.js 22](https://img.shields.io/badge/Node.js_22-339933?style=flat&logo=nodedotjs&logoColor=white)
![AES-GCM-256](https://img.shields.io/badge/Crypto-AES--GCM--256-blue?style=flat)
![GPG Clearsigned](https://img.shields.io/badge/Crypto-GPG_Clearsigned-success?style=flat)
![Anna Storage](https://img.shields.io/badge/Anna-APS_KV_Storage-10b981?style=flat)
![R2 Upload](https://img.shields.io/badge/Anna-R2_Object_Upload-f59e0b?style=flat)
[![CI/CD Pipeline](https://github.com/edycutjong/shipghost/actions/workflows/ci.yml/badge.svg)](https://github.com/edycutjong/shipghost/actions)

---

## ๐Ÿ“ธ See it in Action


Interactive PR Walkthrough






1. Workspace Config & Setup


1. Setup


2. Casper x402 Micropayment


2. Payment




3. PR Analysis Dashboard


3. Dashboard


4. Suggested Inline Comments


4. Comments




5. Interactive Developer Console


5. Developer Console


6. GPG Clearsigned R2 Export


6. Export



> **The ShipGhost Workflow**: Specify git repository branch โ†’ Request analysis & pay Casper x402 micro-fee โ†’ Review side-by-side changes & suggested inline comments โ†’ Clean up commit logs interactively via Anna Developer Console โ†’ Persist history to Anna KV โ†’ Clearsign output bundle and upload to Cloudflare R2.

---

## ๐Ÿ’ก The Problem & Solution

### The Problem
Pull Requests are critical codebase documents, but writing them is tedious. Developers working under pressure often push dozens of messy commits (`wip`, `fix`, `stuff`) and open blank PR descriptions. Code reviewers waste hours reverse-engineering intent, leading to knowledge debt.

### The Solution
**ShipGhost** is a secure, AI-native Anna application that analyzes your local git branch history, groups modified files into architectural components, and drafts a professional PR package (Title, Summary, Changes List, Architecture Rationale, and Suggested Inline Comments).

To protect corporate IP, **diff payloads are encrypted under a 256-bit AES key** before leaving your machine, and final exports are **cryptographically clearsigned** using local GPG/SSH keys.

**Key Features:**
- โšก **Git Analysis Engine**: Walks local git diffs, stats, and logs for any repository branch.
- ๐Ÿ”’ **AES-GCM-256 Encryption**: Diff payloads are encrypted before LLM inference.
- ๐Ÿค– **AI PR Ghostwriter**: Generates professional PR title, description, rationale, testing instructions, and inline review comments.
- ๐Ÿงน **Conventional Commit Cleanup**: Rewrites messy commit messages into proper conventional format.
- โœ๏ธ **GPG/SSH Clearsigning**: Cryptographic clearsigning of final PR description with local keys.
- ๐Ÿ’พ **Persistent PR History**: Every generated PR draft is persisted to Anna APS KV โ€” tracks titles, file changes, and timestamps across sessions.
- ๐Ÿ“ฆ **R2 Signed Artifact Upload**: Clearsigned PR markdown is uploaded to Anna's R2 bucket via `host/uploadFile`, returning a shareable download URL.

---

## ๐Ÿ—๏ธ Architecture & Tech Stack

| Layer | Technology | Rationale |
|---|---|---|
| **App Runtime** | Anna App Runtime (Schema 2) | Native integration with host permissions |
| **Frontend UI** | Vanilla HTML5 / CSS Glassmorphism | Fast rendering, no compile step |
| **Backend Plugin** | Python 3.11 Executa | Accesses local git subprocesses |
| **Cryptographic** | PyCryptodome (AES-GCM-256) | Heavyweight local encryption |
| **Signatures** | GPG/SSH (ED25519 fallback) | Tamper-proof PR clearsigning |
| **Persistent State** | Anna APS KV (`storage/get`, `storage/set`) | PR draft history (last 50 entries) |
| **Artifact Storage** | Anna R2 (`host/uploadFile`) | Signed PR markdown distribution |

### Data Flow Diagram

```mermaid
graph TD
UI[Frontend SPA - index.html] -->|tools.invoke| Exec[Python Executa Plugin]
Exec -->|git subprocess| Git[Local Git Repository]
Git -->|return diffs & logs| Exec
Exec -->|AES-GCM-256 encrypt| Crypto[Crypto Engine]
Exec -->|reverse-RPC: sampling/createMessage| Host[Host LLM Agent]
Host -->|return PR content & suggestions| Exec
Exec -->|storage/set| APS[Anna APS KV - PR History]
Exec -->|format review queue| UI
UI -->|GPG Clearsign request| Exec
Exec -->|gpg clearsign| GPG[Local GPG Agent]
Exec -->|host/uploadFile| R2[Anna R2 Storage]
```

---

## ๐Ÿ”Œ Anna Platform Integration

ShipGhost exercises the full Anna SDK capability surface:

### Reverse-RPC Methods (Plugin โ†’ Host)

| Method | Purpose | Implementation |
|---|---|---|
| `sampling/createMessage` | LLM inference for PR draft generation & commit cleanup | `call_host()` in plugin.py |
| `storage/get` | Read persistent PR draft history from APS KV | `storage_get()` in plugin.py |
| `storage/set` | Write PR history entries to APS KV | `storage_set()` in plugin.py |
| `storage/delete` | Remove PR entries from APS KV | `storage_delete_key()` in plugin.py |
| `storage/list` | List all past PR keys in APS KV | `storage_list_keys()` in plugin.py |
| `host/uploadFile` (inline) | Upload signed PR markdown to R2 | `host_upload_inline()` in plugin.py |
| `host/uploadFile` (negotiate+confirm) | Stream large PR markdown reports to R2 | `host_upload_negotiate()` and `host_upload_confirm()` |
| `embeddings/create` | Compute dense vectors for commit message clustering | `embed_texts()` in plugin.py |
| `image/generate` | Generate visual architecture/impact diagrams | `image_generate()` in plugin.py |
| `files/upload_begin + complete` | Durable PR archive uploads (2-phase) | `files_upload()` in plugin.py |
| `files/download_url` | Presigned retrieval link for PR archive | `files_download_url()` in plugin.py |
| `files/list` | List items in PR archive | `files_list()` in plugin.py |
| `files/delete` | Delete PR archive entries | `files_delete()` in plugin.py |
| `agent/complete` | Stateless L1 completion | `agent_complete()` in plugin.py |
| `agent/session.create + run + history + cancel + delete` | Stateful L2 multi-turn agent sessions | `agent_session_create()`, `agent_session_run()`, etc. |

### Host Capabilities Declared

| Capability | Usage |
|---|---|
| `llm.sample` | Host-brokered LLM for PR drafting & completion |
| `llm.embed` | Vector embedding compute for commit message clustering |
| `llm.image` | DALL-E impact diagram generation |
| `llm.agent.auto` | Stateful multi-turn L2 agent sessions |
| `aps.kv` | Persistent PR history (last 50 drafts) |
| `host.upload` | R2 upload for clearsigned PR markdown |

### Manifest Features (Schema 2)

| Feature | Status |
|---|---|
| `schema: 2` | โœ… |
| `host_capabilities` | โœ… `llm.sample`, `llm.embed`, `llm.image`, `llm.agent.auto`, `host.upload` |
| `user_message_prefix_template` | โœ… |
| `system_prompt_addendum` | โœ… |
| `optional_executas` | โœ… |
| `csp_overrides` | โœ… |
| `state_merge` | โœ… |
| `dev.fixtures` | โœ… |
| `dev.seed_storage` | โœ… |
| `host_api.upload` (negotiate + confirm) | โœ… |
| `host_api.chat` (write_message + append_artifact) | โœ… |
| `host_api.storage` (get/set/delete/list) | โœ… |
| `host_api.window` (set_title/open_view/close) | โœ… |
| `host_api.llm` (complete/embed) | โœ… |
| `host_api.image` (generate) | โœ… |
| `host_api.agent` (session) | โœ… |
| Multiple views with `min_size`/`max_size` | โœ… 3 views |
| Developer Console | โœ… Interactive SDK playground & live log console |
| `tags` | โœ… |
| Typed `parameters` in `describe` | โœ… All 4 tools |

### Cryptographic Security

| Layer | Algorithm |
|---|---|
| Diff encryption | AES-GCM-256 (ephemeral session keys) |
| PR signing | GPG clearsign / SSH-ED25519 fallback |
| Symbol hashing | SHA-256 |

---

## ๐Ÿ† Sponsor Tracks Targeted

1. **Anna AI-Native App**: Combines multiple iframe views (`main`, `inline_inspector`, `commit_cleaner`, `screen-console`) with real Executa tools and broad Anna Host-API usage โ€” `tools.invoke`, `storage` (KV persistence), `chat.append_artifact`, `window` multi-view, and `upload` (R2).
2. **Developer Usability Track**: Delivers full local GPG/SSH signatures, APS KV persistence, R2 presigned exports, and a real-time Developer Console playground.

---

## ๐Ÿ“ Project Structure

```
dorahacks-anna-shipghost/
โ”œโ”€โ”€ app.json # App listing metadata
โ”œโ”€โ”€ manifest.json # Anna App manifest (schema: 2)
โ”œโ”€โ”€ LICENSE # MIT License
โ”œโ”€โ”€ SPONSOR_DEFENSE.md # SDK integration citations
โ”œโ”€โ”€ package.json # Project script definitions
โ”œโ”€โ”€ bundle/
โ”‚ โ”œโ”€โ”€ index.html # Frontend SPA structure
โ”‚ โ”œโ”€โ”€ styles.css # Glassmorphism dark theme
โ”‚ โ”œโ”€โ”€ app.js # State engine, SDK bridge & fallback mocks
โ”‚ โ”œโ”€โ”€ anna-tool-ids.js # Auto-generated tool bindings
โ”‚ โ”œโ”€โ”€ apple-touch-icon.png # Mobile browser bookmark icon
โ”‚ โ””โ”€โ”€ icon.svg # Embedded app icon
โ”œโ”€โ”€ executas/
โ”‚ โ””โ”€โ”€ shipghost/
โ”‚ โ”œโ”€โ”€ pyproject.toml # Executa package configuration
โ”‚ โ”œโ”€โ”€ executa.json # Executa config (host_capabilities, distribution)
โ”‚ โ””โ”€โ”€ plugin.py # Stdio JSON-RPC handler + AES + GPG + APS KV + R2
โ”œโ”€โ”€ fixtures/
โ”‚ โ””โ”€โ”€ seed.jsonl # Dev fixture data for offline testing
โ”œโ”€โ”€ data/
โ”‚ โ””โ”€โ”€ fixtures/
โ”‚ โ””โ”€โ”€ git_seed.jsonl # Seed git diff data
โ”œโ”€โ”€ docs/
โ”‚ โ”œโ”€โ”€ AUDIT_REPORT.md # Threat model and invariants
โ”‚ โ”œโ”€โ”€ friction-log.md # Integration friction log
โ”‚ โ”œโ”€โ”€ icon.svg # Document icon
โ”‚ โ”œโ”€โ”€ readme-hero.svg # Tactical vector header SVG
โ”‚ โ”œโ”€โ”€ assets/ # HTML templates and asset generators
โ”‚ โ””โ”€โ”€ screenshots/ # Step-by-step UX walkthrough screenshots
โ”œโ”€โ”€ public/
โ”‚ โ”œโ”€โ”€ icon.svg # Standalone app icon SVG
โ”‚ โ”œโ”€โ”€ og-image.png # Open Graph banner PNG
โ”‚ โ””โ”€โ”€ pitch.html # Standalone marketing pitch deck HTML
โ”œโ”€โ”€ scripts/
โ”‚ โ”œโ”€โ”€ bench.py # Latency and recall benchmarks
โ”‚ โ”œโ”€โ”€ verify_offline.py # Air-gapped container test
โ”‚ โ””โ”€โ”€ record-shipghost.mjs # Puppeteer demo recording
โ””โ”€โ”€ tests/
โ””โ”€โ”€ test_plugin.py # Complete unit tests (100% offline coverage)
```

---

## ๐Ÿš€ Getting Started

### Prerequisites
- Python โ‰ฅ 3.10
- Node.js โ‰ฅ 20
- Git

### Installation & Setup

1. **Clone the codebase**:
```bash
git clone https://github.com/edycutjong/shipghost.git
cd shipghost
```
2. **Set up virtual environment**:
```bash
python3 -m venv venv
source venv/bin/activate
pip install -e executas/shipghost
```
3. **Install npm dependencies**:
Installs the required `@anna-ai/cli` devDependency locally:
```bash
npm install
```
5. **Run in Anna dev harness**:
```bash
npm run dev
# or
npx anna-app dev .
```

---

## ๐Ÿงช Testing & CI

ShipGhost utilizes a multi-stage CI pipeline verifying quality, cryptography, and offline safety.

```bash
# Run unit and integration tests (100+ assertions)
PYTHONPATH=. python3 tests/test_plugin.py

# Verify offline/air-gapped capability
python3 scripts/verify_offline.py

# Run performance and latency benchmarks
python3 scripts/bench.py
```

| Layer | Tool | Status |
|---|---|---|
| Code Quality | Flake8 | โœ… Passing |
| Unit Testing | 100+ parameterized assertions | โœ… Passing (100%) |
| Security (SAST) | TruffleHog Secret Scanning | โœ… Passing |
| Air-gap Audit | verify_offline.py (Socket blockers) | โœ… Passing |
| Performance | bench.py (Diff walk latency checks) | โœ… Passing (<30ms) |

---

## ๐Ÿ“„ License

This project is licensed under the [MIT License](LICENSE) โ€” see the LICENSE file for details.

---

## ๐Ÿ™ Acknowledgments
Built for the **Anna AI-Native App Hackathon 2026**. Special thanks to the Google DeepMind team.