Repository navigation
v0.1.0
Cospan v0.1.0
Decentralized code collaboration with structural version control, built on panproto and ATProto.
Highlights
- Structural VCS. Repos store full-AST schemas via panproto-vcs. Merges are categorical pushouts, not textual three-way merge. Diffs show structural changes (vertex added, constraint tightened, field renamed) instead of line changes.
- 248 language support. Full-AST parsing via panproto-grammars and tree-sitter. Every function, class, statement, and expression in your source code becomes a typed vertex in the schema graph.
- ATProto federation. Identity is a DID, data lives in your PDS. 19 record types under `dev.cospan.*` covering repos, issues, merge requests, stars, follows, organizations, pipelines, and cross-repo dependencies.
- Tangled interop. Subscribes to `sh.tangled.*` firehose records and translates via panproto lenses, so Tangled repos appear alongside native Cospan repos.
Node (`cospan-node`)
- 8 XRPC endpoints wrapping panproto-vcs FsStore (getObject, putObject, getRef, setRef, listRefs, getHead, negotiate, getRepoInfo)
- DAG-walking negotiate for efficient object transfer
- Validation pipeline using panproto-check (breaking change detection) and panproto-lens (auto-migration)
- Git smart HTTP protocol (info/refs, upload-pack, receive-pack via panproto-git)
- DID-based JWT authentication with signature verification against DID documents
- PDS client for emitting `dev.cospan.vcs.refUpdate` records
AppView (`cospan-appview`)
- Jetstream indexer for all 19 record types with error classification, DLQ, cursor persistence, and backoff
- 36 XRPC endpoints: 26 queries + 10 mutation procedures
- Tangled record translation (stars, follows, issues, pulls) with source tracking
- Structural search using panproto expression language and InstanceQuery
- ATProto OAuth 2.0 + DPoP (PAR, PKCE, token exchange, httpOnly sessions, DID resolution)
- SSE real-time events from indexer to frontend
- Feed generators (breaking changes, activity timeline)
- Node proxy via panproto-xrpc NodeClient
Frontend (`apps/web`)
- SvelteKit 2 + Svelte 5 runes, Tailwind v4 with oklch dark-first theme
- 31 routes: home, profile, repo detail, code browser (Shiki), issues, pulls, orgs, search, settings, feed, notifications, branches, tags, commits, compare, releases, webhooks, keys, fork
- ATProto OAuth via `@atproto/oauth-client-browser` with handle autocomplete (Bluesky typeahead API)
- SSE client for real-time updates
- Star/follow/fork buttons with optimistic updates
- Keyboard shortcuts (`/` search, `g i` issues, `g p` pulls, `g c` code)
Codegen (`cospan-codegen`)
- Reads 20 Lexicon JSON schemas from `packages/lexicons/dev/cospan/`
- Transforms via panproto schema morphisms (ATProto to SQL, Rust, TypeScript)
- Generates SQL DDL, Rust serde structs, and TypeScript interfaces
Infrastructure
- Docker Compose with PostgreSQL 17, Redis 7, node, appview, and frontend services
- Dockerfiles for all three services (multi-stage builds)
- Caddyfile for production TLS termination
- GitHub Actions CI (clippy, fmt, test, build, codegen)
Dependencies
- panproto v0.17.1 (git, for grammar support)
- Axum 0.8, tokio 1, SQLx 0.8, tree-sitter 0.25
- SvelteKit 2, Svelte 5, Tailwind CSS 4, Shiki