~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0

An app's permission set grants its own spaces

Open
Open chadtmiller.com wants to merge into main from chadtmiller.com/hud:app-set-spaces

A sign-in now asks for an app's own spaces through its permission set, as it already does for the app's collections and methods. Grain's consent screen stops listing "Pool spaces you're in" apart from "Grain".

Claude Opus 5.5 · high

What changes

scope::holds. Any set now holds a space: write whose type is within its namespace, not only HUD's own (place.hud.authFull). including drops that token from what it asks beside the include:. A space of another namespace's type, or space:*, is still asked directly. ungranted already checks a held space's collections and actions against the set's lexicon, and logs <set> does not grant space:… as HUD starts where it falls short. A PDS serving no spaces drops a set's space permissions and grants the rest, as it already does for HUD's set.

Grain's sign-in scope, from including on Grain's next/ views:

  • before: atproto include:social.grain.authFull?aud=… repo:app.bsky.feed.post space:social.grain.group.pool?authority=*&collection=social.grain.gallery&collection=social.grain.gallery.item&collection=social.grain.photo&collection=social.grain.photo.exif&action=create&action=update&action=delete blob:image/… rpc:com.atproto.moderation.createReport?aud=… rpc?lxm=*&aud=did:web:groups.grain.social%23atgrp
  • after: the same without the space: token.

Fixtures. Grain's frozen set (testdata/grain/social.grain.authFull.json and its copy under testdata/grain/apps) gains the pool's space permission, as Grain's pull at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n3lhs6qq26xl has it. basePermissions.json leaves the fixture as Grain retires it.

Harness. The spaces alpha resolves the space type a set's space permission names as it grants the set, and refuses the whole sign-in where it can't (invalid_scope: Unable to retrieve space declarations). harness/pds.mjs's lexicons.test now publishes testdata's space types beside its permission sets, and the fixture carries Grain's social.grain.group.pool (testdata/grain/social.grain.group.pool.json). In production grain.social already publishes it: _lexicon.group.grain.social names grain.social's account, which holds the social.grain.group.pool schema record.

Docs. docs/sign-in.md's scope table and Grain's example scopes, and docs/views.md's permission sets, say a set may list space permissions for its own types. The changeset (minor) tells app authors to list them.

Why

A view's pool write was always asked as its own space: token, which a PDS's consent screen shows on its own ("Pool spaces you're in: Add, change and remove your own galleries, items, photos and exifs") beside the app's set. HUD's set already grants its own spaces, and permission sets may carry space permissions of their namespace's types (the spaces field guide, §9.5), so an app's set should be able to do the same. The set then grows with the app with no new consent.

How it was checked

  • cargo test -p hud-core --lib: 843 passed, with apps/ as on main. Covered by permission_sets_asked_first (Grain's set holds the pool, not another namespace's space or space:*; including asks only the other's), what_a_set_does_not_grant (the exact lines for a pool collection or action the set lacks, and for a set with no space permission) and hud_refuses_its_own_set_short.
  • cargo fmt --check passes.
  • CI: every check passes, e2e-spaces included. Its first run refused every sign-in until the harness published the pool's declaration.
  • just cov, just lint, just lex, e2e and e2e-spaces are left to CI.

Shortcomings

  • Order matters for Grain. HUD only warns where an app's set falls short, and the account's PDS reads the published set. So Grain's set has to be published with the pool (its pull above) before Grain takes the HUD release with this. Grain's next/check-apps.mjs now fails where its set doesn't grant a view's space write.
  • apps/ is still Grain's older copy, which writes no pool. Re-vendor it from Grain's main once its pull lands.
chadtmiller.com added 1 commit
Approved an earlier version

This makes scope::holds accept a space: write for any permission set when the space type is within the set's namespace. Before, only HUD's own set did. including therefore drops such a token and asks for it through the include:. ungranted already compared a held space's collections and actions against the set's lexicon, so a set that falls short logs a warning. I read including and ungranted on the branch, and they handle this path without further changes. The tests cover Grain's pool being held, another namespace's space and space:* not being held, and the exact warning lines. The fixtures and docs match the new behaviour.

The ordering risk is stated in the body: Grain's set must publish the pool before Grain takes this HUD release. If the set is missing the pool, HUD only warns, while the PDS no longer receives the space: token. That makes Grain's pool writes fail for lack of scope. The apps/ copy and the e2e-spaces check against the alpha PDS are left as follow-ups, as the body says. I found nothing that must change.

chadtmiller.com added 1 commit
Approved

My earlier approval stands. What came since adds Grain's social.grain.group.pool space lexicon as a test fixture and makes the e2e harness (harness/pds.mjs) publish space-type lexicons alongside permission sets. That addresses the body's open question: a PDS that resolves the type inside a set can now find it. The filter change still throws if there are no permission sets. I found nothing that breaks the earlier approval. The fixture's collection list includes favorite and comment, which are more than the set grants. That only matters for the ungranted warning, and I'd expect the set's lexicon to be checked against it in e2e-spaces.