Sketch: Lexicon package manager #42
Replies: 11 comments 11 replies
-
How can we make sure lexicon docs are verifiable without the actual record existing on the PDS? This is a requirement for fetching historic lex docs, where a new version has been published to the PDS |
Beta Was this translation helpful? Give feedback.
-
Registry interface designI think the registry appview interface would be pretty simple: given an NSID and an optional CID, return a list of lexicon documents along with URIs and CIDs. When provided a CID the registry should return the full tree of lexicons for that specific CID. When the CID is omitted the registry should return the current tree at that point in time. {
"lexicon": 1,
"id": "community.lexicons.lexicon.resolveLexicon",
"defs": {
"main": {
"type": "query",
"description": "Resolve a lexicon from an NSID and optional CID to a list of all lexicon docs required to validate the relevant record.",
"parameters": {
"type": "params",
"required": ["nsid"],
"properties": {
"nsid": {
"type": "string",
"format": "nsid",
"description": "The NSID of the lexicon."
},
"cid": {
"type": "string",
"format": "cid",
"description": "The CID of the version of the lexicon record. If not specified, then return the most recent version."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["schemas"],
"properties": {
"schemas": {
"type": "array",
"items": {
"type": "object",
"required": ["record", "ref"],
"properties": {
"record": {
"type": "ref",
"ref": "com.atproto.lexicon.schema"
},
"ref": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
}
}
}
}
}
}
},
"errors": [{ "name": "LexiconNotFound" }]
}
}
} |
Beta Was this translation helpful? Give feedback.
-
How do we account for changing ownership of lexicons? It's possible for an NSID to be published under |
Beta Was this translation helpful? Give feedback.
-
How do we manage transitive dependencies? The fetched set of lexicons on disk probably ought to contain a single version per lexicon in the tree so that they can work with existing tooling. But what if two direct dependencies depend on different versions of the same lexicon? For example, imagine two lexicons: com.foo and com.bar. com.foo depends on com.baz#a and com.bar depends on com.baz#b Given a lexicon manifest like so:
We would end up with a dependency tree like so:
However the resultant file system view probably ought to look like
So, which version of baz do we pick? |
Beta Was this translation helpful? Give feedback.
-
What need is there for a centralized registry? Is not the Lexicon Resolution proposal and publishing of records the equivalent? |
Beta Was this translation helpful? Give feedback.
-
Once a record is updated, prior CIDs are not recoverable. I'm still of the opinion that we need better versioning in Lexicon than CID or the unused revision int. A number of various schemes for versioning exist in the wild already |
Beta Was this translation helpful? Give feedback.
-
Thought experiment
How can I ever verify step 2 was done correctly after step 3? Where does provenance stem from? |
Beta Was this translation helpful? Give feedback.
-
Strong agree here. I think any attempt to wrangle versioning into this is going to create a divergence when versioning is formally introduced down the road. I think it's smart to just treat all lexicons as |
Beta Was this translation helpful? Give feedback.
-
This looks great. Having a reference tool to resolve and download lexicon files would be a huge win for people and orgs developing against libraries and applications that need to download and resolve lexicon schema definitions for development, testing, and packaging. |
Beta Was this translation helpful? Give feedback.
-
I haven't looked through everything here and in #48, but wanted to share my current thinking on all this:
Lexicon Vendoring Proposal/ConceptThis is a minimal workflow i'm thinking of using for Bluesky projects in the next ~6 months or so, as an evolution of the "all Lexicons in the Bluesky atproto repo" situation.
This is less ambitious that the dependency tracking stuff you have shared. I think things like the UI for visualizing dependency tree are really great! This is just sharing an idea/approach. |
Beta Was this translation helpful? Give feedback.
-
@snarfed for services, I think it depends! to use an example, I think Ozone would probably want to vendor in and reference local copies. Ozone currently does some For the PDS, much more likely to resolve and validate "live", and not have really any Lexicons vendored (other than My guess is that the number of services which do "live" resolution will actually be pretty small: PDS, development and debugging tools. In comparison, there would end up being many, many little appviews, feedgens, bots, and user tools, all of which can use static versions of Lexicons. @tom-sherman as to what the PDS does by default, good question! There is a fair amount of wiggle room to figure out. It is also possible/allowed for PDS to just not really try to validate at all, by default: the validation flag is three-state, "must validate", "must not validate", "default", and "default" isn't really defined. I think a bare-bones PDS which doesn't do live-network lexicon resolution+validation is probably fine? as long as "most" PDS implementations do support it, and even do it by default. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a sketch, it doesn't have many details and is more about sparking discussion.
Now that lexicon authority and resolution is rolling out, it's possible to build a lexicon package manager.
Why?
How?
Two main components are needed: a lexicon registry and a package manager CLI
The lexicon registry would store lex docs against their CID by subscribing to the firehose. Ideally it would also store the dependent lexicon CIDs (the refs) as well, for reliable resolution
The CLI can then use this registry to fetch lexicons and store them on disk in a standard sub directory so that they can be used by tooling such as lex-cli or atcute
Open questions
lpm
Beta Was this translation helpful? Give feedback.
All reactions