⚘ use your pds as a git remote if you want to ⚘
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

lexicon plan

notplants 18ae7100 f08b8bdf

+126 -6
+1 -1
README.md
··· 76 76 77 77 ### State record 78 78 79 - Each repository is stored under the `sh.pdsbackup.git.state` collection as a single record. The record contains: 79 + Each repository is stored under the `net.commoninternet.pdsgit.state` collection as a single record. The record contains: 80 80 81 81 - **refs** — current branch tips (name + SHA) 82 82 - **bundles** — ordered chain of bundle entries, each with blob CIDs, prerequisite commits, and tip commits
+32
lexicon-plan.md
··· 1 + # Lexicon Publication Plan 2 + 3 + NSID: `net.commoninternet.pdsgit.state` 4 + Authority domain: `pdsgit.commoninternet.net` 5 + DID: `did:plc:3nogfd4smhmbrv4wo6kl7zg2` 6 + 7 + ## 1. DNS TXT record 8 + 9 + Add a TXT record: 10 + 11 + ``` 12 + _lexicon.pdsgit.commoninternet.net TXT "did=did:plc:3nogfd4smhmbrv4wo6kl7zg2" 13 + ``` 14 + 15 + This links the NSID authority to our DID so resolvers can find the schema. 16 + 17 + ## 2. Publish schema to PDS 18 + 19 + Upload `lexicons/net/commoninternet/pdsgit/state.json` as a `com.atproto.lexicon.schema` record: 20 + 21 + - Collection: `com.atproto.lexicon.schema` 22 + - Rkey: `net.commoninternet.pdsgit.state` 23 + - Resulting AT-URI: `at://did:plc:3nogfd4smhmbrv4wo6kl7zg2/com.atproto.lexicon.schema/net.commoninternet.pdsgit.state` 24 + 25 + Note: `com.atproto.lexicon.schema` may not be supported on all PDS servers yet since the spec is still being finalized. 26 + 27 + ## Status 28 + 29 + - [x] Schema written (`lexicons/net/commoninternet/pdsgit/state.json`) 30 + - [x] NSID updated in codebase (`src/types.rs`, `README.md`, `plan.md`) 31 + - [ ] DNS TXT record created 32 + - [ ] Schema published to PDS
+87
lexicons/net/commoninternet/pdsgit/state.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "net.commoninternet.pdsgit.state", 4 + "description": "Git repository backup state stored on a PDS. Each record represents one repository, keyed by repo name.", 5 + "defs": { 6 + "main": { 7 + "type": "record", 8 + "key": "any", 9 + "description": "State record for a git repository backup. The rkey is the repository name.", 10 + "record": { 11 + "type": "object", 12 + "required": ["refs", "bundles", "updatedAt"], 13 + "properties": { 14 + "name": { 15 + "type": "string", 16 + "description": "Human-readable repository name.", 17 + "maxLength": 256 18 + }, 19 + "refs": { 20 + "type": "array", 21 + "description": "Current branch and tag refs.", 22 + "items": { "type": "ref", "ref": "#gitRef" } 23 + }, 24 + "bundles": { 25 + "type": "array", 26 + "description": "Ordered bundle chain, oldest first. Each push appends one entry.", 27 + "items": { "type": "ref", "ref": "#bundleEntry" } 28 + }, 29 + "updatedAt": { 30 + "type": "string", 31 + "format": "datetime", 32 + "description": "When the record was last updated." 33 + } 34 + } 35 + } 36 + }, 37 + "gitRef": { 38 + "type": "object", 39 + "description": "A git ref (branch or tag) with its current commit SHA.", 40 + "required": ["name", "sha"], 41 + "properties": { 42 + "name": { 43 + "type": "string", 44 + "description": "Full ref name, e.g. 'refs/heads/main'.", 45 + "maxLength": 512 46 + }, 47 + "sha": { 48 + "type": "string", 49 + "description": "Commit SHA the ref points to.", 50 + "minLength": 40, 51 + "maxLength": 64 52 + } 53 + } 54 + }, 55 + "bundleEntry": { 56 + "type": "object", 57 + "description": "A single entry in the bundle chain. Each push appends one.", 58 + "required": ["parts", "prerequisites", "tips", "createdAt"], 59 + "properties": { 60 + "parts": { 61 + "type": "array", 62 + "description": "Bundle blob(s). Usually one; multiple if the bundle was chunked (>40MB).", 63 + "items": { "type": "blob" } 64 + }, 65 + "prerequisites": { 66 + "type": "array", 67 + "description": "Commit SHAs the receiver must already have before applying this bundle.", 68 + "items": { "type": "string" } 69 + }, 70 + "tips": { 71 + "type": "array", 72 + "description": "Commit SHAs this bundle provides up to.", 73 + "items": { "type": "string" } 74 + }, 75 + "totalSize": { 76 + "type": "integer", 77 + "description": "Total size in bytes across all parts." 78 + }, 79 + "createdAt": { 80 + "type": "string", 81 + "format": "datetime", 82 + "description": "When this bundle was created." 83 + } 84 + } 85 + } 86 + } 87 + }
+2 -2
plan.md
··· 55 55 - [x] define core types in `types.rs`: 56 56 - `GitRef { name, sha }` 57 57 - `BundleEntry { parts (blob CIDs), prerequisites, tips, total_size, created_at }` 58 - - `RepoState { name, refs, bundles, updated_at }` — mirrors the `sh.pdsbackup.git.state` lexicon 58 + - `RepoState { name, refs, bundles, updated_at }` — mirrors the `net.commoninternet.pdsgit.state` lexicon 59 59 - [x] implement PDS XRPC client in `pds_client.rs`: 60 60 - `get_record(did, collection, rkey)` → fetch a record 61 61 - `put_record(did, collection, rkey, record)` → create or update a record ··· 210 210 211 211 Carried forward from pds-git-plan.md — to be resolved as we go: 212 212 213 - - **Lexicon NSID**: `sh.pdsbackup.git.state` is a placeholder. Needs a domain we control for the real NSID. 213 + - **Lexicon NSID**: `net.commoninternet.pdsgit.state` is a placeholder. Needs a domain we control for the real NSID. 214 214 - **Private repos**: all PDS data is currently public. Only suitable for public repos until atproto ships private data. 215 215 - **Force push**: currently planned as "reject". May revisit (full re-upload approach). 216 216 - **Multiple branches**: current design tracks all refs in one state record. Should work naturally but needs testing.
+3 -3
src/types.rs
··· 1 - //! Core types mirroring the `sh.pdsbackup.git.state` lexicon. 1 + //! Core types mirroring the `net.commoninternet.pdsgit.state` lexicon. 2 2 //! 3 3 //! These types represent the PDS record and its nested structures for 4 4 //! tracking git repository backup state. ··· 57 57 58 58 /// Top-level state record for a git repository backup on PDS. 59 59 /// 60 - /// Stored at `sh.pdsbackup.git.state/<repo-name>`. 60 + /// Stored at `net.commoninternet.pdsgit.state/<repo-name>`. 61 61 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] 62 62 pub struct RepoState { 63 63 /// human-readable repo name, e.g. "my-site" ··· 73 73 } 74 74 75 75 /// The lexicon collection NSID for git backup state records. 76 - pub const COLLECTION: &str = "sh.pdsbackup.git.state"; 76 + pub const COLLECTION: &str = "net.commoninternet.pdsgit.state"; 77 77 78 78 impl BlobRef { 79 79 /// Creates a new blob reference from an upload response.
+1
todo.txt
··· 1 1 2 + - finalize lexicon 2 3 - more thorough tests 3 4 - inspect pds via pds browser 4 5 - add an e2e test that tests with larger files