···76767777### State record
78787979-Each repository is stored under the `sh.pdsbackup.git.state` collection as a single record. The record contains:
7979+Each repository is stored under the `net.commoninternet.pdsgit.state` collection as a single record. The record contains:
80808181- **refs** — current branch tips (name + SHA)
8282- **bundles** — ordered chain of bundle entries, each with blob CIDs, prerequisite commits, and tip commits
+32
lexicon-plan.md
···11+# Lexicon Publication Plan
22+33+NSID: `net.commoninternet.pdsgit.state`
44+Authority domain: `pdsgit.commoninternet.net`
55+DID: `did:plc:3nogfd4smhmbrv4wo6kl7zg2`
66+77+## 1. DNS TXT record
88+99+Add a TXT record:
1010+1111+```
1212+_lexicon.pdsgit.commoninternet.net TXT "did=did:plc:3nogfd4smhmbrv4wo6kl7zg2"
1313+```
1414+1515+This links the NSID authority to our DID so resolvers can find the schema.
1616+1717+## 2. Publish schema to PDS
1818+1919+Upload `lexicons/net/commoninternet/pdsgit/state.json` as a `com.atproto.lexicon.schema` record:
2020+2121+- Collection: `com.atproto.lexicon.schema`
2222+- Rkey: `net.commoninternet.pdsgit.state`
2323+- Resulting AT-URI: `at://did:plc:3nogfd4smhmbrv4wo6kl7zg2/com.atproto.lexicon.schema/net.commoninternet.pdsgit.state`
2424+2525+Note: `com.atproto.lexicon.schema` may not be supported on all PDS servers yet since the spec is still being finalized.
2626+2727+## Status
2828+2929+- [x] Schema written (`lexicons/net/commoninternet/pdsgit/state.json`)
3030+- [x] NSID updated in codebase (`src/types.rs`, `README.md`, `plan.md`)
3131+- [ ] DNS TXT record created
3232+- [ ] Schema published to PDS
+87
lexicons/net/commoninternet/pdsgit/state.json
···11+{
22+ "lexicon": 1,
33+ "id": "net.commoninternet.pdsgit.state",
44+ "description": "Git repository backup state stored on a PDS. Each record represents one repository, keyed by repo name.",
55+ "defs": {
66+ "main": {
77+ "type": "record",
88+ "key": "any",
99+ "description": "State record for a git repository backup. The rkey is the repository name.",
1010+ "record": {
1111+ "type": "object",
1212+ "required": ["refs", "bundles", "updatedAt"],
1313+ "properties": {
1414+ "name": {
1515+ "type": "string",
1616+ "description": "Human-readable repository name.",
1717+ "maxLength": 256
1818+ },
1919+ "refs": {
2020+ "type": "array",
2121+ "description": "Current branch and tag refs.",
2222+ "items": { "type": "ref", "ref": "#gitRef" }
2323+ },
2424+ "bundles": {
2525+ "type": "array",
2626+ "description": "Ordered bundle chain, oldest first. Each push appends one entry.",
2727+ "items": { "type": "ref", "ref": "#bundleEntry" }
2828+ },
2929+ "updatedAt": {
3030+ "type": "string",
3131+ "format": "datetime",
3232+ "description": "When the record was last updated."
3333+ }
3434+ }
3535+ }
3636+ },
3737+ "gitRef": {
3838+ "type": "object",
3939+ "description": "A git ref (branch or tag) with its current commit SHA.",
4040+ "required": ["name", "sha"],
4141+ "properties": {
4242+ "name": {
4343+ "type": "string",
4444+ "description": "Full ref name, e.g. 'refs/heads/main'.",
4545+ "maxLength": 512
4646+ },
4747+ "sha": {
4848+ "type": "string",
4949+ "description": "Commit SHA the ref points to.",
5050+ "minLength": 40,
5151+ "maxLength": 64
5252+ }
5353+ }
5454+ },
5555+ "bundleEntry": {
5656+ "type": "object",
5757+ "description": "A single entry in the bundle chain. Each push appends one.",
5858+ "required": ["parts", "prerequisites", "tips", "createdAt"],
5959+ "properties": {
6060+ "parts": {
6161+ "type": "array",
6262+ "description": "Bundle blob(s). Usually one; multiple if the bundle was chunked (>40MB).",
6363+ "items": { "type": "blob" }
6464+ },
6565+ "prerequisites": {
6666+ "type": "array",
6767+ "description": "Commit SHAs the receiver must already have before applying this bundle.",
6868+ "items": { "type": "string" }
6969+ },
7070+ "tips": {
7171+ "type": "array",
7272+ "description": "Commit SHAs this bundle provides up to.",
7373+ "items": { "type": "string" }
7474+ },
7575+ "totalSize": {
7676+ "type": "integer",
7777+ "description": "Total size in bytes across all parts."
7878+ },
7979+ "createdAt": {
8080+ "type": "string",
8181+ "format": "datetime",
8282+ "description": "When this bundle was created."
8383+ }
8484+ }
8585+ }
8686+ }
8787+}
+2-2
plan.md
···5555- [x] define core types in `types.rs`:
5656 - `GitRef { name, sha }`
5757 - `BundleEntry { parts (blob CIDs), prerequisites, tips, total_size, created_at }`
5858- - `RepoState { name, refs, bundles, updated_at }` — mirrors the `sh.pdsbackup.git.state` lexicon
5858+ - `RepoState { name, refs, bundles, updated_at }` — mirrors the `net.commoninternet.pdsgit.state` lexicon
5959- [x] implement PDS XRPC client in `pds_client.rs`:
6060 - `get_record(did, collection, rkey)` → fetch a record
6161 - `put_record(did, collection, rkey, record)` → create or update a record
···210210211211Carried forward from pds-git-plan.md — to be resolved as we go:
212212213213-- **Lexicon NSID**: `sh.pdsbackup.git.state` is a placeholder. Needs a domain we control for the real NSID.
213213+- **Lexicon NSID**: `net.commoninternet.pdsgit.state` is a placeholder. Needs a domain we control for the real NSID.
214214- **Private repos**: all PDS data is currently public. Only suitable for public repos until atproto ships private data.
215215- **Force push**: currently planned as "reject". May revisit (full re-upload approach).
216216- **Multiple branches**: current design tracks all refs in one state record. Should work naturally but needs testing.
+3-3
src/types.rs
···11-//! Core types mirroring the `sh.pdsbackup.git.state` lexicon.
11+//! Core types mirroring the `net.commoninternet.pdsgit.state` lexicon.
22//!
33//! These types represent the PDS record and its nested structures for
44//! tracking git repository backup state.
···57575858/// Top-level state record for a git repository backup on PDS.
5959///
6060-/// Stored at `sh.pdsbackup.git.state/<repo-name>`.
6060+/// Stored at `net.commoninternet.pdsgit.state/<repo-name>`.
6161#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
6262pub struct RepoState {
6363 /// human-readable repo name, e.g. "my-site"
···7373}
74747575/// The lexicon collection NSID for git backup state records.
7676-pub const COLLECTION: &str = "sh.pdsbackup.git.state";
7676+pub const COLLECTION: &str = "net.commoninternet.pdsgit.state";
77777878impl BlobRef {
7979 /// Creates a new blob reference from an upload response.
+1
todo.txt
···1122+- finalize lexicon
23- more thorough tests
34- inspect pds via pds browser
45- add an e2e test that tests with larger files