feat(lexicon): lexicon resolution and publishing, permission sets in atproto-lexgen #130

Closed
opened 2026-09-24 12:39:08 +00:00 by Grandiras · 0 comments
Owner

Part of the v0.7.0 update cycle (wave 6). Lexicon resolution and publication per the Lexicon spec, plus a leaner atproto-lexgen. The owner opted in to this scope.

Runtime (ATProtoNet)

  • com.atproto.lexicon.schema record model (rkey = the NSID) and com.atproto.lexicon.resolveLexicon ({nsid} → {cid, schema, uri}).
  • ILexiconResolver: DNS _lexicon.<reversed authority> TXT did=… → DID → PDS → getRecord(com.atproto.lexicon.schema, nsid), with no hierarchical DNS walk. Includes a short cache and a resolveLexicon path through a service. It uses the identity resolver and its SSRF policy.
  • AtProtoScopes.Include(...) can optionally check that a permission set exists.

atproto-lexgen

  • permission-set definitions:
    • parse, validate and lint them (same-namespace rule; no blob/account/identity; no wildcards; the rpc aud/inheritAud rules);
    • emit NSID constants and Include(...) helpers.
  • publish: write lexicons as com.atproto.lexicon.schema records to a repo through a PDS (authenticated putRecord, rkey = NSID), and check or print the required _lexicon DNS TXT record. The current publish only copies files into a local folder after a diff.
  • resolve <nsid>: fetch a published lexicon.
  • migrate: evaluate it honestly. If it only prints stubs, either make it produce something useful or remove it, and document why.
  • Remove the null def type (dropped from the language in 2025-11). For space defs, warn on * in collections and follow the proposal on name length.
  • Remove dead helpers and duplicated loaders:
    • TypeMapper.GetLexiconType / InferStringFormat / ToCamelCase / NsidToFilePath / ParseTypeValue;
    • CSharpEmitter.Emit(LexiconDocument), LexiconEmitter.JsonOptions;
    • the three directory loaders, the two assembly-document loops, and the duplicate options.
  • Add tests for Program.cs, which has 0% coverage.

CHANGELOG Added (the resolver, permission sets, publish/resolve) and Breaking changes (CLI changes).

Part of the v0.7.0 update cycle (wave 6). Lexicon resolution and publication per the [Lexicon spec](https://atproto.com/specs/lexicon), plus a leaner `atproto-lexgen`. The owner opted in to this scope. ## Runtime (`ATProtoNet`) - [ ] `com.atproto.lexicon.schema` record model (rkey = the NSID) and `com.atproto.lexicon.resolveLexicon` (`{nsid}` → `{cid, schema, uri}`). - [ ] `ILexiconResolver`: DNS `_lexicon.<reversed authority>` TXT `did=…` → DID → PDS → `getRecord(com.atproto.lexicon.schema, nsid)`, with no hierarchical DNS walk. Includes a short cache and a `resolveLexicon` path through a service. It uses the identity resolver and its SSRF policy. - [ ] `AtProtoScopes.Include(...)` can optionally check that a permission set exists. ## `atproto-lexgen` - [ ] `permission-set` definitions: - parse, validate and lint them (same-namespace rule; no `blob`/`account`/`identity`; no wildcards; the rpc `aud`/`inheritAud` rules); - emit NSID constants and `Include(...)` helpers. - [ ] `publish`: write lexicons as `com.atproto.lexicon.schema` records to a repo through a PDS (authenticated putRecord, rkey = NSID), and check or print the required `_lexicon` DNS TXT record. The current `publish` only copies files into a local folder after a diff. - [ ] `resolve <nsid>`: fetch a published lexicon. - [ ] `migrate`: evaluate it honestly. If it only prints stubs, either make it produce something useful or remove it, and document why. - [ ] Remove the `null` def type (dropped from the language in 2025-11). For `space` defs, warn on `*` in `collections` and follow the proposal on `name` length. - [ ] Remove dead helpers and duplicated loaders: - `TypeMapper.GetLexiconType` / `InferStringFormat` / `ToCamelCase` / `NsidToFilePath` / `ParseTypeValue`; - `CSharpEmitter.Emit(LexiconDocument)`, `LexiconEmitter.JsonOptions`; - the three directory loaders, the two assembly-document loops, and the duplicate options. - [ ] Add tests for `Program.cs`, which has 0% coverage. CHANGELOG `Added` (the resolver, permission sets, publish/resolve) and `Breaking changes` (CLI changes).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Grandiras/ATProto.NET#130
No description provided.