From a7bf045a3797e6d84c026d83b2e13e1f789e9aa0 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 8 Aug 2026 11:28:42 +0300 Subject: [PATCH] lexicons: Tangled 1.0 (`org.tangled.{knot,label,repo}.*`) Knot will have its own policy links & contact information similar to PDS. It will be PDS-compatible so maybe we don't really need this? At least for policy documents, it's not that hard to imagine two separate documents about gitrepo identity management & atproto repo identity management. Technically both are same thing now as gitrepo is valid atproto repo, but still. I'm simplifying the label defintion. Few changes: - labels will be just tokens. There won't be data types like integer or boolean & it won't be even key-value pair. We can use good old `key:value` style tokens. - for rich labels like `assignee` will become first-class citizen of `ticket` record lexicon. - label definition is owned by the git repository and only definitions under same git repository can be used. label definition can be referenced by rkey which is any type. TID is preferred, but there will be few known, global rkeys like `good-first-issue`. This design is inspired by atproto labels. - I'm using `label.defs#labelToken` here so we can later rollback to rich key-value style labels. Signed-off-by: Seongmin Lee --- lexicons/org/tangled/knot/describeKnot.json | 61 +++++++++++++++++++ lexicons/org/tangled/label/definition.json | 30 +++++++++ lexicons/org/tangled/label/defs.json | 17 ++++++ lexicons/org/tangled/repo/defs.json | 20 ++++++ lexicons/org/tangled/repo/manifest.json | 67 +++++++++++++++++++++ 5 files changed, 195 insertions(+) create mode 100644 lexicons/org/tangled/knot/describeKnot.json create mode 100644 lexicons/org/tangled/label/definition.json create mode 100644 lexicons/org/tangled/label/defs.json create mode 100644 lexicons/org/tangled/repo/defs.json create mode 100644 lexicons/org/tangled/repo/manifest.json diff --git a/lexicons/org/tangled/knot/describeKnot.json b/lexicons/org/tangled/knot/describeKnot.json new file mode 100644 index 000000000..ffbf455f7 --- /dev/null +++ b/lexicons/org/tangled/knot/describeKnot.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "org.tangled.knot.describeKnot", + "defs": { + "main": { + "type": "query", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "version" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "version": { + "type": "string" + }, + "capabilities": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "tangled1.0" + ] + }, + "description": "Protocol capability tokens this knot implements. Knots that omit this field are treated as legacy." + }, + "links": { + "type": "ref", + "description": "URLs of service policy documents.", + "ref": "#links" + }, + "contact": { + "type": "ref", + "description": "Contact information", + "ref": "#contact" + } + } + } + } + }, + "links": { + "type": "object", + "properties": { + "privacyPolicy": { "type": "string", "format": "uri" }, + "termsOfService": { "type": "string", "format": "uri" } + } + }, + "contact": { + "type": "object", + "properties": { + "email": { "type": "string" } + } + } + } +} diff --git a/lexicons/org/tangled/label/definition.json b/lexicons/org/tangled/label/definition.json new file mode 100644 index 000000000..0c47d084f --- /dev/null +++ b/lexicons/org/tangled/label/definition.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "org.tangled.label.definition", + "defs": { + "main": { + "type": "record", + "key": "any", + "record": { + "type": "object", + "required": ["name", "createdAt"], + "properties": { + "name": { + "type": "string", + "description": "The display name of this label.", + "maxLength": 640, + "maxGraphemes": 64 + }, + "color": { + "type": "string", + "description": "The hex value for the background color for the label. Appviews may choose to respect this." + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} diff --git a/lexicons/org/tangled/label/defs.json b/lexicons/org/tangled/label/defs.json new file mode 100644 index 000000000..7a797765d --- /dev/null +++ b/lexicons/org/tangled/label/defs.json @@ -0,0 +1,17 @@ +{ + "lexicon": 1, + "id": "org.tangled.label.defs", + "defs": { + "labelToken": { + "type": "object", + "required": ["key"], + "properties": { + "key": { + "type": "string", + "description": "Record-key of org.tangled.label.definition owned by this repository.", + "format": "record-key" + } + } + } + } +} diff --git a/lexicons/org/tangled/repo/defs.json b/lexicons/org/tangled/repo/defs.json new file mode 100644 index 000000000..0a53bdd4a --- /dev/null +++ b/lexicons/org/tangled/repo/defs.json @@ -0,0 +1,20 @@ +{ + "lexicon": 1, + "id": "org.tangled.repo.defs", + "defs": { + "sourceTangled": { + "type": "object", + "required": ["did"], + "properties": { + "did": { "type": "string", "format": "did", "description": "DID of the repo identity" } + } + }, + "sourceExternal": { + "type": "object", + "required": ["uri"], + "properties": { + "uri": { "type": "string", "format": "uri", "description": "git-clone uri of the repo" } + } + } + } +} diff --git a/lexicons/org/tangled/repo/manifest.json b/lexicons/org/tangled/repo/manifest.json new file mode 100644 index 000000000..4ceb81e16 --- /dev/null +++ b/lexicons/org/tangled/repo/manifest.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "org.tangled.repo.manifest", + "defs": { + "main": { + "type": "record", + "description": "Git repository manifest record. This record is used for git repository discovery like how `org.tangled.actor.profile` is used to find users.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "declaration", + "createdAt" + ], + "properties": { + "declaration": { + "type": "ref", + "ref": "#declaration" + }, + "spindle": { + "type": "string", + "format": "did" + }, + "description": { + "type": "string", + "minGraphemes": 1, + "maxGraphemes": 140 + }, + "website": { + "type": "string", + "format": "uri", + "description": "Any URI related to the repo" + }, + "topics": { + "type": "array", + "description": "Topics related to the repo", + "items": { + "type": "string", + "maxLength": 50 + }, + "maxLength": 50 + }, + "upstream": { + "type": "union", + "description": "source of the repo", + "refs": [ + "org.tangled.repo.defs#sourceTangled", + "org.tangled.repo.defs#sourceExternal" + ] + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + }, + "declaration": { + "type": "object", + "required": ["owner", "slug"], + "properties": { + "owner": { "type": "string", "format": "did" }, + "slug": { "type": "string", "format": "record-key" } + } + } + } +} -- 2.51.2