Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ Versions follow `package.json`. A tag `v<version>` publishes the image
`ghcr.io/nicolasdb/solid-backoffice:<version>` (`.github/workflows/ci.yml`);
an instance pins it in `instance-template/.env`.

## Unreleased

- **A WebID on your own domain works with every profile step** (#26,
solid-kit ADR 002 amendment of 2026-11-26). Such a profile is a static
file no app can write, so "Use this inbox", the name, "May act for you"
and joining ended in a NetworkError. Each step now writes the profile
only when its server says it may (`WAC-Allow` / `Allow`), else the
extended profile it links in your pod, else a new `profile/about.ttl`
(public read, you edit), and You shows the two lines to add to your
profile, with a copy button.
- **Profiles are read with their extended profile**: the documents linked
with `rdfs:seeAlso` or `foaf:isPrimaryTopicOf`, one level, only inside a
`pim:storage` the profile declares. A collective checking a request, the
members table and the agents found for a member count a membership or a
delegation written only there. You shows the extended profile under the
profile, with its address.

## 0.3.1 — 2026-11-24

- **Sign-up: the passphrase toggle is an eye inside the field** (#23). The
Expand Down
12 changes: 10 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ one changes, change the other. Never point it at the real provider.
`getAccess` is a write's base (always fresh); `readAccess` is for showing
(the `.acl`'s location from memory, the document through `read.ts`).
- `src/lib/collective.ts` — ADR 006, member side: config, profile and roster
parsing, the membership state table, `as:Join` / `as:Announce`.
parsing, the membership state table, `as:Join` / `as:Announce`. A
profile is read with the extended documents it links (`rdfs:seeAlso` /
`foaf:isPrimaryTopicOf`, one level, only inside a `pim:storage` it
declares), and `updateOwnProfile` writes the WebID document only when its
GET answers as writable, else the linked extended document, else a new
`profile/about.ttl` (solid-kit ADR 002 amendment, solid-backoffice#26;
`docs/explanation/membership.md`).
- `src/lib/admin.ts` — ADR 006, collective side: read the inbox, check each
requester's profile, accept / refuse / remove (order pinned in
`src/lib/admin.test.ts`), members from both sides. `src/lib/activity.ts`
Expand Down Expand Up @@ -94,7 +100,9 @@ one changes, change the other. Never point it at the real provider.
to, joining); one collective opens inside it as `src/member.ts`
(sharing, leaving, its members and agent) or `src/admin.ts` (the one you
run). `src/you.ts` is You (name, inbox, may act for you, your agents on our
provider, and `profile/card` read only with the steps' lines marked). `src/steps.ts` holds the pieces they
provider, and `profile/card` read only with the steps' lines marked,
the extended profile below it, and the two lines to add when the profile
cannot be written and does not link it). `src/steps.ts` holds the pieces they
share. No role, progress or tab state is stored.
- `src/places.ts` — Pods (slice C, the tab once called Places): your pod
as a file explorer, built as an iceberg (list → `···` menu → access
Expand Down
31 changes: 31 additions & 0 deletions docs/explanation/membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,37 @@ What depends on it (agents) is offered when the provider says it offers it
(`/.well-known/css/provider.json`, solid-kit ADR 010), and otherwise shown
with why not.

## A profile no app can write

"Your profile" is usually `profile/card` in your pod, which the steps on
You write. A WebID on your own domain
(`https://id.openfab.be/profile/card#me`, solid-kit
[ADR 002](https://github.com/nicolasdb/solid-kit/blob/main/docs/adr/002-portability-tiers.md),
tier 1, amendment of 2026-11-26) is a static file: no app can write it, and
before this every step that wrote it ended in a NetworkError.

So a profile is read as **the WebID document plus the extended documents it
links** with `rdfs:seeAlso` or `foaf:isPrimaryTopicOf` (either one), one
level only, and only when they are inside a `pim:storage` the WebID
document itself declares: anyone can link anything, only you write in your
pod. A linked document outside it is ignored; one that fails to load is
skipped. This is how the collective checks a request (`org:memberOf`) and
how a member's agents are found (`acl:delegates`): one function per
decision in `src/lib/collective.ts` (`declaresMembership`,
`declaredDelegates`), so another authorization backend can replace it.

Writing follows the same rule. A step writes your WebID document only if
the server says you may (`WAC-Allow`, else `Allow`, on its GET; a static
file says neither). Otherwise it writes the extended document your profile
links in your pod. With none, it creates `profile/about.ttl` (readable by
anyone, written by you only: what it holds is there to be checked by
others), writes there, and You shows the two lines to add to your WebID
document by hand, with a copy button. Until they are added, only you see
what the steps saved there: a collective reading your request finds no
`org:memberOf` and says so. The name the steps saved there is the one
shown, over the card's. A line the card itself holds (added by hand) cannot
be removed by an app: the step refuses and says where to remove it.

## Newcomers

Most newcomers have no Solid account and already know the collective that
Expand Down
8 changes: 6 additions & 2 deletions docs/how-to/set-up-a-collective.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ members share; it switches sharing on in `config.ttl` once the agent exists
collective's address and in every member's `org:memberOf`.
2. **Create the inbox** from You → "Create my inbox". It makes `inbox/`, lets
any signed-in account Append there, then names it `ldp:inbox` in the
profile, in that order. `config.ttl` points at the same `inbox/`, so the
profile, in that order (for a WebID on the collective's own domain, a
file apps cannot write, these profile lines go to `profile/about.ttl` in
the pod instead, and You gives the two lines that link it:
[a profile no app can write](../explanation/membership.md#a-profile-no-app-can-write)).
`config.ttl` points at the same `inbox/`, so the
account and the collective share one.
3. **Upload `config.ttl`** at the pod root, from the
[template](../../templates/collective/config.ttl): replace every
Expand Down Expand Up @@ -51,7 +55,7 @@ members share; it switches sharing on in `config.ttl` once the agent exists
compare it with what step 3 wrote.
7. **Let it act for the collective**: on You, the step "May act for you",
offers the agent in one click. That writes `acl:delegates` in the
account's profile, which is how the agent's skill checks it acts for this
account's profile (or its `profile/about.ttl`, as in step 2), which is how the agent's skill checks it acts for this
collective. Creating the agent does not do it.
8. **Switch sharing on** in `config.ttl`: uncomment `sc:feature sc:Sharing`,
`sc:agent` and, if you suggest a folder, `sc:suggestedFolder`. `sc:agent`
Expand Down
40 changes: 39 additions & 1 deletion docs/manual-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ both themes.
only, the lines `foaf:name`, `ldp:inbox`, `acl:delegates` and each
`org:memberOf` marked ("Your name", "Joined HyperScope"…). Change your
name: the marked line changes with it. "Open in Pods" opens the same
file in Pods.
file in Pods. A profile that links an extended profile in your pod
shows it below, with its address ([extended profile](#extended-profile--a-webid-on-your-own-domain)).

## E · A member's agents read what the member reads

Expand Down Expand Up @@ -744,6 +745,43 @@ subdomains: the address is `https://openfab.pod.mapsofmaking.org/`.
12. **A member.** The newcomer follows the link, asks to join, is accepted,
shares a folder: J1 to J4 on this pod.

## Extended profile · a WebID on your own domain

Not yet run (solid-backoffice#26, solid-kit ADR 002 amendment of
2026-11-26). Signed in as a tier-1 WebID, such as
`https://id.openfab.be/profile/card#me` (a static file declaring
`pim:storage <https://openfab.pod.syntonie.be/>`). Do it twice: once with
the profile linking `profile/about.ttl` (`rdfs:seeAlso` and
`foaf:isPrimaryTopicOf`), once on an account whose profile links nothing
and whose pod has no `profile/about.ttl` yet.

1. **You, read.** "Source · …/profile/card" says the file cannot be
written by apps; a linked `profile/about.ttl` is shown below it with
its address and "Open in Pods", its lines marked like the profile's.
2. **The inbox step.** Without an inbox: "Create my inbox" (or "Use this
inbox"). No NetworkError, no "Failed to fetch". In Pods,
`profile/about.ttl` now holds `ldp:inbox`; the WebID document is
unchanged.
3. **No extended profile yet.** On the second account, the same step
creates `profile/about.ttl`. Its access: anyone can read, only you edit
(Pods → "Who can access it"); in a private window it opens. You shows
"Link your extended profile" with the two lines; "Copy the two lines"
copies them. Add them to the WebID document where it is hosted, reload:
the step is gone and the extended profile is shown as linked.
4. **Name and may act for you.** Change the name; add an agent. Both land
in `profile/about.ttl`, marked in the source; the new name is the one
shown, even though the card keeps its own. Remove an agent the card
itself names (a line added by hand): refused, saying to remove it where
the file is hosted; nothing is written. Leave a collective the card
names: the same.
5. **Membership, read by the collective.** Join a collective. Signed in as
its account, the request shows "Profile says they belong to …" (read
from `about.ttl`). Before the two lines are added, it says the profile
does not, and the join's message says why.
6. **Tier 0 unchanged.** As a WebID in its own pod (`…/profile/card#me`
on the provider), every step still writes `profile/card`, and no
`profile/about.ttl` appears.

## H · Mermaid in the Markdown preview

1. **The plan.** In Pods, open `hyperscope_ndb/tasks/now.md`: the
Expand Down
15 changes: 14 additions & 1 deletion docs/slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ Each slice is usable on its own and is tested by a real person before the next
one starts. The order follows who is waiting: new members first, then the admin
who accepts them, then everyone's daily work.

## Where we are (17 Nov 2026)
## Where we are (27 Nov 2026)

**A WebID on your own domain, writers and readers** (solid-backoffice#26,
solid-kit ADR 002 amendment of 2026-11-26). Profiles are read with the
extended documents they link inside their own `pim:storage`; every profile
step writes the WebID document only when it answers as writable, else the
linked extended profile, else a new `profile/about.ttl`, and You gives the
two lines to link it. A line held in the static card itself is refused on
removal, never "removed" silently. Run live: not yet
([manual tests](manual-tests.md#extended-profile--a-webid-on-your-own-domain)).
Next: the two "Bring your domain" paths (#27, #28); whether the inbox step
should also give the `ldp:inbox` line for the card.

## Where we were (17 Nov 2026)

**Creating a collective, reviewed on OpenFab (Maps of Making); docs only,
no code.** Followed as written, the how-to produced a collective whose agent
Expand Down
6 changes: 3 additions & 3 deletions src/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
type MemberView,
type Person,
} from "./lib/admin";
import type { Collective } from "./lib/collective";
import { declaresMembership, type Collective } from "./lib/collective";
import { describePodError } from "./lib/pod";
import { announce } from "./ui/a11y";
import { esc, toast } from "./ui/patterns";
Expand Down Expand Up @@ -136,8 +136,8 @@ function renderRequest(request: Request, i: number, collective: Collective): str
const name = esc(collective.name);
const facts = profile
? `<ul class="checks">
${check(profile.memberOf.includes(collective.group),
profile.memberOf.includes(collective.group) ? `Profile says they belong to ${name}` : `Profile does not say they belong to ${name}`)}
${check(declaresMembership(profile, collective.group),
declaresMembership(profile, collective.group) ? `Profile says they belong to ${name}` : `Profile does not say they belong to ${name}`)}
${check(!!profile.inbox, profile.inbox ? "Has an inbox for the answer" : "No inbox: the answer cannot be sent; tell them another way")}
${check(profile.delegates.length > 0, `Agents: ${profile.delegates.length ? profile.delegates.map((d) => `<code>${esc(d)}</code>`).join(", ") : "none"}`)}
</ul>`
Expand Down
12 changes: 10 additions & 2 deletions src/collectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,23 @@ export function bindCollectives(app: HTMLElement, data: Loaded, ctx: ViewContext
// Profile first: if the message then fails, the screen shows the
// request as pending and offers to send it again. The other order
// would leave the collective holding a request the profile denies.
await updateOwnProfile(webId, profileEdits.join(collective.group));
const written = await updateOwnProfile(webId, profileEdits.join(collective.group));
// Already listed: declaring completes the handshake, and a request
// would ask the collective for something it has already done.
if (view.state !== "left") {
await sendToInbox(collective.inbox, buildJoin(webId, collective.group, profile.name));
}
// The profile now carries the link; the invitation has done its job.
setInvite(null);
announce(`Request sent to ${collective.name}.`);
// Written to an extended profile your profile does not link yet: the
// collective cannot see it until the two lines on You are added.
if (written?.linkToAdd) {
const msg = `Request sent to ${collective.name}. It sees your membership once your profile links your extended profile: You shows the two lines to add.`;
toast(msg);
announce(msg);
} else {
announce(`Request sent to ${collective.name}.`);
}
}, rerender);
});
}
Expand Down
25 changes: 16 additions & 9 deletions src/lib/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import { readTurtle } from "./read";
import { NS } from "./vocab";
import { buildAnswer, buildRemove } from "./activity";
import {
parseProfile,
profileDocOf,
declaredDelegates,
declaresMembership,
readProfile,
sendToInbox,
type ProfileReadError,
type Collective,
type MemberDeclaration,
type MembershipState,
Expand Down Expand Up @@ -195,13 +197,17 @@ export interface Person {
problem: string | null;
}

/**
* Their profile and the extended documents it links inside its own
* pim:storage (solid-kit ADR 002 amendment, point 3): a membership declared
* only in their `profile/about.ttl` counts; one in a document elsewhere does not.
*/
export async function readPerson(webId: string): Promise<Person> {
try {
const doc = profileDocOf(webId);
const res = await readTurtle(doc);
if (!res.ok) return { webId, profile: null, problem: `Their profile could not be read (${res.status}).` };
return { webId, profile: parseProfile(await res.text(), doc, webId), problem: null };
return { webId, profile: await readProfile(webId), problem: null };
} catch (err) {
const status = (err as ProfileReadError).status;
if (status !== undefined) return { webId, profile: null, problem: `Their profile could not be read (${status}).` };
return { webId, profile: null, problem: err instanceof Error ? err.message : String(err) };
}
}
Expand All @@ -217,7 +223,7 @@ export function requestFlags(message: InboxMessage, person: Person, collective:
}
if (!person.profile) {
flags.push("Their profile could not be read, so the request cannot be checked.");
} else if (!person.profile.memberOf.includes(collective.group)) {
} else if (!declaresMembership(person.profile, collective.group)) {
flags.push(`Their profile does not say they belong to ${collective.name}.`);
}
return flags;
Expand Down Expand Up @@ -372,7 +378,8 @@ function memberFolders(collective: Collective): string[] {
* acts for its human, in the pod and in the collective's graph.
*/
export function readersOf(person: Person): string[] {
return [person.webId, ...(person.profile?.delegates ?? []).filter((d) => d !== person.webId && isValidWebId(d))];
const delegates = person.profile ? declaredDelegates(person.profile) : [];
return [person.webId, ...delegates.filter((d) => d !== person.webId && isValidWebId(d))];
}

/**
Expand Down Expand Up @@ -478,7 +485,7 @@ export interface MemberView extends Person {

export function memberState(person: Person, group: string): MembershipState {
if (!person.profile) return "unknown";
return person.profile.memberOf.includes(group) ? "member" : "left";
return declaresMembership(person.profile, group) ? "member" : "left";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export async function deleteAgent(session: AccountSession, owner: string, podUrl
await step("rules", async () => {
for (const r of agent.reach) await setFolderAccess(r.url, owner, podUrl, agent.webId, []);
});
if (agent.delegate) await step("delegates", () => updateOwnProfile(owner, profileEdits.removeDelegate(agent.webId)));
if (agent.delegate) await step("delegates", async () => void (await updateOwnProfile(owner, profileEdits.removeDelegate(agent.webId))));
await step("unlink", async () => {
const res = await account(session, agent.link.resource, { method: "DELETE" });
if (res.status === 401) throw ended();
Expand Down
Loading
Loading