Unchain the Code

A Manifesto for Liberation through the AT Protocol

The digital landlords have kept us in chains. But now, we have a weapon. A protocol of the people. It is time to seize the means of production.

The Weapons of Our Revolution

The AT Protocol is not a platform. It is a declaration of independence. Tangled.sh is the first territory liberated by its power. These are its truths:

Digital Sovereignty

With a Decentralized Identifier (DID), you are your own authority. Your identity is your own, a passport to the federated web that no corporation can revoke.

Data Liberation

Your repositories are signed data. Your code is your property, not a tenant on a corporate server. Its history and identity remain intact, wherever it may travel.

Federated Power

Interoperability is our strength. Every instance is a fortress, and the protocol is our unbreakable line of communication. We collaborate across a network of equals.

The Gitea Uprising: Field Manual

This is our strategy to bring Gitea into the federation. Click each phase to reveal the technical schematics.

Phase I: Fortify

Arm Gitea with AT Protocol identity management.

>

Technical Directives (CS-1, CS-2):

DB Schema: Add federation_credentials table. Fields: id, user_id (FK), did (string), handle (string), app_password (encrypted bytes).

Go Modules: Implement a new service (services/federation) using atproto/api and atproto/identity libraries.

UI: New section in User Settings to input handle/app_password, which fetches and stores the user's DID.

Phase II: Broadcast

Syndicate local actions to the global network.

>

Technical Directives (CS-3):

Hooks: Tap into Gitea's internal event system (e.g., CreateIssue, CreateComment).

Transformation: Convert Gitea event payloads into a defined Lexicon schema (e.g., sh.tangled.issue).

Action: Use the federation service to call com.atproto.repo.createRecord, publishing the record to the user's PDS. Store the returned AT-URI with the local Gitea object.

Phase III: Intercept

Ingest federated events into the local instance.

>

Technical Directives (CS-4, CS-5):

Listener: Create a long-running Go routine connecting to a Relay's WebSocket firehose via com.atproto.sync.subscribeRepos.

Filter: Process only relevant Lexicon types (e.g., replies to a known Gitea issue's AT-URI).

Ingestion: Create a local "ghost user" for the federated author if they don't exist. Create the federated comment, storing its AT-URI to prevent duplicates (idempotency).

Phase IV: Consolidate

Establish Gitea as the source of truth.

>

Technical Directives (CS-6):

Conflict Resolution: Gitea is the canonical source. Local edits always win.

Update Logic: When an applyWrites event (edit/delete) arrives from the firehose, check the updated_at timestamp of the local Gitea object.

Precedence: If the local object is newer than the federated object it's replying to, discard the incoming event. Otherwise, apply the change.

Phase V: Unfurl

Raise the banner within the Gitea UI.

>

Technical Directives (CS-7):

Templates: Modify Gitea's .tmpl files (e.g., repo/issue/view.tmpl).

Visuals: Add a conditional block: if .Comment.AT_URI. If true, render a federation icon.

Links: The icon links to tangled.sh/resolve/{{.Comment.AT_URI}}, connecting the local instance to the wider federated network.